Wrapped Filecoin (WFIL)

WFIL is the First Filecoin Stablecoin on Ethereum


Wrapped Filecoin, ERC20 Wrapper over Filecoin WFIL is the fist ERC20 wrapper over Filecoin, representing a stablecoin on deposits on a custodial Filecoin wallet (1:1 ratio). The current iteration implements a custodial pattern where users need to send filecoins to a custodial wallet and they'll get automatically the correspondent amount in WFIL to their ethereum addresses. Future Developments & Features: We'd like to migrate to a non-custodial pattern where by leveraging on Filecoin smart contracts we'd be able to implement a fully decentralized application. Extend the Filecoin Wallet into a MetaMask for Filecoin. One of the features we're considering is to add the permit() function to WFIL to allow meta transactions by leveraging on OpenZeppelin ERC20Permit module (currently in progress) and incentivise adoption in the space. Applications: Uniswap WFIL as Collateral on MakerDAO De-Fi ...

How it's made

WFIL Implements an ERC20 token by leveraging on OpenZeppelin Library. It allows the owner of the contract, set as Default Admin to add/remove a Minter via grantRole(), revokeRole() functions by leveraging on AccessControl module by OpenZeppelin. The contract implements the wrap() function to mint WFIL by passing the recepient address and the amount of Filecoin to wrap as parameters and emitting an event, Wrapped. The contract also implements the unwrap() function to burn the WFIL by passing the filecoin address and the amount of WFIL to unwrap as parameters and emitting an event, Unwrapped. The contract inherits OpenZeppelin AccessControl module to set the Pauser role to the owner of the contract that can call the pause(), unpause() functions in case of emergency (Circuit Breaker Design Pattern). Once the owner call the pause() function, thanks to the _beforeTokenTransfer() hook, _mint(), _burn() and _transfer() internal functions, will revert. To avoid users from sending WFIL to the contract address, _transfer() has been overidden to make sure the recipient address does not correspond to the contract address, and revert if it does. To manage the wrapping - unwrapping fee, the contract set the Fee Setter role to the owner of the contract that can set the fee via setFee() and the recipient via setFeeTo(). The fee is public and can be queried via the getter function fee(). A Gnosis Safe Multisig is used to receive and store the wrapping fees and set inside the constructor. Backend Implements a custodial wallet by leveraging on Lotus APIs. Via AWS Lambda, allows to automatically wrap/unwrap Filecoin, by minting WFIL from an account set as Minter and call the unwrap method to burn WFIL by the user. It's also connected via Filscan APIs to Filecoin to check for transactions that are tracked via Textile ThreadDB. Frontend The Frontend has been implemented via Rimble UI & Rimble Web3 Components and deployed on IPFS via Fleek. Filecoin Wallet Implements a Filecoin client by leveraging on Lotus APIs. Further developments of the project include building a MetaMask for Filecoin, creating an extension for Chrome.

Technologies used

EthereumFilecoinlibp2pIPFS/FilecoinSolidityGnosis Multisig