Overview
GLMR Balance
0 GLMR
GLMR Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 internal transactions (View All)
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
8634274 | 1 hr ago | 0.81486835 GLMR | ||||
8619706 | 26 hrs ago | 0.76498002 GLMR | ||||
8617713 | 29 hrs ago | 0.81210081 GLMR | ||||
8612839 | 37 hrs ago | 0.88890527 GLMR | ||||
8611962 | 39 hrs ago | 360.74024748 GLMR | ||||
8608928 | 44 hrs ago | 1.74480798 GLMR | ||||
8608780 | 44 hrs ago | 1.81476765 GLMR | ||||
8607024 | 47 hrs ago | 1.13890964 GLMR | ||||
8606876 | 47 hrs ago | 1.13605792 GLMR | ||||
8603871 | 2 days ago | 1.23167621 GLMR | ||||
8598370 | 2 days ago | 1.41236896 GLMR | ||||
8596145 | 2 days ago | 1.23969188 GLMR | ||||
8596016 | 2 days ago | 1.41518051 GLMR | ||||
8594477 | 2 days ago | 1.48047365 GLMR | ||||
8594340 | 2 days ago | 1.80742845 GLMR | ||||
8594113 | 2 days ago | 1.88885418 GLMR | ||||
8594021 | 2 days ago | 1.83063186 GLMR | ||||
8592207 | 3 days ago | 2.07372958 GLMR | ||||
8588408 | 3 days ago | 1.18178469 GLMR | ||||
8587329 | 3 days ago | 1.19914322 GLMR | ||||
8586289 | 3 days ago | 1.5526186 GLMR | ||||
8585845 | 3 days ago | 1.48798448 GLMR | ||||
8585575 | 3 days ago | 1.33294063 GLMR | ||||
8585491 | 3 days ago | 1.34764418 GLMR | ||||
8585009 | 3 days ago | 1.25603965 GLMR |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
InterchainTokenService
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol'; import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol'; import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol'; import { ExpressExecutorTracker } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/express/ExpressExecutorTracker.sol'; import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol'; import { Create3Address } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/deploy/Create3Address.sol'; import { SafeTokenTransferFrom } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol'; import { AddressBytes } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressBytes.sol'; import { StringToBytes32, Bytes32ToString } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/Bytes32String.sol'; import { Multicall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Multicall.sol'; import { Pausable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/Pausable.sol'; import { InterchainAddressTracker } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/InterchainAddressTracker.sol'; import { IInterchainTokenService } from './interfaces/IInterchainTokenService.sol'; import { ITokenManagerProxy } from './interfaces/ITokenManagerProxy.sol'; import { ITokenHandler } from './interfaces/ITokenHandler.sol'; import { ITokenManagerDeployer } from './interfaces/ITokenManagerDeployer.sol'; import { IInterchainTokenDeployer } from './interfaces/IInterchainTokenDeployer.sol'; import { IInterchainTokenExecutable } from './interfaces/IInterchainTokenExecutable.sol'; import { IInterchainTokenExpressExecutable } from './interfaces/IInterchainTokenExpressExecutable.sol'; import { ITokenManager } from './interfaces/ITokenManager.sol'; import { Operator } from './utils/Operator.sol'; /** * @title The Interchain Token Service * @notice This contract is responsible for facilitating interchain token transfers. * It (mostly) does not handle tokens, but is responsible for the messaging that needs to occur for interchain transfers to happen. * @dev The only storage used in this contract is for Express calls. * Furthermore, no ether is intended to or should be sent to this contract except as part of deploy/interchainTransfer payable methods for gas payment. */ contract InterchainTokenService is Upgradable, Operator, Pausable, Multicall, Create3Address, ExpressExecutorTracker, InterchainAddressTracker, IInterchainTokenService { using StringToBytes32 for string; using Bytes32ToString for bytes32; using AddressBytes for bytes; using AddressBytes for address; using SafeTokenTransferFrom for IERC20; IAxelarGateway public immutable gateway; IAxelarGasService public immutable gasService; address public immutable interchainTokenFactory; bytes32 public immutable chainNameHash; address public immutable interchainTokenDeployer; address public immutable tokenManagerDeployer; /** * @dev Token manager implementation addresses */ address public immutable tokenManager; address public immutable tokenHandler; bytes32 internal constant PREFIX_INTERCHAIN_TOKEN_ID = keccak256('its-interchain-token-id'); bytes32 internal constant PREFIX_INTERCHAIN_TOKEN_SALT = keccak256('its-interchain-token-salt'); bytes32 private constant CONTRACT_ID = keccak256('interchain-token-service'); bytes32 private constant EXECUTE_SUCCESS = keccak256('its-execute-success'); bytes32 private constant EXPRESS_EXECUTE_SUCCESS = keccak256('its-express-execute-success'); /** * @dev The message types that are sent between InterchainTokenService on different chains. */ uint256 private constant MESSAGE_TYPE_INTERCHAIN_TRANSFER = 0; uint256 private constant MESSAGE_TYPE_DEPLOY_INTERCHAIN_TOKEN = 1; uint256 private constant MESSAGE_TYPE_DEPLOY_TOKEN_MANAGER = 2; /** * @dev Tokens and token managers deployed via the Token Factory contract use a special deployer address. * This removes the dependency on the address the token factory was deployed too to be able to derive the same tokenId. */ address internal constant TOKEN_FACTORY_DEPLOYER = address(0); /** * @dev Latest version of metadata that's supported. */ enum MetadataVersion { CONTRACT_CALL, EXPRESS_CALL } uint32 internal constant LATEST_METADATA_VERSION = 1; /** * @notice Constructor for the Interchain Token Service. * @dev All of the variables passed here are stored as immutable variables. * @param tokenManagerDeployer_ The address of the TokenManagerDeployer. * @param interchainTokenDeployer_ The address of the InterchainTokenDeployer. * @param gateway_ The address of the AxelarGateway. * @param gasService_ The address of the AxelarGasService. * @param interchainTokenFactory_ The address of the InterchainTokenFactory. * @param chainName_ The name of the chain that this contract is deployed on. * @param tokenManagerImplementation_ The tokenManager implementation. * @param tokenHandler_ The tokenHandler implementation. */ constructor( address tokenManagerDeployer_, address interchainTokenDeployer_, address gateway_, address gasService_, address interchainTokenFactory_, string memory chainName_, address tokenManagerImplementation_, address tokenHandler_ ) { if ( gasService_ == address(0) || tokenManagerDeployer_ == address(0) || interchainTokenDeployer_ == address(0) || gateway_ == address(0) || interchainTokenFactory_ == address(0) || tokenManagerImplementation_ == address(0) || tokenHandler_ == address(0) ) revert ZeroAddress(); gateway = IAxelarGateway(gateway_); gasService = IAxelarGasService(gasService_); tokenManagerDeployer = tokenManagerDeployer_; interchainTokenDeployer = interchainTokenDeployer_; interchainTokenFactory = interchainTokenFactory_; if (bytes(chainName_).length == 0) revert InvalidChainName(); chainNameHash = keccak256(bytes(chainName_)); tokenManager = tokenManagerImplementation_; tokenHandler = tokenHandler_; } /*******\ MODIFIERS \*******/ /** * @notice This modifier is used to ensure that only a remote InterchainTokenService can invoke the execute function. * @param sourceChain The source chain of the contract call. * @param sourceAddress The source address that the call came from. */ modifier onlyRemoteService(string calldata sourceChain, string calldata sourceAddress) { if (!isTrustedAddress(sourceChain, sourceAddress)) revert NotRemoteService(); _; } /*****\ GETTERS \*****/ /** * @notice Getter for the contract id. * @return bytes32 The contract id of this contract. */ function contractId() external pure returns (bytes32) { return CONTRACT_ID; } /** * @notice Calculates the address of a TokenManager from a specific tokenId. * @dev The TokenManager does not need to exist already. * @param tokenId The tokenId. * @return tokenManagerAddress_ The deployment address of the TokenManager. */ function tokenManagerAddress(bytes32 tokenId) public view returns (address tokenManagerAddress_) { tokenManagerAddress_ = _create3Address(tokenId); } /** * @notice Returns the address of a TokenManager from a specific tokenId. * @dev The TokenManager needs to exist already. * @param tokenId The tokenId. * @return tokenManagerAddress_ The deployment address of the TokenManager. */ function validTokenManagerAddress(bytes32 tokenId) public view returns (address tokenManagerAddress_) { tokenManagerAddress_ = tokenManagerAddress(tokenId); if (tokenManagerAddress_.code.length == 0) revert TokenManagerDoesNotExist(tokenId); } /** * @notice Returns the address of the token that an existing tokenManager points to. * @param tokenId The tokenId. * @return tokenAddress The address of the token. */ function validTokenAddress(bytes32 tokenId) public view returns (address tokenAddress) { address tokenManagerAddress_ = validTokenManagerAddress(tokenId); tokenAddress = ITokenManager(tokenManagerAddress_).tokenAddress(); } /** * @notice Returns the address of the interchain token associated with the given tokenId. * @dev The token does not need to exist. * @param tokenId The tokenId of the interchain token. * @return tokenAddress The address of the interchain token. */ function interchainTokenAddress(bytes32 tokenId) public view returns (address tokenAddress) { tokenId = _getInterchainTokenSalt(tokenId); tokenAddress = _create3Address(tokenId); } /** * @notice Calculates the tokenId that would correspond to a link for a given deployer with a specified salt. * @param sender The address of the TokenManager deployer. * @param salt The salt that the deployer uses for the deployment. * @return tokenId The tokenId that the custom TokenManager would get (or has gotten). */ function interchainTokenId(address sender, bytes32 salt) public pure returns (bytes32 tokenId) { tokenId = keccak256(abi.encode(PREFIX_INTERCHAIN_TOKEN_ID, sender, salt)); } /** * @notice Getter function for TokenManager implementation. This will mainly be called by TokenManager proxies * to figure out their implementations. * @return tokenManagerAddress The address of the TokenManager implementation. */ function tokenManagerImplementation(uint256 /*tokenManagerType*/) external view returns (address) { return tokenManager; } /** * @notice Getter function for the flow limit of an existing TokenManager with a given tokenId. * @param tokenId The tokenId of the TokenManager. * @return flowLimit_ The flow limit. */ function flowLimit(bytes32 tokenId) external view returns (uint256 flowLimit_) { ITokenManager tokenManager_ = ITokenManager(validTokenManagerAddress(tokenId)); flowLimit_ = tokenManager_.flowLimit(); } /** * @notice Getter function for the flow out amount of an existing TokenManager with a given tokenId. * @param tokenId The tokenId of the TokenManager. * @return flowOutAmount_ The flow out amount. */ function flowOutAmount(bytes32 tokenId) external view returns (uint256 flowOutAmount_) { ITokenManager tokenManager_ = ITokenManager(validTokenManagerAddress(tokenId)); flowOutAmount_ = tokenManager_.flowOutAmount(); } /** * @notice Getter function for the flow in amount of an existing TokenManager with a given tokenId. * @param tokenId The tokenId of the TokenManager. * @return flowInAmount_ The flow in amount. */ function flowInAmount(bytes32 tokenId) external view returns (uint256 flowInAmount_) { ITokenManager tokenManager_ = ITokenManager(validTokenManagerAddress(tokenId)); flowInAmount_ = tokenManager_.flowInAmount(); } /************\ USER FUNCTIONS \************/ /** * @notice Used to deploy remote custom TokenManagers. * @dev At least the `gasValue` amount of native token must be passed to the function call. `gasValue` exists because this function can be * part of a multicall involving multiple functions that could make remote contract calls. * @param salt The salt to be used during deployment. * @param destinationChain The name of the chain to deploy the TokenManager and standardized token to. * @param tokenManagerType The type of token manager to be deployed. Cannot be NATIVE_INTERCHAIN_TOKEN. * @param params The params that will be used to initialize the TokenManager. * @param gasValue The amount of native tokens to be used to pay for gas for the remote deployment. * @return tokenId The tokenId corresponding to the deployed TokenManager. */ function deployTokenManager( bytes32 salt, string calldata destinationChain, TokenManagerType tokenManagerType, bytes calldata params, uint256 gasValue ) external payable whenNotPaused returns (bytes32 tokenId) { // Custom token managers can't be deployed with Interchain token mint burn type, which is reserved for interchain tokens if (tokenManagerType == TokenManagerType.NATIVE_INTERCHAIN_TOKEN) revert CannotDeploy(tokenManagerType); address deployer = msg.sender; if (deployer == interchainTokenFactory) { deployer = TOKEN_FACTORY_DEPLOYER; } tokenId = interchainTokenId(deployer, salt); emit InterchainTokenIdClaimed(tokenId, deployer, salt); if (bytes(destinationChain).length == 0) { _deployTokenManager(tokenId, tokenManagerType, params); } else { _deployRemoteTokenManager(tokenId, destinationChain, gasValue, tokenManagerType, params); } } /** * @notice Used to deploy an interchain token alongside a TokenManager in another chain. * @dev At least the `gasValue` amount of native token must be passed to the function call. `gasValue` exists because this function can be * part of a multicall involving multiple functions that could make remote contract calls. If the `minter` parameter is empty bytes then * a mint/burn TokenManager is used, otherwise a lock/unlock TokenManager is used. * @param salt The salt to be used during deployment. * @param destinationChain The name of the destination chain to deploy to. * @param name The name of the token to be deployed. * @param symbol The symbol of the token to be deployed. * @param decimals The decimals of the token to be deployed. * @param minter The address that will be able to mint and burn the deployed token. * @param gasValue The amount of native tokens to be used to pay for gas for the remote deployment. * @return tokenId The tokenId corresponding to the deployed InterchainToken. */ function deployInterchainToken( bytes32 salt, string calldata destinationChain, string memory name, string memory symbol, uint8 decimals, bytes memory minter, uint256 gasValue ) external payable whenNotPaused returns (bytes32 tokenId) { address deployer = msg.sender; if (deployer == interchainTokenFactory) deployer = TOKEN_FACTORY_DEPLOYER; tokenId = interchainTokenId(deployer, salt); if (bytes(destinationChain).length == 0) { address tokenAddress = _deployInterchainToken(tokenId, minter, name, symbol, decimals); _deployTokenManager(tokenId, TokenManagerType.NATIVE_INTERCHAIN_TOKEN, abi.encode(minter, tokenAddress)); } else { _deployRemoteInterchainToken(tokenId, name, symbol, decimals, minter, destinationChain, gasValue); } } /** * @notice Returns the amount of token that this call is worth. * @dev If `tokenAddress` is `0`, then value is in terms of the native token, otherwise it's in terms of the token address. * @param sourceChain The source chain. * @param sourceAddress The source address on the source chain. * @param payload The payload sent with the call. * @return address The token address. * @return uint256 The value the call is worth. */ function contractCallValue( string calldata sourceChain, string calldata sourceAddress, bytes calldata payload ) public view virtual onlyRemoteService(sourceChain, sourceAddress) whenNotPaused returns (address, uint256) { (uint256 messageType, bytes32 tokenId, , uint256 amount) = abi.decode(payload, (uint256, bytes32, bytes, uint256)); if (messageType != MESSAGE_TYPE_INTERCHAIN_TRANSFER) { revert InvalidExpressMessageType(messageType); } return (validTokenAddress(tokenId), amount); } /** * @notice Express executes operations based on the payload and selector. * @param commandId The unique message id. * @param sourceChain The chain where the transaction originates from. * @param sourceAddress The address of the remote ITS where the transaction originates from. * @param payload The encoded data payload for the transaction. */ function expressExecute( bytes32 commandId, string calldata sourceChain, string calldata sourceAddress, bytes calldata payload ) external payable whenNotPaused { uint256 messageType = abi.decode(payload, (uint256)); if (messageType != MESSAGE_TYPE_INTERCHAIN_TRANSFER) { revert InvalidExpressMessageType(messageType); } 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); _expressExecute(commandId, sourceChain, payload); } /** * @notice Uses the caller's tokens to fullfill a sendCall ahead of time. Use this only if you have detected an outgoing * interchainTransfer that matches the parameters passed here. * @param commandId The unique message id of the transfer being expressed. * @param sourceChain the name of the chain where the interchainTransfer originated from. * @param payload the payload of the receive token */ function _expressExecute(bytes32 commandId, string calldata sourceChain, bytes calldata payload) internal { (, bytes32 tokenId, bytes memory sourceAddress, bytes memory destinationAddressBytes, uint256 amount, bytes memory data) = abi .decode(payload, (uint256, bytes32, bytes, bytes, uint256, bytes)); address destinationAddress = destinationAddressBytes.toAddress(); IERC20 token; { ITokenManager tokenManager_ = ITokenManager(tokenManagerAddress(tokenId)); token = IERC20(tokenManager_.tokenAddress()); (bool success, bytes memory returnData) = tokenHandler.delegatecall( abi.encodeWithSelector( ITokenHandler.transferTokenFrom.selector, tokenManager_.implementationType(), address(token), msg.sender, destinationAddress, amount ) ); if (!success) revert TokenHandlerFailed(returnData); amount = abi.decode(returnData, (uint256)); } // slither-disable-next-line reentrancy-events emit InterchainTransferReceived( commandId, tokenId, sourceChain, sourceAddress, destinationAddress, amount, data.length == 0 ? bytes32(0) : keccak256(data) ); if (data.length != 0) { bytes32 result = IInterchainTokenExpressExecutable(destinationAddress).expressExecuteWithInterchainToken( commandId, sourceChain, sourceAddress, data, tokenId, address(token), amount ); if (result != EXPRESS_EXECUTE_SUCCESS) revert ExpressExecuteWithInterchainTokenFailed(destinationAddress); } } /** * @notice Initiates an interchain transfer of a specified token to a destination chain. * @dev The function retrieves the TokenManager associated with the tokenId. * @param tokenId The unique identifier of the token to be transferred. * @param destinationChain The destination chain to send the tokens to. * @param destinationAddress The address on the destination chain to send the tokens to. * @param amount The amount of tokens to be transferred. * @param metadata Optional metadata for the call for additional effects (such as calling a destination contract). */ function interchainTransfer( bytes32 tokenId, string calldata destinationChain, bytes calldata destinationAddress, uint256 amount, bytes calldata metadata, uint256 gasValue ) external payable whenNotPaused { amount = _takeToken(tokenId, msg.sender, amount, false); (MetadataVersion metadataVersion, bytes memory data) = _decodeMetadata(metadata); _transmitInterchainTransfer(tokenId, msg.sender, destinationChain, destinationAddress, amount, metadataVersion, data, gasValue); } /** * @notice Initiates an interchain call contract with interchain token to a destination chain. * @param tokenId The unique identifier of the token to be transferred. * @param destinationChain The destination chain to send the tokens to. * @param destinationAddress The address on the destination chain to send the tokens to. * @param amount The amount of tokens to be transferred. * @param data Additional data to be passed along with the transfer. */ function callContractWithInterchainToken( bytes32 tokenId, string calldata destinationChain, bytes calldata destinationAddress, uint256 amount, bytes memory data, uint256 gasValue ) external payable whenNotPaused { if (data.length == 0) revert EmptyData(); amount = _takeToken(tokenId, msg.sender, amount, false); _transmitInterchainTransfer( tokenId, msg.sender, destinationChain, destinationAddress, amount, MetadataVersion.CONTRACT_CALL, data, gasValue ); } /******************\ TOKEN ONLY FUNCTIONS \******************/ /** * @notice Transmit an interchain transfer for the given tokenId. * @dev Only callable by a token registered under a tokenId. * @param tokenId The tokenId of the token (which must be the msg.sender). * @param sourceAddress The address where the token is coming from. * @param destinationChain The name of the chain to send tokens to. * @param destinationAddress The destinationAddress for the interchainTransfer. * @param amount The amount of token to give. * @param metadata Optional metadata for the call for additional effects (such as calling a destination contract). */ function transmitInterchainTransfer( bytes32 tokenId, address sourceAddress, string calldata destinationChain, bytes memory destinationAddress, uint256 amount, bytes calldata metadata ) external payable whenNotPaused { amount = _takeToken(tokenId, sourceAddress, amount, true); (MetadataVersion metadataVersion, bytes memory data) = _decodeMetadata(metadata); _transmitInterchainTransfer(tokenId, sourceAddress, destinationChain, destinationAddress, amount, metadataVersion, data, msg.value); } /*************\ OWNER FUNCTIONS \*************/ /** * @notice Used to set a flow limit for a token manager that has the service as its operator. * @param tokenIds An array of the tokenIds of the tokenManagers to set the flow limits of. * @param flowLimits The flowLimits to set. */ function setFlowLimits(bytes32[] calldata tokenIds, uint256[] calldata flowLimits) external onlyRole(uint8(Roles.OPERATOR)) { uint256 length = tokenIds.length; if (length != flowLimits.length) revert LengthMismatch(); for (uint256 i; i < length; ++i) { ITokenManager tokenManager_ = ITokenManager(validTokenManagerAddress(tokenIds[i])); // slither-disable-next-line calls-loop tokenManager_.setFlowLimit(flowLimits[i]); } } /** * @notice Used to set a trusted address for a chain. * @param chain The chain to set the trusted address of. * @param address_ The address to set as trusted. */ function setTrustedAddress(string memory chain, string memory address_) external onlyOwner { _setTrustedAddress(chain, address_); } /** * @notice Used to remove a trusted address for a chain. * @param chain The chain to set the trusted address of. */ function removeTrustedAddress(string memory chain) external onlyOwner { _removeTrustedAddress(chain); } /** * @notice Allows the owner to pause/unpause the token service. * @param paused Boolean value representing whether to pause or unpause. */ function setPauseStatus(bool paused) external onlyOwner { if (paused) { _pause(); } else { _unpause(); } } /****************\ INTERNAL FUNCTIONS \****************/ function _setup(bytes calldata params) internal override { (address operator, string memory chainName_, string[] memory trustedChainNames, string[] memory trustedAddresses) = abi.decode( params, (address, string, string[], string[]) ); uint256 length = trustedChainNames.length; if (operator == address(0)) revert ZeroAddress(); if (bytes(chainName_).length == 0 || keccak256(bytes(chainName_)) != chainNameHash) revert InvalidChainName(); if (length != trustedAddresses.length) revert LengthMismatch(); _addOperator(operator); _setChainName(chainName_); for (uint256 i; i < length; ++i) { _setTrustedAddress(trustedChainNames[i], trustedAddresses[i]); } } /** * @notice Executes operations based on the payload and selector. * @param commandId The unique message id. * @param sourceChain The chain where the transaction originates from. * @param sourceAddress The address of the remote ITS where the transaction originates from. * @param payload The encoded data payload for the transaction. */ function execute( bytes32 commandId, string calldata sourceChain, string calldata sourceAddress, bytes calldata payload ) external onlyRemoteService(sourceChain, sourceAddress) whenNotPaused { bytes32 payloadHash = keccak256(payload); if (!gateway.validateContractCall(commandId, sourceChain, sourceAddress, payloadHash)) revert NotApprovedByGateway(); uint256 messageType = abi.decode(payload, (uint256)); if (messageType == MESSAGE_TYPE_INTERCHAIN_TRANSFER) { address expressExecutor = _popExpressExecutor(commandId, sourceChain, sourceAddress, payloadHash); _processInterchainTransferPayload(commandId, expressExecutor, sourceChain, payload); if (expressExecutor != address(0)) { emit ExpressExecutionFulfilled(commandId, sourceChain, sourceAddress, payloadHash, expressExecutor); } } else if (messageType == MESSAGE_TYPE_DEPLOY_TOKEN_MANAGER) { _processDeployTokenManagerPayload(payload); } else if (messageType == MESSAGE_TYPE_DEPLOY_INTERCHAIN_TOKEN) { _processDeployInterchainTokenPayload(payload); } else { revert InvalidMessageType(messageType); } } function contractCallWithTokenValue( string calldata /*sourceChain*/, string calldata /*sourceAddress*/, bytes calldata /*payload*/, string calldata /*symbol*/, uint256 /*amount*/ ) public view virtual returns (address, uint256) { revert ExecuteWithTokenNotSupported(); } function expressExecuteWithToken( bytes32 /*commandId*/, string calldata /*sourceChain*/, string calldata /*sourceAddress*/, bytes calldata /*payload*/, string calldata /*tokenSymbol*/, uint256 /*amount*/ ) external payable { revert ExecuteWithTokenNotSupported(); } function executeWithToken( bytes32 /*commandId*/, string calldata /*sourceChain*/, string calldata /*sourceAddress*/, bytes calldata /*payload*/, string calldata /*tokenSymbol*/, uint256 /*amount*/ ) external pure { revert ExecuteWithTokenNotSupported(); } /** * @notice Processes the payload data for a send token call. * @param commandId The unique message id. * @param expressExecutor The address of the express executor. Equals `address(0)` if it wasn't expressed. * @param sourceChain The chain where the transaction originates from. * @param payload The encoded data payload to be processed. */ function _processInterchainTransferPayload( bytes32 commandId, address expressExecutor, string calldata sourceChain, bytes calldata payload ) internal { bytes32 tokenId; bytes memory sourceAddress; address destinationAddress; uint256 amount; bytes memory data; { bytes memory destinationAddressBytes; (, tokenId, sourceAddress, destinationAddressBytes, amount, data) = abi.decode( payload, (uint256, bytes32, bytes, bytes, uint256, bytes) ); destinationAddress = destinationAddressBytes.toAddress(); } // Return token to the existing express caller if (expressExecutor != address(0)) { // slither-disable-next-line unused-return _giveToken(tokenId, expressExecutor, amount); return; } address tokenAddress; (amount, tokenAddress) = _giveToken(tokenId, destinationAddress, amount); // slither-disable-next-line reentrancy-events emit InterchainTransferReceived( commandId, tokenId, sourceChain, sourceAddress, destinationAddress, amount, data.length == 0 ? bytes32(0) : keccak256(data) ); if (data.length != 0) { bytes32 result = IInterchainTokenExecutable(destinationAddress).executeWithInterchainToken( commandId, sourceChain, sourceAddress, data, tokenId, tokenAddress, amount ); if (result != EXECUTE_SUCCESS) revert ExecuteWithInterchainTokenFailed(destinationAddress); } } /** * @notice Processes a deploy token manager payload. */ function _processDeployTokenManagerPayload(bytes calldata payload) internal { (, bytes32 tokenId, TokenManagerType tokenManagerType, bytes memory params) = abi.decode( payload, (uint256, bytes32, TokenManagerType, bytes) ); if (tokenManagerType == TokenManagerType.NATIVE_INTERCHAIN_TOKEN) revert CannotDeploy(tokenManagerType); _deployTokenManager(tokenId, tokenManagerType, params); } /** * @notice Processes a deploy interchain token manager payload. * @param payload The encoded data payload to be processed. */ function _processDeployInterchainTokenPayload(bytes calldata payload) internal { (, bytes32 tokenId, string memory name, string memory symbol, uint8 decimals, bytes memory minterBytes) = abi.decode( payload, (uint256, bytes32, string, string, uint8, bytes) ); address tokenAddress; tokenAddress = _deployInterchainToken(tokenId, minterBytes, name, symbol, decimals); _deployTokenManager(tokenId, TokenManagerType.NATIVE_INTERCHAIN_TOKEN, abi.encode(minterBytes, tokenAddress)); } /** * @notice Calls a contract on a specific destination chain with the given payload * @param destinationChain The target chain where the contract will be called. * @param payload The data payload for the transaction. * @param gasValue The amount of gas to be paid for the transaction. */ function _callContract( string calldata destinationChain, bytes memory payload, MetadataVersion metadataVersion, uint256 gasValue ) internal { string memory destinationAddress = trustedAddress(destinationChain); if (bytes(destinationAddress).length == 0) revert UntrustedChain(); if (gasValue > 0) { if (metadataVersion == MetadataVersion.CONTRACT_CALL) { gasService.payNativeGasForContractCall{ value: gasValue }( address(this), destinationChain, destinationAddress, payload, // solhint-disable-next-line avoid-tx-origin tx.origin ); } else if (metadataVersion == MetadataVersion.EXPRESS_CALL) { gasService.payNativeGasForExpressCall{ value: gasValue }( address(this), destinationChain, destinationAddress, payload, // solhint-disable-next-line avoid-tx-origin tx.origin ); } else { revert InvalidMetadataVersion(uint32(metadataVersion)); } } gateway.callContract(destinationChain, destinationAddress, payload); } /** * @notice Deploys a token manager on a destination chain. * @param tokenId The ID of the token. * @param destinationChain The chain where the token manager will be deployed. * @param gasValue The amount of gas to be paid for the transaction. * @param tokenManagerType The type of token manager to be deployed. * @param params Additional parameters for the token manager deployment. */ function _deployRemoteTokenManager( bytes32 tokenId, string calldata destinationChain, uint256 gasValue, TokenManagerType tokenManagerType, bytes memory params ) internal { // slither-disable-next-line unused-return validTokenManagerAddress(tokenId); emit TokenManagerDeploymentStarted(tokenId, destinationChain, tokenManagerType, params); bytes memory payload = abi.encode(MESSAGE_TYPE_DEPLOY_TOKEN_MANAGER, tokenId, tokenManagerType, params); _callContract(destinationChain, payload, MetadataVersion.CONTRACT_CALL, gasValue); } /** * @notice Deploys an interchain token on a destination chain. * @param tokenId The ID of the token. * @param name The name of the token. * @param symbol The symbol of the token. * @param decimals The number of decimals of the token. * @param minter The minter address for the token. * @param destinationChain The destination chain where the token will be deployed. * @param gasValue The amount of gas to be paid for the transaction. */ function _deployRemoteInterchainToken( bytes32 tokenId, string memory name, string memory symbol, uint8 decimals, bytes memory minter, string calldata destinationChain, uint256 gasValue ) internal { // slither-disable-next-line unused-return validTokenManagerAddress(tokenId); // slither-disable-next-line reentrancy-events emit InterchainTokenDeploymentStarted(tokenId, name, symbol, decimals, minter, destinationChain); bytes memory payload = abi.encode(MESSAGE_TYPE_DEPLOY_INTERCHAIN_TOKEN, tokenId, name, symbol, decimals, minter); _callContract(destinationChain, payload, MetadataVersion.CONTRACT_CALL, gasValue); } /** * @notice Deploys a token manager. * @param tokenId The ID of the token. * @param tokenManagerType The type of the token manager to be deployed. * @param params Additional parameters for the token manager deployment. */ function _deployTokenManager(bytes32 tokenId, TokenManagerType tokenManagerType, bytes memory params) internal { (bool success, bytes memory returnData) = tokenManagerDeployer.delegatecall( abi.encodeWithSelector(ITokenManagerDeployer.deployTokenManager.selector, tokenId, tokenManagerType, params) ); if (!success) revert TokenManagerDeploymentFailed(returnData); address tokenManager_; assembly { tokenManager_ := mload(add(returnData, 0x20)) } if (tokenManagerType == TokenManagerType.LOCK_UNLOCK || tokenManagerType == TokenManagerType.LOCK_UNLOCK_FEE) { ITokenManager(tokenManager_).approveService(); } // slither-disable-next-line reentrancy-events emit TokenManagerDeployed(tokenId, tokenManager_, tokenManagerType, params); } /** * @notice Computes the salt for an interchain token deployment. * @param tokenId The ID of the token. * @return salt The computed salt for the token deployment. */ function _getInterchainTokenSalt(bytes32 tokenId) internal pure returns (bytes32 salt) { return keccak256(abi.encode(PREFIX_INTERCHAIN_TOKEN_SALT, tokenId)); } /** * @notice Deploys an interchain token. * @param tokenId The ID of the token. * @param minterBytes The minter address for the token. * @param name The name of the token. * @param symbol The symbol of the token. * @param decimals The number of decimals of the token. */ function _deployInterchainToken( bytes32 tokenId, bytes memory minterBytes, string memory name, string memory symbol, uint8 decimals ) internal returns (address tokenAddress) { bytes32 salt = _getInterchainTokenSalt(tokenId); address minter; if (bytes(minterBytes).length != 0) minter = minterBytes.toAddress(); (bool success, bytes memory returnData) = interchainTokenDeployer.delegatecall( abi.encodeWithSelector(IInterchainTokenDeployer.deployInterchainToken.selector, salt, tokenId, minter, name, symbol, decimals) ); if (!success) { revert InterchainTokenDeploymentFailed(returnData); } assembly { tokenAddress := mload(add(returnData, 0x20)) } // slither-disable-next-line reentrancy-events emit InterchainTokenDeployed(tokenId, tokenAddress, minter, name, symbol, decimals); } /** * @notice Decodes the metadata into a version number and data bytes. * @dev The function expects the metadata to have the version in the first 4 bytes, followed by the actual data. * @param metadata The bytes containing the metadata to decode. * @return version The version number extracted from the metadata. * @return data The data bytes extracted from the metadata. */ function _decodeMetadata(bytes calldata metadata) internal pure returns (MetadataVersion version, bytes memory data) { if (metadata.length < 4) return (MetadataVersion.CONTRACT_CALL, data); uint32 versionUint = uint32(bytes4(metadata[:4])); if (versionUint > LATEST_METADATA_VERSION) revert InvalidMetadataVersion(versionUint); version = MetadataVersion(versionUint); if (metadata.length == 4) return (version, data); data = metadata[4:]; } /** * @notice Transmit a callContractWithInterchainToken for the given tokenId. * @param tokenId The tokenId of the TokenManager (which must be the msg.sender). * @param sourceAddress The address where the token is coming from, which will also be used for gas reimbursement. * @param destinationChain The name of the chain to send tokens to. * @param destinationAddress The destinationAddress for the interchainTransfer. * @param amount The amount of tokens to send. * @param metadataVersion The version of the metadata. * @param data The data to be passed with the token transfer. */ function _transmitInterchainTransfer( bytes32 tokenId, address sourceAddress, string calldata destinationChain, bytes memory destinationAddress, uint256 amount, MetadataVersion metadataVersion, bytes memory data, uint256 gasValue ) internal { // slither-disable-next-line reentrancy-events emit InterchainTransfer( tokenId, sourceAddress, destinationChain, destinationAddress, amount, data.length == 0 ? bytes32(0) : keccak256(data) ); bytes memory payload = abi.encode( MESSAGE_TYPE_INTERCHAIN_TRANSFER, tokenId, sourceAddress.toBytes(), destinationAddress, amount, data ); _callContract(destinationChain, payload, metadataVersion, gasValue); } /** * @dev Takes token from a sender via the token service. `tokenOnly` indicates if the caller should be restricted to the token only. */ function _takeToken(bytes32 tokenId, address from, uint256 amount, bool tokenOnly) internal returns (uint256) { address tokenManager_ = tokenManagerAddress(tokenId); uint256 tokenManagerType; address tokenAddress; (tokenManagerType, tokenAddress) = ITokenManagerProxy(tokenManager_).getImplementationTypeAndTokenAddress(); if (tokenOnly && msg.sender != tokenAddress) revert NotToken(msg.sender, tokenAddress); (bool success, bytes memory data) = tokenHandler.delegatecall( abi.encodeWithSelector(ITokenHandler.takeToken.selector, tokenManagerType, tokenAddress, tokenManager_, from, amount) ); if (!success) revert TakeTokenFailed(data); amount = abi.decode(data, (uint256)); /// @dev Track the flow amount being sent out as a message ITokenManager(tokenManager_).addFlowOut(amount); return amount; } /** * @dev Gives token to recipient via the token service. */ function _giveToken(bytes32 tokenId, address to, uint256 amount) internal returns (uint256, address) { address tokenManager_ = tokenManagerAddress(tokenId); (uint256 tokenManagerType, address tokenAddress) = ITokenManagerProxy(tokenManager_).getImplementationTypeAndTokenAddress(); /// @dev Track the flow amount being received via the message ITokenManager(tokenManager_).addFlowIn(amount); (bool success, bytes memory data) = tokenHandler.delegatecall( abi.encodeWithSelector(ITokenHandler.giveToken.selector, tokenManagerType, tokenAddress, tokenManager_, to, amount) ); if (!success) revert GiveTokenFailed(data); amount = abi.decode(data, (uint256)); return (amount, tokenAddress); } }
// SPDX-License-Identifier: MIT import { CreateDeploy } from './CreateDeploy.sol'; pragma solidity ^0.8.0; /** * @title Create3Address contract * @notice This contract can be used to predict the deterministic deployment address of a contract deployed with the `CREATE3` technique. */ contract Create3Address { /// @dev bytecode hash of the CreateDeploy helper contract bytes32 internal immutable createDeployBytecodeHash; constructor() { createDeployBytecodeHash = keccak256(type(CreateDeploy).creationCode); } /** * @notice Compute the deployed address that will result from the `CREATE3` method. * @param deploySalt A salt to influence the contract address * @return deployed The deterministic contract address if it was deployed */ function _create3Address(bytes32 deploySalt) internal view returns (address deployed) { address deployer = address( uint160(uint256(keccak256(abi.encodePacked(hex'ff', address(this), deploySalt, createDeployBytecodeHash)))) ); deployed = address(uint160(uint256(keccak256(abi.encodePacked(hex'd6_94', deployer, hex'01'))))); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title CreateDeploy Contract * @notice This contract deploys new contracts using the `CREATE` opcode and is used as part of * the `CREATE3` deployment method. */ contract CreateDeploy { /** * @dev Deploys a new contract with the specified bytecode using the `CREATE` opcode. * @param bytecode The bytecode of the contract to be deployed */ // slither-disable-next-line locked-ether function deploy(bytes memory bytecode) external payable { assembly { if iszero(create(0, add(bytecode, 32), mload(bytecode))) { revert(0, 0) } } } }
// 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 { IUpgradable } from '../interfaces/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 IUpgradable { error NothingReceived(); error InvalidAddress(); error NotCollector(); error InvalidAmounts(); 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 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 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 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 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 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 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; import { IAxelarExpressExecutable } from './IAxelarExpressExecutable.sol'; /** * @title IAxelarValuedExpressExecutable * @dev Interface for the Axelar Valued Express Executable contract. */ interface IAxelarValuedExpressExecutable is IAxelarExpressExecutable { /** * @dev Returns the value (token address and amount) associated with a contract call * @param sourceChain The source blockchain. * @param sourceAddress The source address. * @param payload The payload data. * @return tokenAddress The address of the token used. * @return value The value associated with the contract call. */ function contractCallValue( string calldata sourceChain, string calldata sourceAddress, bytes calldata payload ) external view returns (address tokenAddress, uint256 value); /** * @dev Returns the value (token address and amount) associated with a contract call with token. * @param sourceChain The source blockchain. * @param sourceAddress The source address. * @param payload The payload data. * @param symbol The token symbol. * @param amount The amount of tokens. * @return tokenAddress The address of the token used. * @return value The value associated with the contract call. */ function contractCallWithTokenValue( string calldata sourceChain, string calldata sourceAddress, bytes calldata payload, string calldata symbol, uint256 amount ) external view returns (address tokenAddress, uint256 value); }
// 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 { IContractIdentifier } from './IContractIdentifier.sol'; /** * @title IInterchainAddressTracker * @dev Manages trusted addresses by chain, keeps track of addresses supported by the Axelar gateway contract */ interface IInterchainAddressTracker { error ZeroAddress(); error LengthMismatch(); error ZeroStringLength(); error UntrustedChain(); event TrustedAddressSet(string chain, string address_); event TrustedAddressRemoved(string chain); /** * @dev Gets the name of the chain this is deployed at */ function chainName() external view returns (string memory); /** * @dev Gets the trusted address at a remote chain * @param chain Chain name of the remote chain * @return trustedAddress_ The trusted address for the chain. Returns '' if the chain is untrusted */ function trustedAddress(string memory chain) external view returns (string memory trustedAddress_); /** * @dev Gets the trusted address hash for a chain * @param chain Chain name * @return trustedAddressHash_ the hash of the trusted address for that chain */ function trustedAddressHash(string memory chain) external view returns (bytes32 trustedAddressHash_); /** * @dev Checks whether the interchain sender is a trusted address * @param chain Chain name of the sender * @param address_ Address of the sender * @return bool true if the sender chain/address are trusted, false otherwise */ function isTrustedAddress(string calldata chain, string calldata address_) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IMulticall * @notice This contract is a multi-functional smart contract which allows for multiple * contract calls in a single transaction. */ interface IMulticall { error MulticallFailed(); /** * @notice Performs multiple delegate calls and returns the results of all calls as an array * @dev This function requires that the contract has sufficient balance for the delegate calls. * If any of the calls fail, the function will revert with the failure message. * @param data An array of encoded function calls * @return results An bytes array with the return data of each function call */ function multicall(bytes[] calldata data) external payable returns (bytes[] memory results); }
// 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; /** * @title Pausable * @notice This contract provides a mechanism to halt the execution of specific functions * if a pause condition is activated. */ interface IPausable { event Paused(address indexed account); event Unpaused(address indexed account); error Pause(); error NotPaused(); /** * @notice Check if the contract is paused * @return paused A boolean representing the pause status. True if paused, false otherwise. */ function paused() external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // General interface for upgradable contracts interface IProxy { error InvalidOwner(); error InvalidImplementation(); error SetupFailed(); error NotOwner(); error AlreadyInitialized(); function implementation() external view returns (address); function setup(bytes calldata setupParams) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IRolesBase Interface * @notice IRolesBase is an interface that abstracts the implementation of a * contract with role control internal functions. */ interface IRolesBase { error MissingRole(address account, uint8 role); error MissingAllRoles(address account, uint256 accountRoles); error MissingAnyOfRoles(address account, uint256 accountRoles); error InvalidProposedRoles(address fromAccount, address toAccount, uint256 accountRoles); event RolesProposed(address indexed fromAccount, address indexed toAccount, uint256 accountRoles); event RolesAdded(address indexed account, uint256 accountRoles); event RolesRemoved(address indexed account, uint256 accountRoles); /** * @notice Checks if an account has a role. * @param account The address to check * @param role The role to check * @return True if the account has the role, false otherwise */ function hasRole(address account, uint8 role) external view returns (bool); }
// 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; /** * @title AddressBytesUtils * @dev This library provides utility functions to convert between `address` and `bytes`. */ library AddressBytes { error InvalidBytesLength(bytes bytesAddress); /** * @dev Converts a bytes address to an address type. * @param bytesAddress The bytes representation of an address * @return addr The converted address */ function toAddress(bytes memory bytesAddress) internal pure returns (address addr) { if (bytesAddress.length != 20) revert InvalidBytesLength(bytesAddress); assembly { addr := mload(add(bytesAddress, 20)) } } /** * @dev Converts an address to bytes. * @param addr The address to be converted * @return bytesAddress The bytes representation of the address */ function toBytes(address addr) internal pure returns (bytes memory bytesAddress) { bytesAddress = new bytes(20); // we can test if using a single 32 byte variable that is the address with the length together and using one mstore would be slightly cheaper. assembly { mstore(add(bytesAddress, 20), addr) mstore(bytesAddress, 20) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library StringToBytes32 { error InvalidStringLength(); function toBytes32(string memory str) internal pure returns (bytes32) { // Converting a string to bytes32 for immutable storage bytes memory stringBytes = bytes(str); // We can store up to 31 bytes of data as 1 byte is for encoding length if (stringBytes.length == 0 || stringBytes.length > 31) revert InvalidStringLength(); uint256 stringNumber = uint256(bytes32(stringBytes)); // Storing string length as the last byte of the data stringNumber |= 0xff & stringBytes.length; return bytes32(stringNumber); } } library Bytes32ToString { function toTrimmedString(bytes32 stringData) internal pure returns (string memory converted) { // recovering string length as the last byte of the data uint256 length = 0xff & uint256(stringData); // restoring the string with the correct length assembly { converted := mload(0x40) // new "memory end" including padding (the string isn't larger than 32 bytes) mstore(0x40, add(converted, 0x40)) // store length in memory mstore(converted, length) // write actual data mstore(add(converted, 0x20), stringData) } } }
// 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; library StringStorage { struct Wrapper { string value; } function set(bytes32 slot, string memory value) internal { _getStorageStruct(slot).value = value; } function get(bytes32 slot) internal view returns (string memory value) { value = _getStorageStruct(slot).value; } function clear(bytes32 slot) internal { delete _getStorageStruct(slot).value; } function _getStorageStruct(bytes32 slot) internal pure returns (Wrapper storage wrapper) { assembly { wrapper.slot := slot } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IImplementation } from '../interfaces/IImplementation.sol'; /** * @title Implementation * @notice This contract serves as a base for other contracts and enforces a proxy-first access restriction. * @dev Derived contracts must implement the setup function. */ abstract contract Implementation is IImplementation { address private immutable implementationAddress; /** * @dev Contract constructor that sets the implementation address to the address of this contract. */ constructor() { implementationAddress = address(this); } /** * @dev Modifier to require the caller to be the proxy contract. * Reverts if the caller is the current contract (i.e., the implementation contract itself). */ modifier onlyProxy() { if (implementationAddress == address(this)) revert NotProxy(); _; } /** * @notice Initializes contract parameters. * This function is intended to be overridden by derived contracts. * The overriding function must have the onlyProxy modifier. * @param params The parameters to be used for initialization */ function setup(bytes calldata params) external virtual; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IImplementation } from '../interfaces/IImplementation.sol'; import { IUpgradable } from '../interfaces/IUpgradable.sol'; import { Ownable } from '../utils/Ownable.sol'; import { Implementation } from './Implementation.sol'; /** * @title Upgradable Contract * @notice This contract provides an interface for upgradable smart contracts and includes the functionality to perform upgrades. */ abstract contract Upgradable is Ownable, Implementation, IUpgradable { // bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @notice Constructor sets the implementation address to the address of the contract itself * @dev This is used in the onlyProxy modifier to prevent certain functions from being called directly * on the implementation contract itself. * @dev The owner is initially set as address(1) because the actual owner is set within the proxy. It is not * set as the zero address because Ownable is designed to throw an error for ownership transfers to the zero address. */ constructor() Ownable(address(1)) {} /** * @notice Returns the address of the current implementation * @return implementation_ Address of the current implementation */ function implementation() public view returns (address implementation_) { assembly { implementation_ := sload(_IMPLEMENTATION_SLOT) } } /** * @notice Upgrades the contract to a new implementation * @param newImplementation The address of the new implementation contract * @param newImplementationCodeHash The codehash of the new implementation contract * @param params Optional setup parameters for the new implementation contract * @dev This function is only callable by the owner. */ function upgrade( address newImplementation, bytes32 newImplementationCodeHash, bytes calldata params ) external override onlyOwner { if (IUpgradable(newImplementation).contractId() != IUpgradable(implementation()).contractId()) revert InvalidImplementation(); if (newImplementationCodeHash != newImplementation.codehash) revert InvalidCodeHash(); emit Upgraded(newImplementation); if (params.length > 0) { // slither-disable-next-line controlled-delegatecall (bool success, ) = newImplementation.delegatecall(abi.encodeWithSelector(this.setup.selector, params)); if (!success) revert SetupFailed(); } assembly { sstore(_IMPLEMENTATION_SLOT, newImplementation) } } /** * @notice Sets up the contract with initial data * @param data Initialization data for the contract * @dev This function is only callable by the proxy contract. */ function setup(bytes calldata data) external override(IImplementation, Implementation) onlyProxy { _setup(data); } /** * @notice Internal function to set up the contract with initial data * @param data Initialization data for the contract * @dev This function should be implemented in derived contracts. */ function _setup(bytes calldata data) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IInterchainAddressTracker } from '../interfaces/IInterchainAddressTracker.sol'; import { StringStorage } from '../libs/StringStorage.sol'; /** * @title InterchainAddressTracker * @dev Manages and validates trusted interchain addresses of an application. */ contract InterchainAddressTracker is IInterchainAddressTracker { bytes32 internal constant PREFIX_ADDRESS_MAPPING = keccak256('interchain-address-tracker-address-mapping'); bytes32 internal constant PREFIX_ADDRESS_HASH_MAPPING = keccak256('interchain-address-tracker-address-hash-mapping'); // bytes32(uint256(keccak256('interchain-address-tracker-chain-name')) - 1) bytes32 internal constant _CHAIN_NAME_SLOT = 0x0e2c162a1f4b5cff9fdbd6b34678a9bcb9898a0b9fbca695b112d61688d8b2ac; function _setChainName(string memory chainName_) internal { StringStorage.set(_CHAIN_NAME_SLOT, chainName_); } /** * @dev Gets the name of the chain this is deployed at */ function chainName() external view returns (string memory chainName_) { chainName_ = StringStorage.get(_CHAIN_NAME_SLOT); } /** * @dev Gets the trusted address at a remote chain * @param chain Chain name of the remote chain * @return trustedAddress_ The trusted address for the chain. Returns '' if the chain is untrusted */ function trustedAddress(string memory chain) public view returns (string memory trustedAddress_) { trustedAddress_ = StringStorage.get(_getTrustedAddressSlot(chain)); } /** * @dev Gets the trusted address hash for a chain * @param chain Chain name * @return trustedAddressHash_ the hash of the trusted address for that chain */ function trustedAddressHash(string memory chain) public view returns (bytes32 trustedAddressHash_) { bytes32 slot = _getTrustedAddressHashSlot(chain); assembly { trustedAddressHash_ := sload(slot) } } /** * @dev Checks whether the interchain sender is a trusted address * @param chain Chain name of the sender * @param address_ Address of the sender * @return bool true if the sender chain/address are trusted, false otherwise */ function isTrustedAddress(string calldata chain, string calldata address_) public view returns (bool) { bytes32 addressHash = keccak256(bytes(address_)); return addressHash == trustedAddressHash(chain); } /** * @dev Gets the key for the trusted address at a remote chain * @param chain Chain name of the remote chain * @return slot the slot to store the trusted address in */ function _getTrustedAddressSlot(string memory chain) internal pure returns (bytes32 slot) { slot = keccak256(abi.encode(PREFIX_ADDRESS_MAPPING, chain)); } /** * @dev Gets the key for the trusted address at a remote chain * @param chain Chain name of the remote chain * @return slot the slot to store the trusted address hash in */ function _getTrustedAddressHashSlot(string memory chain) internal pure returns (bytes32 slot) { slot = keccak256(abi.encode(PREFIX_ADDRESS_HASH_MAPPING, chain)); } /** * @dev Sets the trusted address and its hash for a remote chain * @param chain Chain name of the remote chain * @param address_ the string representation of the trusted address */ function _setTrustedAddress(string memory chain, string memory address_) internal { if (bytes(chain).length == 0) revert ZeroStringLength(); if (bytes(address_).length == 0) revert ZeroStringLength(); StringStorage.set(_getTrustedAddressSlot(chain), address_); bytes32 slot = _getTrustedAddressHashSlot(chain); bytes32 addressHash = keccak256(bytes(address_)); assembly { sstore(slot, addressHash) } emit TrustedAddressSet(chain, address_); } /** * @dev Remove the trusted address of the chain. * @param chain Chain name that should be made untrusted */ function _removeTrustedAddress(string memory chain) internal { if (bytes(chain).length == 0) revert ZeroStringLength(); StringStorage.clear(_getTrustedAddressSlot(chain)); bytes32 slot = _getTrustedAddressHashSlot(chain); assembly { sstore(slot, 0) } emit TrustedAddressRemoved(chain); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IMulticall } from '../interfaces/IMulticall.sol'; /** * @title Multicall * @notice This contract is a multi-functional smart contract which allows for multiple * contract calls in a single transaction. */ contract Multicall is IMulticall { /** * @notice Performs multiple delegate calls and returns the results of all calls as an array * @dev This function requires that the contract has sufficient balance for the delegate calls. * If any of the calls fail, the function will revert with the failure message. * @param data An array of encoded function calls * @return results An bytes array with the return data of each function call */ function multicall(bytes[] calldata data) public payable returns (bytes[] memory results) { results = new bytes[](data.length); bool success; bytes memory result; for (uint256 i = 0; i < data.length; ++i) { // slither-disable-next-line calls-loop,delegatecall-loop (success, result) = address(this).delegatecall(data[i]); if (!success) { if (result.length == 0) revert MulticallFailed(); assembly { revert(add(32, result), mload(result)) } } results[i] = result; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IOwnable } from '../interfaces/IOwnable.sol'; /** * @title Ownable * @notice A contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * The owner account is set through ownership transfer. This module makes * it possible to transfer the ownership of the contract to a new account in one * step, as well as to an interim pending owner. In the second flow the ownership does not * change until the pending owner accepts the ownership transfer. */ abstract contract Ownable is IOwnable { // keccak256('owner') bytes32 internal constant _OWNER_SLOT = 0x02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c0; // keccak256('ownership-transfer') bytes32 internal constant _OWNERSHIP_TRANSFER_SLOT = 0x9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d1; /** * @notice Initializes the contract by transferring ownership to the owner parameter. * @param _owner Address to set as the initial owner of the contract */ constructor(address _owner) { _transferOwnership(_owner); } /** * @notice Modifier that throws an error if called by any account other than the owner. */ modifier onlyOwner() { if (owner() != msg.sender) revert NotOwner(); _; } /** * @notice Returns the current owner of the contract. * @return owner_ The current owner of the contract */ function owner() public view returns (address owner_) { assembly { owner_ := sload(_OWNER_SLOT) } } /** * @notice Returns the pending owner of the contract. * @return owner_ The pending owner of the contract */ function pendingOwner() public view returns (address owner_) { assembly { owner_ := sload(_OWNERSHIP_TRANSFER_SLOT) } } /** * @notice Transfers ownership of the contract to a new account `newOwner`. * @dev Can only be called by the current owner. * @param newOwner The address to transfer ownership to */ function transferOwnership(address newOwner) external virtual onlyOwner { _transferOwnership(newOwner); } /** * @notice Propose to transfer ownership of the contract to a new account `newOwner`. * @dev Can only be called by the current owner. The ownership does not change * until the new owner accepts the ownership transfer. * @param newOwner The address to transfer ownership to */ function proposeOwnership(address newOwner) external virtual onlyOwner { if (newOwner == address(0)) revert InvalidOwnerAddress(); emit OwnershipTransferStarted(newOwner); assembly { sstore(_OWNERSHIP_TRANSFER_SLOT, newOwner) } } /** * @notice Accepts ownership of the contract. * @dev Can only be called by the pending owner */ function acceptOwnership() external virtual { address newOwner = pendingOwner(); if (newOwner != msg.sender) revert InvalidOwner(); _transferOwnership(newOwner); } /** * @notice Internal function to transfer ownership of the contract to a new account `newOwner`. * @dev Called in the constructor to set the initial owner. * @param newOwner The address to transfer ownership to */ function _transferOwnership(address newOwner) internal virtual { if (newOwner == address(0)) revert InvalidOwnerAddress(); emit OwnershipTransferred(newOwner); assembly { sstore(_OWNER_SLOT, newOwner) sstore(_OWNERSHIP_TRANSFER_SLOT, 0) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IPausable } from '../interfaces/IPausable.sol'; /** * @title Pausable * @notice This contract provides a mechanism to halt the execution of specific functions * if a pause condition is activated. */ contract Pausable is IPausable { // uint256(keccak256('paused')) - 1 uint256 internal constant PAUSE_SLOT = 0xee35723ac350a69d2a92d3703f17439cbaadf2f093a21ba5bf5f1a53eb2a14d8; /** * @notice A modifier that throws a Paused custom error if the contract is paused * @dev This modifier should be used with functions that can be paused */ modifier whenNotPaused() { if (paused()) revert Pause(); _; } modifier whenPaused() { if (!paused()) revert NotPaused(); _; } /** * @notice Check if the contract is paused * @return paused_ A boolean representing the pause status. True if paused, false otherwise. */ function paused() public view returns (bool paused_) { assembly { paused_ := sload(PAUSE_SLOT) } } /** * @notice Pauses the contract * @dev This function should be callable by the owner/governance. */ function _pause() internal { _setPaused(true); emit Paused(msg.sender); } /** * @notice Unpauses the contract * @dev This function should be callable by the owner/governance. */ function _unpause() internal { _setPaused(false); emit Unpaused(msg.sender); } /** * @notice Sets the pause status of the contract * @dev This is an internal function, meaning it can only be called from within the contract itself * or from derived contracts. * @param paused_ The new pause status */ function _setPaused(bool paused_) internal { assembly { sstore(PAUSE_SLOT, paused_) } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IRolesBase } from '../interfaces/IRolesBase.sol'; /** * @title RolesBase * @notice A contract module which provides a set if internal functions * for implementing role control features. */ contract RolesBase is IRolesBase { bytes32 internal constant ROLES_PREFIX = keccak256('roles'); bytes32 internal constant PROPOSE_ROLES_PREFIX = keccak256('propose-roles'); /** * @notice Modifier that throws an error if called by any account missing the role. */ modifier onlyRole(uint8 role) { if (!_hasRole(_getRoles(msg.sender), role)) revert MissingRole(msg.sender, role); _; } /** * @notice Modifier that throws an error if called by an account without all the roles. */ modifier withEveryRole(uint8[] memory roles) { uint256 accountRoles = _toAccountRoles(roles); if (!_hasAllTheRoles(_getRoles(msg.sender), accountRoles)) revert MissingAllRoles(msg.sender, accountRoles); _; } /** * @notice Modifier that throws an error if called by an account without any of the roles. */ modifier withAnyRole(uint8[] memory roles) { uint256 accountRoles = _toAccountRoles(roles); if (!_hasAnyOfRoles(_getRoles(msg.sender), accountRoles)) revert MissingAnyOfRoles(msg.sender, accountRoles); _; } /** * @notice Checks if an account has a role. * @param account The address to check * @param role The role to check * @return True if the account has the role, false otherwise */ function hasRole(address account, uint8 role) public view returns (bool) { return _hasRole(_getRoles(account), role); } /** * @notice Internal function to convert an array of roles to a uint256. * @param roles The roles to convert * @return accountRoles The roles in uint256 format */ function _toAccountRoles(uint8[] memory roles) internal pure returns (uint256) { uint256 length = roles.length; uint256 accountRoles; for (uint256 i = 0; i < length; ++i) { accountRoles |= (1 << roles[i]); } return accountRoles; } /** * @notice Internal function to get the key of the roles mapping. * @param account The address to get the key for * @return key The key of the roles mapping */ function _rolesKey(address account) internal view virtual returns (bytes32 key) { return keccak256(abi.encodePacked(ROLES_PREFIX, account)); } /** * @notice Internal function to get the roles of an account. * @param account The address to get the roles for * @return accountRoles The roles of the account in uint256 format */ function _getRoles(address account) internal view returns (uint256 accountRoles) { bytes32 key = _rolesKey(account); assembly { accountRoles := sload(key) } } /** * @notice Internal function to set the roles of an account. * @param account The address to set the roles for * @param accountRoles The roles to set */ function _setRoles(address account, uint256 accountRoles) private { bytes32 key = _rolesKey(account); assembly { sstore(key, accountRoles) } } /** * @notice Internal function to get the key of the proposed roles mapping. * @param fromAccount The address of the current role * @param toAccount The address of the pending role * @return key The key of the proposed roles mapping */ function _proposalKey(address fromAccount, address toAccount) internal view virtual returns (bytes32 key) { return keccak256(abi.encodePacked(PROPOSE_ROLES_PREFIX, fromAccount, toAccount)); } /** * @notice Internal function to get the proposed roles of an account. * @param fromAccount The address of the current role * @param toAccount The address of the pending role * @return proposedRoles_ The proposed roles of the account in uint256 format */ function _getProposedRoles(address fromAccount, address toAccount) internal view returns (uint256 proposedRoles_) { bytes32 key = _proposalKey(fromAccount, toAccount); assembly { proposedRoles_ := sload(key) } } /** * @notice Internal function to set the proposed roles of an account. * @param fromAccount The address of the current role * @param toAccount The address of the pending role * @param proposedRoles_ The proposed roles to set in uint256 format */ function _setProposedRoles( address fromAccount, address toAccount, uint256 proposedRoles_ ) private { bytes32 key = _proposalKey(fromAccount, toAccount); assembly { sstore(key, proposedRoles_) } } /** * @notice Internal function to add a role to an account. * @dev emits a RolesAdded event. * @param account The address to add the role to * @param role The role to add */ function _addRole(address account, uint8 role) internal { _addAccountRoles(account, 1 << role); } /** * @notice Internal function to add roles to an account. * @dev emits a RolesAdded event. * @dev Called in the constructor to set the initial roles. * @param account The address to add roles to * @param roles The roles to add */ function _addRoles(address account, uint8[] memory roles) internal { _addAccountRoles(account, _toAccountRoles(roles)); } /** * @notice Internal function to add roles to an account. * @dev emits a RolesAdded event. * @dev Called in the constructor to set the initial roles. * @param account The address to add roles to * @param accountRoles The roles to add */ function _addAccountRoles(address account, uint256 accountRoles) internal { uint256 newAccountRoles = _getRoles(account) | accountRoles; _setRoles(account, newAccountRoles); emit RolesAdded(account, accountRoles); } /** * @notice Internal function to remove a role from an account. * @dev emits a RolesRemoved event. * @param account The address to remove the role from * @param role The role to remove */ function _removeRole(address account, uint8 role) internal { _removeAccountRoles(account, 1 << role); } /** * @notice Internal function to remove roles from an account. * @dev emits a RolesRemoved event. * @param account The address to remove roles from * @param roles The roles to remove */ function _removeRoles(address account, uint8[] memory roles) internal { _removeAccountRoles(account, _toAccountRoles(roles)); } /** * @notice Internal function to remove roles from an account. * @dev emits a RolesRemoved event. * @param account The address to remove roles from * @param accountRoles The roles to remove */ function _removeAccountRoles(address account, uint256 accountRoles) internal { uint256 newAccountRoles = _getRoles(account) & ~accountRoles; _setRoles(account, newAccountRoles); emit RolesRemoved(account, accountRoles); } /** * @notice Internal function to check if an account has a role. * @param accountRoles The roles of the account in uint256 format * @param role The role to check * @return True if the account has the role, false otherwise */ function _hasRole(uint256 accountRoles, uint8 role) internal pure returns (bool) { return accountRoles & (1 << role) != 0; } /** * @notice Internal function to check if an account has all the roles. * @param hasAccountRoles The roles of the account in uint256 format * @param mustHaveAccountRoles The roles the account must have * @return True if the account has all the roles, false otherwise */ function _hasAllTheRoles(uint256 hasAccountRoles, uint256 mustHaveAccountRoles) internal pure returns (bool) { return (hasAccountRoles & mustHaveAccountRoles) == mustHaveAccountRoles; } /** * @notice Internal function to check if an account has any of the roles. * @param hasAccountRoles The roles of the account in uint256 format * @param mustHaveAnyAccountRoles The roles to check in uint256 format * @return True if the account has any of the roles, false otherwise */ function _hasAnyOfRoles(uint256 hasAccountRoles, uint256 mustHaveAnyAccountRoles) internal pure returns (bool) { return (hasAccountRoles & mustHaveAnyAccountRoles) != 0; } /** * @notice Internal function to propose to transfer roles of message sender to a new account. * @dev Original account must have all the proposed roles. * @dev Emits a RolesProposed event. * @dev Roles are not transferred until the new role accepts the role transfer. * @param fromAccount The address of the current roles * @param toAccount The address to transfer roles to * @param role The role to transfer */ function _proposeRole( address fromAccount, address toAccount, uint8 role ) internal { _proposeAccountRoles(fromAccount, toAccount, 1 << role); } /** * @notice Internal function to propose to transfer roles of message sender to a new account. * @dev Original account must have all the proposed roles. * @dev Emits a RolesProposed event. * @dev Roles are not transferred until the new role accepts the role transfer. * @param fromAccount The address of the current roles * @param toAccount The address to transfer roles to * @param roles The roles to transfer */ function _proposeRoles( address fromAccount, address toAccount, uint8[] memory roles ) internal { _proposeAccountRoles(fromAccount, toAccount, _toAccountRoles(roles)); } /** * @notice Internal function to propose to transfer roles of message sender to a new account. * @dev Original account must have all the proposed roles. * @dev Emits a RolesProposed event. * @dev Roles are not transferred until the new role accepts the role transfer. * @param fromAccount The address of the current roles * @param toAccount The address to transfer roles to * @param accountRoles The account roles to transfer */ function _proposeAccountRoles( address fromAccount, address toAccount, uint256 accountRoles ) internal { if (!_hasAllTheRoles(_getRoles(fromAccount), accountRoles)) revert MissingAllRoles(fromAccount, accountRoles); _setProposedRoles(fromAccount, toAccount, accountRoles); emit RolesProposed(fromAccount, toAccount, accountRoles); } /** * @notice Internal function to accept roles transferred from another account. * @dev Pending account needs to pass all the proposed roles. * @dev Emits RolesRemoved and RolesAdded events. * @param fromAccount The address of the current role * @param role The role to accept */ function _acceptRole( address fromAccount, address toAccount, uint8 role ) internal virtual { _acceptAccountRoles(fromAccount, toAccount, 1 << role); } /** * @notice Internal function to accept roles transferred from another account. * @dev Pending account needs to pass all the proposed roles. * @dev Emits RolesRemoved and RolesAdded events. * @param fromAccount The address of the current role * @param roles The roles to accept */ function _acceptRoles( address fromAccount, address toAccount, uint8[] memory roles ) internal virtual { _acceptAccountRoles(fromAccount, toAccount, _toAccountRoles(roles)); } /** * @notice Internal function to accept roles transferred from another account. * @dev Pending account needs to pass all the proposed roles. * @dev Emits RolesRemoved and RolesAdded events. * @param fromAccount The address of the current role * @param accountRoles The account roles to accept */ function _acceptAccountRoles( address fromAccount, address toAccount, uint256 accountRoles ) internal virtual { if (_getProposedRoles(fromAccount, toAccount) != accountRoles) { revert InvalidProposedRoles(fromAccount, toAccount, accountRoles); } _setProposedRoles(fromAccount, toAccount, 0); _transferAccountRoles(fromAccount, toAccount, accountRoles); } /** * @notice Internal function to transfer roles from one account to another. * @dev Original account must have all the proposed roles. * @param fromAccount The address of the current role * @param toAccount The address to transfer role to * @param role The role to transfer */ function _transferRole( address fromAccount, address toAccount, uint8 role ) internal { _transferAccountRoles(fromAccount, toAccount, 1 << role); } /** * @notice Internal function to transfer roles from one account to another. * @dev Original account must have all the proposed roles. * @param fromAccount The address of the current role * @param toAccount The address to transfer role to * @param roles The roles to transfer */ function _transferRoles( address fromAccount, address toAccount, uint8[] memory roles ) internal { _transferAccountRoles(fromAccount, toAccount, _toAccountRoles(roles)); } /** * @notice Internal function to transfer roles from one account to another. * @dev Original account must have all the proposed roles. * @param fromAccount The address of the current role * @param toAccount The address to transfer role to * @param accountRoles The account roles to transfer */ function _transferAccountRoles( address fromAccount, address toAccount, uint256 accountRoles ) internal { if (!_hasAllTheRoles(_getRoles(fromAccount), accountRoles)) revert MissingAllRoles(fromAccount, accountRoles); _removeAccountRoles(fromAccount, accountRoles); _addAccountRoles(toAccount, accountRoles); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IInterchainAddressTracker } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IInterchainAddressTracker.sol'; /** * @title IAddressTracker Interface * @notice This interface allows setting and removing a trusted address for a specific chain. * @dev Extends the IInterchainAddressTracker interface. */ interface IAddressTracker is IInterchainAddressTracker { /** * @notice Sets the trusted address for the specified chain. * @param chain Chain name to be trusted. * @param address_ Trusted address to be added for the chain. */ function setTrustedAddress(string memory chain, string memory address_) external; /** * @notice Remove the trusted address of the chain. * @param chain Chain name to remove the trusted address for. */ function removeTrustedAddress(string calldata chain) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IBaseTokenManager * @notice This contract is defines the base token manager interface implemented by all token managers. */ interface IBaseTokenManager { /** * @notice A function that returns the token id. */ function interchainTokenId() external view returns (bytes32); /** * @notice A function that should return the address of the token. * Must be overridden in the inheriting contract. * @return address address of the token. */ function tokenAddress() external view returns (address); /** * @notice A function that should return the token address from the init params. */ function getTokenAddressFromParams(bytes calldata params) external pure returns (address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title FlowLimit Interface * @notice Interface for flow limit logic for interchain token transfers. */ interface IFlowLimit { error FlowLimitExceeded(uint256 limit, uint256 flowAmount, address tokenManager); event FlowLimitSet(bytes32 indexed tokenId, address operator, uint256 flowLimit_); /** * @notice Returns the current flow limit. * @return flowLimit_ The current flow limit value. */ function flowLimit() external view returns (uint256 flowLimit_); /** * @notice Returns the current flow out amount. * @return flowOutAmount_ The current flow out amount. */ function flowOutAmount() external view returns (uint256 flowOutAmount_); /** * @notice Returns the current flow in amount. * @return flowInAmount_ The current flow in amount. */ function flowInAmount() external view returns (uint256 flowInAmount_); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IInterchainTokenDeployer * @notice This interface is used to deploy new instances of the InterchainTokenProxy contract. */ interface IInterchainTokenDeployer { error AddressZero(); error TokenDeploymentFailed(); /** * @notice Returns the interchain token implementation address. * @return address The interchain token implementation address. */ function implementationAddress() external view returns (address); /** * @notice Returns the interchain token deployment address. * @param salt The deployment salt. * @return tokenAddress The token address. */ function deployedAddress(bytes32 salt) external view returns (address tokenAddress); /** * @notice Deploys a new instance of the InterchainTokenProxy contract. * @param salt The salt used by Create3Deployer. * @param tokenId tokenId of the token. * @param minter Address of the minter. * @param name Name of the token. * @param symbol Symbol of the token. * @param decimals Decimals of the token. * @return tokenAddress Address of the deployed token. */ function deployInterchainToken( bytes32 salt, bytes32 tokenId, address minter, string calldata name, string calldata symbol, uint8 decimals ) external returns (address tokenAddress); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title IInterchainTokenExecutable * @notice Contracts should implement this interface to accept calls from the InterchainTokenService. */ interface IInterchainTokenExecutable { /** * @notice This will be called after the tokens are sent to this contract. * @dev Execution should revert unless the msg.sender is the InterchainTokenService * @param commandId The unique message id for the call. * @param sourceChain The name of the source chain. * @param sourceAddress The address that sent the contract call. * @param data The data to be processed. * @param tokenId The tokenId of the token manager managing the token. * @param token The address of the token. * @param amount The amount of tokens that were sent. * @return bytes32 Hash indicating success of the execution. */ function executeWithInterchainToken( bytes32 commandId, string calldata sourceChain, bytes calldata sourceAddress, bytes calldata data, bytes32 tokenId, address token, uint256 amount ) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IInterchainTokenExecutable } from './IInterchainTokenExecutable.sol'; /** * @title IInterchainTokenExpressExecutable * @notice Contracts should implement this interface to accept express calls from the InterchainTokenService. */ interface IInterchainTokenExpressExecutable is IInterchainTokenExecutable { /** * @notice Executes express logic in the context of an interchain token transfer. * @dev Only callable by the interchain token service. * @param commandId The unique message id for the call. * @param sourceChain The source chain of the token transfer. * @param sourceAddress The source address of the token transfer. * @param data The data associated with the token transfer. * @param tokenId The token ID. * @param token The token address. * @param amount The amount of tokens to be transferred. * @return bytes32 Hash indicating success of the express execution. */ function expressExecuteWithInterchainToken( bytes32 commandId, string calldata sourceChain, bytes calldata sourceAddress, bytes calldata data, bytes32 tokenId, address token, uint256 amount ) external returns (bytes32); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IAxelarValuedExpressExecutable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarValuedExpressExecutable.sol'; import { IMulticall } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IMulticall.sol'; import { IPausable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IPausable.sol'; import { IUpgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IUpgradable.sol'; import { ITransmitInterchainToken } from './ITransmitInterchainToken.sol'; import { ITokenManagerType } from './ITokenManagerType.sol'; import { ITokenManagerImplementation } from './ITokenManagerImplementation.sol'; import { IOperator } from './IOperator.sol'; import { IAddressTracker } from './IAddressTracker.sol'; /** * @title IInterchainTokenService Interface * @notice Interface for the Interchain Token Service */ interface IInterchainTokenService is ITransmitInterchainToken, ITokenManagerType, ITokenManagerImplementation, IAxelarValuedExpressExecutable, IOperator, IPausable, IMulticall, IAddressTracker, IUpgradable { error InvalidTokenManagerImplementationType(address implementation); error InvalidChainName(); error NotRemoteService(); error TokenManagerDoesNotExist(bytes32 tokenId); error NotToken(address caller, address token); error ExecuteWithInterchainTokenFailed(address contractAddress); error ExpressExecuteWithInterchainTokenFailed(address contractAddress); error GatewayToken(); error TokenManagerDeploymentFailed(bytes error); error InterchainTokenDeploymentFailed(bytes error); error InvalidMessageType(uint256 messageType); error InvalidMetadataVersion(uint32 version); error ExecuteWithTokenNotSupported(); error InvalidExpressMessageType(uint256 messageType); error TakeTokenFailed(bytes data); error GiveTokenFailed(bytes data); error TokenHandlerFailed(bytes data); error EmptyData(); error CannotDeploy(TokenManagerType); event InterchainTransfer( bytes32 indexed tokenId, address indexed sourceAddress, string destinationChain, bytes destinationAddress, uint256 amount, bytes32 indexed dataHash ); event InterchainTransferReceived( bytes32 indexed commandId, bytes32 indexed tokenId, string sourceChain, bytes sourceAddress, address indexed destinationAddress, uint256 amount, bytes32 dataHash ); event TokenManagerDeploymentStarted( bytes32 indexed tokenId, string destinationChain, TokenManagerType indexed tokenManagerType, bytes params ); event InterchainTokenDeploymentStarted( bytes32 indexed tokenId, string tokenName, string tokenSymbol, uint8 tokenDecimals, bytes minter, string destinationChain ); event TokenManagerDeployed(bytes32 indexed tokenId, address tokenManager, TokenManagerType indexed tokenManagerType, bytes params); event InterchainTokenDeployed( bytes32 indexed tokenId, address tokenAddress, address indexed minter, string name, string symbol, uint8 decimals ); event InterchainTokenIdClaimed(bytes32 indexed tokenId, address indexed deployer, bytes32 indexed salt); /** * @notice Returns the address of the token manager deployer contract. * @return tokenManagerDeployerAddress The address of the token manager deployer contract. */ function tokenManagerDeployer() external view returns (address tokenManagerDeployerAddress); /** * @notice Returns the address of the interchain token deployer contract. * @return interchainTokenDeployerAddress The address of the interchain token deployer contract. */ function interchainTokenDeployer() external view returns (address interchainTokenDeployerAddress); /** * @notice Returns the address of TokenManager implementation. * @return tokenManagerAddress_ The address of the token manager contract. */ function tokenManager() external view returns (address tokenManagerAddress_); /** * @notice Returns the address of TokenHandler implementation. * @return tokenHandlerAddress The address of the token handler contract. */ function tokenHandler() external view returns (address tokenHandlerAddress); /** * @notice Returns the address of the interchain token factory. * @return address The address of the interchain token factory. */ function interchainTokenFactory() external view returns (address); /** * @notice Returns the hash of the chain name. * @return bytes32 The hash of the chain name. */ function chainNameHash() external view returns (bytes32); /** * @notice Returns the address of the token manager associated with the given tokenId. * @param tokenId The tokenId of the token manager. * @return tokenManagerAddress_ The address of the token manager. */ function tokenManagerAddress(bytes32 tokenId) external view returns (address tokenManagerAddress_); /** * @notice Returns the address of the valid token manager associated with the given tokenId. * @param tokenId The tokenId of the token manager. * @return tokenManagerAddress_ The address of the valid token manager. */ function validTokenManagerAddress(bytes32 tokenId) external view returns (address tokenManagerAddress_); /** * @notice Returns the address of the token that an existing tokenManager points to. * @param tokenId The tokenId of the token manager. * @return tokenAddress The address of the token. */ function validTokenAddress(bytes32 tokenId) external view returns (address tokenAddress); /** * @notice Returns the address of the interchain token associated with the given tokenId. * @param tokenId The tokenId of the interchain token. * @return tokenAddress The address of the interchain token. */ function interchainTokenAddress(bytes32 tokenId) external view returns (address tokenAddress); /** * @notice Returns the custom tokenId associated with the given operator and salt. * @param operator_ The operator address. * @param salt The salt used for token id calculation. * @return tokenId The custom tokenId associated with the operator and salt. */ function interchainTokenId(address operator_, bytes32 salt) external view returns (bytes32 tokenId); /** * @notice Deploys a custom token manager contract on a remote chain. * @param salt The salt used for token manager deployment. * @param destinationChain The name of the destination chain. * @param tokenManagerType The type of token manager. Cannot be NATIVE_INTERCHAIN_TOKEN. * @param params The deployment parameters. * @param gasValue The gas value for deployment. * @return tokenId The tokenId associated with the token manager. */ function deployTokenManager( bytes32 salt, string calldata destinationChain, TokenManagerType tokenManagerType, bytes calldata params, uint256 gasValue ) external payable returns (bytes32 tokenId); /** * @notice Deploys and registers an interchain token on a remote chain. * @param salt The salt used for token deployment. * @param destinationChain The name of the destination chain. Use '' for this chain. * @param name The name of the interchain tokens. * @param symbol The symbol of the interchain tokens. * @param decimals The number of decimals for the interchain tokens. * @param minter The minter data for mint/burn operations. * @param gasValue The gas value for deployment. * @return tokenId The tokenId corresponding to the deployed InterchainToken. */ function deployInterchainToken( bytes32 salt, string calldata destinationChain, string memory name, string memory symbol, uint8 decimals, bytes memory minter, uint256 gasValue ) external payable returns (bytes32 tokenId); /** * @notice Initiates an interchain transfer of a specified token to a destination chain. * @param tokenId The unique identifier of the token to be transferred. * @param destinationChain The destination chain to send the tokens to. * @param destinationAddress The address on the destination chain to send the tokens to. * @param amount The amount of tokens to be transferred. * @param metadata Optional metadata for the call for additional effects (such as calling a destination contract). */ function interchainTransfer( bytes32 tokenId, string calldata destinationChain, bytes calldata destinationAddress, uint256 amount, bytes calldata metadata, uint256 gasValue ) external payable; /** * @notice Initiates an interchain call contract with interchain token to a destination chain. * @param tokenId The unique identifier of the token to be transferred. * @param destinationChain The destination chain to send the tokens to. * @param destinationAddress The address on the destination chain to send the tokens to. * @param amount The amount of tokens to be transferred. * @param data Additional data to be passed along with the transfer. */ function callContractWithInterchainToken( bytes32 tokenId, string calldata destinationChain, bytes calldata destinationAddress, uint256 amount, bytes calldata data, uint256 gasValue ) external payable; /** * @notice Sets the flow limits for multiple tokens. * @param tokenIds An array of tokenIds. * @param flowLimits An array of flow limits corresponding to the tokenIds. */ function setFlowLimits(bytes32[] calldata tokenIds, uint256[] calldata flowLimits) external; /** * @notice Returns the flow limit for a specific token. * @param tokenId The tokenId of the token. * @return flowLimit_ The flow limit for the token. */ function flowLimit(bytes32 tokenId) external view returns (uint256 flowLimit_); /** * @notice Returns the total amount of outgoing flow for a specific token. * @param tokenId The tokenId of the token. * @return flowOutAmount_ The total amount of outgoing flow for the token. */ function flowOutAmount(bytes32 tokenId) external view returns (uint256 flowOutAmount_); /** * @notice Returns the total amount of incoming flow for a specific token. * @param tokenId The tokenId of the token. * @return flowInAmount_ The total amount of incoming flow for the token. */ function flowInAmount(bytes32 tokenId) external view returns (uint256 flowInAmount_); /** * @notice Allows the owner to pause/unpause the token service. * @param paused whether to pause or unpause. */ function setPauseStatus(bool paused) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IRolesBase } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IRolesBase.sol'; /** * @title IOperator Interface * @notice An interface for a contract module which provides a basic access control mechanism, where * there is an account (a operator) that can be granted exclusive access to specific functions. */ interface IOperator is IRolesBase { /** * @notice Change the operator of the contract. * @dev Can only be called by the current operator. * @param operator_ The address of the new operator. */ function transferOperatorship(address operator_) external; /** * @notice Proposed a change of the operator of the contract. * @dev Can only be called by the current operator. * @param operator_ The address of the new operator. */ function proposeOperatorship(address operator_) external; /** * @notice Accept a proposed change of operatorship. * @dev Can only be called by the proposed operator. * @param fromOperator The previous operator of the contract. */ function acceptOperatorship(address fromOperator) external; /** * @notice Query if an address is a operator. * @param addr The address to query for. * @return bool Boolean value representing whether or not the address is an operator. */ function isOperator(address addr) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ITokenHandler Interface * @notice This interface is responsible for handling tokens before initiating an interchain token transfer, or after receiving one. */ interface ITokenHandler { error UnsupportedTokenManagerType(uint256 tokenManagerType); /** * @notice This function gives token to a specified address from the token manager. * @param tokenManagerType The token manager type. * @param tokenAddress The address of the token to give. * @param tokenManager The address of the token manager. * @param to The address to give tokens to. * @param amount The amount of tokens to give. * @return uint256 The amount of token actually given, which could be different for certain token type. */ function giveToken( uint256 tokenManagerType, address tokenAddress, address tokenManager, address to, uint256 amount ) external payable returns (uint256); /** * @notice This function takes token from a specified address to the token manager. * @param tokenManagerType The token manager type. * @param tokenAddress The address of the token to give. * @param tokenManager The address of the token manager. * @param from The address to take tokens from. * @param amount The amount of token to take. * @return uint256 The amount of token actually taken, which could be different for certain token type. */ function takeToken( uint256 tokenManagerType, address tokenAddress, address tokenManager, address from, uint256 amount ) external payable returns (uint256); /** * @notice This function transfers token from and to a specified address. * @param tokenManagerType The token manager type. * @param tokenAddress the address of the token to give. * @param from The address to transfer tokens from. * @param to The address to transfer tokens to. * @param amount The amount of token to transfer. * @return uint256 The amount of token actually transferred, which could be different for certain token type. */ function transferTokenFrom( uint256 tokenManagerType, address tokenAddress, address from, address to, uint256 amount ) external payable returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IImplementation } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IImplementation.sol'; import { IBaseTokenManager } from './IBaseTokenManager.sol'; import { IOperator } from './IOperator.sol'; import { IFlowLimit } from './IFlowLimit.sol'; /** * @title ITokenManager Interface * @notice This contract is responsible for managing tokens, such as setting locking token balances, or setting flow limits, for interchain transfers. */ interface ITokenManager is IBaseTokenManager, IOperator, IFlowLimit, IImplementation { error TokenLinkerZeroAddress(); error NotService(address caller); error TakeTokenFailed(); error GiveTokenFailed(); error NotToken(address caller); error ZeroAddress(); error AlreadyFlowLimiter(address flowLimiter); error NotFlowLimiter(address flowLimiter); error NotSupported(); /** * @notice Returns implementation type of this token manager. * @return uint256 The implementation type of this token manager. */ function implementationType() external view returns (uint256); function addFlowIn(uint256 amount) external; function addFlowOut(uint256 amount) external; /** * @notice This function adds a flow limiter for this TokenManager. * @dev Can only be called by the operator. * @param flowLimiter the address of the new flow limiter. */ function addFlowLimiter(address flowLimiter) external; /** * @notice This function removes a flow limiter for this TokenManager. * @dev Can only be called by the operator. * @param flowLimiter the address of an existing flow limiter. */ function removeFlowLimiter(address flowLimiter) external; /** * @notice Query if an address is a flow limiter. * @param addr The address to query for. * @return bool Boolean value representing whether or not the address is a flow limiter. */ function isFlowLimiter(address addr) external view returns (bool); /** * @notice This function sets the flow limit for this TokenManager. * @dev Can only be called by the flow limiters. * @param flowLimit_ The maximum difference between the tokens flowing in and/or out at any given interval of time (6h). */ function setFlowLimit(uint256 flowLimit_) external; /** * @notice A function to renew approval to the service if we need to. */ function approveService() external; /** * @notice Getter function for the parameters of a lock/unlock TokenManager. * @dev This function will be mainly used by frontends. * @param operator_ The operator of the TokenManager. * @param tokenAddress_ The token to be managed. * @return params_ The resulting params to be passed to custom TokenManager deployments. */ function params(bytes calldata operator_, address tokenAddress_) external pure returns (bytes memory params_); /** * @notice External function to allow the service to mint tokens through the tokenManager * @dev This function should revert if called by anyone but the service. * @param tokenAddress_ The address of the token, since its cheaper to pass it in instead of reading it as the token manager. * @param to The recipient. * @param amount The amount to mint. */ function mintToken(address tokenAddress_, address to, uint256 amount) external; /** * @notice External function to allow the service to burn tokens through the tokenManager * @dev This function should revert if called by anyone but the service. * @param tokenAddress_ The address of the token, since its cheaper to pass it in instead of reading it as the token manager. * @param from The address to burn the token from. * @param amount The amount to burn. */ function burnToken(address tokenAddress_, address from, uint256 amount) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ITokenManagerDeployer Interface * @notice This interface is used to deploy new instances of the TokenManagerProxy contract. */ interface ITokenManagerDeployer { error AddressZero(); error TokenManagerDeploymentFailed(); /** * @notice Deploys a new instance of the TokenManagerProxy contract. * @param tokenId The token ID. * @param implementationType Token manager implementation type. * @param params Additional parameters used in the setup of the token manager. * @return tokenManager Address of the deployed tokenManager. */ function deployTokenManager( bytes32 tokenId, uint256 implementationType, bytes calldata params ) external payable returns (address tokenManager); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ITokenManagerImplementation Interface * @notice Interface for returning the token manager implementation type. */ interface ITokenManagerImplementation { /** * @notice Returns the implementation address for a given token manager type. * @param tokenManagerType The type of token manager. * @return tokenManagerAddress_ The address of the token manager implementation. */ function tokenManagerImplementation(uint256 tokenManagerType) external view returns (address tokenManagerAddress_); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { IProxy } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IProxy.sol'; /** * @title ITokenManagerProxy Interface * @notice This interface is for a proxy for token manager contracts. */ interface ITokenManagerProxy is IProxy { error ZeroAddress(); /** * @notice Returns implementation type of this token manager. * @return uint256 The implementation type of this token manager. */ function implementationType() external view returns (uint256); /** * @notice Returns the interchain token ID of the token manager. * @return bytes32 The interchain token ID of the token manager. */ function interchainTokenId() external view returns (bytes32); /** * @notice Returns token address that this token manager manages. * @return address The token address. */ function tokenAddress() external view returns (address); /** * @notice Returns implementation type and token address. * @return uint256 The implementation type. * @return address The token address. */ function getImplementationTypeAndTokenAddress() external view returns (uint256, address); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ITokenManagerType Interface * @notice A simple interface that defines all the token manager types. */ interface ITokenManagerType { enum TokenManagerType { NATIVE_INTERCHAIN_TOKEN, // This type is reserved for interchain tokens deployed by ITS, and can't be used by custom token managers. MINT_BURN_FROM, // The token will be minted/burned on transfers. The token needs to give mint permission to the token manager, but burning happens via an approval. LOCK_UNLOCK, // The token will be locked/unlocked at the token manager. LOCK_UNLOCK_FEE, // The token will be locked/unlocked at the token manager, which will account for any fee-on-transfer behaviour. MINT_BURN // The token will be minted/burned on transfers. The token needs to give mint and burn permission to the token manager. } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title ITransmitInterchainToken Interface * @notice Interface for transmiting interchain tokens via the interchain token service */ interface ITransmitInterchainToken { /** * @notice Transmit an interchain transfer for the given tokenId. * @dev Only callable by a token registered under a tokenId. * @param tokenId The tokenId of the token (which must be the msg.sender). * @param sourceAddress The address where the token is coming from. * @param destinationChain The name of the chain to send tokens to. * @param destinationAddress The destinationAddress for the interchainTransfer. * @param amount The amount of token to give. * @param metadata Optional metadata for the call for additional effects (such as calling a destination contract). */ function transmitInterchainTransfer( bytes32 tokenId, address sourceAddress, string calldata destinationChain, bytes memory destinationAddress, uint256 amount, bytes calldata metadata ) external payable; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import { RolesBase } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/RolesBase.sol'; import { IOperator } from '../interfaces/IOperator.sol'; import { RolesConstants } from './RolesConstants.sol'; /** * @title Operator Contract * @notice A contract module which provides a basic access control mechanism, where * there is an account (a operator) that can be granted exclusive access to * specific functions. * @dev This module is used through inheritance. */ contract Operator is IOperator, RolesBase, RolesConstants { /** * @notice Internal function that stores the new operator address in the correct storage slot * @param operator The address of the new operator */ function _addOperator(address operator) internal { _addRole(operator, uint8(Roles.OPERATOR)); } /** * @notice Change the operator of the contract. * @dev Can only be called by the current operator. * @param operator The address of the new operator. */ function transferOperatorship(address operator) external onlyRole(uint8(Roles.OPERATOR)) { _transferRole(msg.sender, operator, uint8(Roles.OPERATOR)); } /** * @notice Propose a change of the operator of the contract. * @dev Can only be called by the current operator. * @param operator The address of the new operator. */ function proposeOperatorship(address operator) external onlyRole(uint8(Roles.OPERATOR)) { _proposeRole(msg.sender, operator, uint8(Roles.OPERATOR)); } /** * @notice Accept a proposed change of operatorship. * @dev Can only be called by the proposed operator. * @param fromOperator The previous operator of the contract. */ function acceptOperatorship(address fromOperator) external { _acceptRole(fromOperator, msg.sender, uint8(Roles.OPERATOR)); } /** * @notice Query if an address is a operator. * @param addr The address to query for. * @return bool Boolean value representing whether or not the address is an operator. */ function isOperator(address addr) external view returns (bool) { return hasRole(addr, uint8(Roles.OPERATOR)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @title RolesConstants * @notice This contract contains enum values representing different contract roles. */ contract RolesConstants { enum Roles { MINTER, OPERATOR, FLOW_LIMITER } }
{ "evmVersion": "london", "optimizer": { "enabled": true, "runs": 1000, "details": { "peephole": true, "inliner": true, "jumpdestRemover": true, "orderLiterals": true, "deduplicate": true, "cse": true, "constantOptimizer": true, "yul": true, "yulDetails": { "stackAllocation": true } } }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"tokenManagerDeployer_","type":"address"},{"internalType":"address","name":"interchainTokenDeployer_","type":"address"},{"internalType":"address","name":"gateway_","type":"address"},{"internalType":"address","name":"gasService_","type":"address"},{"internalType":"address","name":"interchainTokenFactory_","type":"address"},{"internalType":"string","name":"chainName_","type":"string"},{"internalType":"address","name":"tokenManagerImplementation_","type":"address"},{"internalType":"address","name":"tokenHandler_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyExecuted","type":"error"},{"inputs":[{"internalType":"enum ITokenManagerType.TokenManagerType","name":"","type":"uint8"}],"name":"CannotDeploy","type":"error"},{"inputs":[],"name":"EmptyData","type":"error"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"ExecuteWithInterchainTokenFailed","type":"error"},{"inputs":[],"name":"ExecuteWithTokenNotSupported","type":"error"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"}],"name":"ExpressExecuteWithInterchainTokenFailed","type":"error"},{"inputs":[],"name":"ExpressExecutorAlreadySet","type":"error"},{"inputs":[],"name":"GatewayToken","type":"error"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"GiveTokenFailed","type":"error"},{"inputs":[],"name":"InsufficientValue","type":"error"},{"inputs":[{"internalType":"bytes","name":"error","type":"bytes"}],"name":"InterchainTokenDeploymentFailed","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[{"internalType":"bytes","name":"bytesAddress","type":"bytes"}],"name":"InvalidBytesLength","type":"error"},{"inputs":[],"name":"InvalidChainName","type":"error"},{"inputs":[],"name":"InvalidCodeHash","type":"error"},{"inputs":[{"internalType":"uint256","name":"messageType","type":"uint256"}],"name":"InvalidExpressMessageType","type":"error"},{"inputs":[],"name":"InvalidImplementation","type":"error"},{"inputs":[{"internalType":"uint256","name":"messageType","type":"uint256"}],"name":"InvalidMessageType","type":"error"},{"inputs":[{"internalType":"uint32","name":"version","type":"uint32"}],"name":"InvalidMetadataVersion","type":"error"},{"inputs":[],"name":"InvalidOwner","type":"error"},{"inputs":[],"name":"InvalidOwnerAddress","type":"error"},{"inputs":[{"internalType":"address","name":"fromAccount","type":"address"},{"internalType":"address","name":"toAccount","type":"address"},{"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"InvalidProposedRoles","type":"error"},{"inputs":[{"internalType":"address","name":"implementation","type":"address"}],"name":"InvalidTokenManagerImplementationType","type":"error"},{"inputs":[],"name":"LengthMismatch","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"MissingAllRoles","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"MissingAnyOfRoles","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint8","name":"role","type":"uint8"}],"name":"MissingRole","type":"error"},{"inputs":[],"name":"MulticallFailed","type":"error"},{"inputs":[],"name":"NotApprovedByGateway","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"inputs":[],"name":"NotPaused","type":"error"},{"inputs":[],"name":"NotProxy","type":"error"},{"inputs":[],"name":"NotRemoteService","type":"error"},{"inputs":[{"internalType":"address","name":"caller","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"NotToken","type":"error"},{"inputs":[],"name":"Pause","type":"error"},{"inputs":[],"name":"SetupFailed","type":"error"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"TakeTokenFailed","type":"error"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"TokenHandlerFailed","type":"error"},{"inputs":[{"internalType":"bytes","name":"error","type":"bytes"}],"name":"TokenManagerDeploymentFailed","type":"error"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"TokenManagerDoesNotExist","type":"error"},{"inputs":[],"name":"UntrustedChain","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"inputs":[],"name":"ZeroStringLength","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutedWithToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutionFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"string","name":"sourceAddress","type":"string"},{"indexed":false,"internalType":"bytes32","name":"payloadHash","type":"bytes32"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":true,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"address","name":"expressExecutor","type":"address"}],"name":"ExpressExecutionWithTokenFulfilled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":true,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"string","name":"name","type":"string"},{"indexed":false,"internalType":"string","name":"symbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"decimals","type":"uint8"}],"name":"InterchainTokenDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"tokenName","type":"string"},{"indexed":false,"internalType":"string","name":"tokenSymbol","type":"string"},{"indexed":false,"internalType":"uint8","name":"tokenDecimals","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"minter","type":"bytes"},{"indexed":false,"internalType":"string","name":"destinationChain","type":"string"}],"name":"InterchainTokenDeploymentStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"deployer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"InterchainTokenIdClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"sourceAddress","type":"address"},{"indexed":false,"internalType":"string","name":"destinationChain","type":"string"},{"indexed":false,"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"InterchainTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"commandId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"sourceChain","type":"string"},{"indexed":false,"internalType":"bytes","name":"sourceAddress","type":"bytes"},{"indexed":true,"internalType":"address","name":"destinationAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"dataHash","type":"bytes32"}],"name":"InterchainTransferReceived","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"RolesAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"fromAccount","type":"address"},{"indexed":true,"internalType":"address","name":"toAccount","type":"address"},{"indexed":false,"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"RolesProposed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"accountRoles","type":"uint256"}],"name":"RolesRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":false,"internalType":"address","name":"tokenManager","type":"address"},{"indexed":true,"internalType":"enum ITokenManagerType.TokenManagerType","name":"tokenManagerType","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"params","type":"bytes"}],"name":"TokenManagerDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"indexed":false,"internalType":"string","name":"destinationChain","type":"string"},{"indexed":true,"internalType":"enum ITokenManagerType.TokenManagerType","name":"tokenManagerType","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"params","type":"bytes"}],"name":"TokenManagerDeploymentStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"chain","type":"string"}],"name":"TrustedAddressRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"chain","type":"string"},{"indexed":false,"internalType":"string","name":"address_","type":"string"}],"name":"TrustedAddressSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newImplementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[{"internalType":"address","name":"fromOperator","type":"address"}],"name":"acceptOperatorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"internalType":"string","name":"destinationChain","type":"string"},{"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"gasValue","type":"uint256"}],"name":"callContractWithInterchainToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"chainName","outputs":[{"internalType":"string","name":"chainName_","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"chainNameHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"sourceChain","type":"string"},{"internalType":"string","name":"sourceAddress","type":"string"},{"internalType":"bytes","name":"payload","type":"bytes"}],"name":"contractCallValue","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"contractCallWithTokenValue","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"contractId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"string","name":"destinationChain","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint8","name":"decimals","type":"uint8"},{"internalType":"bytes","name":"minter","type":"bytes"},{"internalType":"uint256","name":"gasValue","type":"uint256"}],"name":"deployInterchainToken","outputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"string","name":"destinationChain","type":"string"},{"internalType":"enum ITokenManagerType.TokenManagerType","name":"tokenManagerType","type":"uint8"},{"internalType":"bytes","name":"params","type":"bytes"},{"internalType":"uint256","name":"gasValue","type":"uint256"}],"name":"deployTokenManager","outputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"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"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"executeWithToken","outputs":[],"stateMutability":"pure","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":"","type":"bytes32"},{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"expressExecuteWithToken","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"flowInAmount","outputs":[{"internalType":"uint256","name":"flowInAmount_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"flowLimit","outputs":[{"internalType":"uint256","name":"flowLimit_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"flowOutAmount","outputs":[{"internalType":"uint256","name":"flowOutAmount_","type":"uint256"}],"stateMutability":"view","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":"address","name":"account","type":"address"},{"internalType":"uint8","name":"role","type":"uint8"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"implementation_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"interchainTokenAddress","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainTokenDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"interchainTokenFactory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"}],"name":"interchainTokenId","outputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"internalType":"string","name":"destinationChain","type":"string"},{"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"metadata","type":"bytes"},{"internalType":"uint256","name":"gasValue","type":"uint256"}],"name":"interchainTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"},{"internalType":"string","name":"address_","type":"string"}],"name":"isTrustedAddress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"paused_","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"owner_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"proposeOperatorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"proposeOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"}],"name":"removeTrustedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"tokenIds","type":"bytes32[]"},{"internalType":"uint256[]","name":"flowLimits","type":"uint256[]"}],"name":"setFlowLimits","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPauseStatus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"},{"internalType":"string","name":"address_","type":"string"}],"name":"setTrustedAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenHandler","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"tokenManagerAddress","outputs":[{"internalType":"address","name":"tokenManagerAddress_","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenManagerDeployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokenManagerImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"transferOperatorship","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"},{"internalType":"address","name":"sourceAddress","type":"address"},{"internalType":"string","name":"destinationChain","type":"string"},{"internalType":"bytes","name":"destinationAddress","type":"bytes"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"metadata","type":"bytes"}],"name":"transmitInterchainTransfer","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"}],"name":"trustedAddress","outputs":[{"internalType":"string","name":"trustedAddress_","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"}],"name":"trustedAddressHash","outputs":[{"internalType":"bytes32","name":"trustedAddressHash_","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes32","name":"newImplementationCodeHash","type":"bytes32"},{"internalType":"bytes","name":"params","type":"bytes"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"validTokenAddress","outputs":[{"internalType":"address","name":"tokenAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"tokenId","type":"bytes32"}],"name":"validTokenManagerAddress","outputs":[{"internalType":"address","name":"tokenManagerAddress_","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6101c06040523480156200001257600080fd5b5060405162005ee438038062005ee4833981016040819052620000359162000272565b600162000042816200018d565b5030608052604051620000586020820162000231565b601f1982820381018352601f9091011660405280516020919091012060a0526001600160a01b03851615806200009557506001600160a01b038816155b80620000a857506001600160a01b038716155b80620000bb57506001600160a01b038616155b80620000ce57506001600160a01b038416155b80620000e157506001600160a01b038216155b80620000f457506001600160a01b038116155b15620001135760405163d92e233d60e01b815260040160405180910390fd5b6001600160a01b0380871660c05285811660e052888116610160528781166101405284166101005282516000036200015e57604051630470832760e11b815260040160405180910390fd5b8251602090930192909220610120526001600160a01b0390811661018052166101a05250620003ca9350505050565b6001600160a01b038116620001b557604051633649397d60e21b815260040160405180910390fd5b6040516001600160a01b038216907f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616390600090a27f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05560007f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d155565b6101828062005d6283390190565b80516001600160a01b03811681146200025757600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600080610100898b0312156200029057600080fd5b6200029b896200023f565b97506020620002ac818b016200023f565b9750620002bc60408b016200023f565b9650620002cc60608b016200023f565b9550620002dc60808b016200023f565b60a08b01519095506001600160401b0380821115620002fa57600080fd5b818c0191508c601f8301126200030f57600080fd5b8151818111156200032457620003246200025c565b604051601f8201601f19908116603f011681019083821181831017156200034f576200034f6200025c565b816040528281528f868487010111156200036857600080fd5b600093505b828410156200038c57848401860151818501870152928501926200036d565b6000868483010152809850505050505050620003ab60c08a016200023f565b9150620003bb60e08a016200023f565b90509295985092959890939650565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516158ba620004a8600039600081816103ff0152818161261f0152818161290d015261398801526000818161049401526107200152600081816106580152612dea01526000818161055b015261341c0152600081816107b101526130ce01526000818161098c015281816116420152611fb701526000818161062401528181613ba80152613c6901526000818161036c01528181610df5015281816111a60152613d0e015260006136a20152600061175201526158ba6000f3fe6080604052600436106103555760003560e01c8063864a0dcf116101bb578063c8bb7067116100f7578063e30c397811610095578063e82e71f81161006f578063e82e71f814610a96578063f2fde38b14610ab6578063f8c8a82614610ad6578063ffd5982a14610af657600080fd5b8063e30c397814610a34578063e4a974cc14610a68578063e7e3ffc814610a7657600080fd5b8063da081c73116100d1578063da081c73146109ce578063da4886df146109e1578063dc88dfd114610a01578063e1d40c7714610a2157600080fd5b8063c8bb70671461095a578063ca58b6441461097a578063d8dab96b146109ae57600080fd5b80639f409d7711610164578063ac9650d81161013e578063ac9650d8146108da578063c38bb537146108fa578063c506bff41461091a578063c7e6a3cc1461093a57600080fd5b80639f409d771461087a578063a3499c731461089a578063a5269ef1146108ba57600080fd5b806395a8c58d1161019557806395a8c58d1461082757806398d78c82146108475780639ded06df1461085a57600080fd5b8063864a0dcf1461079f578063868a166d146107d35780638da5cb5b146107f357600080fd5b80635a6fd76e116102955780636f3eef621161023357806379ba50971161020d57806379ba5097146106ed5780637e151fa6146107025780638291286c1461074257806383d296961461077f57600080fd5b80636f3eef621461069a57806370756cde146106ba578063710bf322146106cd57600080fd5b8063656576361161026f57806365657636146105ff5780636a22d8cc146106125780636ac0d112146106465780636d70f7ae1461067a57600080fd5b80635a6fd76e1461057d5780635c60da1b1461059d5780635c975abb146105d157600080fd5b80632a709b141161030257806349160658116102dc57806349160658146104f65780634a6a42d8146105165780634b4578ba146105365780634f9ae6081461054957600080fd5b80632a709b1414610482578063465a09e0146104b6578063477aedc7146104d657600080fd5b80631b3d6e87116103335780631b3d6e87146103ed5780631c93b03a146104215780631f26d7301461044357600080fd5b8063116191b61461035a5780631a083d39146103ab5780631a98b2e0146103cb575b600080fd5b34801561036657600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103b757600080fd5b5061038e6103c6366004614079565b610b16565b3480156103d757600080fd5b506103eb6103e63660046140d4565b610b8d565b005b3480156103f957600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561042d57600080fd5b50610436610ba6565b6040516103a291906141fe565b34801561044f57600080fd5b5061046361045e366004614211565b610bd6565b604080516001600160a01b0390931683526020830191909152016103a2565b34801561048e57600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156104c257600080fd5b506103eb6104d1366004614322565b610bf2565b3480156104e257600080fd5b506104366104f1366004614445565b610d37565b34801561050257600080fd5b506103eb610511366004614482565b610d50565b34801561052257600080fd5b506103eb61053136600461453b565b610faf565b6103eb610544366004614558565b610ff5565b34801561055557600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561058957600080fd5b5061038e610598366004614079565b6110be565b3480156105a957600080fd5b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5461038e565b3480156105dd57600080fd5b50600080516020615865833981519152545b60405190151581526020016103a2565b6103eb61060d366004614482565b611117565b34801561061e57600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561065257600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561068657600080fd5b506105ef61069536600461453b565b6112e1565b3480156106a657600080fd5b506103eb6106b536600461453b565b6112ee565b6103eb6106c8366004614608565b611330565b3480156106d957600080fd5b506103eb6106e836600461453b565b61138f565b3480156106f957600080fd5b506103eb61145e565b34801561070e57600080fd5b5061038e61071d366004614079565b507f000000000000000000000000000000000000000000000000000000000000000090565b34801561074e57600080fd5b507ff407da03daa7b4243ffb261daad9b01d221ea90ab941948cd48101563654ea865b6040519081526020016103a2565b34801561078b57600080fd5b5061046361079a3660046146c2565b6114d8565b3480156107ab57600080fd5b506107717f000000000000000000000000000000000000000000000000000000000000000081565b3480156107df57600080fd5b5061038e6107ee36600461475c565b61158e565b3480156107ff57600080fd5b507f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05461038e565b34801561083357600080fd5b506105ef610842366004614822565b6115b2565b610771610855366004614866565b6115cd565b34801561086657600080fd5b506103eb6108753660046148fc565b61174f565b34801561088657600080fd5b506103eb61089536600461493e565b6117bb565b3480156108a657600080fd5b506103eb6108b53660046149a2565b611815565b3480156108c657600080fd5b506107716108d53660046149f2565b611b07565b6108ed6108e8366004614a1e565b611b6e565b6040516103a29190614a54565b34801561090657600080fd5b506103eb610915366004614ac4565b611cc7565b34801561092657600080fd5b506105ef610935366004614ae1565b611d2d565b34801561094657600080fd5b5061038e610955366004614b41565b611d93565b34801561096657600080fd5b50610771610975366004614079565b611db1565b34801561098657600080fd5b5061038e7f000000000000000000000000000000000000000000000000000000000000000081565b3480156109ba57600080fd5b506107716109c9366004614079565b611e21565b6103eb6109dc36600461475c565b611e6d565b3480156109ed57600080fd5b506103eb6109fc36600461453b565b611f11565b348015610a0d57600080fd5b506103eb610a1c366004614445565b611f1d565b610771610a2f366004614bc3565b611f76565b348015610a4057600080fd5b507f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d15461038e565b6103eb6103e63660046140d4565b348015610a8257600080fd5b50610771610a91366004614079565b612057565b348015610aa257600080fd5b5061038e610ab1366004614079565b6120a3565b348015610ac257600080fd5b506103eb610ad136600461453b565b6120b9565b348015610ae257600080fd5b5061038e610af1366004614079565b612109565b348015610b0257600080fd5b50610771610b11366004614445565b612114565b600080610b22836110be565b9050806001600160a01b0316639d76ea586040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190614c99565b9392505050565b6040516327616c7360e11b815260040160405180910390fd5b6060610bd17f0e2c162a1f4b5cff9fdbd6b34678a9bcb9898a0b9fbca695b112d61688d8b2ac612128565b905090565b6000806040516327616c7360e11b815260040160405180910390fd5b6001610c0d610c00336121bb565b600160ff84161b16151590565b610c3a5760405163bb6c163960e01b815233600482015260ff821660248201526044015b60405180910390fd5b83828114610c74576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610d2e576000610ca2888884818110610c9657610c96614ccc565b905060200201356110be565b9050806001600160a01b031663a56dbe63878785818110610cc557610cc5614ccc565b905060200201356040518263ffffffff1660e01b8152600401610cea91815260200190565b600060405180830381600087803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b505050505080610d2790614ce2565b9050610c77565b50505050505050565b6060610d4a610d45836121c7565b612128565b92915050565b85858585610d6084848484611d2d565b610d7d5760405163157e5fbf60e21b815260040160405180910390fd5b6000805160206158658339815191525415610dab576040516334c2d01160e11b815260040160405180910390fd5b60008686604051610dbd929190614d09565b6040519081900381207f5f6970c300000000000000000000000000000000000000000000000000000000825291506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690635f6970c390610e34908f908f908f908f908f908990600401614d42565b6020604051808303816000875af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e779190614d83565b610ead576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610ebb87890189614079565b905080610f42576000610ed28e8e8e8e8e88612219565b9050610ee28e828f8f8d8d612246565b6001600160a01b03811615610f3c57806001600160a01b03168e7f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418f8f8f8f89604051610f33959493929190614da0565b60405180910390a35b50610fa0565b60028103610f5957610f54888861240e565b610fa0565b60018103610f6b57610f54888861246d565b6040517f495f232e00000000000000000000000000000000000000000000000000000000815260048101829052602401610c31565b50505050505050505050505050565b6001610fbd610c00336121bb565b610fe55760405163bb6c163960e01b815233600482015260ff82166024820152604401610c31565b610ff1338360016124b4565b5050565b6000805160206158658339815191525415611023576040516334c2d01160e11b815260040160405180910390fd5b815160000361105e576040517f99d8fec900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61106b88338560006124ca565b92506110b48833898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508c935091508a905089612762565b5050505050505050565b60006110c982612109565b9050806001600160a01b03163b600003611112576040517f2dd85afc00000000000000000000000000000000000000000000000000000000815260048101839052602401610c31565b919050565b6000805160206158658339815191525415611145576040516334c2d01160e11b815260040160405180910390fd5b600061115382840184614079565b905080156111775760405163e94617f560e01b815260048101829052602401610c31565b6040517fd26ff210000000000000000000000000000000000000000000000000000000008152600481018990527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d26ff21090602401602060405180830381865afa1580156111f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112199190614d83565b15611250576040517f0dc1019700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405133906000906112659086908690614d09565b60405180910390209050816001600160a01b03168a7f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928b8b8b8b876040516112b1959493929190614da0565b60405180910390a36112c88a8a8a8a8a868861280c565b6112d58a8a8a888861286c565b50505050505050505050565b6000610d4a8260016115b2565b60016112fc610c00336121bb565b6113245760405163bb6c163960e01b815233600482015260ff82166024820152604401610c31565b610ff133836001612bf4565b600080516020615865833981519152541561135e576040516334c2d01160e11b815260040160405180910390fd5b61136b88888560016124ca565b925060008061137a8484612c05565b915091506112d58a8a8a8a8a8a888834612762565b336113b87f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b0316146113df576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b03811661140657604051633649397d60e21b815260040160405180910390fd5b6040516001600160a01b038216907fd9be0e8e07417e00f2521db636cb53e316fd288f5051f16d2aa2bf0c3938a87690600090a27f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d155565b60006114887f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d15490565b90506001600160a01b03811633146114cc576040517f49e27cff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114d581612cd8565b50565b600080878787876114eb84848484611d2d565b6115085760405163157e5fbf60e21b815260040160405180910390fd5b6000805160206158658339815191525415611536576040516334c2d01160e11b815260040160405180910390fd5b600080806115468a8c018c614dda565b93505092509250600083146115715760405163e94617f560e01b815260048101849052602401610c31565b61157a82610b16565b9f909e509c50505050505050505050505050565b6000806115a28b8b8b8b8b8b8b8b8b612d7b565b549b9a5050505050505050505050565b6000610b866115c0846121bb565b600160ff85161b16151590565b60006115e56000805160206158658339815191525490565b15611603576040516334c2d01160e11b815260040160405180910390fd5b600085600481111561161757611617614cb6565b036116375784604051630a7dda8360e01b8152600401610c319190614e54565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016810361166c575060005b611676818a611b07565b915088816001600160a01b0316837f04ddbfaa222e81ab9447c070310e87608bf6a4c5d42be5c2fdf0f370b186af7960405160405180910390a460008790036116ff576116fa828787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612de592505050565b611743565b611743828989868a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fce92505050565b50979650505050505050565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316036117b1576040517fbf10dd3a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ff1828261305f565b336117e47f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b03161461180b576040516330cd747160e01b815260040160405180910390fd5b610ff182826131ca565b3361183e7f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611865576040516330cd747160e01b815260040160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b0316638291286c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e89190614e62565b846001600160a01b0316638291286c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194a9190614e62565b14611981576040517f68155f9a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836001600160a01b03163f83146119c4576040517f8f84fb2400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038516907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28015611ae0576000846001600160a01b0316639ded06df60e01b8484604051602401611a25929190614e7b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051611a639190614e8f565b600060405180830381855af49150503d8060008114611a9e576040519150601f19603f3d011682016040523d82523d6000602084013e611aa3565b606091505b5050905080611ade576040517f97905dfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b5050507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b604080517f980c3be34c7ee75cc250c76223092614e21653cdf2faece10ac24fcef821df1060208201526001600160a01b03841691810191909152606081018290526000906080015b60405160208183030381529060405280519060200120905092915050565b60608167ffffffffffffffff811115611b8957611b8961438e565b604051908082528060200260200182016040528015611bbc57816020015b6060815260200190600190039081611ba75790505b5090506000606060005b84811015611cbe5730868683818110611be157611be1614ccc565b9050602002810190611bf39190614eab565b604051611c01929190614d09565b600060405180830381855af49150503d8060008114611c3c576040519150601f19603f3d011682016040523d82523d6000602084013e611c41565b606091505b50909350915082611c8f578151600003611c87576040517f4d6a232800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815182602001fd5b81848281518110611ca257611ca2614ccc565b602002602001018190525080611cb790614ce2565b9050611bc6565b50505092915050565b33611cf07f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611d17576040516330cd747160e01b815260040160405180910390fd5b8015611d25576114d5613279565b6114d56132bd565b6000808383604051611d40929190614d09565b60405180910390209050611d8986868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061211492505050565b1495945050505050565b600080611da4888888888888613301565b5498975050505050505050565b600080611dbd836110be565b9050806001600160a01b0316637dbab19b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190614e62565b600080611e2d836110be565b9050806001600160a01b0316632f3c78886040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b6000805160206158658339815191525415611e9b576040516334c2d01160e11b815260040160405180910390fd5b611ea889338660006124ca565b9350600080611eb78585612c05565b91509150611f048b338c8c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e92508a91508990508b612762565b5050505050505050505050565b6114d581336001613362565b33611f467f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611f6d576040516330cd747160e01b815260040160405180910390fd5b6114d581613373565b6000611f8e6000805160206158658339815191525490565b15611fac576040516334c2d01160e11b815260040160405180910390fd5b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168103611fe1575060005b611feb818b611b07565b9150600088900361203a57600061200583868a8a8a6133f2565b90506120348360008784604051602001612020929190614ef2565b604051602081830303815290604052612de5565b5061204a565b61204a82888888888e8e8a61357f565b5098975050505050505050565b600080612063836110be565b9050806001600160a01b0316638b38b35d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b60006120ae82613613565b9150610d4a8261364e565b336120e27f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b0316146114cc576040516330cd747160e01b815260040160405180910390fd5b6000610d4a8261364e565b60008061212083613750565b549392505050565b606081805461213690614f1d565b80601f016020809104026020016040519081016040528092919081815260200182805461216290614f1d565b80156121af5780601f10612184576101008083540402835291602001916121af565b820191906000526020600020905b81548152906001019060200180831161219257829003601f168201915b50505050509050919050565b60008061212083613785565b60007fa5b4aa1bcb538076d57d083e3004c6907e2eba42d84c21922d441967a02b472f826040516020016121fc929190614f57565b604051602081830303815290604052805190602001209050919050565b60008061222a888888888888613301565b905080549150811561223b57600081555b509695505050505050565b600060608180828061225a87890189614f70565b939a5091985090955090935091506122739050816137d5565b9350506001600160a01b038a161561229c57612290858b8461381c565b50505050505050612406565b60006122a986858561381c565b8092508194505050836001600160a01b0316868d7fbdb65cfd017af0876344138f62bc895163b5fd120cbe6e666ed306afd658de4b8d8d8a8989516000146122f757895160208b01206122fa565b60005b60405161230b959493929190615014565b60405180910390a48151156123ff576000846001600160a01b031663292415028e8d8d8a888d898c6040518963ffffffff1660e01b815260040161235698979695949392919061504f565b6020604051808303816000875af1158015612375573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123999190614e62565b90507fe84001f3dedacf7f9ddc370e9f09c26b37473e9e959ffdc4925f6fe33c9877e48114610fa0576040517f1ef6f3b30000000000000000000000000000000000000000000000000000000081526001600160a01b0386166004820152602401610c31565b5050505050505b505050505050565b6000808061241e848601866150b9565b919550935091506000905082600481111561243b5761243b614cb6565b0361245b5781604051630a7dda8360e01b8152600401610c319190614e54565b612466838383612de5565b5050505050565b60008080808061247f8688018861511a565b9550955095509550955050600061249986838787876133f2565b90506110b48660008484604051602001612020929190614ef2565b6124c58383600160ff85161b613a57565b505050565b6000806124d686612109565b9050600080826001600160a01b031663d4ae3c426040518163ffffffff1660e01b81526004016040805180830381865afa158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c91906151ab565b90925090508480156125575750336001600160a01b03821614155b1561259f576040517f409304db0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0382166024820152604401610c31565b60408051602481018490526001600160a01b0383811660448301528581166064830152898116608483015260a48083018a90528351808403909101815260c490920183526020820180516001600160e01b03167fb2668ef600000000000000000000000000000000000000000000000000000000179052915160009283927f00000000000000000000000000000000000000000000000000000000000000009091169161264c9190614e8f565b600060405180830381855af49150503d8060008114612687576040519150601f19603f3d011682016040523d82523d6000602084013e61268c565b606091505b5091509150816126ca57806040517f1a59c9bd000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b808060200190518101906126de9190614e62565b6040517fdce29136000000000000000000000000000000000000000000000000000000008152600481018290529098506001600160a01b0386169063dce2913690602401600060405180830381600087803b15801561273c57600080fd5b505af1158015612750573d6000803e3d6000fd5b50999c9b505050505050505050505050565b8151156127755781516020830120612778565b60005b886001600160a01b03168a7fcd05f5b9dc4bb03babf40f5da98f5f46819846207d916f89b67d36fd1f7fd74f8a8a8a8a6040516127b894939291906151db565b60405180910390a46000808a6127d68b6001600160a01b0316613aad565b8888876040516020016127ee96959493929190615213565b60405160208183030381529060405290506112d58888838786613adb565b600061281c888888888888613301565b80549091506001600160a01b03811615612862576040517f725f13f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5055505050505050565b60008080808061287e86880188614f70565b95509550955095509550506000612894846137d5565b90506000806128a288612109565b9050806001600160a01b0316639d76ea586040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129069190614c99565b91506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166345537d7060e01b846001600160a01b0316634fdf7cb56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561297b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299f9190614e62565b60405160248101919091526001600160a01b0380881660448301523360648301528816608482015260a481018a905260c40160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612a0f9190614e8f565b600060405180830381855af49150503d8060008114612a4a576040519150601f19603f3d011682016040523d82523d6000602084013e612a4f565b606091505b509150915081612a8d57806040517f3a5cf905000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b80806020019051810190612aa19190614e62565b9650505050816001600160a01b0316878d7fbdb65cfd017af0876344138f62bc895163b5fd120cbe6e666ed306afd658de4b8e8e8b8a8a51600014612aec578a5160208c0120612aef565b60005b604051612b00959493929190615014565b60405180910390a48251156123ff576000826001600160a01b03166377c790258e8e8e8b898e898d6040518963ffffffff1660e01b8152600401612b4b98979695949392919061504f565b6020604051808303816000875af1158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e9190614e62565b90507f692b2deb10f974787eb65450ba9a90dc0bb28141a633fa3fb556d5292fba42e18114610fa0576040517fc646a6230000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610c31565b6124c58383600160ff85161b613d77565b600060606004831015612c1b5760009150612cd1565b6000612c2a600482868861526b565b612c3391615295565b60e01c90506001811115612c625760405163b47a9b4b60e01b815263ffffffff82166004820152602401610c31565b8063ffffffff166001811115612c7a57612c7a614cb6565b92506004849003612c8b5750612cd1565b612c98846004818861526b565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450505050505b9250929050565b6001600160a01b038116612cff57604051633649397d60e21b815260040160405180910390fd5b6040516001600160a01b038216907f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616390600090a27f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05560007f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d155565b60007febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a604051602001612dc09a999897969594939291906152c5565b6040516020818303038152906040528051906020012090509998505050505050505050565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316636519d04b60e01b868686604051602401612e2f9392919061532b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612e6d9190614e8f565b600060405180830381855af49150503d8060008114612ea8576040519150601f19603f3d011682016040523d82523d6000602084013e612ead565b606091505b509150915081612eeb57806040517ff9eef82a000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b60208101516002856004811115612f0457612f04614cb6565b1480612f2157506003856004811115612f1f57612f1f614cb6565b145b15612f7a57806001600160a01b031663274158386040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f6157600080fd5b505af1158015612f75573d6000803e3d6000fd5b505050505b846004811115612f8c57612f8c614cb6565b867f5284c2478b9c1a55e973429331078be39b5fb3eeb9d87d10b34d65a4c89ee4eb8387604051612fbe92919061535a565b60405180910390a3505050505050565b612fd7866110be565b50816004811115612fea57612fea614cb6565b867fc92a73c79b84dd58e39d4e09fbf47f3f8bd145222bfff3d803eec161bed1c19487878560405161301e9392919061537c565b60405180910390a36000600287848460405160200161304094939291906153ac565b6040516020818303038152906040529050610d2e868683600088613adb565b600080808061307085870187615477565b8151939750919550935091506001600160a01b0385166130bc576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835115806130f05750835160208501207f000000000000000000000000000000000000000000000000000000000000000014155b15613127576040517f08e1064e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81518114613161576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61316a85613e0f565b61317384613e1a565b60005b818110156110b4576131ba84828151811061319357613193614ccc565b60200260200101518483815181106131ad576131ad614ccc565b60200260200101516131ca565b6131c381614ce2565b9050613176565b81516000036131ec5760405163deba168960e01b815260040160405180910390fd5b805160000361320e5760405163deba168960e01b815260040160405180910390fd5b61322061321a836121c7565b82613e40565b600061322b83613750565b82516020840120808255604051919250907fdb6b260ea45f7fe513e1d3b8c21017a29e3a41610e95aefb8862b81c69aec61c9061326b9086908690615506565b60405180910390a150505050565b613290600160008051602061586583398151915255565b60405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6132d4600060008051602061586583398151915255565b60405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b60007f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e5878787878787604051602001613340979695949392919061552b565b6040516020818303038152906040528051906020012090509695505050505050565b6124c58383600160ff85161b613e4b565b80516000036133955760405163deba168960e01b815260040160405180910390fd5b6133a66133a1826121c7565b613ebe565b60006133b182613750565b9050600081557ff9400637a329865492b8d0d4dba4eafc7e8d5d0fae5e27b56766816d2ae1b2ca826040516133e691906141fe565b60405180910390a15050565b6000806133fe87613613565b90506000865160001461341757613414876137d5565b90505b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663f575f35b60e01b858c868c8c8c60405160240161346796959493929190615573565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516134a59190614e8f565b600060405180830381855af49150503d80600081146134e0576040519150601f19603f3d011682016040523d82523d6000602084013e6134e5565b606091505b50915091508161352357806040517fc226af8b000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b60208101519450826001600160a01b03168a7ff0d7beb2b03d35e597f432391dc2a6f6eb1a621be6cb5b325f55a49090085239878b8b8b60405161356a94939291906155ca565b60405180910390a35050505095945050505050565b613588886110be565b50877fe470f4bdd33c8676127d3c20ff725d8dc1605609001389ce3a59c28b54b7992f8888888888886040516135c396959493929190615613565b60405180910390a26000600189898989896040516020016135e99695949392919061566a565b6040516020818303038152906040529050613608848483600086613adb565b505050505050505050565b604080517f610507e221586f499adb972fbdbe7f0619bdae0112c78ebaa562448d0ca7071f60208201529081018290526000906060016121fc565b604080517fff0000000000000000000000000000000000000000000000000000000000000060208083019190915230606090811b6bffffffffffffffffffffffff19908116602185015260358401959095527f0000000000000000000000000000000000000000000000000000000000000000605580850191909152845180850390910181526075840185528051908301207fd6940000000000000000000000000000000000000000000000000000000000006095850152901b90931660978201527f010000000000000000000000000000000000000000000000000000000000000060ab8201528151608c81830301815260ac909101909152805191012090565b60007f5f58fea7d48d37d5d1cc2546dfcc3d3cbfe8d758d5ca19c44087f52e15a10505826040516020016121fc929190614f57565b60007fde9bdca322e1a848f72215bc15cf2c87fe7749145789a9ee281a2a6290af26ab826040516020016121fc92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6000815160141461381457816040517fd08dbec5000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b506014015190565b600080600061382a86612109565b9050600080826001600160a01b031663d4ae3c426040518163ffffffff1660e01b81526004016040805180830381865afa15801561386c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061389091906151ab565b6040517f10d8d8e30000000000000000000000000000000000000000000000000000000081526004810189905291935091506001600160a01b038416906310d8d8e390602401600060405180830381600087803b1580156138f057600080fd5b505af1158015613904573d6000803e3d6000fd5b505060408051602481018690526001600160a01b03858116604483015287811660648301528b8116608483015260a48083018c90528351808403909101815260c490920183526020820180516001600160e01b03167f72689126000000000000000000000000000000000000000000000000000000001790529151600094508493507f0000000000000000000000000000000000000000000000000000000000000000909216916139b59190614e8f565b600060405180830381855af49150503d80600081146139f0576040519150601f19603f3d011682016040523d82523d6000602084013e6139f5565b606091505b509150915081613a3357806040517f0f940973000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b80806020019051810190613a479190614e62565b9a92995091975050505050505050565b613a6a613a63846121bb565b8216821490565b613a9957604051631fe9beed60e21b81526001600160a01b038416600482015260248101829052604401610c31565b613aa38382613ec9565b6124c58282613f2b565b6040805160148082528183019092526060916020820181803683375050506014808201939093529182525090565b6000613b1c86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d3792505050565b90508051600003613b59576040517ff9188a6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613cde576000836001811115613b7357613b73614cb6565b03613c20576040517f0c93e3bb0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690630c93e3bb908490613be99030908b908b9088908c9032906004016156b8565b6000604051808303818588803b158015613c0257600080fd5b505af1158015613c16573d6000803e3d6000fd5b5050505050613cde565b6001836001811115613c3457613c34614cb6565b03613caa576040517ff61ed2180000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063f61ed218908490613be99030908b908b9088908c9032906004016156b8565b826001811115613cbc57613cbc614cb6565b60405163b47a9b4b60e01b815263ffffffff9091166004820152602401610c31565b6040517f1c92115f0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631c92115f90613d49908990899086908a90600401615719565b600060405180830381600087803b158015613d6357600080fd5b505af11580156112d5573d6000803e3d6000fd5b613d83613a63846121bb565b613db257604051631fe9beed60e21b81526001600160a01b038416600482015260248101829052604401610c31565b613dbd838383613f7f565b816001600160a01b0316836001600160a01b03167ff7158d1591c2cf17c0e6b9459d86365c47fe0969c79f40ef49e0c437d8f3991483604051613e0291815260200190565b60405180910390a3505050565b6114d5816001613f94565b6114d57f0e2c162a1f4b5cff9fdbd6b34678a9bcb9898a0b9fbca695b112d61688d8b2ac825b816124c582826157a4565b80613e568484613fa4565b14613ea7576040517f6004fe400000000000000000000000000000000000000000000000000000000081526001600160a01b0380851660048301528316602482015260448101829052606401610c31565b613eb383836000613f7f565b6124c5838383613a57565b6114d581600061402b565b60008119613ed6846121bb565b169050613ee38382613fba565b826001600160a01b03167fccf920c8facee98a9c2a6c6124f2857b87b17e9f3a819bfcc6945196ee77366b83604051613f1e91815260200190565b60405180910390a2505050565b600081613f37846121bb565b179050613f448382613fba565b826001600160a01b03167f34e73c57659d4b6809b53db4feee9b007b892e978114eda420d2991aba15014383604051613f1e91815260200190565b6000613f8b8484613fcd565b91909155505050565b610ff182600160ff84161b613f2b565b600080613fb18484613fcd565b54949350505050565b6000613fc583613785565b919091555050565b60007ff96e07b2f4fbb81c31567d2b261589af429e98f0958d53f7e6ad5d63aea0ab7c8383604051602001611b5093929190928352606091821b6bffffffffffffffffffffffff199081166020850152911b16603482015260480190565b50805461403790614f1d565b6000825580601f10614047575050565b601f0160209004906000526020600020908101906114d591905b808211156140755760008155600101614061565b5090565b60006020828403121561408b57600080fd5b5035919050565b60008083601f8401126140a457600080fd5b50813567ffffffffffffffff8111156140bc57600080fd5b602083019150836020828501011115612cd157600080fd5b60008060008060008060008060008060c08b8d0312156140f357600080fd5b8a35995060208b013567ffffffffffffffff8082111561411257600080fd5b61411e8e838f01614092565b909b50995060408d013591508082111561413757600080fd5b6141438e838f01614092565b909950975060608d013591508082111561415c57600080fd5b6141688e838f01614092565b909750955060808d013591508082111561418157600080fd5b5061418e8d828e01614092565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60005b838110156141c95781810151838201526020016141b1565b50506000910152565b600081518084526141ea8160208601602086016141ae565b601f01601f19169290920160200192915050565b602081526000610b8660208301846141d2565b600080600080600080600080600060a08a8c03121561422f57600080fd5b893567ffffffffffffffff8082111561424757600080fd5b6142538d838e01614092565b909b50995060208c013591508082111561426c57600080fd5b6142788d838e01614092565b909950975060408c013591508082111561429157600080fd5b61429d8d838e01614092565b909750955060608c01359150808211156142b657600080fd5b506142c38c828d01614092565b9a9d999c50979a9699959894979660800135949350505050565b60008083601f8401126142ef57600080fd5b50813567ffffffffffffffff81111561430757600080fd5b6020830191508360208260051b8501011115612cd157600080fd5b6000806000806040858703121561433857600080fd5b843567ffffffffffffffff8082111561435057600080fd5b61435c888389016142dd565b9096509450602087013591508082111561437557600080fd5b50614382878288016142dd565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156143cd576143cd61438e565b604052919050565b600082601f8301126143e657600080fd5b813567ffffffffffffffff8111156144005761440061438e565b614413601f8201601f19166020016143a4565b81815284602083860101111561442857600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561445757600080fd5b813567ffffffffffffffff81111561446e57600080fd5b61447a848285016143d5565b949350505050565b60008060008060008060006080888a03121561449d57600080fd5b87359650602088013567ffffffffffffffff808211156144bc57600080fd5b6144c88b838c01614092565b909850965060408a01359150808211156144e157600080fd5b6144ed8b838c01614092565b909650945060608a013591508082111561450657600080fd5b506145138a828b01614092565b989b979a50959850939692959293505050565b6001600160a01b03811681146114d557600080fd5b60006020828403121561454d57600080fd5b8135610b8681614526565b60008060008060008060008060c0898b03121561457457600080fd5b88359750602089013567ffffffffffffffff8082111561459357600080fd5b61459f8c838d01614092565b909950975060408b01359150808211156145b857600080fd5b6145c48c838d01614092565b909750955060608b0135945060808b01359150808211156145e457600080fd5b506145f18b828c016143d5565b92505060a089013590509295985092959890939650565b60008060008060008060008060c0898b03121561462457600080fd5b88359750602089013561463681614526565b9650604089013567ffffffffffffffff8082111561465357600080fd5b61465f8c838d01614092565b909850965060608b013591508082111561467857600080fd5b6146848c838d016143d5565b955060808b0135945060a08b01359150808211156146a157600080fd5b506146ae8b828c01614092565b999c989b5096995094979396929594505050565b600080600080600080606087890312156146db57600080fd5b863567ffffffffffffffff808211156146f357600080fd5b6146ff8a838b01614092565b9098509650602089013591508082111561471857600080fd5b6147248a838b01614092565b9096509450604089013591508082111561473d57600080fd5b5061474a89828a01614092565b979a9699509497509295939492505050565b600080600080600080600080600060c08a8c03121561477a57600080fd5b8935985060208a013567ffffffffffffffff8082111561479957600080fd5b6147a58d838e01614092565b909a50985060408c01359150808211156147be57600080fd5b6147ca8d838e01614092565b909850965060608c0135955060808c01359150808211156147ea57600080fd5b506147f78c828d01614092565b9a9d999c50979a9699959894979660a00135949350505050565b803560ff8116811461111257600080fd5b6000806040838503121561483557600080fd5b823561484081614526565b915061484e60208401614811565b90509250929050565b80356005811061111257600080fd5b600080600080600080600060a0888a03121561488157600080fd5b87359650602088013567ffffffffffffffff808211156148a057600080fd5b6148ac8b838c01614092565b90985096508691506148c060408b01614857565b955060608a01359150808211156148d657600080fd5b506148e38a828b01614092565b989b979a50959894979596608090950135949350505050565b6000806020838503121561490f57600080fd5b823567ffffffffffffffff81111561492657600080fd5b61493285828601614092565b90969095509350505050565b6000806040838503121561495157600080fd5b823567ffffffffffffffff8082111561496957600080fd5b614975868387016143d5565b9350602085013591508082111561498b57600080fd5b50614998858286016143d5565b9150509250929050565b600080600080606085870312156149b857600080fd5b84356149c381614526565b935060208501359250604085013567ffffffffffffffff8111156149e657600080fd5b61438287828801614092565b60008060408385031215614a0557600080fd5b8235614a1081614526565b946020939093013593505050565b60008060208385031215614a3157600080fd5b823567ffffffffffffffff811115614a4857600080fd5b614932858286016142dd565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614aa957603f19888603018452614a978583516141d2565b94509285019290850190600101614a7b565b5092979650505050505050565b80151581146114d557600080fd5b600060208284031215614ad657600080fd5b8135610b8681614ab6565b60008060008060408587031215614af757600080fd5b843567ffffffffffffffff80821115614b0f57600080fd5b614b1b88838901614092565b90965094506020870135915080821115614b3457600080fd5b5061438287828801614092565b60008060008060008060808789031215614b5a57600080fd5b86359550602087013567ffffffffffffffff80821115614b7957600080fd5b614b858a838b01614092565b90975095506040890135915080821115614b9e57600080fd5b50614bab89828a01614092565b979a9699509497949695606090950135949350505050565b60008060008060008060008060e0898b031215614bdf57600080fd5b88359750602089013567ffffffffffffffff80821115614bfe57600080fd5b614c0a8c838d01614092565b909950975060408b0135915080821115614c2357600080fd5b614c2f8c838d016143d5565b965060608b0135915080821115614c4557600080fd5b614c518c838d016143d5565b9550614c5f60808c01614811565b945060a08b0135915080821115614c7557600080fd5b50614c828b828c016143d5565b92505060c089013590509295985092959890939650565b600060208284031215614cab57600080fd5b8151610b8681614526565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060018201614d0257634e487b7160e01b600052601160045260246000fd5b5060010190565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b868152608060208201526000614d5c608083018789614d19565b8281036040840152614d6f818688614d19565b915050826060830152979650505050505050565b600060208284031215614d9557600080fd5b8151610b8681614ab6565b606081526000614db4606083018789614d19565b8281036020840152614dc7818688614d19565b9150508260408301529695505050505050565b60008060008060808587031215614df057600080fd5b8435935060208501359250604085013567ffffffffffffffff811115614e1557600080fd5b614e21878288016143d5565b949793965093946060013593505050565b60058110614e5057634e487b7160e01b600052602160045260246000fd5b9052565b60208101610d4a8284614e32565b600060208284031215614e7457600080fd5b5051919050565b60208152600061447a602083018486614d19565b60008251614ea18184602087016141ae565b9190910192915050565b6000808335601e19843603018112614ec257600080fd5b83018035915067ffffffffffffffff821115614edd57600080fd5b602001915036819003821315612cd157600080fd5b604081526000614f0560408301856141d2565b90506001600160a01b03831660208301529392505050565b600181811c90821680614f3157607f821691505b602082108103614f5157634e487b7160e01b600052602260045260246000fd5b50919050565b82815260406020820152600061447a60408301846141d2565b60008060008060008060c08789031215614f8957600080fd5b8635955060208701359450604087013567ffffffffffffffff80821115614faf57600080fd5b614fbb8a838b016143d5565b95506060890135915080821115614fd157600080fd5b614fdd8a838b016143d5565b94506080890135935060a0890135915080821115614ffa57600080fd5b5061500789828a016143d5565b9150509295509295509295565b608081526000615028608083018789614d19565b828103602084015261503a81876141d2565b60408401959095525050606001529392505050565b88815260e06020820152600061506960e08301898b614d19565b828103604084015261507b81896141d2565b9050828103606084015261508f81886141d2565b608084019690965250506001600160a01b039290921660a083015260c09091015295945050505050565b600080600080608085870312156150cf57600080fd5b84359350602085013592506150e660408601614857565b9150606085013567ffffffffffffffff81111561510257600080fd5b61510e878288016143d5565b91505092959194509250565b60008060008060008060c0878903121561513357600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561515957600080fd5b6151658a838b016143d5565b9550606089013591508082111561517b57600080fd5b6151878a838b016143d5565b945061519560808a01614811565b935060a0890135915080821115614ffa57600080fd5b600080604083850312156151be57600080fd5b8251915060208301516151d081614526565b809150509250929050565b6060815260006151ef606083018688614d19565b828103602084015261520181866141d2565b91505082604083015295945050505050565b86815285602082015260c06040820152600061523260c08301876141d2565b828103606084015261524481876141d2565b905084608084015282810360a084015261525e81856141d2565b9998505050505050505050565b6000808585111561527b57600080fd5b8386111561528857600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156152bd5780818660040360031b1b83161692505b505092915050565b8a815289602082015260e0604082015260006152e560e083018a8c614d19565b82810360608401526152f881898b614d19565b905086608084015282810360a0840152615313818688614d19565b9150508260c08301529b9a5050505050505050505050565b83815261533b6020820184614e32565b60606040820152600061535160608301846141d2565b95945050505050565b6001600160a01b038316815260406020820152600061447a60408301846141d2565b604081526000615390604083018587614d19565b82810360208401526153a281856141d2565b9695505050505050565b8481528360208201526153c26040820184614e32565b6080606082015260006153a260808301846141d2565b600082601f8301126153e957600080fd5b8135602067ffffffffffffffff808311156154065761540661438e565b8260051b6154158382016143a4565b938452858101830193838101908886111561542f57600080fd5b84880192505b8583101561546b5782358481111561544d5760008081fd5b61545b8a87838c01016143d5565b8352509184019190840190615435565b98975050505050505050565b6000806000806080858703121561548d57600080fd5b843561549881614526565b9350602085013567ffffffffffffffff808211156154b557600080fd5b6154c1888389016143d5565b945060408701359150808211156154d757600080fd5b6154e3888389016153d8565b935060608701359150808211156154f957600080fd5b5061510e878288016153d8565b60408152600061551960408301856141d2565b828103602084015261535181856141d2565b87815286602082015260a06040820152600061554b60a083018789614d19565b828103606084015261555e818688614d19565b91505082608083015298975050505050505050565b8681528560208201526001600160a01b038516604082015260c0606082015260006155a160c08301866141d2565b82810360808401526155b381866141d2565b91505060ff831660a0830152979650505050505050565b6001600160a01b03851681526080602082015260006155ec60808301866141d2565b82810360408401526155fe81866141d2565b91505060ff8316606083015295945050505050565b60a08152600061562660a08301896141d2565b828103602084015261563881896141d2565b905060ff87166040840152828103606084015261565581876141d2565b9050828103608084015261525e818587614d19565b86815285602082015260c06040820152600061568960c08301876141d2565b828103606084015261569b81876141d2565b905060ff8516608084015282810360a084015261525e81856141d2565b60006001600160a01b03808916835260a060208401526156dc60a08401888a614d19565b83810360408501526156ee81886141d2565b9050838103606085015261570281876141d2565b925050808416608084015250979650505050505050565b60608152600061572d606083018688614d19565b828103602084015261573f81866141d2565b9050828103604084015261575381856141d2565b979650505050505050565b601f8211156124c557600081815260208120601f850160051c810160208610156157855750805b601f850160051c820191505b8181101561240657828155600101615791565b815167ffffffffffffffff8111156157be576157be61438e565b6157d2816157cc8454614f1d565b8461575e565b602080601f83116001811461580757600084156157ef5750858301515b600019600386901b1c1916600185901b178555612406565b600085815260208120601f198616915b8281101561583657888601518255948401946001909101908401615817565b50858210156158545787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056feee35723ac350a69d2a92d3703f17439cbaadf2f093a21ba5bf5f1a53eb2a14d8a2646970667358221220dc8540c7b8e2a681cfd9d2e77116365c3c98a566393ebb31308862b395663e1364736f6c63430008150033608060405234801561001057600080fd5b50610162806100206000396000f3fe60806040526004361061001d5760003560e01c806277436014610022575b600080fd5b61003561003036600461007b565b610037565b005b8051602082016000f061004957600080fd5b50565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561008d57600080fd5b813567ffffffffffffffff808211156100a557600080fd5b818401915084601f8301126100b957600080fd5b8135818111156100cb576100cb61004c565b604051601f8201601f19908116603f011681019083821181831017156100f3576100f361004c565b8160405282815287602084870101111561010c57600080fd5b82602086016020830137600092810160200192909252509594505050505056fea264697066735822122094780ce55d28f1d568f4e0ab1b9dc230b96e952b73d2e06456fbff2289fa27f464736f6c63430008150033000000000000000000000000121b0e54cd7ad2bbcb4c4c9275697978ebaf365300000000000000000000000058667c5f134420bf6904c7dd01fddcb4fea3a7600000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a08271200000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d66000000000000000000000000000000000000000000000000000000000000010000000000000000000000000081a0545091864617e7037171fdfcbbdcfe3aeb2300000000000000000000000007715674f74c560200c7c95430673180812fce7300000000000000000000000000000000000000000000000000000000000000084d6f6f6e6265616d000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106103555760003560e01c8063864a0dcf116101bb578063c8bb7067116100f7578063e30c397811610095578063e82e71f81161006f578063e82e71f814610a96578063f2fde38b14610ab6578063f8c8a82614610ad6578063ffd5982a14610af657600080fd5b8063e30c397814610a34578063e4a974cc14610a68578063e7e3ffc814610a7657600080fd5b8063da081c73116100d1578063da081c73146109ce578063da4886df146109e1578063dc88dfd114610a01578063e1d40c7714610a2157600080fd5b8063c8bb70671461095a578063ca58b6441461097a578063d8dab96b146109ae57600080fd5b80639f409d7711610164578063ac9650d81161013e578063ac9650d8146108da578063c38bb537146108fa578063c506bff41461091a578063c7e6a3cc1461093a57600080fd5b80639f409d771461087a578063a3499c731461089a578063a5269ef1146108ba57600080fd5b806395a8c58d1161019557806395a8c58d1461082757806398d78c82146108475780639ded06df1461085a57600080fd5b8063864a0dcf1461079f578063868a166d146107d35780638da5cb5b146107f357600080fd5b80635a6fd76e116102955780636f3eef621161023357806379ba50971161020d57806379ba5097146106ed5780637e151fa6146107025780638291286c1461074257806383d296961461077f57600080fd5b80636f3eef621461069a57806370756cde146106ba578063710bf322146106cd57600080fd5b8063656576361161026f57806365657636146105ff5780636a22d8cc146106125780636ac0d112146106465780636d70f7ae1461067a57600080fd5b80635a6fd76e1461057d5780635c60da1b1461059d5780635c975abb146105d157600080fd5b80632a709b141161030257806349160658116102dc57806349160658146104f65780634a6a42d8146105165780634b4578ba146105365780634f9ae6081461054957600080fd5b80632a709b1414610482578063465a09e0146104b6578063477aedc7146104d657600080fd5b80631b3d6e87116103335780631b3d6e87146103ed5780631c93b03a146104215780631f26d7301461044357600080fd5b8063116191b61461035a5780631a083d39146103ab5780631a98b2e0146103cb575b600080fd5b34801561036657600080fd5b5061038e7f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a581565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156103b757600080fd5b5061038e6103c6366004614079565b610b16565b3480156103d757600080fd5b506103eb6103e63660046140d4565b610b8d565b005b3480156103f957600080fd5b5061038e7f00000000000000000000000007715674f74c560200c7c95430673180812fce7381565b34801561042d57600080fd5b50610436610ba6565b6040516103a291906141fe565b34801561044f57600080fd5b5061046361045e366004614211565b610bd6565b604080516001600160a01b0390931683526020830191909152016103a2565b34801561048e57600080fd5b5061038e7f00000000000000000000000081a0545091864617e7037171fdfcbbdcfe3aeb2381565b3480156104c257600080fd5b506103eb6104d1366004614322565b610bf2565b3480156104e257600080fd5b506104366104f1366004614445565b610d37565b34801561050257600080fd5b506103eb610511366004614482565b610d50565b34801561052257600080fd5b506103eb61053136600461453b565b610faf565b6103eb610544366004614558565b610ff5565b34801561055557600080fd5b5061038e7f00000000000000000000000058667c5f134420bf6904c7dd01fddcb4fea3a76081565b34801561058957600080fd5b5061038e610598366004614079565b6110be565b3480156105a957600080fd5b507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5461038e565b3480156105dd57600080fd5b50600080516020615865833981519152545b60405190151581526020016103a2565b6103eb61060d366004614482565b611117565b34801561061e57600080fd5b5061038e7f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a08271281565b34801561065257600080fd5b5061038e7f000000000000000000000000121b0e54cd7ad2bbcb4c4c9275697978ebaf365381565b34801561068657600080fd5b506105ef61069536600461453b565b6112e1565b3480156106a657600080fd5b506103eb6106b536600461453b565b6112ee565b6103eb6106c8366004614608565b611330565b3480156106d957600080fd5b506103eb6106e836600461453b565b61138f565b3480156106f957600080fd5b506103eb61145e565b34801561070e57600080fd5b5061038e61071d366004614079565b507f00000000000000000000000081a0545091864617e7037171fdfcbbdcfe3aeb2390565b34801561074e57600080fd5b507ff407da03daa7b4243ffb261daad9b01d221ea90ab941948cd48101563654ea865b6040519081526020016103a2565b34801561078b57600080fd5b5061046361079a3660046146c2565b6114d8565b3480156107ab57600080fd5b506107717f99a49606e97aa9d58789783bd4cdfcc3ab4072167b449d1e303cb1135216531b81565b3480156107df57600080fd5b5061038e6107ee36600461475c565b61158e565b3480156107ff57600080fd5b507f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05461038e565b34801561083357600080fd5b506105ef610842366004614822565b6115b2565b610771610855366004614866565b6115cd565b34801561086657600080fd5b506103eb6108753660046148fc565b61174f565b34801561088657600080fd5b506103eb61089536600461493e565b6117bb565b3480156108a657600080fd5b506103eb6108b53660046149a2565b611815565b3480156108c657600080fd5b506107716108d53660046149f2565b611b07565b6108ed6108e8366004614a1e565b611b6e565b6040516103a29190614a54565b34801561090657600080fd5b506103eb610915366004614ac4565b611cc7565b34801561092657600080fd5b506105ef610935366004614ae1565b611d2d565b34801561094657600080fd5b5061038e610955366004614b41565b611d93565b34801561096657600080fd5b50610771610975366004614079565b611db1565b34801561098657600080fd5b5061038e7f00000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d6681565b3480156109ba57600080fd5b506107716109c9366004614079565b611e21565b6103eb6109dc36600461475c565b611e6d565b3480156109ed57600080fd5b506103eb6109fc36600461453b565b611f11565b348015610a0d57600080fd5b506103eb610a1c366004614445565b611f1d565b610771610a2f366004614bc3565b611f76565b348015610a4057600080fd5b507f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d15461038e565b6103eb6103e63660046140d4565b348015610a8257600080fd5b50610771610a91366004614079565b612057565b348015610aa257600080fd5b5061038e610ab1366004614079565b6120a3565b348015610ac257600080fd5b506103eb610ad136600461453b565b6120b9565b348015610ae257600080fd5b5061038e610af1366004614079565b612109565b348015610b0257600080fd5b50610771610b11366004614445565b612114565b600080610b22836110be565b9050806001600160a01b0316639d76ea586040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190614c99565b9392505050565b6040516327616c7360e11b815260040160405180910390fd5b6060610bd17f0e2c162a1f4b5cff9fdbd6b34678a9bcb9898a0b9fbca695b112d61688d8b2ac612128565b905090565b6000806040516327616c7360e11b815260040160405180910390fd5b6001610c0d610c00336121bb565b600160ff84161b16151590565b610c3a5760405163bb6c163960e01b815233600482015260ff821660248201526044015b60405180910390fd5b83828114610c74576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005b81811015610d2e576000610ca2888884818110610c9657610c96614ccc565b905060200201356110be565b9050806001600160a01b031663a56dbe63878785818110610cc557610cc5614ccc565b905060200201356040518263ffffffff1660e01b8152600401610cea91815260200190565b600060405180830381600087803b158015610d0457600080fd5b505af1158015610d18573d6000803e3d6000fd5b505050505080610d2790614ce2565b9050610c77565b50505050505050565b6060610d4a610d45836121c7565b612128565b92915050565b85858585610d6084848484611d2d565b610d7d5760405163157e5fbf60e21b815260040160405180910390fd5b6000805160206158658339815191525415610dab576040516334c2d01160e11b815260040160405180910390fd5b60008686604051610dbd929190614d09565b6040519081900381207f5f6970c300000000000000000000000000000000000000000000000000000000825291506001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690635f6970c390610e34908f908f908f908f908f908990600401614d42565b6020604051808303816000875af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e779190614d83565b610ead576040517f500c44b400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000610ebb87890189614079565b905080610f42576000610ed28e8e8e8e8e88612219565b9050610ee28e828f8f8d8d612246565b6001600160a01b03811615610f3c57806001600160a01b03168e7f8fe61b2d4701a29265508750790e322b2c214399abdf98472158b8908b660d418f8f8f8f89604051610f33959493929190614da0565b60405180910390a35b50610fa0565b60028103610f5957610f54888861240e565b610fa0565b60018103610f6b57610f54888861246d565b6040517f495f232e00000000000000000000000000000000000000000000000000000000815260048101829052602401610c31565b50505050505050505050505050565b6001610fbd610c00336121bb565b610fe55760405163bb6c163960e01b815233600482015260ff82166024820152604401610c31565b610ff1338360016124b4565b5050565b6000805160206158658339815191525415611023576040516334c2d01160e11b815260040160405180910390fd5b815160000361105e576040517f99d8fec900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61106b88338560006124ca565b92506110b48833898989898080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508c935091508a905089612762565b5050505050505050565b60006110c982612109565b9050806001600160a01b03163b600003611112576040517f2dd85afc00000000000000000000000000000000000000000000000000000000815260048101839052602401610c31565b919050565b6000805160206158658339815191525415611145576040516334c2d01160e11b815260040160405180910390fd5b600061115382840184614079565b905080156111775760405163e94617f560e01b815260048101829052602401610c31565b6040517fd26ff210000000000000000000000000000000000000000000000000000000008152600481018990527f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a56001600160a01b03169063d26ff21090602401602060405180830381865afa1580156111f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112199190614d83565b15611250576040517f0dc1019700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60405133906000906112659086908690614d09565b60405180910390209050816001600160a01b03168a7f6e18757e81c44a367109cbaa499add16f2ae7168aab9715c3cdc36b0f7ccce928b8b8b8b876040516112b1959493929190614da0565b60405180910390a36112c88a8a8a8a8a868861280c565b6112d58a8a8a888861286c565b50505050505050505050565b6000610d4a8260016115b2565b60016112fc610c00336121bb565b6113245760405163bb6c163960e01b815233600482015260ff82166024820152604401610c31565b610ff133836001612bf4565b600080516020615865833981519152541561135e576040516334c2d01160e11b815260040160405180910390fd5b61136b88888560016124ca565b925060008061137a8484612c05565b915091506112d58a8a8a8a8a8a888834612762565b336113b87f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b0316146113df576040516330cd747160e01b815260040160405180910390fd5b6001600160a01b03811661140657604051633649397d60e21b815260040160405180910390fd5b6040516001600160a01b038216907fd9be0e8e07417e00f2521db636cb53e316fd288f5051f16d2aa2bf0c3938a87690600090a27f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d155565b60006114887f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d15490565b90506001600160a01b03811633146114cc576040517f49e27cff00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6114d581612cd8565b50565b600080878787876114eb84848484611d2d565b6115085760405163157e5fbf60e21b815260040160405180910390fd5b6000805160206158658339815191525415611536576040516334c2d01160e11b815260040160405180910390fd5b600080806115468a8c018c614dda565b93505092509250600083146115715760405163e94617f560e01b815260048101849052602401610c31565b61157a82610b16565b9f909e509c50505050505050505050505050565b6000806115a28b8b8b8b8b8b8b8b8b612d7b565b549b9a5050505050505050505050565b6000610b866115c0846121bb565b600160ff85161b16151590565b60006115e56000805160206158658339815191525490565b15611603576040516334c2d01160e11b815260040160405180910390fd5b600085600481111561161757611617614cb6565b036116375784604051630a7dda8360e01b8152600401610c319190614e54565b336001600160a01b037f00000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d6616810361166c575060005b611676818a611b07565b915088816001600160a01b0316837f04ddbfaa222e81ab9447c070310e87608bf6a4c5d42be5c2fdf0f370b186af7960405160405180910390a460008790036116ff576116fa828787878080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612de592505050565b611743565b611743828989868a8a8a8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612fce92505050565b50979650505050505050565b307f0000000000000000000000006d59d9360bdae406614b7e61c53f43a03198a4ef6001600160a01b0316036117b1576040517fbf10dd3a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ff1828261305f565b336117e47f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b03161461180b576040516330cd747160e01b815260040160405180910390fd5b610ff182826131ca565b3361183e7f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611865576040516330cd747160e01b815260040160405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b0316638291286c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118e89190614e62565b846001600160a01b0316638291286c6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611926573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194a9190614e62565b14611981576040517f68155f9a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b836001600160a01b03163f83146119c4576040517f8f84fb2400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040516001600160a01b038516907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a28015611ae0576000846001600160a01b0316639ded06df60e01b8484604051602401611a25929190614e7b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051611a639190614e8f565b600060405180830381855af49150503d8060008114611a9e576040519150601f19603f3d011682016040523d82523d6000602084013e611aa3565b606091505b5050905080611ade576040517f97905dfb00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b5050507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b604080517f980c3be34c7ee75cc250c76223092614e21653cdf2faece10ac24fcef821df1060208201526001600160a01b03841691810191909152606081018290526000906080015b60405160208183030381529060405280519060200120905092915050565b60608167ffffffffffffffff811115611b8957611b8961438e565b604051908082528060200260200182016040528015611bbc57816020015b6060815260200190600190039081611ba75790505b5090506000606060005b84811015611cbe5730868683818110611be157611be1614ccc565b9050602002810190611bf39190614eab565b604051611c01929190614d09565b600060405180830381855af49150503d8060008114611c3c576040519150601f19603f3d011682016040523d82523d6000602084013e611c41565b606091505b50909350915082611c8f578151600003611c87576040517f4d6a232800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b815182602001fd5b81848281518110611ca257611ca2614ccc565b602002602001018190525080611cb790614ce2565b9050611bc6565b50505092915050565b33611cf07f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611d17576040516330cd747160e01b815260040160405180910390fd5b8015611d25576114d5613279565b6114d56132bd565b6000808383604051611d40929190614d09565b60405180910390209050611d8986868080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061211492505050565b1495945050505050565b600080611da4888888888888613301565b5498975050505050505050565b600080611dbd836110be565b9050806001600160a01b0316637dbab19b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190614e62565b600080611e2d836110be565b9050806001600160a01b0316632f3c78886040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b6000805160206158658339815191525415611e9b576040516334c2d01160e11b815260040160405180910390fd5b611ea889338660006124ca565b9350600080611eb78585612c05565b91509150611f048b338c8c8c8c8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508e92508a91508990508b612762565b5050505050505050505050565b6114d581336001613362565b33611f467f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b031614611f6d576040516330cd747160e01b815260040160405180910390fd5b6114d581613373565b6000611f8e6000805160206158658339815191525490565b15611fac576040516334c2d01160e11b815260040160405180910390fd5b336001600160a01b037f00000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d66168103611fe1575060005b611feb818b611b07565b9150600088900361203a57600061200583868a8a8a6133f2565b90506120348360008784604051602001612020929190614ef2565b604051602081830303815290604052612de5565b5061204a565b61204a82888888888e8e8a61357f565b5098975050505050505050565b600080612063836110be565b9050806001600160a01b0316638b38b35d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dfd573d6000803e3d6000fd5b60006120ae82613613565b9150610d4a8261364e565b336120e27f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05490565b6001600160a01b0316146114cc576040516330cd747160e01b815260040160405180910390fd5b6000610d4a8261364e565b60008061212083613750565b549392505050565b606081805461213690614f1d565b80601f016020809104026020016040519081016040528092919081815260200182805461216290614f1d565b80156121af5780601f10612184576101008083540402835291602001916121af565b820191906000526020600020905b81548152906001019060200180831161219257829003601f168201915b50505050509050919050565b60008061212083613785565b60007fa5b4aa1bcb538076d57d083e3004c6907e2eba42d84c21922d441967a02b472f826040516020016121fc929190614f57565b604051602081830303815290604052805190602001209050919050565b60008061222a888888888888613301565b905080549150811561223b57600081555b509695505050505050565b600060608180828061225a87890189614f70565b939a5091985090955090935091506122739050816137d5565b9350506001600160a01b038a161561229c57612290858b8461381c565b50505050505050612406565b60006122a986858561381c565b8092508194505050836001600160a01b0316868d7fbdb65cfd017af0876344138f62bc895163b5fd120cbe6e666ed306afd658de4b8d8d8a8989516000146122f757895160208b01206122fa565b60005b60405161230b959493929190615014565b60405180910390a48151156123ff576000846001600160a01b031663292415028e8d8d8a888d898c6040518963ffffffff1660e01b815260040161235698979695949392919061504f565b6020604051808303816000875af1158015612375573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123999190614e62565b90507fe84001f3dedacf7f9ddc370e9f09c26b37473e9e959ffdc4925f6fe33c9877e48114610fa0576040517f1ef6f3b30000000000000000000000000000000000000000000000000000000081526001600160a01b0386166004820152602401610c31565b5050505050505b505050505050565b6000808061241e848601866150b9565b919550935091506000905082600481111561243b5761243b614cb6565b0361245b5781604051630a7dda8360e01b8152600401610c319190614e54565b612466838383612de5565b5050505050565b60008080808061247f8688018861511a565b9550955095509550955050600061249986838787876133f2565b90506110b48660008484604051602001612020929190614ef2565b6124c58383600160ff85161b613a57565b505050565b6000806124d686612109565b9050600080826001600160a01b031663d4ae3c426040518163ffffffff1660e01b81526004016040805180830381865afa158015612518573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061253c91906151ab565b90925090508480156125575750336001600160a01b03821614155b1561259f576040517f409304db0000000000000000000000000000000000000000000000000000000081523360048201526001600160a01b0382166024820152604401610c31565b60408051602481018490526001600160a01b0383811660448301528581166064830152898116608483015260a48083018a90528351808403909101815260c490920183526020820180516001600160e01b03167fb2668ef600000000000000000000000000000000000000000000000000000000179052915160009283927f00000000000000000000000007715674f74c560200c7c95430673180812fce739091169161264c9190614e8f565b600060405180830381855af49150503d8060008114612687576040519150601f19603f3d011682016040523d82523d6000602084013e61268c565b606091505b5091509150816126ca57806040517f1a59c9bd000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b808060200190518101906126de9190614e62565b6040517fdce29136000000000000000000000000000000000000000000000000000000008152600481018290529098506001600160a01b0386169063dce2913690602401600060405180830381600087803b15801561273c57600080fd5b505af1158015612750573d6000803e3d6000fd5b50999c9b505050505050505050505050565b8151156127755781516020830120612778565b60005b886001600160a01b03168a7fcd05f5b9dc4bb03babf40f5da98f5f46819846207d916f89b67d36fd1f7fd74f8a8a8a8a6040516127b894939291906151db565b60405180910390a46000808a6127d68b6001600160a01b0316613aad565b8888876040516020016127ee96959493929190615213565b60405160208183030381529060405290506112d58888838786613adb565b600061281c888888888888613301565b80549091506001600160a01b03811615612862576040517f725f13f100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5055505050505050565b60008080808061287e86880188614f70565b95509550955095509550506000612894846137d5565b90506000806128a288612109565b9050806001600160a01b0316639d76ea586040518163ffffffff1660e01b8152600401602060405180830381865afa1580156128e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129069190614c99565b91506000807f00000000000000000000000007715674f74c560200c7c95430673180812fce736001600160a01b03166345537d7060e01b846001600160a01b0316634fdf7cb56040518163ffffffff1660e01b8152600401602060405180830381865afa15801561297b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061299f9190614e62565b60405160248101919091526001600160a01b0380881660448301523360648301528816608482015260a481018a905260c40160408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612a0f9190614e8f565b600060405180830381855af49150503d8060008114612a4a576040519150601f19603f3d011682016040523d82523d6000602084013e612a4f565b606091505b509150915081612a8d57806040517f3a5cf905000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b80806020019051810190612aa19190614e62565b9650505050816001600160a01b0316878d7fbdb65cfd017af0876344138f62bc895163b5fd120cbe6e666ed306afd658de4b8e8e8b8a8a51600014612aec578a5160208c0120612aef565b60005b604051612b00959493929190615014565b60405180910390a48251156123ff576000826001600160a01b03166377c790258e8e8e8b898e898d6040518963ffffffff1660e01b8152600401612b4b98979695949392919061504f565b6020604051808303816000875af1158015612b6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b8e9190614e62565b90507f692b2deb10f974787eb65450ba9a90dc0bb28141a633fa3fb556d5292fba42e18114610fa0576040517fc646a6230000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610c31565b6124c58383600160ff85161b613d77565b600060606004831015612c1b5760009150612cd1565b6000612c2a600482868861526b565b612c3391615295565b60e01c90506001811115612c625760405163b47a9b4b60e01b815263ffffffff82166004820152602401610c31565b8063ffffffff166001811115612c7a57612c7a614cb6565b92506004849003612c8b5750612cd1565b612c98846004818861526b565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929450505050505b9250929050565b6001600160a01b038116612cff57604051633649397d60e21b815260040160405180910390fd5b6040516001600160a01b038216907f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc68616390600090a27f02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c05560007f9855384122b55936fbfb8ca5120e63c6537a1ac40caf6ae33502b3c5da8c87d155565b60007febf4535caee8019297b7be3ed867db0d00b69fedcdda98c5e2c41ea6e41a98d58a8a8a8a8a8a8a8a8a604051602001612dc09a999897969594939291906152c5565b6040516020818303038152906040528051906020012090509998505050505050505050565b6000807f000000000000000000000000121b0e54cd7ad2bbcb4c4c9275697978ebaf36536001600160a01b0316636519d04b60e01b868686604051602401612e2f9392919061532b565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612e6d9190614e8f565b600060405180830381855af49150503d8060008114612ea8576040519150601f19603f3d011682016040523d82523d6000602084013e612ead565b606091505b509150915081612eeb57806040517ff9eef82a000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b60208101516002856004811115612f0457612f04614cb6565b1480612f2157506003856004811115612f1f57612f1f614cb6565b145b15612f7a57806001600160a01b031663274158386040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612f6157600080fd5b505af1158015612f75573d6000803e3d6000fd5b505050505b846004811115612f8c57612f8c614cb6565b867f5284c2478b9c1a55e973429331078be39b5fb3eeb9d87d10b34d65a4c89ee4eb8387604051612fbe92919061535a565b60405180910390a3505050505050565b612fd7866110be565b50816004811115612fea57612fea614cb6565b867fc92a73c79b84dd58e39d4e09fbf47f3f8bd145222bfff3d803eec161bed1c19487878560405161301e9392919061537c565b60405180910390a36000600287848460405160200161304094939291906153ac565b6040516020818303038152906040529050610d2e868683600088613adb565b600080808061307085870187615477565b8151939750919550935091506001600160a01b0385166130bc576040517fd92e233d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835115806130f05750835160208501207f99a49606e97aa9d58789783bd4cdfcc3ab4072167b449d1e303cb1135216531b14155b15613127576040517f08e1064e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b81518114613161576040517fff633a3800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61316a85613e0f565b61317384613e1a565b60005b818110156110b4576131ba84828151811061319357613193614ccc565b60200260200101518483815181106131ad576131ad614ccc565b60200260200101516131ca565b6131c381614ce2565b9050613176565b81516000036131ec5760405163deba168960e01b815260040160405180910390fd5b805160000361320e5760405163deba168960e01b815260040160405180910390fd5b61322061321a836121c7565b82613e40565b600061322b83613750565b82516020840120808255604051919250907fdb6b260ea45f7fe513e1d3b8c21017a29e3a41610e95aefb8862b81c69aec61c9061326b9086908690615506565b60405180910390a150505050565b613290600160008051602061586583398151915255565b60405133907f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25890600090a2565b6132d4600060008051602061586583398151915255565b60405133907f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa90600090a2565b60007f2a41fec9a0df4e0996b975f71622c7164b0f652ea69d9dbcd6b24e81b20ab5e5878787878787604051602001613340979695949392919061552b565b6040516020818303038152906040528051906020012090509695505050505050565b6124c58383600160ff85161b613e4b565b80516000036133955760405163deba168960e01b815260040160405180910390fd5b6133a66133a1826121c7565b613ebe565b60006133b182613750565b9050600081557ff9400637a329865492b8d0d4dba4eafc7e8d5d0fae5e27b56766816d2ae1b2ca826040516133e691906141fe565b60405180910390a15050565b6000806133fe87613613565b90506000865160001461341757613414876137d5565b90505b6000807f00000000000000000000000058667c5f134420bf6904c7dd01fddcb4fea3a7606001600160a01b031663f575f35b60e01b858c868c8c8c60405160240161346796959493929190615573565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516134a59190614e8f565b600060405180830381855af49150503d80600081146134e0576040519150601f19603f3d011682016040523d82523d6000602084013e6134e5565b606091505b50915091508161352357806040517fc226af8b000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b60208101519450826001600160a01b03168a7ff0d7beb2b03d35e597f432391dc2a6f6eb1a621be6cb5b325f55a49090085239878b8b8b60405161356a94939291906155ca565b60405180910390a35050505095945050505050565b613588886110be565b50877fe470f4bdd33c8676127d3c20ff725d8dc1605609001389ce3a59c28b54b7992f8888888888886040516135c396959493929190615613565b60405180910390a26000600189898989896040516020016135e99695949392919061566a565b6040516020818303038152906040529050613608848483600086613adb565b505050505050505050565b604080517f610507e221586f499adb972fbdbe7f0619bdae0112c78ebaa562448d0ca7071f60208201529081018290526000906060016121fc565b604080517fff0000000000000000000000000000000000000000000000000000000000000060208083019190915230606090811b6bffffffffffffffffffffffff19908116602185015260358401959095527fdb4bab1640a2602c9f66f33765d12be4af115accf74b24515702961e82a71327605580850191909152845180850390910181526075840185528051908301207fd6940000000000000000000000000000000000000000000000000000000000006095850152901b90931660978201527f010000000000000000000000000000000000000000000000000000000000000060ab8201528151608c81830301815260ac909101909152805191012090565b60007f5f58fea7d48d37d5d1cc2546dfcc3d3cbfe8d758d5ca19c44087f52e15a10505826040516020016121fc929190614f57565b60007fde9bdca322e1a848f72215bc15cf2c87fe7749145789a9ee281a2a6290af26ab826040516020016121fc92919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6000815160141461381457816040517fd08dbec5000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b506014015190565b600080600061382a86612109565b9050600080826001600160a01b031663d4ae3c426040518163ffffffff1660e01b81526004016040805180830381865afa15801561386c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061389091906151ab565b6040517f10d8d8e30000000000000000000000000000000000000000000000000000000081526004810189905291935091506001600160a01b038416906310d8d8e390602401600060405180830381600087803b1580156138f057600080fd5b505af1158015613904573d6000803e3d6000fd5b505060408051602481018690526001600160a01b03858116604483015287811660648301528b8116608483015260a48083018c90528351808403909101815260c490920183526020820180516001600160e01b03167f72689126000000000000000000000000000000000000000000000000000000001790529151600094508493507f00000000000000000000000007715674f74c560200c7c95430673180812fce73909216916139b59190614e8f565b600060405180830381855af49150503d80600081146139f0576040519150601f19603f3d011682016040523d82523d6000602084013e6139f5565b606091505b509150915081613a3357806040517f0f940973000000000000000000000000000000000000000000000000000000008152600401610c3191906141fe565b80806020019051810190613a479190614e62565b9a92995091975050505050505050565b613a6a613a63846121bb565b8216821490565b613a9957604051631fe9beed60e21b81526001600160a01b038416600482015260248101829052604401610c31565b613aa38382613ec9565b6124c58282613f2b565b6040805160148082528183019092526060916020820181803683375050506014808201939093529182525090565b6000613b1c86868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250610d3792505050565b90508051600003613b59576040517ff9188a6800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8115613cde576000836001811115613b7357613b73614cb6565b03613c20576040517f0c93e3bb0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a0827121690630c93e3bb908490613be99030908b908b9088908c9032906004016156b8565b6000604051808303818588803b158015613c0257600080fd5b505af1158015613c16573d6000803e3d6000fd5b5050505050613cde565b6001836001811115613c3457613c34614cb6565b03613caa576040517ff61ed2180000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712169063f61ed218908490613be99030908b908b9088908c9032906004016156b8565b826001811115613cbc57613cbc614cb6565b60405163b47a9b4b60e01b815263ffffffff9091166004820152602401610c31565b6040517f1c92115f0000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a51690631c92115f90613d49908990899086908a90600401615719565b600060405180830381600087803b158015613d6357600080fd5b505af11580156112d5573d6000803e3d6000fd5b613d83613a63846121bb565b613db257604051631fe9beed60e21b81526001600160a01b038416600482015260248101829052604401610c31565b613dbd838383613f7f565b816001600160a01b0316836001600160a01b03167ff7158d1591c2cf17c0e6b9459d86365c47fe0969c79f40ef49e0c437d8f3991483604051613e0291815260200190565b60405180910390a3505050565b6114d5816001613f94565b6114d57f0e2c162a1f4b5cff9fdbd6b34678a9bcb9898a0b9fbca695b112d61688d8b2ac825b816124c582826157a4565b80613e568484613fa4565b14613ea7576040517f6004fe400000000000000000000000000000000000000000000000000000000081526001600160a01b0380851660048301528316602482015260448101829052606401610c31565b613eb383836000613f7f565b6124c5838383613a57565b6114d581600061402b565b60008119613ed6846121bb565b169050613ee38382613fba565b826001600160a01b03167fccf920c8facee98a9c2a6c6124f2857b87b17e9f3a819bfcc6945196ee77366b83604051613f1e91815260200190565b60405180910390a2505050565b600081613f37846121bb565b179050613f448382613fba565b826001600160a01b03167f34e73c57659d4b6809b53db4feee9b007b892e978114eda420d2991aba15014383604051613f1e91815260200190565b6000613f8b8484613fcd565b91909155505050565b610ff182600160ff84161b613f2b565b600080613fb18484613fcd565b54949350505050565b6000613fc583613785565b919091555050565b60007ff96e07b2f4fbb81c31567d2b261589af429e98f0958d53f7e6ad5d63aea0ab7c8383604051602001611b5093929190928352606091821b6bffffffffffffffffffffffff199081166020850152911b16603482015260480190565b50805461403790614f1d565b6000825580601f10614047575050565b601f0160209004906000526020600020908101906114d591905b808211156140755760008155600101614061565b5090565b60006020828403121561408b57600080fd5b5035919050565b60008083601f8401126140a457600080fd5b50813567ffffffffffffffff8111156140bc57600080fd5b602083019150836020828501011115612cd157600080fd5b60008060008060008060008060008060c08b8d0312156140f357600080fd5b8a35995060208b013567ffffffffffffffff8082111561411257600080fd5b61411e8e838f01614092565b909b50995060408d013591508082111561413757600080fd5b6141438e838f01614092565b909950975060608d013591508082111561415c57600080fd5b6141688e838f01614092565b909750955060808d013591508082111561418157600080fd5b5061418e8d828e01614092565b9150809450508092505060a08b013590509295989b9194979a5092959850565b60005b838110156141c95781810151838201526020016141b1565b50506000910152565b600081518084526141ea8160208601602086016141ae565b601f01601f19169290920160200192915050565b602081526000610b8660208301846141d2565b600080600080600080600080600060a08a8c03121561422f57600080fd5b893567ffffffffffffffff8082111561424757600080fd5b6142538d838e01614092565b909b50995060208c013591508082111561426c57600080fd5b6142788d838e01614092565b909950975060408c013591508082111561429157600080fd5b61429d8d838e01614092565b909750955060608c01359150808211156142b657600080fd5b506142c38c828d01614092565b9a9d999c50979a9699959894979660800135949350505050565b60008083601f8401126142ef57600080fd5b50813567ffffffffffffffff81111561430757600080fd5b6020830191508360208260051b8501011115612cd157600080fd5b6000806000806040858703121561433857600080fd5b843567ffffffffffffffff8082111561435057600080fd5b61435c888389016142dd565b9096509450602087013591508082111561437557600080fd5b50614382878288016142dd565b95989497509550505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff811182821017156143cd576143cd61438e565b604052919050565b600082601f8301126143e657600080fd5b813567ffffffffffffffff8111156144005761440061438e565b614413601f8201601f19166020016143a4565b81815284602083860101111561442857600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561445757600080fd5b813567ffffffffffffffff81111561446e57600080fd5b61447a848285016143d5565b949350505050565b60008060008060008060006080888a03121561449d57600080fd5b87359650602088013567ffffffffffffffff808211156144bc57600080fd5b6144c88b838c01614092565b909850965060408a01359150808211156144e157600080fd5b6144ed8b838c01614092565b909650945060608a013591508082111561450657600080fd5b506145138a828b01614092565b989b979a50959850939692959293505050565b6001600160a01b03811681146114d557600080fd5b60006020828403121561454d57600080fd5b8135610b8681614526565b60008060008060008060008060c0898b03121561457457600080fd5b88359750602089013567ffffffffffffffff8082111561459357600080fd5b61459f8c838d01614092565b909950975060408b01359150808211156145b857600080fd5b6145c48c838d01614092565b909750955060608b0135945060808b01359150808211156145e457600080fd5b506145f18b828c016143d5565b92505060a089013590509295985092959890939650565b60008060008060008060008060c0898b03121561462457600080fd5b88359750602089013561463681614526565b9650604089013567ffffffffffffffff8082111561465357600080fd5b61465f8c838d01614092565b909850965060608b013591508082111561467857600080fd5b6146848c838d016143d5565b955060808b0135945060a08b01359150808211156146a157600080fd5b506146ae8b828c01614092565b999c989b5096995094979396929594505050565b600080600080600080606087890312156146db57600080fd5b863567ffffffffffffffff808211156146f357600080fd5b6146ff8a838b01614092565b9098509650602089013591508082111561471857600080fd5b6147248a838b01614092565b9096509450604089013591508082111561473d57600080fd5b5061474a89828a01614092565b979a9699509497509295939492505050565b600080600080600080600080600060c08a8c03121561477a57600080fd5b8935985060208a013567ffffffffffffffff8082111561479957600080fd5b6147a58d838e01614092565b909a50985060408c01359150808211156147be57600080fd5b6147ca8d838e01614092565b909850965060608c0135955060808c01359150808211156147ea57600080fd5b506147f78c828d01614092565b9a9d999c50979a9699959894979660a00135949350505050565b803560ff8116811461111257600080fd5b6000806040838503121561483557600080fd5b823561484081614526565b915061484e60208401614811565b90509250929050565b80356005811061111257600080fd5b600080600080600080600060a0888a03121561488157600080fd5b87359650602088013567ffffffffffffffff808211156148a057600080fd5b6148ac8b838c01614092565b90985096508691506148c060408b01614857565b955060608a01359150808211156148d657600080fd5b506148e38a828b01614092565b989b979a50959894979596608090950135949350505050565b6000806020838503121561490f57600080fd5b823567ffffffffffffffff81111561492657600080fd5b61493285828601614092565b90969095509350505050565b6000806040838503121561495157600080fd5b823567ffffffffffffffff8082111561496957600080fd5b614975868387016143d5565b9350602085013591508082111561498b57600080fd5b50614998858286016143d5565b9150509250929050565b600080600080606085870312156149b857600080fd5b84356149c381614526565b935060208501359250604085013567ffffffffffffffff8111156149e657600080fd5b61438287828801614092565b60008060408385031215614a0557600080fd5b8235614a1081614526565b946020939093013593505050565b60008060208385031215614a3157600080fd5b823567ffffffffffffffff811115614a4857600080fd5b614932858286016142dd565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614aa957603f19888603018452614a978583516141d2565b94509285019290850190600101614a7b565b5092979650505050505050565b80151581146114d557600080fd5b600060208284031215614ad657600080fd5b8135610b8681614ab6565b60008060008060408587031215614af757600080fd5b843567ffffffffffffffff80821115614b0f57600080fd5b614b1b88838901614092565b90965094506020870135915080821115614b3457600080fd5b5061438287828801614092565b60008060008060008060808789031215614b5a57600080fd5b86359550602087013567ffffffffffffffff80821115614b7957600080fd5b614b858a838b01614092565b90975095506040890135915080821115614b9e57600080fd5b50614bab89828a01614092565b979a9699509497949695606090950135949350505050565b60008060008060008060008060e0898b031215614bdf57600080fd5b88359750602089013567ffffffffffffffff80821115614bfe57600080fd5b614c0a8c838d01614092565b909950975060408b0135915080821115614c2357600080fd5b614c2f8c838d016143d5565b965060608b0135915080821115614c4557600080fd5b614c518c838d016143d5565b9550614c5f60808c01614811565b945060a08b0135915080821115614c7557600080fd5b50614c828b828c016143d5565b92505060c089013590509295985092959890939650565b600060208284031215614cab57600080fd5b8151610b8681614526565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b600060018201614d0257634e487b7160e01b600052601160045260246000fd5b5060010190565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b868152608060208201526000614d5c608083018789614d19565b8281036040840152614d6f818688614d19565b915050826060830152979650505050505050565b600060208284031215614d9557600080fd5b8151610b8681614ab6565b606081526000614db4606083018789614d19565b8281036020840152614dc7818688614d19565b9150508260408301529695505050505050565b60008060008060808587031215614df057600080fd5b8435935060208501359250604085013567ffffffffffffffff811115614e1557600080fd5b614e21878288016143d5565b949793965093946060013593505050565b60058110614e5057634e487b7160e01b600052602160045260246000fd5b9052565b60208101610d4a8284614e32565b600060208284031215614e7457600080fd5b5051919050565b60208152600061447a602083018486614d19565b60008251614ea18184602087016141ae565b9190910192915050565b6000808335601e19843603018112614ec257600080fd5b83018035915067ffffffffffffffff821115614edd57600080fd5b602001915036819003821315612cd157600080fd5b604081526000614f0560408301856141d2565b90506001600160a01b03831660208301529392505050565b600181811c90821680614f3157607f821691505b602082108103614f5157634e487b7160e01b600052602260045260246000fd5b50919050565b82815260406020820152600061447a60408301846141d2565b60008060008060008060c08789031215614f8957600080fd5b8635955060208701359450604087013567ffffffffffffffff80821115614faf57600080fd5b614fbb8a838b016143d5565b95506060890135915080821115614fd157600080fd5b614fdd8a838b016143d5565b94506080890135935060a0890135915080821115614ffa57600080fd5b5061500789828a016143d5565b9150509295509295509295565b608081526000615028608083018789614d19565b828103602084015261503a81876141d2565b60408401959095525050606001529392505050565b88815260e06020820152600061506960e08301898b614d19565b828103604084015261507b81896141d2565b9050828103606084015261508f81886141d2565b608084019690965250506001600160a01b039290921660a083015260c09091015295945050505050565b600080600080608085870312156150cf57600080fd5b84359350602085013592506150e660408601614857565b9150606085013567ffffffffffffffff81111561510257600080fd5b61510e878288016143d5565b91505092959194509250565b60008060008060008060c0878903121561513357600080fd5b8635955060208701359450604087013567ffffffffffffffff8082111561515957600080fd5b6151658a838b016143d5565b9550606089013591508082111561517b57600080fd5b6151878a838b016143d5565b945061519560808a01614811565b935060a0890135915080821115614ffa57600080fd5b600080604083850312156151be57600080fd5b8251915060208301516151d081614526565b809150509250929050565b6060815260006151ef606083018688614d19565b828103602084015261520181866141d2565b91505082604083015295945050505050565b86815285602082015260c06040820152600061523260c08301876141d2565b828103606084015261524481876141d2565b905084608084015282810360a084015261525e81856141d2565b9998505050505050505050565b6000808585111561527b57600080fd5b8386111561528857600080fd5b5050820193919092039150565b6001600160e01b031981358181169160048510156152bd5780818660040360031b1b83161692505b505092915050565b8a815289602082015260e0604082015260006152e560e083018a8c614d19565b82810360608401526152f881898b614d19565b905086608084015282810360a0840152615313818688614d19565b9150508260c08301529b9a5050505050505050505050565b83815261533b6020820184614e32565b60606040820152600061535160608301846141d2565b95945050505050565b6001600160a01b038316815260406020820152600061447a60408301846141d2565b604081526000615390604083018587614d19565b82810360208401526153a281856141d2565b9695505050505050565b8481528360208201526153c26040820184614e32565b6080606082015260006153a260808301846141d2565b600082601f8301126153e957600080fd5b8135602067ffffffffffffffff808311156154065761540661438e565b8260051b6154158382016143a4565b938452858101830193838101908886111561542f57600080fd5b84880192505b8583101561546b5782358481111561544d5760008081fd5b61545b8a87838c01016143d5565b8352509184019190840190615435565b98975050505050505050565b6000806000806080858703121561548d57600080fd5b843561549881614526565b9350602085013567ffffffffffffffff808211156154b557600080fd5b6154c1888389016143d5565b945060408701359150808211156154d757600080fd5b6154e3888389016153d8565b935060608701359150808211156154f957600080fd5b5061510e878288016153d8565b60408152600061551960408301856141d2565b828103602084015261535181856141d2565b87815286602082015260a06040820152600061554b60a083018789614d19565b828103606084015261555e818688614d19565b91505082608083015298975050505050505050565b8681528560208201526001600160a01b038516604082015260c0606082015260006155a160c08301866141d2565b82810360808401526155b381866141d2565b91505060ff831660a0830152979650505050505050565b6001600160a01b03851681526080602082015260006155ec60808301866141d2565b82810360408401526155fe81866141d2565b91505060ff8316606083015295945050505050565b60a08152600061562660a08301896141d2565b828103602084015261563881896141d2565b905060ff87166040840152828103606084015261565581876141d2565b9050828103608084015261525e818587614d19565b86815285602082015260c06040820152600061568960c08301876141d2565b828103606084015261569b81876141d2565b905060ff8516608084015282810360a084015261525e81856141d2565b60006001600160a01b03808916835260a060208401526156dc60a08401888a614d19565b83810360408501526156ee81886141d2565b9050838103606085015261570281876141d2565b925050808416608084015250979650505050505050565b60608152600061572d606083018688614d19565b828103602084015261573f81866141d2565b9050828103604084015261575381856141d2565b979650505050505050565b601f8211156124c557600081815260208120601f850160051c810160208610156157855750805b601f850160051c820191505b8181101561240657828155600101615791565b815167ffffffffffffffff8111156157be576157be61438e565b6157d2816157cc8454614f1d565b8461575e565b602080601f83116001811461580757600084156157ef5750858301515b600019600386901b1c1916600185901b178555612406565b600085815260208120601f198616915b8281101561583657888601518255948401946001909101908401615817565b50858210156158545787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056feee35723ac350a69d2a92d3703f17439cbaadf2f093a21ba5bf5f1a53eb2a14d8a2646970667358221220dc8540c7b8e2a681cfd9d2e77116365c3c98a566393ebb31308862b395663e1364736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000121b0e54cd7ad2bbcb4c4c9275697978ebaf365300000000000000000000000058667c5f134420bf6904c7dd01fddcb4fea3a7600000000000000000000000004f4495243837681061c4743b74b3eedf548d56a50000000000000000000000002d5d7d31f671f86c782533cc367f14109a08271200000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d66000000000000000000000000000000000000000000000000000000000000010000000000000000000000000081a0545091864617e7037171fdfcbbdcfe3aeb2300000000000000000000000007715674f74c560200c7c95430673180812fce7300000000000000000000000000000000000000000000000000000000000000084d6f6f6e6265616d000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : tokenManagerDeployer_ (address): 0x121b0e54Cd7ad2BBCb4c4C9275697978EBaF3653
Arg [1] : interchainTokenDeployer_ (address): 0x58667c5f134420Bf6904C7dD01fDDcB4Fea3a760
Arg [2] : gateway_ (address): 0x4F4495243837681061C4743b74B3eEdf548D56A5
Arg [3] : gasService_ (address): 0x2d5d7d31F671F86C782533cc367F14109a082712
Arg [4] : interchainTokenFactory_ (address): 0x83a93500d23Fbc3e82B410aD07A6a9F7A0670D66
Arg [5] : chainName_ (string): Moonbeam
Arg [6] : tokenManagerImplementation_ (address): 0x81a0545091864617E7037171FdfcBbdCFE3aeb23
Arg [7] : tokenHandler_ (address): 0x07715674F74c560200c7C95430673180812fCE73
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000121b0e54cd7ad2bbcb4c4c9275697978ebaf3653
Arg [1] : 00000000000000000000000058667c5f134420bf6904c7dd01fddcb4fea3a760
Arg [2] : 0000000000000000000000004f4495243837681061c4743b74b3eedf548d56a5
Arg [3] : 0000000000000000000000002d5d7d31f671f86c782533cc367f14109a082712
Arg [4] : 00000000000000000000000083a93500d23fbc3e82b410ad07a6a9f7a0670d66
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [6] : 00000000000000000000000081a0545091864617e7037171fdfcbbdcfe3aeb23
Arg [7] : 00000000000000000000000007715674f74c560200c7c95430673180812fce73
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [9] : 4d6f6f6e6265616d000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.