Skip to content

Conversation

Amxx
Copy link
Collaborator

@Amxx Amxx commented Jul 25, 2025

Fixes #201
Based on #200

@frangio frangio mentioned this pull request Aug 15, 2025
@frangio frangio changed the title Merge AxelarGatewaySource and AxelarGatewayDestination in AxelarGatewayAdaptor Flatten AxelarGatewayAdapter contract Aug 18, 2025
@Amxx Amxx marked this pull request as ready for review August 18, 2025 13:49
@Amxx Amxx requested review from cjcobb23 and a team as code owners August 18, 2025 13:49
* The contract implements AxelarExecutable's {_execute} function to execute the message, converting Axelar's native
* workflow into the standard ERC-7786.
*/
// slither-disable-next-line locked-ether
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: sendMessage is maked as payable, so slither believes this contract can lock ether. Slither is missing the fact that sendMessage does require(msg.value == 0, UnsupportedNativeTransfer());. IERC7786GatewaySource asks that sendMessage is payable, so we have to disable slither here.

frangio
frangio previously approved these changes Aug 19, 2025
Copy link
Contributor

@frangio frangio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but please note the comment below. Feel free to merge once that's addressed.

(bytes2 chainType, bytes calldata chainReference, ) = recipient.parseV1Calldata();
bytes memory remoteGateway = getRemoteGateway(chainType, chainReference);
string memory axelarDestination = getAxelarChain(InteroperableAddress.formatV1(chainType, chainReference, ""));
string memory axelarTarget = address(bytes20(remoteGateway)).toChecksumHexString(); // TODO non-evm chains?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove all "TODO" comments. If the contract doesn't support non-EVM chains, let's document that in the contract-level documentation.

) Ownable(initialOwner) AxelarExecutable(address(gateway)) {}

/// @dev Returns the Axelar chain identifier for a given binary interoperable chain id.
function getAxelarChain(bytes memory input) public view virtual returns (string memory output) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe getAxelarChainIdentifier or getAxelarChainId would be clearer?

}

/// @dev Registers a chain equivalence between a binary interoperable chain id and an Axelar chain identifier.
function registerChainEquivalence(bytes calldata chain, string calldata axelar) public virtual onlyOwner {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be more expressive imo

Suggested change
function registerChainEquivalence(bytes calldata chain, string calldata axelar) public virtual onlyOwner {
function registerChainEquivalence(bytes calldata chain, string calldata axelarId) public virtual onlyOwner {

@Amxx Amxx merged commit b91151f into master Aug 20, 2025
10 checks passed
@Amxx Amxx deleted the interop/refactor-axelar-gateway branch August 20, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider merging AxelarGatewaySource and AxelarGatewayDestination
3 participants