InitiateTransfer
function on the L1Gateway
contract. This function accepts two parameters, a recipient account to receive funds on the counterparty chain, and an amount to transfer. The user must send (lock) the appropriate amount of ether in the L1Gateway
contract as a part of the transaction that calls this function.
During the InitiateTransfer
transaction, an event is emitted from L1. The relayer continuously monitors for these L1 events from finalized blocks. Once the L1 event is observed by the relayer, it calls the FinalizeTransfer
function on the bridge gateway contract residing on the mev-commit chain, the SettlementGateway
contract. This transaction mints native ether to the recipient EOA, with an appropriate amount of wei.
To bridge ether from the mev-commit chain back to L1, a user follows the same pattern as described above, as the relayer monitors both chains for transfer events.
Note the destination gateway contract enforces a flat fee on the destination address. This is a constant fee paid to the relayer during the transfer finalization transaction. It currently serves as a simple 1 wei placeholder. In production, this fee must be greater on average than the gas cost of transfer finalization transactions sent from the relayer.
https://chainrpc.testnet.mev-commit.xyz
.
Now you can deploy any EVM compatible contracts to the mev-commit chain.
Feel free to use Foundry, Hardhat, or any other smart-contract development and deployment framework.