EVM: add FA bridge precompile and FA withdrawal execution
What
The MR introduces FA withdrawal execution methods and FA bridge precompile (not included in the base set for now).
Why
In order to initiate FA token withdrawals users need an EVM compatible way to do that.
Precompiled contract is a kernel "module" that looks like an ordinary smart contract from the EVM perspective, and has wider access to the state (compared to the ordinary contracts) on the other hand.
How
FA bridge precompile is introduced, it has a single entrypoint withdraw which:
- parses
FaWithdrawalfrom the calldata - tries to update the according ticket table entry
- tries to call the specified L2 proxy contract (if specified)
- if everything is ok, creates and queues an outbox message
Manually testing the MR
make test
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Michael Zaikin