What
hardhat-fe
will be a Hardhat plugin to develop Ethereum based smart contracts with the new smart contract language Fe.
Possible usages:
-
hardhat compile
to compile Fe based smart contract projects, will emit ABI files with the official Fe compiler releases. -
hardhat test
will run integration and unit tests for Fe based smart contract projects. -
hardhat coverage
will run test and generate coverage report for Fe based smart contract projects.
Why
Fe is the next generation smart contract language for EVM based blockchains, and it introduces bunch of modern features which solidity does not arm with:
- Bounds and overflow checking
- Decidability by limitation of dynamic program behavior
- More precise gas estimation (as a consequence of decidability)
- Static typing
- Pure function support
- Restrictions on reentrancy
- Static looping
- Usage of YUL IR to target both EVM and eWASM
- WASM compiler binaries for enhanced portability and in-browser compilation of Fe contracts
- Implementation in a powerful, systems-oriented language (Rust) with strong safety guarantees to reduce risk of compiler bugs
I think the most interesting features are the static typing, program behavior decidability and eWASM support. the type system for Fe is almost derived from Rust without the ownership system, but it is still weaponed with a compiler-phase type checking with fully functional type inference engine.
How
we can start with this project with hardhat-vyper as a scaffold, and there is some key points we need to put attentions to:
- the main part of the plugin is to download Fe compiler depending on running system, first we need to download release schema file, then we parse the schema file to get the
browser_download_url
as the download url to fetch the compiler binary, currently, Fe only support OSX and Linux 64bit. - the official examples provided by the Fe team are all written in a single
.fe
file, but our plugin need to be able to compile and test a whole project assembled with multiple.fe
files, e.g. multiple module example. - this plugin should also be able to compile a project contains multiple smart contract languages mixed with Solidity and Fe or even with Vyper.
Please leave any feedback that you may have - good or bad. Excited to work on this project with y’all.