Skip to content

Commit 9bd6a3b

Browse files
committed
update
1 parent 98dede1 commit 9bd6a3b

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

contracts/crosschain/axelar/AxelarGatewayDestination.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract contract AxelarGatewayDestination is IERC7786GatewayDestinationPassive,
2020
string calldata sender, // CAIP-10
2121
bytes calldata payload,
2222
bytes[] calldata attributes
23-
) external virtual {
23+
) external {
2424
// Extract Axelar commandId
2525
bytes32 commandId = abi.decode(messageKey, (bytes32));
2626

@@ -56,7 +56,7 @@ abstract contract AxelarGatewayDestination is IERC7786GatewayDestinationPassive,
5656
string calldata remoteChain, // chain of the remote gateway - axelar format
5757
string calldata remoteAccount, // address of the remote gateway
5858
bytes calldata adapterPayload
59-
) internal virtual override {
59+
) internal override {
6060
// Parse the package
6161
(string memory sender, string memory receiver, bytes memory payload, bytes[] memory attributes) = abi.decode(
6262
adapterPayload,

contracts/crosschain/axelar/AxelarGatewaySource.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {IERC7786GatewaySource} from "../interfaces/draft-IERC7786.sol";
1111
abstract contract AxelarGatewaySource is IERC7786GatewaySource, AxelarGatewayBase {
1212
using Strings for address;
1313

14-
function supportsAttribute(bytes4 /*selector*/) public view virtual returns (bool) {
14+
function supportsAttribute(bytes4 /*selector*/) public pure returns (bool) {
1515
return false;
1616
}
1717

@@ -20,9 +20,9 @@ abstract contract AxelarGatewaySource is IERC7786GatewaySource, AxelarGatewayBas
2020
string calldata receiver, // i.e. address
2121
bytes calldata payload,
2222
bytes[] calldata attributes
23-
) external payable virtual returns (bytes32) {
23+
) external payable returns (bytes32) {
2424
require(msg.value == 0, "Value not supported");
25-
require(attributes.length == 0, UnsupportedAttribute(bytes4(attributes[0][0:4])));
25+
if (attributes.length > 0) revert UnsupportedAttribute(bytes4(attributes[0][0:4]));
2626

2727
// Create the package
2828
string memory sender = msg.sender.toChecksumHexString();

contracts/crosschain/mocks/ERC7786GatewayMock.sol

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ contract ERC7786GatewayMock is IERC7786GatewaySource, IERC7786GatewayDestination
2929
bytes calldata payload,
3030
bytes[] calldata attributes
3131
) public payable returns (bytes32) {
32-
string memory source = CAIP2.local();
33-
string memory sender = msg.sender.toChecksumHexString();
32+
require(msg.value == 0, "Value not supported");
33+
if (attributes.length > 0) revert UnsupportedAttribute(bytes4(attributes[0][0:4]));
34+
require(destination.equal(CAIP2.local()), "This mock only supports local messages");
3435

35-
require(destination.equal(source), "This mock only supports local messages");
36-
for (uint256 i = 0; i < attributes.length; ++i) {
37-
bytes4 selector = bytes4(attributes[i][0:4]);
38-
if (!supportsAttribute(selector)) revert UnsupportedAttribute(selector);
39-
}
36+
string memory source = destination;
37+
string memory sender = msg.sender.toChecksumHexString();
4038

4139
if (_activeMode) {
4240
address target = Strings.parseAddress(receiver);

0 commit comments

Comments
 (0)