Source Code
Overview
GLMR Balance
GLMR Value
$0.00Latest 20 from a total of 20 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Set Receiver | 13893203 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893199 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893197 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893195 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893193 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893191 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893189 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893187 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893185 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893183 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893181 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893179 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893174 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893172 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Receiver | 13893170 | 29 days ago | IN | 0 GLMR | 0.002941 | ||||
| Set Chain Id Ada... | 13893167 | 29 days ago | IN | 0 GLMR | 0.00293275 | ||||
| Grant Role | 13496620 | 62 days ago | IN | 0 GLMR | 0.005307 | ||||
| Grant Role | 13496619 | 62 days ago | IN | 0 GLMR | 0.005307 | ||||
| Revoke Role | 13462858 | 65 days ago | IN | 0 GLMR | 0.003102 | ||||
| Grant Role | 13462857 | 65 days ago | IN | 0 GLMR | 0.00398025 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BridgeAxelar
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 "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import { AxelarExpressExecutable } from "@axelar-network/axelar-gmp-sdk-solidity/contracts/express/AxelarExpressExecutable.sol";
import { IAxelarGasService } from "@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol";
import "../../interfaces/IBridge.sol";
import "../../interfaces/IChainIdAdapter.sol";
contract BridgeAxelar is AxelarExpressExecutable, IBridge, AccessControlEnumerable, ReentrancyGuard {
using Address for address;
/// @dev gate keeper role id
bytes32 public constant GATEKEEPER_ROLE = keccak256("GATEKEEPER_ROLE");
/// @dev operator role id
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
/// @dev current state Active\Inactive
IBridge.State public state;
/// @dev nonces
mapping(address => uint256) public nonces;
/// @dev chainIdTo => receiver
mapping (uint64 => address) public receivers;
/// @dev Axelar gas service
IAxelarGasService public immutable gasService;
/// @dev ChainIdAdapter address
address public chainIdAdapter;
/// @dev human readable tag
string public tag;
event StateSet(IBridge.State state);
event NetworkSet(uint64 chainIdTo, string network);
event ReceiverSet(uint64 chainIdTo, address receiver);
event ChainIdAdapterSet(address);
constructor(address gateway_, address gasService_, string memory tag_) AxelarExpressExecutable(gateway_) {
_grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
state = IBridge.State.Active;
tag = tag_;
gasService = IAxelarGasService(gasService_);
}
receive() external payable {}
/**
* @dev Set receiver for chainId
*
* @param chainIdTo_ Chain ID of receiver
*/
function setReceiver(uint64 chainIdTo_, address receiver_) external onlyRole(OPERATOR_ROLE) {
receivers[chainIdTo_] = receiver_;
emit ReceiverSet(chainIdTo_, receiver_);
}
/**
* @dev Set ChainIdAdapter address.
*
* @param chainIdAdapter_ ChainIdAdapter address
*/
function setChainIdAdapter(address chainIdAdapter_) external onlyRole(OPERATOR_ROLE) {
chainIdAdapter = chainIdAdapter_;
emit ChainIdAdapterSet(chainIdAdapter_);
}
/**
* @dev Set new state.
*
* Controlled by operator. Can be used to emergency pause send or send and receive data.
*
* @param state_ Active\Inactive state
*/
function setState(IBridge.State state_) external onlyRole(OPERATOR_ROLE) {
state = state_;
emit StateSet(state);
}
/**
* @notice Estimate gas for a cross-chain contract call
* @param destinationChain_ name of the dest chain
* @param destinationAddress_ address on dest chain this tx is going to
* @param payload_ message to be sent
* @param gasLimit_ message to be sent
* @param params_ message to be sent
* @return gasEstimate The cross-chain gas estimate
*/
function quote(
string memory destinationChain_,
string memory destinationAddress_,
bytes memory payload_,
uint256 gasLimit_,
bytes memory params_
) public view returns (uint256) {
return gasService.estimateGasFee(
destinationChain_,
destinationAddress_,
payload_,
gasLimit_,
params_
);
}
/**
* @dev Estimate price for Axelar bridge
*
* @param params send params
* @param sender protocol which uses bridge
* @param options_ additional call options
*/
function estimateGasFee(
IBridge.SendParams calldata params,
address sender,
bytes memory options_
) public view returns (uint256) {
(
string memory destinationChain,
string memory destinationAddress,
uint256 gasLimit,
bytes memory options
) = _unpackParams(params, options_);
return gasService.estimateGasFee(
destinationChain,
destinationAddress,
params.data,
gasLimit,
options
);
}
/**
* @dev Send params to chainIdTo
*
* @param params params, which will be sent
* @param sender protocol which uses bridge
* @param nonce nonce
* @param options additional call options
*/
function sendV3(
IBridge.SendParams calldata params,
address sender,
uint256 nonce,
bytes memory options
) public payable onlyRole(GATEKEEPER_ROLE) {
_send(params, sender, options);
}
/**
* @dev Send params to chainIdTo
*
* @param params params, which will be sent
* @param sender protocol which uses bridge
* @param options_ additional call options
*/
function _send(
IBridge.SendParams calldata params,
address sender,
bytes memory options_
) internal {
require(state == IBridge.State.Active, "BridgeAxelar: state inactive");
(
string memory destinationChain,
string memory destinationAddress,
uint256 gasLimit,
bytes memory options
) = _unpackParams(params, options_);
_payGas(destinationChain, destinationAddress, params.data, gasLimit, sender, options);
gateway.callContract(
destinationChain,
destinationAddress,
params.data
);
}
/**
* @dev Unpack params for Axelar bridge usage
*
* @param params send params
* @param options_ additional options packed
* @return destinationChain destionation chain in string type
* @return destinationAddress destination address in string type
* @return gasLimit gas limit for destination tx
* @return options additional options for destination call
*/
function _unpackParams(IBridge.SendParams calldata params, bytes memory options_) internal view
returns(
string memory destinationChain,
string memory destinationAddress,
uint256 gasLimit,
bytes memory options
) {
uint64 chainIdTo = uint64(params.chainIdTo);
require(chainIdAdapter != address(0), "Bridge: chainId adapter not set");
destinationChain = IChainIdAdapter(chainIdAdapter).chainIdToChainName(chainIdTo);
destinationAddress = Strings.toHexString(uint160(receivers[chainIdTo]), 20);
(gasLimit, options) = abi.decode(options_, (uint256, bytes));
}
/**
* @dev Pay gas for Axelar bridge usage
*
* @param chainId chain id to
* @param destinationAddress destionation address
* @param data send data
* @param gasLimit gas limit of destination tx
* @param sender protocol address
* @param options additional options
*/
function _payGas(
string memory chainId,
string memory destinationAddress,
bytes memory data,
uint256 gasLimit,
address sender,
bytes memory options
) internal {
gasService.payGas{value: msg.value} (
address(this),
chainId,
destinationAddress,
data,
gasLimit,
false,
sender,
options
);
}
}// 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 { GasInfo } from '../types/GasEstimationTypes.sol';
import { IInterchainGasEstimation } from './IInterchainGasEstimation.sol';
import { IUpgradable } from './IUpgradable.sol';
/**
* @title IAxelarGasService Interface
* @notice This is an interface for the AxelarGasService contract which manages gas payments
* and refunds for cross-chain communication on the Axelar network.
* @dev This interface inherits IUpgradable
*/
interface IAxelarGasService is IInterchainGasEstimation, IUpgradable {
error InvalidAddress();
error NotCollector();
error InvalidAmounts();
error InvalidGasUpdates();
error InvalidParams();
error InsufficientGasPayment(uint256 required, uint256 provided);
event GasPaidForContractCall(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event GasPaidForContractCallWithToken(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
string symbol,
uint256 amount,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event NativeGasPaidForContractCall(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
uint256 gasFeeAmount,
address refundAddress
);
event NativeGasPaidForContractCallWithToken(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
string symbol,
uint256 amount,
uint256 gasFeeAmount,
address refundAddress
);
event GasPaidForExpressCall(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event GasPaidForExpressCallWithToken(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
string symbol,
uint256 amount,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event NativeGasPaidForExpressCall(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
uint256 gasFeeAmount,
address refundAddress
);
event NativeGasPaidForExpressCallWithToken(
address indexed sourceAddress,
string destinationChain,
string destinationAddress,
bytes32 indexed payloadHash,
string symbol,
uint256 amount,
uint256 gasFeeAmount,
address refundAddress
);
event GasAdded(
bytes32 indexed txHash,
uint256 indexed logIndex,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event NativeGasAdded(bytes32 indexed txHash, uint256 indexed logIndex, uint256 gasFeeAmount, address refundAddress);
event ExpressGasAdded(
bytes32 indexed txHash,
uint256 indexed logIndex,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
);
event NativeExpressGasAdded(
bytes32 indexed txHash,
uint256 indexed logIndex,
uint256 gasFeeAmount,
address refundAddress
);
event Refunded(
bytes32 indexed txHash,
uint256 indexed logIndex,
address payable receiver,
address token,
uint256 amount
);
/**
* @notice Pay for gas for any type of contract execution on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @dev If estimateOnChain is true, the function will estimate the gas cost and revert if the payment is insufficient.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call
* @param executionGasLimit The gas limit for the contract call
* @param estimateOnChain Flag to enable on-chain gas estimation
* @param refundAddress The address where refunds, if any, should be sent
* @param params Additional parameters for gas payment. This can be left empty for normal contract call payments.
*/
function payGas(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
uint256 executionGasLimit,
bool estimateOnChain,
address refundAddress,
bytes calldata params
) external payable;
/**
* @notice Pay for gas using ERC20 tokens for a contract call on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call
* @param gasToken The address of the ERC20 token used to pay for gas
* @param gasFeeAmount The amount of tokens to pay for gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function payGasForContractCall(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Pay for gas using ERC20 tokens for a contract call with tokens on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call with tokens will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call with tokens
* @param symbol The symbol of the token to be sent with the call
* @param amount The amount of tokens to be sent with the call
* @param gasToken The address of the ERC20 token used to pay for gas
* @param gasFeeAmount The amount of tokens to pay for gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function payGasForContractCallWithToken(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Pay for gas using native currency for a contract call on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call
* @param refundAddress The address where refunds, if any, should be sent
*/
function payNativeGasForContractCall(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
address refundAddress
) external payable;
/**
* @notice Pay for gas using native currency for a contract call with tokens on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call with tokens will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call with tokens
* @param symbol The symbol of the token to be sent with the call
* @param amount The amount of tokens to be sent with the call
* @param refundAddress The address where refunds, if any, should be sent
*/
function payNativeGasForContractCallWithToken(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount,
address refundAddress
) external payable;
/**
* @notice Pay for gas using ERC20 tokens for an express contract call on a destination chain.
* @dev This function is called on the source chain before calling the gateway to express execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call
* @param gasToken The address of the ERC20 token used to pay for gas
* @param gasFeeAmount The amount of tokens to pay for gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function payGasForExpressCall(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Pay for gas using ERC20 tokens for an express contract call with tokens on a destination chain.
* @dev This function is called on the source chain before calling the gateway to express execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call with tokens will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call with tokens
* @param symbol The symbol of the token to be sent with the call
* @param amount The amount of tokens to be sent with the call
* @param gasToken The address of the ERC20 token used to pay for gas
* @param gasFeeAmount The amount of tokens to pay for gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function payGasForExpressCallWithToken(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Pay for gas using native currency for an express contract call on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call
* @param refundAddress The address where refunds, if any, should be sent
*/
function payNativeGasForExpressCall(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
address refundAddress
) external payable;
/**
* @notice Pay for gas using native currency for an express contract call with tokens on a destination chain.
* @dev This function is called on the source chain before calling the gateway to execute a remote contract.
* @param sender The address making the payment
* @param destinationChain The target chain where the contract call with tokens will be made
* @param destinationAddress The target address on the destination chain
* @param payload Data payload for the contract call with tokens
* @param symbol The symbol of the token to be sent with the call
* @param amount The amount of tokens to be sent with the call
* @param refundAddress The address where refunds, if any, should be sent
*/
function payNativeGasForExpressCallWithToken(
address sender,
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
string calldata symbol,
uint256 amount,
address refundAddress
) external payable;
/**
* @notice Add additional gas payment using ERC20 tokens after initiating a cross-chain call.
* @dev This function can be called on the source chain after calling the gateway to execute a remote contract.
* @param txHash The transaction hash of the cross-chain call
* @param logIndex The log index for the cross-chain call
* @param gasToken The ERC20 token address used to add gas
* @param gasFeeAmount The amount of tokens to add as gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function addGas(
bytes32 txHash,
uint256 logIndex,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Add additional gas payment using native currency after initiating a cross-chain call.
* @dev This function can be called on the source chain after calling the gateway to execute a remote contract.
* @param txHash The transaction hash of the cross-chain call
* @param logIndex The log index for the cross-chain call
* @param refundAddress The address where refunds, if any, should be sent
*/
function addNativeGas(
bytes32 txHash,
uint256 logIndex,
address refundAddress
) external payable;
/**
* @notice Add additional gas payment using ERC20 tokens after initiating an express cross-chain call.
* @dev This function can be called on the source chain after calling the gateway to express execute a remote contract.
* @param txHash The transaction hash of the cross-chain call
* @param logIndex The log index for the cross-chain call
* @param gasToken The ERC20 token address used to add gas
* @param gasFeeAmount The amount of tokens to add as gas
* @param refundAddress The address where refunds, if any, should be sent
*/
function addExpressGas(
bytes32 txHash,
uint256 logIndex,
address gasToken,
uint256 gasFeeAmount,
address refundAddress
) external;
/**
* @notice Add additional gas payment using native currency after initiating an express cross-chain call.
* @dev This function can be called on the source chain after calling the gateway to express execute a remote contract.
* @param txHash The transaction hash of the cross-chain call
* @param logIndex The log index for the cross-chain call
* @param refundAddress The address where refunds, if any, should be sent
*/
function addNativeExpressGas(
bytes32 txHash,
uint256 logIndex,
address refundAddress
) external payable;
/**
* @notice Updates the gas price for a specific chain.
* @dev This function is called by the gas oracle to update the gas prices for a specific chains.
* @param chains Array of chain names
* @param gasUpdates Array of gas updates
*/
function updateGasInfo(string[] calldata chains, GasInfo[] calldata gasUpdates) external;
/**
* @notice Allows the gasCollector to collect accumulated fees from the contract.
* @dev Use address(0) as the token address for native currency.
* @param receiver The address to receive the collected fees
* @param tokens Array of token addresses to be collected
* @param amounts Array of amounts to be collected for each respective token address
*/
function collectFees(
address payable receiver,
address[] calldata tokens,
uint256[] calldata amounts
) external;
/**
* @notice Refunds gas payment to the receiver in relation to a specific cross-chain transaction.
* @dev Only callable by the gasCollector.
* @dev Use address(0) as the token address to refund native currency.
* @param txHash The transaction hash of the cross-chain call
* @param logIndex The log index for the cross-chain call
* @param receiver The address to receive the refund
* @param token The token address to be refunded
* @param amount The amount to refund
*/
function refund(
bytes32 txHash,
uint256 logIndex,
address payable receiver,
address token,
uint256 amount
) external;
/**
* @notice Returns the address of the designated gas collector.
* @return address of the gas collector
*/
function gasCollector() external returns (address);
}// 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;
import { GasEstimationType, GasInfo } from '../types/GasEstimationTypes.sol';
/**
* @title IInterchainGasEstimation Interface
* @notice This is an interface for the InterchainGasEstimation contract
* which allows for estimating gas fees for cross-chain communication on the Axelar network.
*/
interface IInterchainGasEstimation {
error UnsupportedEstimationType(GasEstimationType gasEstimationType);
/**
* @notice Event emitted when the gas price for a specific chain is updated.
* @param chain The name of the chain
* @param info The gas info for the chain
*/
event GasInfoUpdated(string chain, GasInfo info);
/**
* @notice Returns the gas price for a specific chain.
* @param chain The name of the chain
* @return gasInfo The gas info for the chain
*/
function getGasInfo(string calldata chain) external view returns (GasInfo memory);
/**
* @notice Estimates the gas fee for a cross-chain contract call.
* @param destinationChain Axelar registered name of the destination chain
* @param destinationAddress Destination contract address being called
* @param executionGasLimit The gas limit to be used for the destination contract execution,
* e.g. pass in 200k if your app consumes needs upto 200k for this contract call
* @param params Additional parameters for the gas estimation
* @return gasEstimate The cross-chain gas estimate, in terms of source chain's native gas token that should be forwarded to the gas service.
*/
function estimateGasFee(
string calldata destinationChain,
string calldata destinationAddress,
bytes calldata payload,
uint256 executionGasLimit,
bytes calldata params
) external view returns (uint256 gasEstimate);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title IOwnable Interface
* @notice IOwnable is an interface that abstracts the implementation of a
* contract with ownership control features. It's commonly used in upgradable
* contracts and includes the functionality to get current owner, transfer
* ownership, and propose and accept ownership.
*/
interface IOwnable {
error NotOwner();
error InvalidOwner();
error InvalidOwnerAddress();
event OwnershipTransferStarted(address indexed newOwner);
event OwnershipTransferred(address indexed newOwner);
/**
* @notice Returns the current owner of the contract.
* @return address The address of the current owner
*/
function owner() external view returns (address);
/**
* @notice Returns the address of the pending owner of the contract.
* @return address The address of the pending owner
*/
function pendingOwner() external view returns (address);
/**
* @notice Transfers ownership of the contract to a new address
* @param newOwner The address to transfer ownership to
*/
function transferOwnership(address newOwner) external;
/**
* @notice Proposes to transfer the contract's ownership to a new address.
* The new owner needs to accept the ownership explicitly.
* @param newOwner The address to transfer ownership to
*/
function proposeOwnership(address newOwner) external;
/**
* @notice Transfers ownership to the pending owner.
* @dev Can only be called by the pending owner
*/
function acceptOwnership() external;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import { IOwnable } from './IOwnable.sol';
import { IImplementation } from './IImplementation.sol';
// General interface for upgradable contracts
interface IUpgradable is IOwnable, IImplementation {
error InvalidCodeHash();
error InvalidImplementation();
error SetupFailed();
event Upgraded(address indexed newImplementation);
function implementation() external view returns (address);
function upgrade(
address newImplementation,
bytes32 newImplementationCodeHash,
bytes calldata params
) external;
}// 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
pragma solidity ^0.8.0;
/**
* @title GasEstimationType
* @notice This enum represents the gas estimation types for different chains.
*/
enum GasEstimationType {
Default,
OptimismEcotone,
OptimismBedrock,
Arbitrum,
Scroll
}
/**
* @title GasInfo
* @notice This struct represents the gas pricing information for a specific chain.
* @dev Smaller uint types are used for efficient struct packing to save storage costs.
*/
struct GasInfo {
/// @dev Custom gas pricing rule, such as L1 data fee on L2s
uint64 gasEstimationType;
/// @dev Scalar value needed for specific gas estimation types, expected to be less than 1e10
uint64 l1FeeScalar;
/// @dev Axelar base fee for cross-chain message approval on destination, in terms of source native gas token
uint128 axelarBaseFee;
/// @dev Gas price of destination chain, in terms of the source chain token, i.e dest_gas_price * dest_token_market_price / src_token_market_price
uint128 relativeGasPrice;
/// @dev Needed for specific gas estimation types. Blob base fee of destination chain, in terms of the source chain token, i.e dest_blob_base_fee * dest_token_market_price / src_token_market_price
uint128 relativeBlobBaseFee;
/// @dev Axelar express fee for express execution, in terms of source chain token
uint128 expressFee;
}// 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.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// 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 IBridge {
enum State {
Active, // data send and receive possible
Inactive, // data send and receive impossible
Limited // only data receive possible
}
struct SendParams {
/// @param requestId unique request ID
bytes32 requestId;
/// @param data call data
bytes data;
/// @param to receiver contract address
bytes32 to;
/// @param chainIdTo destination chain ID
uint64 chainIdTo;
}
function sendV3(
SendParams calldata params,
address sender,
uint256 nonce,
bytes memory options
) external payable;
function estimateGasFee(
SendParams memory params,
address sender,
bytes memory options
) external view returns (uint256);
}// SPDX-License-Identifier: UNLICENSED
// Copyright (c) Eywa.Fi, 2021-2025 - all rights reserved
pragma solidity ^0.8.20;
interface IChainIdAdapter {
function chainIdToDstEid(uint64 chainId) external view returns(uint32);
function dstEidToChainId(uint32 dstEid) external view returns(uint64);
function chainIdToChainName(uint64 chainId) external view returns(string memory);
function chainNameToChainId(string memory chainName) external view returns(uint64);
}{
"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]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[email protected]/",
"project/:@openzeppelin/contracts/=npm/@openzeppelin/[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":"string","name":"tag_","type":"string"}],"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":"NotApprovedByGateway","type":"error"},{"inputs":[],"name":"TokenTransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"}],"name":"ChainIdAdapterSet","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":"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":"uint64","name":"chainIdTo","type":"uint64"},{"indexed":false,"internalType":"string","name":"network","type":"string"}],"name":"NetworkSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"chainIdTo","type":"uint64"},{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"ReceiverSet","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IBridge.State","name":"state","type":"uint8"}],"name":"StateSet","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"GATEKEEPER_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":[],"name":"chainIdAdapter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint64","name":"chainIdTo","type":"uint64"}],"internalType":"struct IBridge.SendParams","name":"params","type":"tuple"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes","name":"options_","type":"bytes"}],"name":"estimateGasFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"gasService","outputs":[{"internalType":"contract IAxelarGasService","name":"","type":"address"}],"stateMutability":"view","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":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"destinationChain_","type":"string"},{"internalType":"string","name":"destinationAddress_","type":"string"},{"internalType":"bytes","name":"payload_","type":"bytes"},{"internalType":"uint256","name":"gasLimit_","type":"uint256"},{"internalType":"bytes","name":"params_","type":"bytes"}],"name":"quote","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"","type":"uint64"}],"name":"receivers","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":[{"components":[{"internalType":"bytes32","name":"requestId","type":"bytes32"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"bytes32","name":"to","type":"bytes32"},{"internalType":"uint64","name":"chainIdTo","type":"uint64"}],"internalType":"struct IBridge.SendParams","name":"params","type":"tuple"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"options","type":"bytes"}],"name":"sendV3","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"chainIdAdapter_","type":"address"}],"name":"setChainIdAdapter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"chainIdTo_","type":"uint64"},{"internalType":"address","name":"receiver_","type":"address"}],"name":"setReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum IBridge.State","name":"state_","type":"uint8"}],"name":"setState","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"state","outputs":[{"internalType":"enum IBridge.State","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tag","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
60c060405234801562000010575f80fd5b5060405162002ed038038062002ed083398101604081905262000033916200020d565b826001600160a01b0381166200005c5760405163e6c4247b60e01b815260040160405180910390fd5b6001600160a01b03166080526001600255620000795f33620000a6565b6003805460ff1916905560076200009182826200038a565b50506001600160a01b031660a0525062000452565b620000b28282620000d0565b5f828152600160205260409020620000cb90826200016f565b505050565b5f828152602081815260408083206001600160a01b038516845290915290205460ff166200016b575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556200012a3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b5f62000185836001600160a01b0384166200018e565b90505b92915050565b5f818152600183016020526040812054620001d557508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915562000188565b505f62000188565b80516001600160a01b0381168114620001f4575f80fd5b919050565b634e487b7160e01b5f52604160045260245ffd5b5f805f6060848603121562000220575f80fd5b6200022b84620001dd565b925060206200023c818601620001dd565b60408601519093506001600160401b038082111562000259575f80fd5b818701915087601f8301126200026d575f80fd5b815181811115620002825762000282620001f9565b604051601f8201601f19908116603f01168101908382118183101715620002ad57620002ad620001f9565b816040528281528a86848701011115620002c5575f80fd5b5f93505b82841015620002e85784840186015181850187015292850192620002c9565b5f8684830101528096505050505050509250925092565b600181811c908216806200031457607f821691505b6020821081036200033357634e487b7160e01b5f52602260045260245ffd5b50919050565b601f821115620000cb575f81815260208120601f850160051c81016020861015620003615750805b601f850160051c820191505b8181101562000382578281556001016200036d565b505050505050565b81516001600160401b03811115620003a657620003a6620001f9565b620003be81620003b78454620002ff565b8462000339565b602080601f831160018114620003f4575f8415620003dc5750858301515b5f19600386901b1c1916600185901b17855562000382565b5f85815260208120601f198616915b82811015620004245788860151825594840194600190910190840162000403565b50858210156200044257878501515f19600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a051612a16620004ba5f395f818161038f01528181610b2c01528181610cf10152611ab601525f8181610218015281816106520152818161077f015281816108f701528181610bc801528181610ea001528181610f4a01526115b10152612a165ff3fe6080604052600436106101c8575f3560e01c80639010d07c116100f2578063d547741f11610092578063f5b541a611610062578063f5b541a614610566578063f91e705714610586578063fbaa1fa4146105a5578063ff2ffb67146105d9575f80fd5b8063d547741f146104e2578063d6fd317514610501578063e4a974cc14610534578063efac2a7c14610547575f80fd5b8063c19d93fb116100cd578063c19d93fb1461046b578063c7e6a3cc14610491578063ca15c873146104b0578063d174ff82146104cf575f80fd5b80639010d07c1461041a57806391d1485414610439578063a217fddf14610458575f80fd5b806351f91066116101685780636a22d8cc116101385780636a22d8cc1461037e5780636e9cb097146103b15780637ecebe00146103d0578063868a166d146103fb575f80fd5b806351f910661461030c57806356de96db1461032d57806361e0114e1461034c578063656576361461036b575f80fd5b8063248a9ca3116101a3578063248a9ca3146102735780632f2ff15d146102af57806336568abe146102ce57806349160658146102ed575f80fd5b806301ffc9a7146101d3578063116191b6146102075780631a98b2e014610252575f80fd5b366101cf57005b5f80fd5b3480156101de575f80fd5b506101f26101ed366004611c57565b6105f8565b60405190151581526020015b60405180910390f35b348015610212575f80fd5b5061023a7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016101fe565b34801561025d575f80fd5b5061027161026c366004611cc2565b610622565b005b34801561027e575f80fd5b506102a161028d366004611d91565b5f9081526020819052604090206001015490565b6040519081526020016101fe565b3480156102ba575f80fd5b506102716102c9366004611dbc565b61081b565b3480156102d9575f80fd5b506102716102e8366004611dbc565b610844565b3480156102f8575f80fd5b50610271610307366004611dea565b6108c7565b348015610317575f80fd5b50610320610a09565b6040516101fe9190611ed2565b348015610338575f80fd5b50610271610347366004611ee4565b610a95565b348015610357575f80fd5b506102a1610366366004611fbe565b610b13565b610271610379366004611dea565b610bb2565b348015610389575f80fd5b5061023a7f000000000000000000000000000000000000000000000000000000000000000081565b3480156103bc575f80fd5b506102a16103cb366004612082565b610cce565b3480156103db575f80fd5b506102a16103ea3660046120f4565b60046020525f908152604090205481565b348015610406575f80fd5b5061023a61041536600461210f565b610d95565b348015610425575f80fd5b5061023a6104343660046121ba565b610db8565b348015610444575f80fd5b506101f2610453366004611dbc565b610dcf565b348015610463575f80fd5b506102a15f81565b348015610476575f80fd5b506003546104849060ff1681565b6040516101fe91906121ee565b34801561049c575f80fd5b5061023a6104ab366004612214565b610df7565b3480156104bb575f80fd5b506102a16104ca366004611d91565b610e14565b6102716104dd36600461228f565b610e2a565b3480156104ed575f80fd5b506102716104fc366004611dbc565b610e66565b34801561050c575f80fd5b506102a17f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c81565b610271610542366004611cc2565b610e8a565b348015610552575f80fd5b50610271610561366004612326565b611053565b348015610571575f80fd5b506102a15f805160206129c183398151915281565b348015610591575f80fd5b5060065461023a906001600160a01b031681565b3480156105b0575f80fd5b5061023a6105bf366004612350565b60056020525f90815260409020546001600160a01b031681565b3480156105e4575f80fd5b506102716105f33660046120f4565b6110da565b5f6001600160e01b03198216635a05180f60e01b148061061c575061061c8261113f565b92915050565b5f8585604051610633929190612369565b604051908190038120631876eed960e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631876eed990610697908e908e908e908e908e9089908d908d908d906004016123a0565b6020604051808303815f875af11580156106b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106d791906123fe565b6106f457604051631403112d60e21b815260040160405180910390fd5b5f6107068c8c8c8c8c878b8b8b611173565b90506001600160a01b0381161561080d57806001600160a01b0316838d7fdb3db9dfc9262f4fe09dbadef104f799d8181ec565e09275d80ed3355aab68d38e8e8e8e898d8d60405161075e979695949392919061241d565b60405180910390a46040516349ad89fb60e11b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063935b13f6906107b6908990899060040161246c565b602060405180830381865afa1580156107d1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107f59190612487565b905061080b6001600160a01b03821683866111a4565b505b505050505050505050505050565b5f8281526020819052604090206001015461083581611207565b61083f8383611214565b505050565b6001600160a01b03811633146108b95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6108c38282611235565b5050565b5f82826040516108d8929190612369565b604051908190038120635f6970c360e01b825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635f6970c390610936908b908b908b908b908b9089906004016124a2565b6020604051808303815f875af1158015610952573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061097691906123fe565b61099357604051631403112d60e21b815260040160405180910390fd5b5f6109a2898989898987611256565b90506001600160a01b038116156109fe57806001600160a01b0316897f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418a8a8a8a886040516109f59594939291906124e2565b60405180910390a35b505050505050505050565b60078054610a169061251b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a429061251b565b8015610a8d5780601f10610a6457610100808354040283529160200191610a8d565b820191905f5260205f20905b815481529060010190602001808311610a7057829003601f168201915b505050505081565b5f805160206129c1833981519152610aac81611207565b6003805483919060ff19166001836002811115610acb57610acb6121da565b02179055506003546040517fc635bb75c392e81c891d50372a48cfa81b6799ac6d594cb4c28a8c5e8bef6e9b91610b079160ff909116906121ee565b60405180910390a15050565b604051630135eaa760e41b81525f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063135eaa7090610b69908990899089908990899060040161254d565b602060405180830381865afa158015610b84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ba891906125ab565b9695505050505050565b604051630d26ff2160e41b8152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d26ff21090602401602060405180830381865afa158015610c15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c3991906123fe565b15610c5757604051630dc1019760e01b815260040160405180910390fd5b60405133905f90610c6b9085908590612369565b60405180910390209050816001600160a01b0316897f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928a8a8a8a87604051610cb79594939291906124e2565b60405180910390a36109fe89898989898688611281565b5f805f805f610cdd88876112c7565b929650909450925090506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001663135eaa708585610d2560208d018d6125c2565b87876040518763ffffffff1660e01b8152600401610d4896959493929190612604565b602060405180830381865afa158015610d63573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8791906125ab565b9450505050505b9392505050565b5f80610da88b8b8b8b8b8b8b8b8b6113fd565b549b9a5050505050505050505050565b5f828152600160205260408120610d8e9083611466565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80610e07888888888888611471565b5498975050505050505050565b5f81815260016020526040812061061c906114d1565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c610e5481611207565b610e5f8585846114da565b5050505050565b5f82815260208190526040902060010154610e8081611207565b61083f8383611235565b604051630d26ff2160e41b8152600481018b90527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d26ff21090602401602060405180830381865afa158015610eed573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f1191906123fe565b15610f2f57604051630dc1019760e01b815260040160405180910390fd5b6040516349ad89fb60e11b815233905f906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063935b13f690610f81908890889060040161246c565b602060405180830381865afa158015610f9c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc09190612487565b90505f8787604051610fd3929190612369565b60405180910390209050826001600160a01b0316848e7f5844b8bbe3fd2b0354e73f27bfde28d2e6d991f14139c382876ec4360391a47b8f8f8f8f888e8e604051611024979695949392919061241d565b60405180910390a461103e8d8d8d8d8d868c8c8c8c61163a565b61080b6001600160a01b038316843087611686565b5f805160206129c183398151915261106a81611207565b6001600160401b0383165f8181526005602090815260409182902080546001600160a01b0319166001600160a01b0387169081179091558251938452908301527f291689eb8100e4e7dd36e2ea308963360cdb6d3451d662194ac9d3f52f518d97910160405180910390a1505050565b5f805160206129c18339815191526110f181611207565b600680546001600160a01b0319166001600160a01b0384169081179091556040519081527f5e9597ddd3bece60e86206816ff57f77bb1045d96995d7e1e144ddc72c3ba60190602001610b07565b5f6001600160e01b03198216637965db0b60e01b148061061c57506301ffc9a760e01b6001600160e01b031983161461061c565b5f806111868b8b8b8b8b8b8b8b8b6113fd565b9050805491508115611196575f81555b509998505050505050505050565b6040516001600160a01b03831660248201526044810182905261083f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526116c4565b611211813361177c565b50565b61121e82826117d5565b5f82815260016020526040902061083f9082611858565b61123f828261186c565b5f82815260016020526040902061083f90826118d0565b5f80611266888888888888611471565b9050805491508115611276575f81555b509695505050505050565b5f611290888888888888611471565b80549091506001600160a01b038116156112bd5760405163725f13f160e01b815260040160405180910390fd5b5055505050505050565b6060805f81816112dc60808801888401612350565b6006549091506001600160a01b03166113375760405162461bcd60e51b815260206004820152601f60248201527f4272696467653a20636861696e49642061646170746572206e6f74207365740060448201526064016108b0565b6006546040516355765f3160e01b81526001600160401b03831660048201526001600160a01b03909116906355765f31906024015f60405180830381865afa158015611385573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526113ac9190810190612692565b6001600160401b0382165f908152600560205260409020549095506113db906001600160a01b031660146118e4565b9350858060200190518101906113f191906126d6565b95989497509550505050565b5f7febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a6040516020016114419a9998979695949392919061272c565b6040516020818303038152906040528051906020012090509998505050505050505050565b5f610d8e8383611a79565b5f7f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e58787878787876040516020016114af9796959493929190612791565b6040516020818303038152906040528051906020012090509695505050505050565b5f61061c825490565b5f60035460ff1660028111156114f2576114f26121da565b1461153f5760405162461bcd60e51b815260206004820152601c60248201527f4272696467654178656c61723a20737461746520696e6163746976650000000060448201526064016108b0565b5f805f8061154d87866112c7565b929650909450925090506115a7848461156960208b018b6125c2565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508892508c9150879050611a9f565b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016631c92115f85856115e560208c018c6125c2565b6040518563ffffffff1660e01b815260040161160494939291906127d8565b5f604051808303815f87803b15801561161b575f80fd5b505af115801561162d573d5f803e3d5ffd5b5050505050505050505050565b5f61164c8b8b8b8b8b8b8b8b8b6113fd565b80549091506001600160a01b038116156116795760405163725f13f160e01b815260040160405180910390fd5b5055505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116be9085906323b872dd60e01b906084016111d0565b50505050565b5f80836001600160a01b0316836040516116de919061281c565b5f604051808303815f865af19150503d805f8114611717576040519150601f19603f3d011682016040523d82523d5f602084013e61171c565b606091505b50915091505f82801561174757508151158061174757508180602001905181019061174791906123fe565b905080158061175e57506001600160a01b0385163b155b15610e5f5760405163022e258160e11b815260040160405180910390fd5b6117868282610dcf565b6108c35761179381611b12565b61179e8360206118e4565b6040516020016117af929190612837565b60408051601f198184030181529082905262461bcd60e51b82526108b091600401611ed2565b6117df8282610dcf565b6108c3575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556118143390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f610d8e836001600160a01b038416611b28565b6118768282610dcf565b156108c3575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f610d8e836001600160a01b038416611b74565b60605f6118f28360026128bf565b6118fd9060026128d6565b6001600160401b0381111561191457611914611f02565b6040519080825280601f01601f19166020018201604052801561193e576020820181803683370190505b509050600360fc1b815f81518110611958576119586128e9565b60200101906001600160f81b03191690815f1a905350600f60fb1b81600181518110611986576119866128e9565b60200101906001600160f81b03191690815f1a9053505f6119a88460026128bf565b6119b39060016128d6565b90505b6001811115611a2a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106119e7576119e76128e9565b1a60f81b8282815181106119fd576119fd6128e9565b60200101906001600160f81b03191690815f1a90535060049490941c93611a23816128fd565b90506119b6565b508315610d8e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b0565b5f825f018281548110611a8e57611a8e6128e9565b905f5260205f200154905092915050565b6040516376fc9b7960e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063edf936f2903490611afb9030908b908b908b908b905f908c908c90600401612912565b5f604051808303818588803b15801561161b575f80fd5b606061061c6001600160a01b03831660146118e4565b5f818152600183016020526040812054611b6d57508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561061c565b505f61061c565b5f8181526001830160205260408120548015611c4e575f611b96600183612999565b85549091505f90611ba990600190612999565b9050818114611c08575f865f018281548110611bc757611bc76128e9565b905f5260205f200154905080875f018481548110611be757611be76128e9565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080611c1957611c196129ac565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061061c565b5f91505061061c565b5f60208284031215611c67575f80fd5b81356001600160e01b031981168114610d8e575f80fd5b5f8083601f840112611c8e575f80fd5b5081356001600160401b03811115611ca4575f80fd5b602083019150836020828501011115611cbb575f80fd5b9250929050565b5f805f805f805f805f8060c08b8d031215611cdb575f80fd5b8a35995060208b01356001600160401b0380821115611cf8575f80fd5b611d048e838f01611c7e565b909b50995060408d0135915080821115611d1c575f80fd5b611d288e838f01611c7e565b909950975060608d0135915080821115611d40575f80fd5b611d4c8e838f01611c7e565b909750955060808d0135915080821115611d64575f80fd5b50611d718d828e01611c7e565b9150809450508092505060a08b013590509295989b9194979a5092959850565b5f60208284031215611da1575f80fd5b5035919050565b6001600160a01b0381168114611211575f80fd5b5f8060408385031215611dcd575f80fd5b823591506020830135611ddf81611da8565b809150509250929050565b5f805f805f805f6080888a031215611e00575f80fd5b8735965060208801356001600160401b0380821115611e1d575f80fd5b611e298b838c01611c7e565b909850965060408a0135915080821115611e41575f80fd5b611e4d8b838c01611c7e565b909650945060608a0135915080821115611e65575f80fd5b50611e728a828b01611c7e565b989b979a50959850939692959293505050565b5f5b83811015611e9f578181015183820152602001611e87565b50505f910152565b5f8151808452611ebe816020860160208601611e85565b601f01601f19169290920160200192915050565b602081525f610d8e6020830184611ea7565b5f60208284031215611ef4575f80fd5b813560038110610d8e575f80fd5b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715611f3e57611f3e611f02565b604052919050565b5f6001600160401b03821115611f5e57611f5e611f02565b50601f01601f191660200190565b5f82601f830112611f7b575f80fd5b8135611f8e611f8982611f46565b611f16565b818152846020838601011115611fa2575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f60a08688031215611fd2575f80fd5b85356001600160401b0380821115611fe8575f80fd5b611ff489838a01611f6c565b96506020880135915080821115612009575f80fd5b61201589838a01611f6c565b9550604088013591508082111561202a575f80fd5b61203689838a01611f6c565b9450606088013593506080880135915080821115612052575f80fd5b5061205f88828901611f6c565b9150509295509295909350565b5f6080828403121561207c575f80fd5b50919050565b5f805f60608486031215612094575f80fd5b83356001600160401b03808211156120aa575f80fd5b6120b68783880161206c565b9450602086013591506120c882611da8565b909250604085013590808211156120dd575f80fd5b506120ea86828701611f6c565b9150509250925092565b5f60208284031215612104575f80fd5b8135610d8e81611da8565b5f805f805f805f805f60c08a8c031215612127575f80fd5b8935985060208a01356001600160401b0380821115612144575f80fd5b6121508d838e01611c7e565b909a50985060408c0135915080821115612168575f80fd5b6121748d838e01611c7e565b909850965060608c0135955060808c0135915080821115612193575f80fd5b506121a08c828d01611c7e565b9a9d999c50979a9699959894979660a00135949350505050565b5f80604083850312156121cb575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52602160045260245ffd5b602081016003831061220e57634e487b7160e01b5f52602160045260245ffd5b91905290565b5f805f805f8060808789031215612229575f80fd5b8635955060208701356001600160401b0380821115612246575f80fd5b6122528a838b01611c7e565b9097509550604089013591508082111561226a575f80fd5b5061227789828a01611c7e565b979a9699509497949695606090950135949350505050565b5f805f80608085870312156122a2575f80fd5b84356001600160401b03808211156122b8575f80fd5b6122c48883890161206c565b9550602087013591506122d682611da8565b90935060408601359250606086013590808211156122f2575f80fd5b506122ff87828801611f6c565b91505092959194509250565b80356001600160401b0381168114612321575f80fd5b919050565b5f8060408385031215612337575f80fd5b6123408361230b565b91506020830135611ddf81611da8565b5f60208284031215612360575f80fd5b610d8e8261230b565b818382375f9101908152919050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b89815260c060208201525f6123b960c083018a8c612378565b82810360408401526123cc81898b612378565b905086606084015282810360808401526123e7818688612378565b9150508260a08301529a9950505050505050505050565b5f6020828403121561240e575f80fd5b81518015158114610d8e575f80fd5b608081525f61243060808301898b612378565b828103602084015261244381888a612378565b9050856040840152828103606084015261245e818587612378565b9a9950505050505050505050565b602081525f61247f602083018486612378565b949350505050565b5f60208284031215612497575f80fd5b8151610d8e81611da8565b868152608060208201525f6124bb608083018789612378565b82810360408401526124ce818688612378565b915050826060830152979650505050505050565b606081525f6124f5606083018789612378565b8281036020840152612508818688612378565b9150508260408301529695505050505050565b600181811c9082168061252f57607f821691505b60208210810361207c57634e487b7160e01b5f52602260045260245ffd5b60a081525f61255f60a0830188611ea7565b82810360208401526125718188611ea7565b905082810360408401526125858187611ea7565b9050846060840152828103608084015261259f8185611ea7565b98975050505050505050565b5f602082840312156125bb575f80fd5b5051919050565b5f808335601e198436030181126125d7575f80fd5b8301803591506001600160401b038211156125f0575f80fd5b602001915036819003821315611cbb575f80fd5b60a081525f61261660a0830189611ea7565b82810360208401526126288189611ea7565b9050828103604084015261263d818789612378565b905084606084015282810360808401526126578185611ea7565b9998505050505050505050565b5f612671611f8984611f46565b9050828152838383011115612684575f80fd5b610d8e836020830184611e85565b5f602082840312156126a2575f80fd5b81516001600160401b038111156126b7575f80fd5b8201601f810184136126c7575f80fd5b61247f84825160208401612664565b5f80604083850312156126e7575f80fd5b8251915060208301516001600160401b03811115612703575f80fd5b8301601f81018513612713575f80fd5b61272285825160208401612664565b9150509250929050565b8a815289602082015260e060408201525f61274b60e083018a8c612378565b828103606084015261275e81898b612378565b905086608084015282810360a0840152612779818688612378565b9150508260c08301529b9a5050505050505050505050565b87815286602082015260a060408201525f6127b060a083018789612378565b82810360608401526127c3818688612378565b91505082608083015298975050505050505050565b606081525f6127ea6060830187611ea7565b82810360208401526127fc8187611ea7565b90508281036040840152612811818587612378565b979650505050505050565b5f825161282d818460208701611e85565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f835161286e816017850160208801611e85565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161289f816028840160208801611e85565b01602801949350505050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761061c5761061c6128ab565b8082018082111561061c5761061c6128ab565b634e487b7160e01b5f52603260045260245ffd5b5f8161290b5761290b6128ab565b505f190190565b6001600160a01b038981168252610100602083018190525f916129378483018c611ea7565b9150838203604085015261294b828b611ea7565b9150838203606085015261295f828a611ea7565b915087608085015286151560a085015280861660c08501525082810360e084015261298a8185611ea7565b9b9a5050505050505050505050565b8181038181111561061c5761061c6128ab565b634e487b7160e01b5f52603160045260245ffdfe97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a26469706673582212200621a202f7c878c9c5dc7b0b808c46368acb05c3fbe90eab205f4cfee8e1a95f64736f6c634300081400330000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000064178656c61720000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106101c8575f3560e01c80639010d07c116100f2578063d547741f11610092578063f5b541a611610062578063f5b541a614610566578063f91e705714610586578063fbaa1fa4146105a5578063ff2ffb67146105d9575f80fd5b8063d547741f146104e2578063d6fd317514610501578063e4a974cc14610534578063efac2a7c14610547575f80fd5b8063c19d93fb116100cd578063c19d93fb1461046b578063c7e6a3cc14610491578063ca15c873146104b0578063d174ff82146104cf575f80fd5b80639010d07c1461041a57806391d1485414610439578063a217fddf14610458575f80fd5b806351f91066116101685780636a22d8cc116101385780636a22d8cc1461037e5780636e9cb097146103b15780637ecebe00146103d0578063868a166d146103fb575f80fd5b806351f910661461030c57806356de96db1461032d57806361e0114e1461034c578063656576361461036b575f80fd5b8063248a9ca3116101a3578063248a9ca3146102735780632f2ff15d146102af57806336568abe146102ce57806349160658146102ed575f80fd5b806301ffc9a7146101d3578063116191b6146102075780631a98b2e014610252575f80fd5b366101cf57005b5f80fd5b3480156101de575f80fd5b506101f26101ed366004611c57565b6105f8565b60405190151581526020015b60405180910390f35b348015610212575f80fd5b5061023a7f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a581565b6040516001600160a01b0390911681526020016101fe565b34801561025d575f80fd5b5061027161026c366004611cc2565b610622565b005b34801561027e575f80fd5b506102a161028d366004611d91565b5f9081526020819052604090206001015490565b6040519081526020016101fe565b3480156102ba575f80fd5b506102716102c9366004611dbc565b61081b565b3480156102d9575f80fd5b506102716102e8366004611dbc565b610844565b3480156102f8575f80fd5b50610271610307366004611dea565b6108c7565b348015610317575f80fd5b50610320610a09565b6040516101fe9190611ed2565b348015610338575f80fd5b50610271610347366004611ee4565b610a95565b348015610357575f80fd5b506102a1610366366004611fbe565b610b13565b610271610379366004611dea565b610bb2565b348015610389575f80fd5b5061023a7f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a08271281565b3480156103bc575f80fd5b506102a16103cb366004612082565b610cce565b3480156103db575f80fd5b506102a16103ea3660046120f4565b60046020525f908152604090205481565b348015610406575f80fd5b5061023a61041536600461210f565b610d95565b348015610425575f80fd5b5061023a6104343660046121ba565b610db8565b348015610444575f80fd5b506101f2610453366004611dbc565b610dcf565b348015610463575f80fd5b506102a15f81565b348015610476575f80fd5b506003546104849060ff1681565b6040516101fe91906121ee565b34801561049c575f80fd5b5061023a6104ab366004612214565b610df7565b3480156104bb575f80fd5b506102a16104ca366004611d91565b610e14565b6102716104dd36600461228f565b610e2a565b3480156104ed575f80fd5b506102716104fc366004611dbc565b610e66565b34801561050c575f80fd5b506102a17f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c81565b610271610542366004611cc2565b610e8a565b348015610552575f80fd5b50610271610561366004612326565b611053565b348015610571575f80fd5b506102a15f805160206129c183398151915281565b348015610591575f80fd5b5060065461023a906001600160a01b031681565b3480156105b0575f80fd5b5061023a6105bf366004612350565b60056020525f90815260409020546001600160a01b031681565b3480156105e4575f80fd5b506102716105f33660046120f4565b6110da565b5f6001600160e01b03198216635a05180f60e01b148061061c575061061c8261113f565b92915050565b5f8585604051610633929190612369565b604051908190038120631876eed960e01b825291506001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690631876eed990610697908e908e908e908e908e9089908d908d908d906004016123a0565b6020604051808303815f875af11580156106b3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106d791906123fe565b6106f457604051631403112d60e21b815260040160405180910390fd5b5f6107068c8c8c8c8c878b8b8b611173565b90506001600160a01b0381161561080d57806001600160a01b0316838d7fdb3db9dfc9262f4fe09dbadef104f799d8181ec565e09275d80ed3355aab68d38e8e8e8e898d8d60405161075e979695949392919061241d565b60405180910390a46040516349ad89fb60e11b81525f906001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5169063935b13f6906107b6908990899060040161246c565b602060405180830381865afa1580156107d1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107f59190612487565b905061080b6001600160a01b03821683866111a4565b505b505050505050505050505050565b5f8281526020819052604090206001015461083581611207565b61083f8383611214565b505050565b6001600160a01b03811633146108b95760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b6108c38282611235565b5050565b5f82826040516108d8929190612369565b604051908190038120635f6970c360e01b825291506001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690635f6970c390610936908b908b908b908b908b9089906004016124a2565b6020604051808303815f875af1158015610952573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061097691906123fe565b61099357604051631403112d60e21b815260040160405180910390fd5b5f6109a2898989898987611256565b90506001600160a01b038116156109fe57806001600160a01b0316897f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418a8a8a8a886040516109f59594939291906124e2565b60405180910390a35b505050505050505050565b60078054610a169061251b565b80601f0160208091040260200160405190810160405280929190818152602001828054610a429061251b565b8015610a8d5780601f10610a6457610100808354040283529160200191610a8d565b820191905f5260205f20905b815481529060010190602001808311610a7057829003601f168201915b505050505081565b5f805160206129c1833981519152610aac81611207565b6003805483919060ff19166001836002811115610acb57610acb6121da565b02179055506003546040517fc635bb75c392e81c891d50372a48cfa81b6799ac6d594cb4c28a8c5e8bef6e9b91610b079160ff909116906121ee565b60405180910390a15050565b604051630135eaa760e41b81525f906001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712169063135eaa7090610b69908990899089908990899060040161254d565b602060405180830381865afa158015610b84573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610ba891906125ab565b9695505050505050565b604051630d26ff2160e41b8152600481018890527f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a56001600160a01b03169063d26ff21090602401602060405180830381865afa158015610c15573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610c3991906123fe565b15610c5757604051630dc1019760e01b815260040160405180910390fd5b60405133905f90610c6b9085908590612369565b60405180910390209050816001600160a01b0316897f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928a8a8a8a87604051610cb79594939291906124e2565b60405180910390a36109fe89898989898688611281565b5f805f805f610cdd88876112c7565b929650909450925090506001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827121663135eaa708585610d2560208d018d6125c2565b87876040518763ffffffff1660e01b8152600401610d4896959493929190612604565b602060405180830381865afa158015610d63573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d8791906125ab565b9450505050505b9392505050565b5f80610da88b8b8b8b8b8b8b8b8b6113fd565b549b9a5050505050505050505050565b5f828152600160205260408120610d8e9083611466565b5f918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b5f80610e07888888888888611471565b5498975050505050505050565b5f81815260016020526040812061061c906114d1565b7f3c63e605be3290ab6b04cfc46c6e1516e626d43236b034f09d7ede1d017beb0c610e5481611207565b610e5f8585846114da565b5050505050565b5f82815260208190526040902060010154610e8081611207565b61083f8383611235565b604051630d26ff2160e41b8152600481018b90527f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a56001600160a01b03169063d26ff21090602401602060405180830381865afa158015610eed573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f1191906123fe565b15610f2f57604051630dc1019760e01b815260040160405180910390fd5b6040516349ad89fb60e11b815233905f906001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5169063935b13f690610f81908890889060040161246c565b602060405180830381865afa158015610f9c573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fc09190612487565b90505f8787604051610fd3929190612369565b60405180910390209050826001600160a01b0316848e7f5844b8bbe3fd2b0354e73f27bfde28d2e6d991f14139c382876ec4360391a47b8f8f8f8f888e8e604051611024979695949392919061241d565b60405180910390a461103e8d8d8d8d8d868c8c8c8c61163a565b61080b6001600160a01b038316843087611686565b5f805160206129c183398151915261106a81611207565b6001600160401b0383165f8181526005602090815260409182902080546001600160a01b0319166001600160a01b0387169081179091558251938452908301527f291689eb8100e4e7dd36e2ea308963360cdb6d3451d662194ac9d3f52f518d97910160405180910390a1505050565b5f805160206129c18339815191526110f181611207565b600680546001600160a01b0319166001600160a01b0384169081179091556040519081527f5e9597ddd3bece60e86206816ff57f77bb1045d96995d7e1e144ddc72c3ba60190602001610b07565b5f6001600160e01b03198216637965db0b60e01b148061061c57506301ffc9a760e01b6001600160e01b031983161461061c565b5f806111868b8b8b8b8b8b8b8b8b6113fd565b9050805491508115611196575f81555b509998505050505050505050565b6040516001600160a01b03831660248201526044810182905261083f90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526116c4565b611211813361177c565b50565b61121e82826117d5565b5f82815260016020526040902061083f9082611858565b61123f828261186c565b5f82815260016020526040902061083f90826118d0565b5f80611266888888888888611471565b9050805491508115611276575f81555b509695505050505050565b5f611290888888888888611471565b80549091506001600160a01b038116156112bd5760405163725f13f160e01b815260040160405180910390fd5b5055505050505050565b6060805f81816112dc60808801888401612350565b6006549091506001600160a01b03166113375760405162461bcd60e51b815260206004820152601f60248201527f4272696467653a20636861696e49642061646170746572206e6f74207365740060448201526064016108b0565b6006546040516355765f3160e01b81526001600160401b03831660048201526001600160a01b03909116906355765f31906024015f60405180830381865afa158015611385573d5f803e3d5ffd5b505050506040513d5f823e601f3d908101601f191682016040526113ac9190810190612692565b6001600160401b0382165f908152600560205260409020549095506113db906001600160a01b031660146118e4565b9350858060200190518101906113f191906126d6565b95989497509550505050565b5f7febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a6040516020016114419a9998979695949392919061272c565b6040516020818303038152906040528051906020012090509998505050505050505050565b5f610d8e8383611a79565b5f7f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e58787878787876040516020016114af9796959493929190612791565b6040516020818303038152906040528051906020012090509695505050505050565b5f61061c825490565b5f60035460ff1660028111156114f2576114f26121da565b1461153f5760405162461bcd60e51b815260206004820152601c60248201527f4272696467654178656c61723a20737461746520696e6163746976650000000060448201526064016108b0565b5f805f8061154d87866112c7565b929650909450925090506115a7848461156960208b018b6125c2565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f920191909152508892508c9150879050611a9f565b6001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a516631c92115f85856115e560208c018c6125c2565b6040518563ffffffff1660e01b815260040161160494939291906127d8565b5f604051808303815f87803b15801561161b575f80fd5b505af115801561162d573d5f803e3d5ffd5b5050505050505050505050565b5f61164c8b8b8b8b8b8b8b8b8b6113fd565b80549091506001600160a01b038116156116795760405163725f13f160e01b815260040160405180910390fd5b5055505050505050505050565b6040516001600160a01b03808516602483015283166044820152606481018290526116be9085906323b872dd60e01b906084016111d0565b50505050565b5f80836001600160a01b0316836040516116de919061281c565b5f604051808303815f865af19150503d805f8114611717576040519150601f19603f3d011682016040523d82523d5f602084013e61171c565b606091505b50915091505f82801561174757508151158061174757508180602001905181019061174791906123fe565b905080158061175e57506001600160a01b0385163b155b15610e5f5760405163022e258160e11b815260040160405180910390fd5b6117868282610dcf565b6108c35761179381611b12565b61179e8360206118e4565b6040516020016117af929190612837565b60408051601f198184030181529082905262461bcd60e51b82526108b091600401611ed2565b6117df8282610dcf565b6108c3575f828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556118143390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b5f610d8e836001600160a01b038416611b28565b6118768282610dcf565b156108c3575f828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b5f610d8e836001600160a01b038416611b74565b60605f6118f28360026128bf565b6118fd9060026128d6565b6001600160401b0381111561191457611914611f02565b6040519080825280601f01601f19166020018201604052801561193e576020820181803683370190505b509050600360fc1b815f81518110611958576119586128e9565b60200101906001600160f81b03191690815f1a905350600f60fb1b81600181518110611986576119866128e9565b60200101906001600160f81b03191690815f1a9053505f6119a88460026128bf565b6119b39060016128d6565b90505b6001811115611a2a576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106119e7576119e76128e9565b1a60f81b8282815181106119fd576119fd6128e9565b60200101906001600160f81b03191690815f1a90535060049490941c93611a23816128fd565b90506119b6565b508315610d8e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016108b0565b5f825f018281548110611a8e57611a8e6128e9565b905f5260205f200154905092915050565b6040516376fc9b7960e11b81526001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712169063edf936f2903490611afb9030908b908b908b908b905f908c908c90600401612912565b5f604051808303818588803b15801561161b575f80fd5b606061061c6001600160a01b03831660146118e4565b5f818152600183016020526040812054611b6d57508154600181810184555f84815260208082209093018490558454848252828601909352604090209190915561061c565b505f61061c565b5f8181526001830160205260408120548015611c4e575f611b96600183612999565b85549091505f90611ba990600190612999565b9050818114611c08575f865f018281548110611bc757611bc76128e9565b905f5260205f200154905080875f018481548110611be757611be76128e9565b5f918252602080832090910192909255918252600188019052604090208390555b8554869080611c1957611c196129ac565b600190038181905f5260205f20015f90559055856001015f8681526020019081526020015f205f90556001935050505061061c565b5f91505061061c565b5f60208284031215611c67575f80fd5b81356001600160e01b031981168114610d8e575f80fd5b5f8083601f840112611c8e575f80fd5b5081356001600160401b03811115611ca4575f80fd5b602083019150836020828501011115611cbb575f80fd5b9250929050565b5f805f805f805f805f8060c08b8d031215611cdb575f80fd5b8a35995060208b01356001600160401b0380821115611cf8575f80fd5b611d048e838f01611c7e565b909b50995060408d0135915080821115611d1c575f80fd5b611d288e838f01611c7e565b909950975060608d0135915080821115611d40575f80fd5b611d4c8e838f01611c7e565b909750955060808d0135915080821115611d64575f80fd5b50611d718d828e01611c7e565b9150809450508092505060a08b013590509295989b9194979a5092959850565b5f60208284031215611da1575f80fd5b5035919050565b6001600160a01b0381168114611211575f80fd5b5f8060408385031215611dcd575f80fd5b823591506020830135611ddf81611da8565b809150509250929050565b5f805f805f805f6080888a031215611e00575f80fd5b8735965060208801356001600160401b0380821115611e1d575f80fd5b611e298b838c01611c7e565b909850965060408a0135915080821115611e41575f80fd5b611e4d8b838c01611c7e565b909650945060608a0135915080821115611e65575f80fd5b50611e728a828b01611c7e565b989b979a50959850939692959293505050565b5f5b83811015611e9f578181015183820152602001611e87565b50505f910152565b5f8151808452611ebe816020860160208601611e85565b601f01601f19169290920160200192915050565b602081525f610d8e6020830184611ea7565b5f60208284031215611ef4575f80fd5b813560038110610d8e575f80fd5b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b0381118282101715611f3e57611f3e611f02565b604052919050565b5f6001600160401b03821115611f5e57611f5e611f02565b50601f01601f191660200190565b5f82601f830112611f7b575f80fd5b8135611f8e611f8982611f46565b611f16565b818152846020838601011115611fa2575f80fd5b816020850160208301375f918101602001919091529392505050565b5f805f805f60a08688031215611fd2575f80fd5b85356001600160401b0380821115611fe8575f80fd5b611ff489838a01611f6c565b96506020880135915080821115612009575f80fd5b61201589838a01611f6c565b9550604088013591508082111561202a575f80fd5b61203689838a01611f6c565b9450606088013593506080880135915080821115612052575f80fd5b5061205f88828901611f6c565b9150509295509295909350565b5f6080828403121561207c575f80fd5b50919050565b5f805f60608486031215612094575f80fd5b83356001600160401b03808211156120aa575f80fd5b6120b68783880161206c565b9450602086013591506120c882611da8565b909250604085013590808211156120dd575f80fd5b506120ea86828701611f6c565b9150509250925092565b5f60208284031215612104575f80fd5b8135610d8e81611da8565b5f805f805f805f805f60c08a8c031215612127575f80fd5b8935985060208a01356001600160401b0380821115612144575f80fd5b6121508d838e01611c7e565b909a50985060408c0135915080821115612168575f80fd5b6121748d838e01611c7e565b909850965060608c0135955060808c0135915080821115612193575f80fd5b506121a08c828d01611c7e565b9a9d999c50979a9699959894979660a00135949350505050565b5f80604083850312156121cb575f80fd5b50508035926020909101359150565b634e487b7160e01b5f52602160045260245ffd5b602081016003831061220e57634e487b7160e01b5f52602160045260245ffd5b91905290565b5f805f805f8060808789031215612229575f80fd5b8635955060208701356001600160401b0380821115612246575f80fd5b6122528a838b01611c7e565b9097509550604089013591508082111561226a575f80fd5b5061227789828a01611c7e565b979a9699509497949695606090950135949350505050565b5f805f80608085870312156122a2575f80fd5b84356001600160401b03808211156122b8575f80fd5b6122c48883890161206c565b9550602087013591506122d682611da8565b90935060408601359250606086013590808211156122f2575f80fd5b506122ff87828801611f6c565b91505092959194509250565b80356001600160401b0381168114612321575f80fd5b919050565b5f8060408385031215612337575f80fd5b6123408361230b565b91506020830135611ddf81611da8565b5f60208284031215612360575f80fd5b610d8e8261230b565b818382375f9101908152919050565b81835281816020850137505f828201602090810191909152601f909101601f19169091010190565b89815260c060208201525f6123b960c083018a8c612378565b82810360408401526123cc81898b612378565b905086606084015282810360808401526123e7818688612378565b9150508260a08301529a9950505050505050505050565b5f6020828403121561240e575f80fd5b81518015158114610d8e575f80fd5b608081525f61243060808301898b612378565b828103602084015261244381888a612378565b9050856040840152828103606084015261245e818587612378565b9a9950505050505050505050565b602081525f61247f602083018486612378565b949350505050565b5f60208284031215612497575f80fd5b8151610d8e81611da8565b868152608060208201525f6124bb608083018789612378565b82810360408401526124ce818688612378565b915050826060830152979650505050505050565b606081525f6124f5606083018789612378565b8281036020840152612508818688612378565b9150508260408301529695505050505050565b600181811c9082168061252f57607f821691505b60208210810361207c57634e487b7160e01b5f52602260045260245ffd5b60a081525f61255f60a0830188611ea7565b82810360208401526125718188611ea7565b905082810360408401526125858187611ea7565b9050846060840152828103608084015261259f8185611ea7565b98975050505050505050565b5f602082840312156125bb575f80fd5b5051919050565b5f808335601e198436030181126125d7575f80fd5b8301803591506001600160401b038211156125f0575f80fd5b602001915036819003821315611cbb575f80fd5b60a081525f61261660a0830189611ea7565b82810360208401526126288189611ea7565b9050828103604084015261263d818789612378565b905084606084015282810360808401526126578185611ea7565b9998505050505050505050565b5f612671611f8984611f46565b9050828152838383011115612684575f80fd5b610d8e836020830184611e85565b5f602082840312156126a2575f80fd5b81516001600160401b038111156126b7575f80fd5b8201601f810184136126c7575f80fd5b61247f84825160208401612664565b5f80604083850312156126e7575f80fd5b8251915060208301516001600160401b03811115612703575f80fd5b8301601f81018513612713575f80fd5b61272285825160208401612664565b9150509250929050565b8a815289602082015260e060408201525f61274b60e083018a8c612378565b828103606084015261275e81898b612378565b905086608084015282810360a0840152612779818688612378565b9150508260c08301529b9a5050505050505050505050565b87815286602082015260a060408201525f6127b060a083018789612378565b82810360608401526127c3818688612378565b91505082608083015298975050505050505050565b606081525f6127ea6060830187611ea7565b82810360208401526127fc8187611ea7565b90508281036040840152612811818587612378565b979650505050505050565b5f825161282d818460208701611e85565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081525f835161286e816017850160208801611e85565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161289f816028840160208801611e85565b01602801949350505050565b634e487b7160e01b5f52601160045260245ffd5b808202811582820484141761061c5761061c6128ab565b8082018082111561061c5761061c6128ab565b634e487b7160e01b5f52603260045260245ffd5b5f8161290b5761290b6128ab565b505f190190565b6001600160a01b038981168252610100602083018190525f916129378483018c611ea7565b9150838203604085015261294b828b611ea7565b9150838203606085015261295f828a611ea7565b915087608085015286151560a085015280861660c08501525082810360e084015261298a8185611ea7565b9b9a5050505050505050505050565b8181038181111561061c5761061c6128ab565b634e487b7160e01b5f52603160045260245ffdfe97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929a26469706673582212200621a202f7c878c9c5dc7b0b808c46368acb05c3fbe90eab205f4cfee8e1a95f64736f6c63430008140033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000064178656c61720000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : gateway_ (address): 0x4F4495243837681061C4743b74B3eEdf548D56A5
Arg [1] : gasService_ (address): 0x2d5d7d31F671F86C782533cc367F14109a082712
Arg [2] : tag_ (string): Axelar
-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5
Arg [1] : 0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [4] : 4178656c61720000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
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.