Beyond Hello Wormhole
Protections
Issue: The greetings can come from anyone
address registrationOwner;
mapping(uint16 => bytes32) registeredSenders;
modifier isRegisteredSender(uint16 sourceChain, bytes32 sourceAddress) {
require(registeredSenders[sourceChain] == sourceAddress, "Not registered sender");
_;
}
/**
* Sets the registered address for 'sourceChain' to 'sourceAddress'
* So that for messages from 'sourceChain', only ones from 'sourceAddress' are valid
*
* Assumes only one sender per chain is valid
* Sender is the address that called 'send' on the Wormhole Relayer contract on the source chain)
*/
function setRegisteredSender(uint16 sourceChain, bytes32 sourceAddress) public {
require(msg.sender == registrationOwner, "Not allowed to set registered sender");
registeredSenders[sourceChain] = sourceAddress;
}Example Solution for Problem 1
Feature: Receive Refunds
Feature: Going from chain A → chain B → chain C
Composing with other Wormhole modules - Requesting Delivery of Existing Wormhole Messages
Last updated
Was this helpful?

