This is a simple flash mintable tokens contract designed to be as simple as possible. One can read about flash mintable tokens here.
The basic idea behind this tokens is, x amount of fWETH token is minted to a flashMinter contract which has a onFlashMint methode and it's executed after the token is minted. Once the onFlashMint is completed x amount of token is burnt. In case due to some reason if x amount of token was not burned then the whole transaction is reverted.
Before running any command, make sure to install dependencies:
$ yarn install
Compile the smart contracts with Hardhat:
$ yarn compile
Compile the smart contracts and generate TypeChain artifacts:
$ yarn typechain
Lint the Solidity code:
$ yarn lint:sol
Lint the TypeScript code:
$ yarn lint:ts
Run the Mocha tests:
$ yarn test
Generate the code coverage report:
$ yarn coverage
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean
If you use VSCode, you can enjoy syntax highlighting for your Solidity code via the vscode-solidity extension. The recommended approach to set the compiler version is to add the following fields to your VSCode user settings:
{
"solidity.compileUsingRemoteVersion": "v0.8.3+commit.8d00100c",
"solidity.defaultCompiler": "remote"
}
Where of course v0.8.3+commit.8d00100c
can be replaced with any other version.