EVM - Sending And Receiving Messages
Last updated
Last updated
On EVM-based chains (Ethereum/Base), messages are sent and received via a Portal contract, which usually sits behind an upgradeable proxy.
Any contract (or user) that want to send a message can call the sendMessage
function:
A per-message toll of 0.00001 ETH
will need to be sent for each message. Note that the function identifies the sender as msg.sender
.
After the required signatures have been collected, anyone can call the following function:
The receiveMessage
function will call the destination contract and provide details about the message that has been relayed. It then proceeds to mark the nonce and source chain combination as 'used', thus preventing a message from being relayed twice.
sendMessage
function with the protocol-set message toll (denoted as $fee$ to highlight that the call also includes some value in ETH). A MessageSent
is then generated, which the validators observe. After enough confirmations have passed, the validators generate signatures and post them on Nostr.receiveMessage
function is then called, which will call the destination contract. Note that warp.green is used as an oracle by the destination contract, which trusts the provided values (nonce, source chain id, source, contents) given that the Portal contract calls it.