Skip to content

Commit

Permalink
feat: notify developers about GMP token events they can emit (#1262)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenFluin authored Dec 5, 2024
1 parent 164a60d commit 559833a
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions src/content/docs/dev/general-message-passing/gmp-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,52 @@ function _execute(
```

**Learn More:** For a detailed tutorial on building a full-stack interchain decentralized application with Next.js, Solidity, and Axelar's General Message Passing `callContract` to send messages between blockchains, check out our comprehensive guide: [Build a Full-Stack Interchain Application With Next.js, Solidity & Axelar](https://www.axelar.network/blog/how-to-build-interchain-dapp-with-next-js-solidity-and-axelar).

If you are implementing any underlying token transfer capabilities, you should import the [`InterchainTransferSent`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/interfaces/IInterchainTransfer.sol) or [`InterchainTransferReceived`](https://github.com/axelarnetwork/axelar-gmp-sdk-solidity/blob/main/contracts/interfaces/IInterchainTransfer.sol) interfaces and emit events as appropriate so that these events can be tracked.
```
interface IInterchainTransferSent {
/**
* @dev Emitted when a GMP transfer is sent, providing details for volume tracking.
* @param destinationChain The Axelar chain identifier of the destination chain.
* @param destinationContractAddress The address of the contract on the destination chain that receives the transfer.
* @param recipient The address of the final recipient of the transferred assets on the destination chain.
* @param token The address of the token contract on the source chain.
* @param amount The amount (in atomic units) of tokens transferred.
*/
event InterchainTransferSent(
string destinationChain,
string destinationContractAddress,
address indexed sender,
bytes recipient,
address indexed token,
uint256 amount
);
}
/**
* @title IInterchainTransferReceived
* @dev Interface for tracking asset value transfers using General Message Passing (GMP) calls in the Axelar Network.
* This interface defines an event that should be emitted when a GMP transfer is received,
* allowing for standardized volume tracking across different implementations.
*/
interface IInterchainTransferReceived {
/**
* @dev Emitted when an interchain transfer is received, providing details for volume tracking.
* @param sourceChain The Axelar chain identifier of the source chain.
* @param sourceAddress The address of the contract that initiated the transfer on the source chain.
* @param sender The address of the sender in case it is different from the source contract address
* @param recipient The address of the final recipient of the transferred assets on the destination chain.
* @param token The address of the token contract on the destination chain.
* @param amount The amount (in atomic units) of tokens received.
*/
event InterchainTransferReceived(
string sourceChain,
string sourceAddress,
bytes sender,
address indexed recipient,
address indexed token,
uint256 amount
);
}
```

0 comments on commit 559833a

Please sign in to comment.