You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Includes interfaces to interact with contracts in the Wormhole ecosystem (src/interfaces)
21
22
- Includes the base class ‘Base’ with helpers for common actions that will typically need to be done within ‘receiveWormholeMessages’:
22
-
-`onlyWormholeRelayer()`: Checking that msg.sender is the wormhole relayer contract
23
-
-`replayProtect(bytes32 deliveryHash)`: Checking that the current delivery has not already been processed (via the hash)
24
-
23
+
-`onlyWormholeRelayer()`: Checking that msg.sender is the wormhole relayer contract
24
+
-`replayProtect(bytes32 deliveryHash)`: Checking that the current delivery has not already been processed (via the hash)
25
25
Sometimes, Cross-chain applications may be set up such that there is one ‘spoke’ contract on every chain, which sends messages to the ‘hub’ contract. If so, we’d ideally only want to allow messages to be sent from these spoke contracts. Included are helpers for this:
26
-
27
-
-`setRegisteredSender(uint16 sourceChain, bytes32 sourceAddress)`: Setting the specified sender for ‘sourceChain’ to be ‘sourceAddress’
28
-
-`isRegisteredSender(uint16 sourceChain, bytes32 sourceAddress)` : Checking that the sender who requested the delivery is the registered address for that chain
29
-
26
+
-`setRegisteredSender(uint16 sourceChain, bytes32 sourceAddress)`: Setting the specified sender for ‘sourceChain’ to be ‘sourceAddress’
27
+
-`isRegisteredSender(uint16 sourceChain, bytes32 sourceAddress)` : Checking that the sender who requested the delivery is the registered address for that chain
30
28
Look at test/Counter.t.sol for an example usage of Base
31
-
32
29
- Included are also the ‘TokenSender’ and ‘TokenReceiver’ base classes with helpers for smart contracts that wish to send and receive tokens using Wormhole’s TokenBridge. See ‘HelloToken’ for example usage.
33
30
- Included are helpers that help set up a local forge testing environment. See ‘HelloWormhole’ for example usage.
31
+
32
+
Note: This code is meant to be used as starter / reference code. Feel free to modify for use in your contracts, and also make sure to audit any code used from here as part of your contracts before deploying to mainnet.
0 commit comments