-
Notifications
You must be signed in to change notification settings - Fork 23
Flatten AxelarGatewayAdapter contract #202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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? |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
function registerChainEquivalence(bytes calldata chain, string calldata axelar) public virtual onlyOwner { | |
function registerChainEquivalence(bytes calldata chain, string calldata axelarId) public virtual onlyOwner { |
Fixes #201
Based on #200