Source Code
Latest 18 from a total of 18 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Peer | 28723147 | 58 days ago | IN | 0 FRAX | 0.00000473 | ||||
| Set Peer | 28723141 | 58 days ago | IN | 0 FRAX | 0.00000469 | ||||
| Set Peer | 28723135 | 58 days ago | IN | 0 FRAX | 0.00000473 | ||||
| Set Peer | 28723131 | 58 days ago | IN | 0 FRAX | 0.00000472 | ||||
| Set Peer | 28723125 | 58 days ago | IN | 0 FRAX | 0.00000471 | ||||
| Set Peer | 28723120 | 58 days ago | IN | 0 FRAX | 0.00000429 | ||||
| Set Peer | 28723112 | 58 days ago | IN | 0 FRAX | 0.00000453 | ||||
| Set Peer | 28723104 | 58 days ago | IN | 0 FRAX | 0.00000453 | ||||
| Set Peer | 28723098 | 58 days ago | IN | 0 FRAX | 0.00000461 | ||||
| Set Peer | 28723093 | 58 days ago | IN | 0 FRAX | 0.00000449 | ||||
| Set Peer | 28723087 | 58 days ago | IN | 0 FRAX | 0.00000466 | ||||
| Set Peer | 28723082 | 58 days ago | IN | 0 FRAX | 0.00000461 | ||||
| Set Peer | 28723074 | 58 days ago | IN | 0 FRAX | 0.0000048 | ||||
| Set Peer | 28723066 | 58 days ago | IN | 0 FRAX | 0.00000478 | ||||
| Set Peer | 28723061 | 58 days ago | IN | 0 FRAX | 0.00000502 | ||||
| Grant Role | 28707889 | 59 days ago | IN | 0 FRAX | 0.00000432 | ||||
| Revoke Role | 28587782 | 62 days ago | IN | 0 FRAX | 0.00000695 | ||||
| Grant Role | 28587780 | 62 days ago | IN | 0 FRAX | 0.00000702 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ReceiverAxelar
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
shanghai EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2025 - all rights reserved
pragma solidity ^0.8.20;
import { AxelarExpressExecutable } from "@axelar-network/axelar-gmp-sdk-solidity/contracts/express/AxelarExpressExecutable.sol";
import { StringToAddress } from "@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressString.sol";
import "../../interfaces/IReceiver.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
contract ReceiverAxelar is AxelarExpressExecutable, AccessControlEnumerable {
using StringToAddress for string;
/// @dev address of main receiver, that stores data and hashes
address public immutable receiver;
/// @dev operator role id
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
/// @dev approved peers
mapping(string sourceChain => address peer) public peers;
event PeerSet(string sourceChain, address peer);
constructor(address gateway_, address gasService_, address receiver_) AxelarExpressExecutable(gateway_) {
require(gateway_ != address(0), "ReceiverAxelar: zero address");
require(gasService_ != address(0), "ReceiverAxelar: zero address");
require(receiver_ != address(0), "ReceiverAxelar: zero address");
_grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
receiver = receiver_;
}
/**
* @dev Set peer for source chain
*
* @param sourceChain_ source chain
* @param peer_ source peer address
*/
function setPeer(string calldata sourceChain_, address peer_) public onlyRole(OPERATOR_ROLE) {
peers[sourceChain_] = peer_;
emit PeerSet(sourceChain_, peer_);
}
/**
* @dev Receive payload from Axelar bridge
*
* @param sourceChain source chain
* @param sourceAddress source address, which calls axelar gateway
* @param payload_ received payload
*/
function _execute(
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload_
) internal override {
require(peers[sourceChain] == sourceAddress.toAddress(), "ReceiverAxelar: wrong peer");
bytes32 requestId;
bytes32 sender;
uint256 chainIdFrom;
uint256 length = payload_.length - 1;
bytes memory data = new bytes(length);
for (uint i; i < length; ++i) {
data[i] = payload_[i];
}
if (payload_[payload_.length - 1] == 0x01) {
require(data.length == 128, "ReceiverAxelar: Invalid message length");
bytes32 payload;
(payload, sender, chainIdFrom, requestId) = abi.decode(data, (bytes32, bytes32, uint256, bytes32));
IReceiver(receiver).receiveHash(sender, uint64(chainIdFrom), payload, requestId);
} else if (payload_[payload_.length - 1] == 0x00) {
bytes memory payload;
(payload, sender, chainIdFrom, requestId) = abi.decode(data, (bytes, bytes32, uint256, bytes32));
IReceiver(receiver).receiveData(sender, uint64(chainIdFrom), payload, requestId);
} else {
revert("ReceiverAxelar: wrong message");
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAxelarGateway } from '../interfaces/IAxelarGateway.sol';
import { ExpressExecutorTracker } from './ExpressExecutorTracker.sol';
import { SafeTokenTransferFrom, SafeTokenTransfer } from '../libs/SafeTransfer.sol';
import { IERC20 } from '../interfaces/IERC20.sol';
contract AxelarExpressExecutable is ExpressExecutorTracker {
using SafeTokenTransfer for IERC20;
using SafeTokenTransferFrom for IERC20;
IAxelarGateway public immutable gateway;
constructor(address gateway_) {
if (gateway_ == address(0)) revert InvalidAddress();
gateway = IAxelarGateway(gateway_);
}
function execute(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) external {
bytes32 payloadHash = keccak256(payload);
if (!gateway.validateContractCall(commandId, sourceChain, sourceAddress, payloadHash))
revert NotApprovedByGateway();
address expressExecutor = _popExpressExecutor(commandId, sourceChain, sourceAddress, payloadHash);
if (expressExecutor != address(0)) {
// slither-disable-next-line reentrancy-events
emit ExpressExecutionFulfilled(commandId, sourceChain, sourceAddress, payloadHash, expressExecutor);
} else {
_execute(sourceChain, sourceAddress, payload);
}
}
function executeWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload,
string calldata tokenSymbol,
uint256 amount
) external {
bytes32 payloadHash = keccak256(payload);
if (
!gateway.validateContractCallAndMint(
commandId,
sourceChain,
sourceAddress,
payloadHash,
tokenSymbol,
amount
)
) revert NotApprovedByGateway();
address expressExecutor = _popExpressExecutorWithToken(
commandId,
sourceChain,
sourceAddress,
payloadHash,
tokenSymbol,
amount
);
if (expressExecutor != address(0)) {
// slither-disable-next-line reentrancy-events
emit ExpressExecutionWithTokenFulfilled(
commandId,
sourceChain,
sourceAddress,
payloadHash,
tokenSymbol,
amount,
expressExecutor
);
address gatewayToken = gateway.tokenAddresses(tokenSymbol);
IERC20(gatewayToken).safeTransfer(expressExecutor, amount);
} else {
_executeWithToken(sourceChain, sourceAddress, payload, tokenSymbol, amount);
}
}
function expressExecute(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) external payable virtual {
if (gateway.isCommandExecuted(commandId)) revert AlreadyExecuted();
address expressExecutor = msg.sender;
bytes32 payloadHash = keccak256(payload);
emit ExpressExecuted(commandId, sourceChain, sourceAddress, payloadHash, expressExecutor);
_setExpressExecutor(commandId, sourceChain, sourceAddress, payloadHash, expressExecutor);
_execute(sourceChain, sourceAddress, payload);
}
function expressExecuteWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount
) external payable virtual {
if (gateway.isCommandExecuted(commandId)) revert AlreadyExecuted();
address expressExecutor = msg.sender;
address gatewayToken = gateway.tokenAddresses(symbol);
bytes32 payloadHash = keccak256(payload);
emit ExpressExecutedWithToken(
commandId,
sourceChain,
sourceAddress,
payloadHash,
symbol,
amount,
expressExecutor
);
_setExpressExecutorWithToken(
commandId,
sourceChain,
sourceAddress,
payloadHash,
symbol,
amount,
expressExecutor
);
IERC20(gatewayToken).safeTransferFrom(expressExecutor, address(this), amount);
_executeWithToken(sourceChain, sourceAddress, payload, symbol, amount);
}
function _execute(
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) internal virtual {}
function _executeWithToken(
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload,
string calldata tokenSymbol,
uint256 amount
) internal virtual {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAxelarExpressExecutable } from '../interfaces/IAxelarExpressExecutable.sol';
abstract contract ExpressExecutorTracker is IAxelarExpressExecutable {
bytes32 internal constant PREFIX_EXPRESS_EXECUTE = keccak256('express-execute');
bytes32 internal constant PREFIX_EXPRESS_EXECUTE_WITH_TOKEN = keccak256('express-execute-with-token');
function _expressExecuteSlot(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash
) internal pure returns (bytes32 slot) {
slot = keccak256(abi.encode(PREFIX_EXPRESS_EXECUTE, commandId, sourceChain, sourceAddress, payloadHash));
}
function _expressExecuteWithTokenSlot(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) internal pure returns (bytes32 slot) {
slot = keccak256(
abi.encode(
PREFIX_EXPRESS_EXECUTE_WITH_TOKEN,
commandId,
sourceChain,
sourceAddress,
payloadHash,
symbol,
amount
)
);
}
function getExpressExecutor(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash
) external view returns (address expressExecutor) {
bytes32 slot = _expressExecuteSlot(commandId, sourceChain, sourceAddress, payloadHash);
assembly {
expressExecutor := sload(slot)
}
}
function getExpressExecutorWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) external view returns (address expressExecutor) {
bytes32 slot = _expressExecuteWithTokenSlot(commandId, sourceChain, sourceAddress, payloadHash, symbol, amount);
assembly {
expressExecutor := sload(slot)
}
}
function _setExpressExecutor(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
address expressExecutor
) internal {
bytes32 slot = _expressExecuteSlot(commandId, sourceChain, sourceAddress, payloadHash);
address currentExecutor;
assembly {
currentExecutor := sload(slot)
}
if (currentExecutor != address(0)) revert ExpressExecutorAlreadySet();
assembly {
sstore(slot, expressExecutor)
}
}
function _setExpressExecutorWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount,
address expressExecutor
) internal {
bytes32 slot = _expressExecuteWithTokenSlot(commandId, sourceChain, sourceAddress, payloadHash, symbol, amount);
address currentExecutor;
assembly {
currentExecutor := sload(slot)
}
if (currentExecutor != address(0)) revert ExpressExecutorAlreadySet();
assembly {
sstore(slot, expressExecutor)
}
}
function _popExpressExecutor(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash
) internal returns (address expressExecutor) {
bytes32 slot = _expressExecuteSlot(commandId, sourceChain, sourceAddress, payloadHash);
assembly {
expressExecutor := sload(slot)
if expressExecutor {
sstore(slot, 0)
}
}
}
function _popExpressExecutorWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) internal returns (address expressExecutor) {
bytes32 slot = _expressExecuteWithTokenSlot(commandId, sourceChain, sourceAddress, payloadHash, symbol, amount);
assembly {
expressExecutor := sload(slot)
if expressExecutor {
sstore(slot, 0)
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAxelarGateway } from './IAxelarGateway.sol';
interface IAxelarExecutable {
error InvalidAddress();
error NotApprovedByGateway();
function gateway() external view returns (IAxelarGateway);
function execute(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) external;
function executeWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload,
string calldata tokenSymbol,
uint256 amount
) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IAxelarExecutable } from './IAxelarExecutable.sol';
/**
* @title IAxelarExpressExecutable
* @notice Interface for the Axelar Express Executable contract.
*/
interface IAxelarExpressExecutable is IAxelarExecutable {
// Custom errors
error AlreadyExecuted();
error InsufficientValue();
error ExpressExecutorAlreadySet();
/**
* @notice Emitted when an express execution is successfully performed.
* @param commandId The unique identifier for the command.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @param expressExecutor The address of the express executor.
*/
event ExpressExecuted(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
bytes32 payloadHash,
address indexed expressExecutor
);
/**
* @notice Emitted when an express execution with a token is successfully performed.
* @param commandId The unique identifier for the command.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @param symbol The token symbol.
* @param amount The amount of tokens.
* @param expressExecutor The address of the express executor.
*/
event ExpressExecutedWithToken(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
bytes32 payloadHash,
string symbol,
uint256 indexed amount,
address indexed expressExecutor
);
/**
* @notice Emitted when an express execution is fulfilled.
* @param commandId The commandId for the contractCall.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @param expressExecutor The address of the express executor.
*/
event ExpressExecutionFulfilled(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
bytes32 payloadHash,
address indexed expressExecutor
);
/**
* @notice Emitted when an express execution with a token is fulfilled.
* @param commandId The commandId for the contractCallWithToken.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @param symbol The token symbol.
* @param amount The amount of tokens.
* @param expressExecutor The address of the express executor.
*/
event ExpressExecutionWithTokenFulfilled(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
bytes32 payloadHash,
string symbol,
uint256 indexed amount,
address indexed expressExecutor
);
/**
* @notice Returns the express executor for a given command.
* @param commandId The commandId for the contractCall.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @return expressExecutor The address of the express executor.
*/
function getExpressExecutor(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash
) external view returns (address expressExecutor);
/**
* @notice Returns the express executor with token for a given command.
* @param commandId The commandId for the contractCallWithToken.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payloadHash The hash of the payload.
* @param symbol The token symbol.
* @param amount The amount of tokens.
* @return expressExecutor The address of the express executor.
*/
function getExpressExecutorWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) external view returns (address expressExecutor);
/**
* @notice Express executes a contract call.
* @param commandId The commandId for the contractCall.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payload The payload data.
*/
function expressExecute(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload
) external payable;
/**
* @notice Express executes a contract call with token.
* @param commandId The commandId for the contractCallWithToken.
* @param sourceChain The source chain.
* @param sourceAddress The source address.
* @param payload The payload data.
* @param symbol The token symbol.
* @param amount The amount of token.
*/
function expressExecuteWithToken(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount
) external payable;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IGovernable } from './IGovernable.sol';
import { IImplementation } from './IImplementation.sol';
interface IAxelarGateway is IImplementation, IGovernable {
/**********\
|* Errors *|
\**********/
error NotSelf();
error InvalidCodeHash();
error SetupFailed();
error InvalidAuthModule();
error InvalidTokenDeployer();
error InvalidAmount();
error InvalidChainId();
error InvalidCommands();
error TokenDoesNotExist(string symbol);
error TokenAlreadyExists(string symbol);
error TokenDeployFailed(string symbol);
error TokenContractDoesNotExist(address token);
error BurnFailed(string symbol);
error MintFailed(string symbol);
error InvalidSetMintLimitsParams();
error ExceedMintLimit(string symbol);
/**********\
|* Events *|
\**********/
event TokenSent(
address indexed sender,
string destinationChain,
string destinationAddress,
string symbol,
uint256 amount
);
event ContractCall(
address indexed sender,
string destinationChain,
string destinationContractAddress,
bytes32 indexed payloadHash,
bytes payload
);
event ContractCallWithToken(
address indexed sender,
string destinationChain,
string destinationContractAddress,
bytes32 indexed payloadHash,
bytes payload,
string symbol,
uint256 amount
);
event Executed(bytes32 indexed commandId);
event TokenDeployed(string symbol, address tokenAddresses);
event ContractCallApproved(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
address indexed contractAddress,
bytes32 indexed payloadHash,
bytes32 sourceTxHash,
uint256 sourceEventIndex
);
event ContractCallApprovedWithMint(
bytes32 indexed commandId,
string sourceChain,
string sourceAddress,
address indexed contractAddress,
bytes32 indexed payloadHash,
string symbol,
uint256 amount,
bytes32 sourceTxHash,
uint256 sourceEventIndex
);
event ContractCallExecuted(bytes32 indexed commandId);
event TokenMintLimitUpdated(string symbol, uint256 limit);
event OperatorshipTransferred(bytes newOperatorsData);
event Upgraded(address indexed implementation);
/********************\
|* Public Functions *|
\********************/
function sendToken(
string calldata destinationChain,
string calldata destinationAddress,
string calldata symbol,
uint256 amount
) external;
function callContract(
string calldata destinationChain,
string calldata contractAddress,
bytes calldata payload
) external;
function callContractWithToken(
string calldata destinationChain,
string calldata contractAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount
) external;
function isContractCallApproved(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
address contractAddress,
bytes32 payloadHash
) external view returns (bool);
function isContractCallAndMintApproved(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
address contractAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) external view returns (bool);
function validateContractCall(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash
) external returns (bool);
function validateContractCallAndMint(
bytes32 commandId,
string calldata sourceChain,
string calldata sourceAddress,
bytes32 payloadHash,
string calldata symbol,
uint256 amount
) external returns (bool);
/***********\
|* Getters *|
\***********/
function authModule() external view returns (address);
function tokenDeployer() external view returns (address);
function tokenMintLimit(string memory symbol) external view returns (uint256);
function tokenMintAmount(string memory symbol) external view returns (uint256);
function allTokensFrozen() external view returns (bool);
function implementation() external view returns (address);
function tokenAddresses(string memory symbol) external view returns (address);
function tokenFrozen(string memory symbol) external view returns (bool);
function isCommandExecuted(bytes32 commandId) external view returns (bool);
/************************\
|* Governance Functions *|
\************************/
function setTokenMintLimits(string[] calldata symbols, uint256[] calldata limits) external;
function upgrade(
address newImplementation,
bytes32 newImplementationCodeHash,
bytes calldata setupParams
) external;
/**********************\
|* External Functions *|
\**********************/
function execute(bytes calldata input) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
// General interface for upgradable contracts
interface IContractIdentifier {
/**
* @notice Returns the contract ID. It can be used as a check during upgrades.
* @dev Meant to be overridden in derived contracts.
* @return bytes32 The contract ID
*/
function contractId() external pure returns (bytes32);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
error InvalidAccount();
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title IGovernable Interface
* @notice This is an interface used by the AxelarGateway contract to manage governance and mint limiter roles.
*/
interface IGovernable {
error NotGovernance();
error NotMintLimiter();
error InvalidGovernance();
error InvalidMintLimiter();
event GovernanceTransferred(address indexed previousGovernance, address indexed newGovernance);
event MintLimiterTransferred(address indexed previousGovernance, address indexed newGovernance);
/**
* @notice Returns the governance address.
* @return address of the governance
*/
function governance() external view returns (address);
/**
* @notice Returns the mint limiter address.
* @return address of the mint limiter
*/
function mintLimiter() external view returns (address);
/**
* @notice Transfer the governance role to another address.
* @param newGovernance The new governance address
*/
function transferGovernance(address newGovernance) external;
/**
* @notice Transfer the mint limiter role to another address.
* @param newGovernance The new mint limiter address
*/
function transferMintLimiter(address newGovernance) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IContractIdentifier } from './IContractIdentifier.sol';
interface IImplementation is IContractIdentifier {
error NotProxy();
function setup(bytes calldata data) external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library StringToAddress {
error InvalidAddressString();
function toAddress(string memory addressString) internal pure returns (address) {
bytes memory stringBytes = bytes(addressString);
uint160 addressNumber = 0;
uint8 stringByte;
if (stringBytes.length != 42 || stringBytes[0] != '0' || stringBytes[1] != 'x') revert InvalidAddressString();
for (uint256 i = 2; i < 42; ++i) {
stringByte = uint8(stringBytes[i]);
if ((stringByte >= 97) && (stringByte <= 102)) stringByte -= 87;
else if ((stringByte >= 65) && (stringByte <= 70)) stringByte -= 55;
else if ((stringByte >= 48) && (stringByte <= 57)) stringByte -= 48;
else revert InvalidAddressString();
addressNumber |= uint160(uint256(stringByte) << ((41 - i) << 2));
}
return address(addressNumber);
}
}
library AddressToString {
function toString(address address_) internal pure returns (string memory) {
bytes memory addressBytes = abi.encodePacked(address_);
bytes memory characters = '0123456789abcdef';
bytes memory stringBytes = new bytes(42);
stringBytes[0] = '0';
stringBytes[1] = 'x';
for (uint256 i; i < 20; ++i) {
stringBytes[2 + i * 2] = characters[uint8(addressBytes[i] >> 4)];
stringBytes[3 + i * 2] = characters[uint8(addressBytes[i] & 0x0f)];
}
return string(stringBytes);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IERC20 } from '../interfaces/IERC20.sol';
error TokenTransferFailed();
/*
* @title SafeTokenCall
* @dev This library is used for performing safe token transfers.
*/
library SafeTokenCall {
/*
* @notice Make a safe call to a token contract.
* @param token The token contract to interact with.
* @param callData The function call data.
* @throws TokenTransferFailed error if transfer of token is not successful.
*/
function safeCall(IERC20 token, bytes memory callData) internal {
(bool success, bytes memory returnData) = address(token).call(callData);
bool transferred = success && (returnData.length == uint256(0) || abi.decode(returnData, (bool)));
if (!transferred || address(token).code.length == 0) revert TokenTransferFailed();
}
}
/*
* @title SafeTokenTransfer
* @dev This library safely transfers tokens from the contract to a recipient.
*/
library SafeTokenTransfer {
/*
* @notice Transfer tokens to a recipient.
* @param token The token contract.
* @param receiver The recipient of the tokens.
* @param amount The amount of tokens to transfer.
*/
function safeTransfer(
IERC20 token,
address receiver,
uint256 amount
) internal {
SafeTokenCall.safeCall(token, abi.encodeWithSelector(IERC20.transfer.selector, receiver, amount));
}
}
/*
* @title SafeTokenTransferFrom
* @dev This library helps to safely transfer tokens on behalf of a token holder.
*/
library SafeTokenTransferFrom {
/*
* @notice Transfer tokens on behalf of a token holder.
* @param token The token contract.
* @param from The address of the token holder.
* @param to The address the tokens are to be sent to.
* @param amount The amount of tokens to be transferred.
*/
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 amount
) internal {
SafeTokenCall.safeCall(token, abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, amount));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `_msgSender()` is missing `role`.
* Overriding this function changes the behavior of the {onlyRole} modifier.
*
* Format of the revert message is described in {_checkRole}.
*
* _Available since v4.6._
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(account),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* May emit a {RoleGranted} event.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
using EnumerableSet for EnumerableSet.AddressSet;
mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override {
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
enum Rounding {
Down, // Toward negative infinity
Up, // Toward infinity
Zero // Toward zero
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow.
return (a & b) + (a ^ b) / 2;
}
/**
* @dev Returns the ceiling of the division of two numbers.
*
* This differs from standard division with `/` in that it rounds up instead
* of rounding down.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b - 1) / b can overflow on addition, so we distribute.
return a == 0 ? 0 : (a - 1) / b + 1;
}
/**
* @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
* @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
* with further edits by Uniswap Labs also under MIT license.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
unchecked {
// 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
// use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2^256 + prod0.
uint256 prod0; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod0 := mul(x, y)
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
require(denominator > prod1, "Math: mulDiv overflow");
///////////////////////////////////////////////
// 512 by 256 division.
///////////////////////////////////////////////
// Make division exact by subtracting the remainder from [prod1 prod0].
uint256 remainder;
assembly {
// Compute remainder using mulmod.
remainder := mulmod(x, y, denominator)
// Subtract 256 bit number from 512 bit number.
prod1 := sub(prod1, gt(remainder, prod0))
prod0 := sub(prod0, remainder)
}
// Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
// See https://cs.stackexchange.com/q/138556/92363.
// Does not overflow because the denominator cannot be zero at this stage in the function.
uint256 twos = denominator & (~denominator + 1);
assembly {
// Divide denominator by twos.
denominator := div(denominator, twos)
// Divide [prod1 prod0] by twos.
prod0 := div(prod0, twos)
// Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
twos := add(div(sub(0, twos), twos), 1)
}
// Shift in bits from prod1 into prod0.
prod0 |= prod1 * twos;
// Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
// that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv = 1 mod 2^4.
uint256 inverse = (3 * denominator) ^ 2;
// Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
// in modular arithmetic, doubling the correct bits in each step.
inverse *= 2 - denominator * inverse; // inverse mod 2^8
inverse *= 2 - denominator * inverse; // inverse mod 2^16
inverse *= 2 - denominator * inverse; // inverse mod 2^32
inverse *= 2 - denominator * inverse; // inverse mod 2^64
inverse *= 2 - denominator * inverse; // inverse mod 2^128
inverse *= 2 - denominator * inverse; // inverse mod 2^256
// Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
// This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
// less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
// is no longer required.
result = prod0 * inverse;
return result;
}
}
/**
* @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
*/
function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
uint256 result = mulDiv(x, y, denominator);
if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
result += 1;
}
return result;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
*
* Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
*/
function sqrt(uint256 a) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
// For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
//
// We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
// `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
//
// This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
// → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
// → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
//
// Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
uint256 result = 1 << (log2(a) >> 1);
// At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
// since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
// every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
// into the expected uint128 result.
unchecked {
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
result = (result + a / result) >> 1;
return min(result, a / result);
}
}
/**
* @notice Calculates sqrt(a), following the selected rounding direction.
*/
function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = sqrt(a);
return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 128;
}
if (value >> 64 > 0) {
value >>= 64;
result += 64;
}
if (value >> 32 > 0) {
value >>= 32;
result += 32;
}
if (value >> 16 > 0) {
value >>= 16;
result += 16;
}
if (value >> 8 > 0) {
value >>= 8;
result += 8;
}
if (value >> 4 > 0) {
value >>= 4;
result += 4;
}
if (value >> 2 > 0) {
value >>= 2;
result += 2;
}
if (value >> 1 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 2, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log2(value);
return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10, rounded down, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >= 10 ** 64) {
value /= 10 ** 64;
result += 64;
}
if (value >= 10 ** 32) {
value /= 10 ** 32;
result += 32;
}
if (value >= 10 ** 16) {
value /= 10 ** 16;
result += 16;
}
if (value >= 10 ** 8) {
value /= 10 ** 8;
result += 8;
}
if (value >= 10 ** 4) {
value /= 10 ** 4;
result += 4;
}
if (value >= 10 ** 2) {
value /= 10 ** 2;
result += 2;
}
if (value >= 10 ** 1) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 10, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log10(value);
return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256, rounded down, of a positive value.
* Returns 0 if given 0.
*
* Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
*/
function log256(uint256 value) internal pure returns (uint256) {
uint256 result = 0;
unchecked {
if (value >> 128 > 0) {
value >>= 128;
result += 16;
}
if (value >> 64 > 0) {
value >>= 64;
result += 8;
}
if (value >> 32 > 0) {
value >>= 32;
result += 4;
}
if (value >> 16 > 0) {
value >>= 16;
result += 2;
}
if (value >> 8 > 0) {
result += 1;
}
}
return result;
}
/**
* @dev Return the log in base 256, following the selected rounding direction, of a positive value.
* Returns 0 if given 0.
*/
function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
unchecked {
uint256 result = log256(value);
return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.0;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
import "./math/Math.sol";
import "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
unchecked {
uint256 length = Math.log10(value) + 1;
string memory buffer = new string(length);
uint256 ptr;
/// @solidity memory-safe-assembly
assembly {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
/// @solidity memory-safe-assembly
assembly {
mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toString(int256 value) internal pure returns (string memory) {
return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
unchecked {
return toHexString(value, Math.log256(value) + 1);
}
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```solidity
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*
* [WARNING]
* ====
* Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
* unusable.
* See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
*
* In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
* array of EnumerableSet.
* ====
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastValue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastValue;
// Update the index for the moved value
set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
bytes32[] memory store = _values(set._inner);
bytes32[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
/// @solidity memory-safe-assembly
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2025 - all rights reserved
pragma solidity ^0.8.20;
interface IReceiver {
function receiveData(bytes32 sender, uint64 chainIdFrom, bytes memory receivedData, bytes32 requestId) external;
function receiveHash(bytes32 sender, uint64 chainIdFrom, bytes32 receivedHash, bytes32 requestId) external;
}{
"evmVersion": "shanghai",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": [
"project/:@axelar-network/axelar-gmp-sdk-solidity/=npm/@axelar-network/[email protected]/",
"project/:@axelar-network/axelar-gmp-sdk-solidity/=npm/@axelar-network/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/"
]
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"gateway_","type":"address"},{"internalType":"address","name":"gasService_","type":"address"},{"internalType":"address","name":"receiver_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExecuted","type":"error"},{"inputs":[],"name":"ExpressExecutorAlreadySet","type":"error"},{"inputs":[],"name":"InsufficientValue","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAddressString","type":"error"},{"inputs":[],"name":"NotApprovedByGateway","type":"error"},{"inputs":[],"name":"TokenTransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutedWithToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutionFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutionWithTokenFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"address","name":"peer","type":"address"}],"name":"PeerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"string","name":"tokenSymbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"executeWithToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"expressExecute","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"expressExecuteWithToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"gateway","outputs":[{"internalType":"contract IAxelarGateway","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes32","name":"payloadHash","type":"bytes32"}],"name":"getExpressExecutor","outputs":[{"internalType":"address","name":"expressExecutor","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"commandId","type":"bytes32"},{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"getExpressExecutorWithToken","outputs":[{"internalType":"address","name":"expressExecutor","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"sourceChain","type":"string"}],"name":"peers","outputs":[{"internalType":"address","name":"peer","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"receiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"sourceChain_","type":"string"},{"internalType":"address","name":"peer_","type":"address"}],"name":"setPeer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405234801562000010575f80fd5b5060405162002748380380620027488339810160408190526200003391620002ac565b826001600160a01b0381166200005c5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b039081166080528316620000ac5760405162461bcd60e51b815260206004820152601c60248201525f805160206200272883398151915260448201526064015b60405180910390fd5b6001600160a01b038216620000f25760405162461bcd60e51b815260206004820152601c60248201525f80516020620027288339815191526044820152606401620000a3565b6001600160a01b038116620001385760405162461bcd60e51b815260206004820152601c60248201525f80516020620027288339815191526044820152606401620000a3565b620001445f3362000159565b6001600160a01b031660a05250620002f39050565b62000165828262000183565b5f8281526001602052604090206200017e908262000222565b505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166200021e575f828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001dd3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b5f62000238836001600160a01b03841662000241565b90505b92915050565b5f8181526001830160205260408120546200028857508154600181810184555f8481526020808220909301849055845484825282860190935260409020919091556200023b565b505f6200023b565b80516001600160a01b0381168114620002a7575f80fd5b919050565b5f805f60608486031215620002bf575f80fd5b620002ca8462000290565b9250620002da6020850162000290565b9150620002ea6040850162000290565b90509250925092565b60805160a0516123db6200034d5f395f81816103ee0152818161102401526110f401525f81816101640152818161046a015281816105970152818161070f0152818161084901528181610ad10152610b7b01526123db5ff3fe60806040526004361061011b575f3560e01c8063868a166d1161009d578063ca15c87311610062578063ca15c87314610359578063d547741f14610378578063e4a974cc14610397578063f5b541a6146103aa578063f7260d3e146103dd575f80fd5b8063868a166d146102ca5780639010d07c146102e957806391d1485414610308578063a217fddf14610327578063c7e6a3cc1461033a575f80fd5b806336568abe116100e357806336568abe1461021a57806349160658146102395780636565763614610258578063717808821461026b578063790a72141461028a575f80fd5b806301ffc9a71461011f578063116191b6146101535780631a98b2e01461019e578063248a9ca3146101bf5780632f2ff15d146101fb575b5f80fd5b34801561012a575f80fd5b5061013e6101393660046119d0565b610410565b60405190151581526020015b60405180910390f35b34801561015e575f80fd5b506101867f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161014a565b3480156101a9575f80fd5b506101bd6101b8366004611a3b565b61043a565b005b3480156101ca575f80fd5b506101ed6101d9366004611b0a565b5f9081526020819052604090206001015490565b60405190815260200161014a565b348015610206575f80fd5b506101bd610215366004611b35565b610633565b348015610225575f80fd5b506101bd610234366004611b35565b61065c565b348015610244575f80fd5b506101bd610253366004611b63565b6106df565b6101bd610266366004611b63565b610833565b348015610276575f80fd5b506101bd610285366004611bfe565b61094f565b348015610295575f80fd5b506101866102a4366004611cba565b80516020818301810180516002825292820191909301209152546001600160a01b031681565b3480156102d5575f80fd5b506101866102e4366004611d33565b6109fb565b3480156102f4575f80fd5b50610186610303366004611dde565b610a1e565b348015610313575f80fd5b5061013e610322366004611b35565b610a3c565b348015610332575f80fd5b506101ed5f81565b348015610345575f80fd5b50610186610354366004611dfe565b610a64565b348015610364575f80fd5b506101ed610373366004611b0a565b610a81565b348015610383575f80fd5b506101bd610392366004611b35565b610a97565b6101bd6103a5366004611a3b565b610abb565b3480156103b5575f80fd5b506101ed7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b3480156103e8575f80fd5b506101867f000000000000000000000000000000000000000000000000000000000000000081565b5f6001600160e01b03198216635a05180f60e01b1480610434575061043482610c84565b92915050565b5f858560405161044b929190611e79565b604051908190038120631876eed960e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631876eed9906104af908e908e908e908e908e9089908d908d908d90600401611eb0565b6020604051808303815f875af11580156104cb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ef9190611f0e565b61050c57604051631403112d60e21b815260040160405180910390fd5b5f61051e8c8c8c8c8c878b8b8b610cb8565b90506001600160a01b0381161561062557806001600160a01b0316838d7fdb3db9dfc9262f4fe09dbadef104f799d8181ec565e09275d80ed3355aab68d38e8e8e8e898d8d6040516105769796959493929190611f2d565b60405180910390a46040516349ad89fb60e11b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063935b13f6906105ce9089908990600401611f7c565b602060405180830381865afa1580156105e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061060d9190611f97565b90506106236001600160a01b0382168386610ce9565b505b505050505050505050505050565b5f8281526020819052604090206001015461064d81610d4c565b6106578383610d59565b505050565b6001600160a01b03811633146106d15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106db8282610d7a565b5050565b5f82826040516106f0929190611e79565b604051908190038120635f6970c360e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635f6970c39061074e908b908b908b908b908b908990600401611fb2565b6020604051808303815f875af115801561076a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078e9190611f0e565b6107ab57604051631403112d60e21b815260040160405180910390fd5b5f6107ba898989898987610d9b565b90506001600160a01b0381161561081a57806001600160a01b0316897f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418a8a8a8a8860405161080d959493929190611ff2565b60405180910390a3610828565b610828888888888888610dc6565b505050505050505050565b604051630d26ff2160e41b8152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d26ff21090602401602060405180830381865afa158015610896573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108ba9190611f0e565b156108d857604051630dc1019760e01b815260040160405180910390fd5b60405133905f906108ec9085908590611e79565b60405180910390209050816001600160a01b0316897f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928a8a8a8a87604051610938959493929190611ff2565b60405180910390a361081a89898989898688611184565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92961097981610d4c565b816002858560405161098c929190611e79565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557fa92669dee832c52e51d7443a8cd48a0e3dc297def6dc76887e24b2f728f62ded906109ed9086908690869061202b565b60405180910390a150505050565b5f80610a0e8b8b8b8b8b8b8b8b8b6111ca565b549b9a5050505050505050505050565b5f828152600160205260408120610a359083611233565b9392505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80610a7488888888888861123e565b5498975050505050505050565b5f8181526001602052604081206104349061129e565b5f82815260208190526040902060010154610ab181610d4c565b6106578383610d7a565b604051630d26ff2160e41b8152600481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d26ff21090602401602060405180830381865afa158015610b1e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b429190611f0e565b15610b6057604051630dc1019760e01b815260040160405180910390fd5b6040516349ad89fb60e11b815233905f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063935b13f690610bb29088908890600401611f7c565b602060405180830381865afa158015610bcd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bf19190611f97565b90505f8787604051610c04929190611e79565b60405180910390209050826001600160a01b0316848e7f5844b8bbe3fd2b0354e73f27bfde28d2e6d991f14139c382876ec4360391a47b8f8f8f8f888e8e604051610c559796959493929190611f2d565b60405180910390a4610c6f8d8d8d8d8d868c8c8c8c6112a7565b6106236001600160a01b0383168430876112f3565b5f6001600160e01b03198216637965db0b60e01b148061043457506301ffc9a760e01b6001600160e01b0319831614610434565b5f80610ccb8b8b8b8b8b8b8b8b8b6111ca565b9050805491508115610cdb575f81555b509998505050505050505050565b6040516001600160a01b03831660248201526044810182905261065790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611331565b610d5681336113f0565b50565b610d638282611449565b5f82815260016020526040902061065790826114cc565b610d8482826114e0565b5f8281526001602052604090206106579082611544565b5f80610dab88888888888861123e565b9050805491508115610dbb575f81555b509695505050505050565b610e0484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061155892505050565b6001600160a01b031660028787604051610e1f929190611e79565b908152604051908190036020019020546001600160a01b031614610e855760405162461bcd60e51b815260206004820152601a60248201527f52656365697665724178656c61723a2077726f6e67207065657200000000000060448201526064016106c8565b5f808080610e9460018661206a565b90505f816001600160401b03811115610eaf57610eaf611c50565b6040519080825280601f01601f191660200182016040528015610ed9576020820181803683370190505b5090505f5b82811015610f3a57878782818110610ef857610ef861207d565b9050013560f81c60f81b828281518110610f1457610f1461207d565b60200101906001600160f81b03191690815f1a905350610f3381612091565b9050610ede565b508686610f4860018261206a565b818110610f5757610f5761207d565b909101356001600160f81b031916600160f81b03905061108a578051608014610fd15760405162461bcd60e51b815260206004820152602660248201527f52656365697665724178656c61723a20496e76616c6964206d657373616765206044820152650d8cadccee8d60d31b60648201526084016106c8565b5f81806020019051810190610fe691906120a9565b604051632c7f327760e11b8152600481018490526001600160401b0383166024820152604481018590526064810182905290995091975095509091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906358fe64ee906084015b5f604051808303815f87803b15801561106e575f80fd5b505af1158015611080573d5f803e3d5ffd5b5050505050611177565b868661109760018261206a565b8181106110a6576110a661207d565b909101356001600160f81b0319165f03905061112f576060818060200190518101906110d291906120fe565b60405163f137538b60e01b815290995091975095509091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f137538b90611057908890889086908c906004016121b4565b60405162461bcd60e51b815260206004820152601d60248201527f52656365697665724178656c61723a2077726f6e67206d65737361676500000060448201526064016106c8565b5050505050505050505050565b5f61119388888888888861123e565b80549091506001600160a01b038116156111c05760405163725f13f160e01b815260040160405180910390fd5b5055505050505050565b5f7febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a60405160200161120e9a999897969594939291906121ec565b6040516020818303038152906040528051906020012090509998505050505050505050565b5f610a3583836116d4565b5f7f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e587878787878760405160200161127c9796959493929190612251565b6040516020818303038152906040528051906020012090509695505050505050565b5f610434825490565b5f6112b98b8b8b8b8b8b8b8b8b6111ca565b80549091506001600160a01b038116156112e65760405163725f13f160e01b815260040160405180910390fd5b5055505050505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261132b9085906323b872dd60e01b90608401610d15565b50505050565b5f80836001600160a01b03168360405161134b9190612298565b5f604051808303815f865af19150503d805f8114611384576040519150601f19603f3d011682016040523d82523d5f602084013e611389565b606091505b50915091505f8280156113b45750815115806113b45750818060200190518101906113b49190611f0e565b90508015806113cb57506001600160a01b0385163b155b156113e95760405163022e258160e11b815260040160405180910390fd5b5050505050565b6113fa8282610a3c565b6106db57611407816116fa565b61141283602061170c565b6040516020016114239291906122b3565b60408051601f198184030181529082905262461bcd60e51b82526106c891600401612327565b6114538282610a3c565b6106db575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f610a35836001600160a01b0384166118a1565b6114ea8282610a3c565b156106db575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f610a35836001600160a01b0384166118ed565b5f808290505f808251602a1415806115955750825f8151811061157d5761157d61207d565b6020910101516001600160f81b031916600360fc1b14155b806115c65750826001815181106115ae576115ae61207d565b6020910101516001600160f81b031916600f60fb1b14155b156115e457604051636fa478cf60e11b815260040160405180910390fd5b60025b602a8110156116ca578381815181106116025761160261207d565b016020015160f81c915060618210801590611621575060668260ff1611155b1561163857611631605783612339565b91506116a1565b60418260ff1610158015611650575060468260ff1611155b1561166057611631603783612339565b60308260ff1610158015611678575060398260ff1611155b1561168857611631603083612339565b604051636fa478cf60e11b815260040160405180910390fd5b60026116ae82602961206a565b60ff8416911b1b92909217916116c381612091565b90506115e7565b5090949350505050565b5f825f0182815481106116e9576116e961207d565b905f5260205f200154905092915050565b60606104346001600160a01b03831660145b60605f61171a836002612352565b611725906002612369565b6001600160401b0381111561173c5761173c611c50565b6040519080825280601f01601f191660200182016040528015611766576020820181803683370190505b509050600360fc1b815f815181106117805761178061207d565b60200101906001600160f81b03191690815f1a905350600f60fb1b816001815181106117ae576117ae61207d565b60200101906001600160f81b03191690815f1a9053505f6117d0846002612352565b6117db906001612369565b90505b6001811115611852576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061180f5761180f61207d565b1a60f81b8282815181106118255761182561207d565b60200101906001600160f81b03191690815f1a90535060049490941c9361184b8161237c565b90506117de565b508315610a355760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106c8565b5f8181526001830160205260408120546118e657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610434565b505f610434565b5f81815260018301602052604081205480156119c7575f61190f60018361206a565b85549091505f906119229060019061206a565b9050818114611981575f865f0182815481106119405761194061207d565b905f5260205f200154905080875f0184815481106119605761196061207d565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061199257611992612391565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610434565b5f915050610434565b5f602082840312156119e0575f80fd5b81356001600160e01b031981168114610a35575f80fd5b5f8083601f840112611a07575f80fd5b5081356001600160401b03811115611a1d575f80fd5b602083019150836020828501011115611a34575f80fd5b9250929050565b5f805f805f805f805f8060c08b8d031215611a54575f80fd5b8a35995060208b01356001600160401b0380821115611a71575f80fd5b611a7d8e838f016119f7565b909b50995060408d0135915080821115611a95575f80fd5b611aa18e838f016119f7565b909950975060608d0135915080821115611ab9575f80fd5b611ac58e838f016119f7565b909750955060808d0135915080821115611add575f80fd5b50611aea8d828e016119f7565b9150809450508092505060a08b013590509295989b9194979a5092959850565b5f60208284031215611b1a575f80fd5b5035919050565b6001600160a01b0381168114610d56575f80fd5b5f8060408385031215611b46575f80fd5b823591506020830135611b5881611b21565b809150509250929050565b5f805f805f805f6080888a031215611b79575f80fd5b8735965060208801356001600160401b0380821115611b96575f80fd5b611ba28b838c016119f7565b909850965060408a0135915080821115611bba575f80fd5b611bc68b838c016119f7565b909650945060608a0135915080821115611bde575f80fd5b50611beb8a828b016119f7565b989b979a50959850939692959293505050565b5f805f60408486031215611c10575f80fd5b83356001600160401b03811115611c25575f80fd5b611c31868287016119f7565b9094509250506020840135611c4581611b21565b809150509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715611c8c57611c8c611c50565b604052919050565b5f6001600160401b03821115611cac57611cac611c50565b50601f01601f191660200190565b5f60208284031215611cca575f80fd5b81356001600160401b03811115611cdf575f80fd5b8201601f81018413611cef575f80fd5b8035611d02611cfd82611c94565b611c64565b818152856020838501011115611d16575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f805f805f805f805f60c08a8c031215611d4b575f80fd5b8935985060208a01356001600160401b0380821115611d68575f80fd5b611d748d838e016119f7565b909a50985060408c0135915080821115611d8c575f80fd5b611d988d838e016119f7565b909850965060608c0135955060808c0135915080821115611db7575f80fd5b50611dc48c828d016119f7565b9a9d999c50979a9699959894979660a00135949350505050565b5f8060408385031215611def575f80fd5b50508035926020909101359150565b5f805f805f8060808789031215611e13575f80fd5b8635955060208701356001600160401b0380821115611e30575f80fd5b611e3c8a838b016119f7565b90975095506040890135915080821115611e54575f80fd5b50611e6189828a016119f7565b979a9699509497949695606090950135949350505050565b818382375f9101908152919050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b89815260c060208201525f611ec960c083018a8c611e88565b8281036040840152611edc81898b611e88565b90508660608401528281036080840152611ef7818688611e88565b9150508260a08301529a9950505050505050505050565b5f60208284031215611f1e575f80fd5b81518015158114610a35575f80fd5b608081525f611f4060808301898b611e88565b8281036020840152611f5381888a611e88565b90508560408401528281036060840152611f6e818587611e88565b9a9950505050505050505050565b602081525f611f8f602083018486611e88565b949350505050565b5f60208284031215611fa7575f80fd5b8151610a3581611b21565b868152608060208201525f611fcb608083018789611e88565b8281036040840152611fde818688611e88565b915050826060830152979650505050505050565b606081525f612005606083018789611e88565b8281036020840152612018818688611e88565b9150508260408301529695505050505050565b604081525f61203e604083018587611e88565b905060018060a01b0383166020830152949350505050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561043457610434612056565b634e487b7160e01b5f52603260045260245ffd5b5f600182016120a2576120a2612056565b5060010190565b5f805f80608085870312156120bc575f80fd5b505082516020840151604085015160609095015191969095509092509050565b5f5b838110156120f65781810151838201526020016120de565b50505f910152565b5f805f8060808587031215612111575f80fd5b84516001600160401b03811115612126575f80fd5b8501601f81018713612136575f80fd5b8051612144611cfd82611c94565b818152886020838501011115612158575f80fd5b6121698260208301602086016120dc565b60208801516040890151606090990151919a909950909650945050505050565b5f81518084526121a08160208601602086016120dc565b601f01601f19169290920160200192915050565b8481526001600160401b0384166020820152608060408201525f6121db6080830185612189565b905082606083015295945050505050565b8a815289602082015260e060408201525f61220b60e083018a8c611e88565b828103606084015261221e81898b611e88565b905086608084015282810360a0840152612239818688611e88565b9150508260c08301529b9a5050505050505050505050565b87815286602082015260a060408201525f61227060a083018789611e88565b8281036060840152612283818688611e88565b91505082608083015298975050505050505050565b5f82516122a98184602087016120dc565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f83516122ea8160178501602088016120dc565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161231b8160288401602088016120dc565b01602801949350505050565b602081525f610a356020830184612189565b60ff828116828216039081111561043457610434612056565b808202811582820484141761043457610434612056565b8082018082111561043457610434612056565b5f8161238a5761238a612056565b505f190190565b634e487b7160e01b5f52603160045260245ffdfea2646970667358221220c30ef538d6df44af53919678291be073744193f19a2ae154f4f88793400e02d064736f6c6343000814003352656365697665724178656c61723a207a65726f206164647265737300000000000000000000000000000000e432150cce91c13a887f7d836923d5597add8e310000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827120000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b11200
Deployed Bytecode
0x60806040526004361061011b575f3560e01c8063868a166d1161009d578063ca15c87311610062578063ca15c87314610359578063d547741f14610378578063e4a974cc14610397578063f5b541a6146103aa578063f7260d3e146103dd575f80fd5b8063868a166d146102ca5780639010d07c146102e957806391d1485414610308578063a217fddf14610327578063c7e6a3cc1461033a575f80fd5b806336568abe116100e357806336568abe1461021a57806349160658146102395780636565763614610258578063717808821461026b578063790a72141461028a575f80fd5b806301ffc9a71461011f578063116191b6146101535780631a98b2e01461019e578063248a9ca3146101bf5780632f2ff15d146101fb575b5f80fd5b34801561012a575f80fd5b5061013e6101393660046119d0565b610410565b60405190151581526020015b60405180910390f35b34801561015e575f80fd5b506101867f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e3181565b6040516001600160a01b03909116815260200161014a565b3480156101a9575f80fd5b506101bd6101b8366004611a3b565b61043a565b005b3480156101ca575f80fd5b506101ed6101d9366004611b0a565b5f9081526020819052604090206001015490565b60405190815260200161014a565b348015610206575f80fd5b506101bd610215366004611b35565b610633565b348015610225575f80fd5b506101bd610234366004611b35565b61065c565b348015610244575f80fd5b506101bd610253366004611b63565b6106df565b6101bd610266366004611b63565b610833565b348015610276575f80fd5b506101bd610285366004611bfe565b61094f565b348015610295575f80fd5b506101866102a4366004611cba565b80516020818301810180516002825292820191909301209152546001600160a01b031681565b3480156102d5575f80fd5b506101866102e4366004611d33565b6109fb565b3480156102f4575f80fd5b50610186610303366004611dde565b610a1e565b348015610313575f80fd5b5061013e610322366004611b35565b610a3c565b348015610332575f80fd5b506101ed5f81565b348015610345575f80fd5b50610186610354366004611dfe565b610a64565b348015610364575f80fd5b506101ed610373366004611b0a565b610a81565b348015610383575f80fd5b506101bd610392366004611b35565b610a97565b6101bd6103a5366004611a3b565b610abb565b3480156103b5575f80fd5b506101ed7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92981565b3480156103e8575f80fd5b506101867f0000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b1120081565b5f6001600160e01b03198216635a05180f60e01b1480610434575061043482610c84565b92915050565b5f858560405161044b929190611e79565b604051908190038120631876eed960e01b825291506001600160a01b037f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e311690631876eed9906104af908e908e908e908e908e9089908d908d908d90600401611eb0565b6020604051808303815f875af11580156104cb573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104ef9190611f0e565b61050c57604051631403112d60e21b815260040160405180910390fd5b5f61051e8c8c8c8c8c878b8b8b610cb8565b90506001600160a01b0381161561062557806001600160a01b0316838d7fdb3db9dfc9262f4fe09dbadef104f799d8181ec565e09275d80ed3355aab68d38e8e8e8e898d8d6040516105769796959493929190611f2d565b60405180910390a46040516349ad89fb60e11b81525f906001600160a01b037f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e31169063935b13f6906105ce9089908990600401611f7c565b602060405180830381865afa1580156105e9573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061060d9190611f97565b90506106236001600160a01b0382168386610ce9565b505b505050505050505050505050565b5f8281526020819052604090206001015461064d81610d4c565b6106578383610d59565b505050565b6001600160a01b03811633146106d15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6106db8282610d7a565b5050565b5f82826040516106f0929190611e79565b604051908190038120635f6970c360e01b825291506001600160a01b037f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e311690635f6970c39061074e908b908b908b908b908b908990600401611fb2565b6020604051808303815f875af115801561076a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078e9190611f0e565b6107ab57604051631403112d60e21b815260040160405180910390fd5b5f6107ba898989898987610d9b565b90506001600160a01b0381161561081a57806001600160a01b0316897f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418a8a8a8a8860405161080d959493929190611ff2565b60405180910390a3610828565b610828888888888888610dc6565b505050505050505050565b604051630d26ff2160e41b8152600481018890527f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e316001600160a01b03169063d26ff21090602401602060405180830381865afa158015610896573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108ba9190611f0e565b156108d857604051630dc1019760e01b815260040160405180910390fd5b60405133905f906108ec9085908590611e79565b60405180910390209050816001600160a01b0316897f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928a8a8a8a87604051610938959493929190611ff2565b60405180910390a361081a89898989898688611184565b7f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92961097981610d4c565b816002858560405161098c929190611e79565b90815260405190819003602001812080546001600160a01b03939093166001600160a01b0319909316929092179091557fa92669dee832c52e51d7443a8cd48a0e3dc297def6dc76887e24b2f728f62ded906109ed9086908690869061202b565b60405180910390a150505050565b5f80610a0e8b8b8b8b8b8b8b8b8b6111ca565b549b9a5050505050505050505050565b5f828152600160205260408120610a359083611233565b9392505050565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80610a7488888888888861123e565b5498975050505050505050565b5f8181526001602052604081206104349061129e565b5f82815260208190526040902060010154610ab181610d4c565b6106578383610d7a565b604051630d26ff2160e41b8152600481018b90527f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e316001600160a01b03169063d26ff21090602401602060405180830381865afa158015610b1e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b429190611f0e565b15610b6057604051630dc1019760e01b815260040160405180910390fd5b6040516349ad89fb60e11b815233905f906001600160a01b037f000000000000000000000000e432150cce91c13a887f7d836923d5597add8e31169063935b13f690610bb29088908890600401611f7c565b602060405180830381865afa158015610bcd573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610bf19190611f97565b90505f8787604051610c04929190611e79565b60405180910390209050826001600160a01b0316848e7f5844b8bbe3fd2b0354e73f27bfde28d2e6d991f14139c382876ec4360391a47b8f8f8f8f888e8e604051610c559796959493929190611f2d565b60405180910390a4610c6f8d8d8d8d8d868c8c8c8c6112a7565b6106236001600160a01b0383168430876112f3565b5f6001600160e01b03198216637965db0b60e01b148061043457506301ffc9a760e01b6001600160e01b0319831614610434565b5f80610ccb8b8b8b8b8b8b8b8b8b6111ca565b9050805491508115610cdb575f81555b509998505050505050505050565b6040516001600160a01b03831660248201526044810182905261065790849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152611331565b610d5681336113f0565b50565b610d638282611449565b5f82815260016020526040902061065790826114cc565b610d8482826114e0565b5f8281526001602052604090206106579082611544565b5f80610dab88888888888861123e565b9050805491508115610dbb575f81555b509695505050505050565b610e0484848080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061155892505050565b6001600160a01b031660028787604051610e1f929190611e79565b908152604051908190036020019020546001600160a01b031614610e855760405162461bcd60e51b815260206004820152601a60248201527f52656365697665724178656c61723a2077726f6e67207065657200000000000060448201526064016106c8565b5f808080610e9460018661206a565b90505f816001600160401b03811115610eaf57610eaf611c50565b6040519080825280601f01601f191660200182016040528015610ed9576020820181803683370190505b5090505f5b82811015610f3a57878782818110610ef857610ef861207d565b9050013560f81c60f81b828281518110610f1457610f1461207d565b60200101906001600160f81b03191690815f1a905350610f3381612091565b9050610ede565b508686610f4860018261206a565b818110610f5757610f5761207d565b909101356001600160f81b031916600160f81b03905061108a578051608014610fd15760405162461bcd60e51b815260206004820152602660248201527f52656365697665724178656c61723a20496e76616c6964206d657373616765206044820152650d8cadccee8d60d31b60648201526084016106c8565b5f81806020019051810190610fe691906120a9565b604051632c7f327760e11b8152600481018490526001600160401b0383166024820152604481018590526064810182905290995091975095509091507f0000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b112006001600160a01b0316906358fe64ee906084015b5f604051808303815f87803b15801561106e575f80fd5b505af1158015611080573d5f803e3d5ffd5b5050505050611177565b868661109760018261206a565b8181106110a6576110a661207d565b909101356001600160f81b0319165f03905061112f576060818060200190518101906110d291906120fe565b60405163f137538b60e01b815290995091975095509091506001600160a01b037f0000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b11200169063f137538b90611057908890889086908c906004016121b4565b60405162461bcd60e51b815260206004820152601d60248201527f52656365697665724178656c61723a2077726f6e67206d65737361676500000060448201526064016106c8565b5050505050505050505050565b5f61119388888888888861123e565b80549091506001600160a01b038116156111c05760405163725f13f160e01b815260040160405180910390fd5b5055505050505050565b5f7febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a60405160200161120e9a999897969594939291906121ec565b6040516020818303038152906040528051906020012090509998505050505050505050565b5f610a3583836116d4565b5f7f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e587878787878760405160200161127c9796959493929190612251565b6040516020818303038152906040528051906020012090509695505050505050565b5f610434825490565b5f6112b98b8b8b8b8b8b8b8b8b6111ca565b80549091506001600160a01b038116156112e65760405163725f13f160e01b815260040160405180910390fd5b5055505050505050505050565b6040516001600160a01b038085166024830152831660448201526064810182905261132b9085906323b872dd60e01b90608401610d15565b50505050565b5f80836001600160a01b03168360405161134b9190612298565b5f604051808303815f865af19150503d805f8114611384576040519150601f19603f3d011682016040523d82523d5f602084013e611389565b606091505b50915091505f8280156113b45750815115806113b45750818060200190518101906113b49190611f0e565b90508015806113cb57506001600160a01b0385163b155b156113e95760405163022e258160e11b815260040160405180910390fd5b5050505050565b6113fa8282610a3c565b6106db57611407816116fa565b61141283602061170c565b6040516020016114239291906122b3565b60408051601f198184030181529082905262461bcd60e51b82526106c891600401612327565b6114538282610a3c565b6106db575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114883390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f610a35836001600160a01b0384166118a1565b6114ea8282610a3c565b156106db575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f610a35836001600160a01b0384166118ed565b5f808290505f808251602a1415806115955750825f8151811061157d5761157d61207d565b6020910101516001600160f81b031916600360fc1b14155b806115c65750826001815181106115ae576115ae61207d565b6020910101516001600160f81b031916600f60fb1b14155b156115e457604051636fa478cf60e11b815260040160405180910390fd5b60025b602a8110156116ca578381815181106116025761160261207d565b016020015160f81c915060618210801590611621575060668260ff1611155b1561163857611631605783612339565b91506116a1565b60418260ff1610158015611650575060468260ff1611155b1561166057611631603783612339565b60308260ff1610158015611678575060398260ff1611155b1561168857611631603083612339565b604051636fa478cf60e11b815260040160405180910390fd5b60026116ae82602961206a565b60ff8416911b1b92909217916116c381612091565b90506115e7565b5090949350505050565b5f825f0182815481106116e9576116e961207d565b905f5260205f200154905092915050565b60606104346001600160a01b03831660145b60605f61171a836002612352565b611725906002612369565b6001600160401b0381111561173c5761173c611c50565b6040519080825280601f01601f191660200182016040528015611766576020820181803683370190505b509050600360fc1b815f815181106117805761178061207d565b60200101906001600160f81b03191690815f1a905350600f60fb1b816001815181106117ae576117ae61207d565b60200101906001600160f81b03191690815f1a9053505f6117d0846002612352565b6117db906001612369565b90505b6001811115611852576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061180f5761180f61207d565b1a60f81b8282815181106118255761182561207d565b60200101906001600160f81b03191690815f1a90535060049490941c9361184b8161237c565b90506117de565b508315610a355760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016106c8565b5f8181526001830160205260408120546118e657508154600181810184555f848152602080822090930184905584548482528286019093526040902091909155610434565b505f610434565b5f81815260018301602052604081205480156119c7575f61190f60018361206a565b85549091505f906119229060019061206a565b9050818114611981575f865f0182815481106119405761194061207d565b905f5260205f200154905080875f0184815481106119605761196061207d565b5f918252602080832090910192909255918252600188019052604090208390555b855486908061199257611992612391565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f905560019350505050610434565b5f915050610434565b5f602082840312156119e0575f80fd5b81356001600160e01b031981168114610a35575f80fd5b5f8083601f840112611a07575f80fd5b5081356001600160401b03811115611a1d575f80fd5b602083019150836020828501011115611a34575f80fd5b9250929050565b5f805f805f805f805f8060c08b8d031215611a54575f80fd5b8a35995060208b01356001600160401b0380821115611a71575f80fd5b611a7d8e838f016119f7565b909b50995060408d0135915080821115611a95575f80fd5b611aa18e838f016119f7565b909950975060608d0135915080821115611ab9575f80fd5b611ac58e838f016119f7565b909750955060808d0135915080821115611add575f80fd5b50611aea8d828e016119f7565b9150809450508092505060a08b013590509295989b9194979a5092959850565b5f60208284031215611b1a575f80fd5b5035919050565b6001600160a01b0381168114610d56575f80fd5b5f8060408385031215611b46575f80fd5b823591506020830135611b5881611b21565b809150509250929050565b5f805f805f805f6080888a031215611b79575f80fd5b8735965060208801356001600160401b0380821115611b96575f80fd5b611ba28b838c016119f7565b909850965060408a0135915080821115611bba575f80fd5b611bc68b838c016119f7565b909650945060608a0135915080821115611bde575f80fd5b50611beb8a828b016119f7565b989b979a50959850939692959293505050565b5f805f60408486031215611c10575f80fd5b83356001600160401b03811115611c25575f80fd5b611c31868287016119f7565b9094509250506020840135611c4581611b21565b809150509250925092565b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715611c8c57611c8c611c50565b604052919050565b5f6001600160401b03821115611cac57611cac611c50565b50601f01601f191660200190565b5f60208284031215611cca575f80fd5b81356001600160401b03811115611cdf575f80fd5b8201601f81018413611cef575f80fd5b8035611d02611cfd82611c94565b611c64565b818152856020838501011115611d16575f80fd5b816020840160208301375f91810160200191909152949350505050565b5f805f805f805f805f60c08a8c031215611d4b575f80fd5b8935985060208a01356001600160401b0380821115611d68575f80fd5b611d748d838e016119f7565b909a50985060408c0135915080821115611d8c575f80fd5b611d988d838e016119f7565b909850965060608c0135955060808c0135915080821115611db7575f80fd5b50611dc48c828d016119f7565b9a9d999c50979a9699959894979660a00135949350505050565b5f8060408385031215611def575f80fd5b50508035926020909101359150565b5f805f805f8060808789031215611e13575f80fd5b8635955060208701356001600160401b0380821115611e30575f80fd5b611e3c8a838b016119f7565b90975095506040890135915080821115611e54575f80fd5b50611e6189828a016119f7565b979a9699509497949695606090950135949350505050565b818382375f9101908152919050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b89815260c060208201525f611ec960c083018a8c611e88565b8281036040840152611edc81898b611e88565b90508660608401528281036080840152611ef7818688611e88565b9150508260a08301529a9950505050505050505050565b5f60208284031215611f1e575f80fd5b81518015158114610a35575f80fd5b608081525f611f4060808301898b611e88565b8281036020840152611f5381888a611e88565b90508560408401528281036060840152611f6e818587611e88565b9a9950505050505050505050565b602081525f611f8f602083018486611e88565b949350505050565b5f60208284031215611fa7575f80fd5b8151610a3581611b21565b868152608060208201525f611fcb608083018789611e88565b8281036040840152611fde818688611e88565b915050826060830152979650505050505050565b606081525f612005606083018789611e88565b8281036020840152612018818688611e88565b9150508260408301529695505050505050565b604081525f61203e604083018587611e88565b905060018060a01b0383166020830152949350505050565b634e487b7160e01b5f52601160045260245ffd5b8181038181111561043457610434612056565b634e487b7160e01b5f52603260045260245ffd5b5f600182016120a2576120a2612056565b5060010190565b5f805f80608085870312156120bc575f80fd5b505082516020840151604085015160609095015191969095509092509050565b5f5b838110156120f65781810151838201526020016120de565b50505f910152565b5f805f8060808587031215612111575f80fd5b84516001600160401b03811115612126575f80fd5b8501601f81018713612136575f80fd5b8051612144611cfd82611c94565b818152886020838501011115612158575f80fd5b6121698260208301602086016120dc565b60208801516040890151606090990151919a909950909650945050505050565b5f81518084526121a08160208601602086016120dc565b601f01601f19169290920160200192915050565b8481526001600160401b0384166020820152608060408201525f6121db6080830185612189565b905082606083015295945050505050565b8a815289602082015260e060408201525f61220b60e083018a8c611e88565b828103606084015261221e81898b611e88565b905086608084015282810360a0840152612239818688611e88565b9150508260c08301529b9a5050505050505050505050565b87815286602082015260a060408201525f61227060a083018789611e88565b8281036060840152612283818688611e88565b91505082608083015298975050505050505050565b5f82516122a98184602087016120dc565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f83516122ea8160178501602088016120dc565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161231b8160288401602088016120dc565b01602801949350505050565b602081525f610a356020830184612189565b60ff828116828216039081111561043457610434612056565b808202811582820484141761043457610434612056565b8082018082111561043457610434612056565b5f8161238a5761238a612056565b505f190190565b634e487b7160e01b5f52603160045260245ffdfea2646970667358221220c30ef538d6df44af53919678291be073744193f19a2ae154f4f88793400e02d064736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e432150cce91c13a887f7d836923d5597add8e310000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827120000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b11200
-----Decoded View---------------
Arg [0] : gateway_ (address): 0xe432150cce91c13a887f7D836923d5597adD8E31
Arg [1] : gasService_ (address): 0x2d5d7d31F671F86C782533cc367F14109a082712
Arg [2] : receiver_ (address): 0x0F00F1a6A32e644815C5686aD7dc305A54B11200
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000e432150cce91c13a887f7d836923d5597add8e31
Arg [1] : 0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712
Arg [2] : 0000000000000000000000000f00f1a6a32e644815c5686ad7dc305a54b11200
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.