See:
To generate Solidity docs as an mdbook, run:
forge doc -b
(If you want to make you token omni-chain):
Implement (either one of, or both) the following interface(s) in your token contract:
-
ISender if you want your token be cross-chain transferrable.
See TokenSender example for reference implementation, along with its test. -
ISenderCaller if you want your token be cross-chain transferrable and call some external contract on the destination network upon such a transfer delivery.
See TokenSenderCaller example for reference implementation, along with its test.
(If you want your contract be called upon x-chain token transfer):
Implement ICallee interface in your contract. The onTransferReceived()
callback function will be called by GMP Gateway once the tokens are delivered to target network.
Important
The caller of onTransferReceived()
MUST be checked to be the token contract you want to integrate with.
Note
In case onTransferReceived()
execution fails, GMP message is still considered delivered, and token transfer is not reverted.
Caller contract emits specific events reflecting the callback execution outcome.
See Callee example contract in the test for reference implementation.