Skip to content

Commit c31ff36

Browse files
committed
clarify AxelarGatewayDestination._execute
1 parent 0d84e79 commit c31ff36

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

contracts/crosschain/axelar/AxelarGatewayDestination.sol

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,34 +55,35 @@ abstract contract AxelarGatewayDestination is IERC7786GatewayDestinationPassive,
5555
*
5656
* In this function:
5757
*
58-
* - `remoteChain` is in the Axelar format. It should not be expected to be a proper CAIP-2 format
59-
* - `remoteAccount` is the sender of the crosschain message. That should be the remote gateway on the chain which
60-
* the message originates from. It is NOT the sender of the crosschain message
58+
* - `axelarSourceChain` is in the Axelar format. It should not be expected to be a proper CAIP-2 format
59+
* - `axelarSourceAddress` is the sender of the Axelar message. That should be the remote gateway on the chain
60+
* which the message originates from. It is NOT the sender of the ERC-7786 crosschain message.
6161
*
6262
* Proper CAIP-10 encoding of the message sender (including the CAIP-2 name of the origin chain can be found in
6363
* the message)
6464
*/
6565
function _execute(
66-
string calldata remoteChain, // chain of the remote gateway - axelar format
67-
string calldata remoteAccount, // address of the remote gateway
66+
string calldata axelarSourceChain, // chain of the remote gateway - axelar format
67+
string calldata axelarSourceAddress, // address of the remote gateway
6868
bytes calldata adapterPayload
6969
) internal override {
7070
// Parse the package
7171
(string memory sender, string memory receiver, bytes memory payload, bytes[] memory attributes) = abi.decode(
7272
adapterPayload,
7373
(string, string, bytes, bytes[])
7474
);
75-
string memory source = getEquivalentChain(remoteChain);
75+
// Axelar to CAIP-2 translation
76+
string memory sourceChain = getEquivalentChain(axelarSourceChain);
7677

7778
// check message validity
78-
// - `remoteAccount` is the remote gateway on the origin chain.
79-
require(getRemoteGateway(source).equal(remoteAccount), "Invalid origin gateway");
79+
// - `axelarSourceAddress` is the remote gateway on the origin chain.
80+
require(getRemoteGateway(sourceChain).equal(axelarSourceAddress), "Invalid origin gateway");
8081

8182
// Active mode
8283
bytes4 result = IERC7786Receiver(receiver.parseAddress()).executeMessage(
8384
address(0), // not needed in active mode
8485
new bytes(0), // not needed in active mode
85-
source,
86+
sourceChain,
8687
sender,
8788
payload,
8889
attributes

0 commit comments

Comments
 (0)