Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 623 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Process Swap Req... | 20285764 | 41 days ago | IN | 0 ETH | 0.00050893 | ||||
Process Swap Req... | 20097159 | 67 days ago | IN | 0 ETH | 0.00046162 | ||||
Process Swap Req... | 20097088 | 67 days ago | IN | 0 ETH | 0.0003813 | ||||
Process Swap Req... | 20069488 | 71 days ago | IN | 0 ETH | 0.00284563 | ||||
Process Swap Req... | 20069461 | 71 days ago | IN | 0 ETH | 0.00297602 | ||||
Process Swap Req... | 20069416 | 71 days ago | IN | 0 ETH | 0.00270805 | ||||
Process Swap Req... | 20067104 | 72 days ago | IN | 0 ETH | 0.0004895 | ||||
Swap Request | 20066980 | 72 days ago | IN | 0.002 ETH | 0.00069492 | ||||
Process Swap Req... | 20066924 | 72 days ago | IN | 0 ETH | 0.00062921 | ||||
Process Swap Req... | 20066596 | 72 days ago | IN | 0 ETH | 0.00042767 | ||||
Process Swap Req... | 20066584 | 72 days ago | IN | 0 ETH | 0.00036433 | ||||
Process Swap Req... | 20066583 | 72 days ago | IN | 0 ETH | 0.00045154 | ||||
Process Swap Req... | 20066536 | 72 days ago | IN | 0 ETH | 0.00055685 | ||||
Process Swap Req... | 19989779 | 82 days ago | IN | 0 ETH | 0.0010901 | ||||
Process Swap Req... | 19574301 | 140 days ago | IN | 0 ETH | 0.00211708 | ||||
Process Swap Req... | 19558450 | 143 days ago | IN | 0 ETH | 0.00156868 | ||||
Swap Request | 19558445 | 143 days ago | IN | 0.002 ETH | 0.00152302 | ||||
Swap Request | 19558421 | 143 days ago | IN | 0.002 ETH | 0.00149141 | ||||
Process Swap Req... | 19558386 | 143 days ago | IN | 0 ETH | 0.00182712 | ||||
Swap Request | 19543289 | 145 days ago | IN | 0.002 ETH | 0.00135268 | ||||
Process Swap Req... | 19543157 | 145 days ago | IN | 0 ETH | 0.00243627 | ||||
Process Swap Req... | 19543135 | 145 days ago | IN | 0 ETH | 0.00193995 | ||||
Process Swap Req... | 19481706 | 154 days ago | IN | 0 ETH | 0.00223657 | ||||
Swap Request | 19467067 | 156 days ago | IN | 0.002 ETH | 0.00205197 | ||||
Swap Request | 19458781 | 157 days ago | IN | 0.002 ETH | 0.00167334 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
20066980 | 72 days ago | 0.002 ETH | ||||
19558445 | 143 days ago | 0.002 ETH | ||||
19558421 | 143 days ago | 0.002 ETH | ||||
19543289 | 145 days ago | 0.002 ETH | ||||
19467067 | 156 days ago | 0.002 ETH | ||||
19458781 | 157 days ago | 0.002 ETH | ||||
19457911 | 157 days ago | 0.002 ETH | ||||
19455495 | 157 days ago | 0.002 ETH | ||||
19455307 | 157 days ago | 0.002 ETH | ||||
19454268 | 157 days ago | 0.002 ETH | ||||
19453164 | 158 days ago | 0.002 ETH | ||||
19453142 | 158 days ago | 0.002 ETH | ||||
19449653 | 158 days ago | 0.002 ETH | ||||
19449478 | 158 days ago | 0.002 ETH | ||||
19448445 | 158 days ago | 0.002 ETH | ||||
19448346 | 158 days ago | 0.002 ETH | ||||
19448228 | 158 days ago | 0.002 ETH | ||||
19344649 | 173 days ago | 0.002 ETH | ||||
19149651 | 200 days ago | 0.002 ETH | ||||
19148775 | 200 days ago | 0.002 ETH | ||||
19148596 | 200 days ago | 0.002 ETH | ||||
19148162 | 200 days ago | 0.002 ETH | ||||
19137692 | 202 days ago | 0.002 ETH | ||||
19137661 | 202 days ago | 0.002 ETH | ||||
19091784 | 208 days ago | 0.002 ETH |
Loading...
Loading
Contract Name:
SwapRouter
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./../interfaces/IERC20Mintable.sol"; /** * @title SwapRouter * @dev A contract for performing cross-chain swaps between different networks. */ contract SwapRouter is Ownable, Pausable, ReentrancyGuard { using SafeERC20 for IERC20; struct TargetChainConfig { uint256 swapFee; bool isActive; bool exist; } event TargetChainConfigUpdate(uint256 chainId, uint256 swapFee, bool isActive); event RemoveTargetChainConfig(uint256 chainId, uint256 swapFee, bool isActive); event FeeReceiverUpdated(address receiver); event SwapRequest(address indexed account, uint256 amount, uint fromChainId, uint toChainId); event SwapCompleted(address indexed account, uint256 amount, uint fromChainId, uint toChainId, bytes32 requestTransactionHash); modifier notIsSameChain(uint256 chainId) { require(chainId != getChainId(), "Is same chain"); _; } modifier feeReceiverDefined() { require(feeReceiver != address(0), "Fee receiver is not defined"); _; } modifier onlyMessageRelayer() { require(_msgSender() == messageRelayer, "Only call from message relayer"); _; } address payable public feeReceiver; address public messageRelayer; IERC20 public swapToken; mapping(uint256 => TargetChainConfig) public targetChains; // From-ChainID > Request Transaction Hash > State mapping(uint256 => mapping(bytes32 => bool)) private swapState; /** * @dev Initializes the SwapRouter contract. * @param feeReceiver_ The address that will receive the swap fees. * @param token The ERC20 token used for swapping. */ constructor(address payable feeReceiver_, IERC20 token, address relayer) { _setToken(token); _setFeeReceiver(feeReceiver_); _setMessageRelayer(relayer); } /** * @dev Get swap state * @param chainId Request chain id * @param transactionHash Swap transaction hash from sender chain */ function isSwapCompleted(uint256 chainId, bytes32 transactionHash) public view returns (bool) { return swapState[chainId][transactionHash]; } function _setMessageRelayer(address relayer) internal { require(relayer != address(0), "Message relayer cant be zero address"); messageRelayer = relayer; } /** * @dev Sets the address of the message relayer. * @param relayer The address of the message relayer. */ function setMessageRelayer(address relayer) external onlyOwner { _setMessageRelayer(relayer); } function _setToken(IERC20 token) internal { require(address(token) != address(0), "Token address cant be zero address"); swapToken = token; } /** * @dev Sets the ERC20 token used for swapping. * @param token The ERC20 token used for swapping. */ function setToken(IERC20 token) external onlyOwner { _setToken(token); } function _setFeeReceiver(address payable account) internal { require(account != address(0), "Receiver address cant be zero address"); feeReceiver = account; emit FeeReceiverUpdated(account); } /** * @dev Sets the address that will receive the swap fees. * @param account The address that will receive the swap fees. */ function setFeeReceiver(address payable account) external onlyOwner { _setFeeReceiver(account); } /** * @dev Sets the configuration for a target chain. * @param chainId The ID of the target chain. * @param swapFee The fee required for performing a swap on the target chain. * @param isActive The status of the target chain (active or inactive). */ function setTargetChainConfig(uint256 chainId, uint256 swapFee, bool isActive) external onlyOwner notIsSameChain(chainId) { TargetChainConfig memory config = targetChains[chainId]; config.swapFee = swapFee; config.isActive = isActive; config.exist = true; targetChains[chainId] = config; emit TargetChainConfigUpdate(chainId, swapFee, isActive); } /** * @dev Removes a target chain configuration. * @param chainId The ID of the target chain to remove. */ function removeTargetChain(uint256 chainId) external onlyOwner notIsSameChain(chainId) { TargetChainConfig memory config = targetChains[chainId]; require(config.exist == true, "Target chain does not exist"); delete targetChains[chainId]; emit RemoveTargetChainConfig(chainId, config.swapFee, config.isActive); } /** * @dev Initiates a swap request. * @param chainId The ID of the target chain. * @param amount The amount of tokens to swap. */ function swapRequest(uint256 chainId, uint256 amount) external payable whenNotPaused feeReceiverDefined nonReentrant { TargetChainConfig memory config = targetChains[chainId]; IERC20Mintable token = IERC20Mintable(address(swapToken)); if (config.exist == false || config.isActive == false) { revert("Target chain is not active"); } if (msg.value < config.swapFee) { revert("Swap fee doesnt payed"); } // Transfer token SafeERC20.safeTransferFrom(swapToken, _msgSender(), address(this), amount); // Burn given amount token.burn(amount); // Transfer swap fee if (config.swapFee > 0) { (bool sent,) = feeReceiver.call{value : msg.value}(""); require(sent, "Fee transfer failed"); } // Emit swap request event emit SwapRequest(_msgSender(), amount, getChainId(), chainId); } /** * @dev Processes a swap request from the message relayer. * @param fromChainId The ID of the source chain. * @param requestTransactionHash The transaction hash of the swap request. * @param account The account to receive the swapped tokens. * @param amount The amount of tokens to swap. */ function processSwapRequest(uint256 fromChainId, bytes32 requestTransactionHash, address account, uint256 amount) public whenNotPaused onlyMessageRelayer nonReentrant { require(swapState[fromChainId][requestTransactionHash] == false, "This swap request already completed"); swapState[fromChainId][requestTransactionHash] = true; IERC20Mintable token = IERC20Mintable(address(swapToken)); token.mint(account, amount); emit SwapCompleted(account, amount, fromChainId, getChainId(), requestTransactionHash); } /** * @dev Returns the ID of the current chain. * @return The ID of the current chain. */ function getChainId() public view returns (uint) { return block.chainid; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev 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. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Mintable { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); function mint(address account, uint256 amount) external; function burn(uint256 amount) external; }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address payable","name":"feeReceiver_","type":"address"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"relayer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"}],"name":"FeeReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swapFee","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"RemoveTargetChainConfig","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fromChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toChainId","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"requestTransactionHash","type":"bytes32"}],"name":"SwapCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fromChainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"toChainId","type":"uint256"}],"name":"SwapRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"chainId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"swapFee","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isActive","type":"bool"}],"name":"TargetChainConfigUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getChainId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"bytes32","name":"transactionHash","type":"bytes32"}],"name":"isSwapCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"messageRelayer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromChainId","type":"uint256"},{"internalType":"bytes32","name":"requestTransactionHash","type":"bytes32"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"processSwapRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"}],"name":"removeTargetChain","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"account","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"relayer","type":"address"}],"name":"setMessageRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256","name":"swapFee","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"}],"name":"setTargetChainConfig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"setToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapRequest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"swapToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"targetChains","outputs":[{"internalType":"uint256","name":"swapFee","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"},{"internalType":"bool","name":"exist","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620015cb380380620015cb8339810160408190526200003491620002ac565b6200003f336200007a565b6000805460ff60a01b19169055600180556200005b82620000ca565b620000668362000153565b62000071816200020d565b50505062000300565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038116620001315760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20616464726573732063616e74206265207a65726f206164647265604482015261737360f01b60648201526084015b60405180910390fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038116620001b95760405162461bcd60e51b815260206004820152602560248201527f526563656976657220616464726573732063616e74206265207a65726f206164604482015264647265737360d81b606482015260840162000128565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f27aae5db36d94179909d019ae0b1ac7c16d96d953148f63c0f6a0a9c8ead79ee9060200160405180910390a150565b6001600160a01b038116620002715760405162461bcd60e51b8152602060048201526024808201527f4d6573736167652072656c617965722063616e74206265207a65726f206164646044820152637265737360e01b606482015260840162000128565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0381168114620002a957600080fd5b50565b600080600060608486031215620002c257600080fd5b8351620002cf8162000293565b6020850151909350620002e28162000293565b6040850151909250620002f58162000293565b809150509250925092565b6112bb80620003106000396000f3fe6080604052600436106100fe5760003560e01c80636cfd26e911610095578063a00b804b11610064578063a00b804b146102f7578063b3f006741461030a578063dc73e49c1461032a578063efdcd9741461034a578063f2fde38b1461036a57600080fd5b80636cfd26e914610284578063715018a6146102a45780637a681df2146102b95780638da5cb5b146102d957600080fd5b806339016762116100d157806339016762146101b057806345e1adc0146101d05780634f3b457e1461022d5780635c975abb1461026557600080fd5b8063144fa6d71461010357806329b29b0d14610125578063306db231146101455780633408e47014610195575b600080fd5b34801561010f57600080fd5b5061012361011e366004611110565b61038a565b005b34801561013157600080fd5b50610123610140366004611142565b61039e565b34801561015157600080fd5b5061018061016036600461117b565b600091825260066020908152604080842092845291905290205460ff1690565b60405190151581526020015b60405180910390f35b3480156101a157600080fd5b5060405146815260200161018c565b3480156101bc57600080fd5b506101236101cb36600461119d565b610493565b3480156101dc57600080fd5b506102106101eb3660046111dc565b6005602052600090815260409020805460019091015460ff8082169161010090041683565b60408051938452911515602084015215159082015260600161018c565b34801561023957600080fd5b5060035461024d906001600160a01b031681565b6040516001600160a01b03909116815260200161018c565b34801561027157600080fd5b50600054600160a01b900460ff16610180565b34801561029057600080fd5b5061012361029f366004611110565b610674565b3480156102b057600080fd5b50610123610685565b3480156102c557600080fd5b506101236102d43660046111dc565b610699565b3480156102e557600080fd5b506000546001600160a01b031661024d565b61012361030536600461117b565b6107dd565b34801561031657600080fd5b5060025461024d906001600160a01b031681565b34801561033657600080fd5b5060045461024d906001600160a01b031681565b34801561035657600080fd5b50610123610365366004611110565b610aa4565b34801561037657600080fd5b50610123610385366004611110565b610ab5565b610392610b2b565b61039b81610b85565b50565b6103a6610b2b565b824681036103eb5760405162461bcd60e51b815260206004820152600d60248201526c24b99039b0b6b29031b430b4b760991b60448201526064015b60405180910390fd5b6000848152600560208181526040808420815160608082018452600180840180548c85528b15158589018181528689019485529a8f905298885284519095559751905161ffff1990941690151561ff0019161761010093151593909302929092179095558151898152928301889052908201929092527f478dd41061ee5e513dbcc0ff2b73e1f24c64f7d7f12fe59e3c839f4223820200910160405180910390a15050505050565b61049b610c08565b6003546001600160a01b0316336001600160a01b0316146104fe5760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c792063616c6c2066726f6d206d6573736167652072656c61796572000060448201526064016103e2565b610506610c55565b600084815260066020908152604080832086845290915290205460ff161561057c5760405162461bcd60e51b815260206004820152602360248201527f546869732073776170207265717565737420616c726561647920636f6d706c656044820152621d195960ea1b60648201526084016103e2565b600084815260066020908152604080832086845290915290819020805460ff191660011790556004805491516340c10f1960e01b81526001600160a01b03858116928201929092526024810184905291169081906340c10f1990604401600060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b50505050826001600160a01b03167ffaada5e2bf1280a33429be771be90ded670733aa2ecca91252b1ebdb81ea217a838761063f4690565b604080519384526020840192909252908201526060810187905260800160405180910390a25061066e60018055565b50505050565b61067c610b2b565b61039b81610cae565b61068d610b2b565b6106976000610d32565b565b6106a1610b2b565b804681036106e15760405162461bcd60e51b815260206004820152600d60248201526c24b99039b0b6b29031b430b4b760991b60448201526064016103e2565b60008281526005602090815260409182902082516060810184528154815260019182015460ff808216151594830194909452610100900490921615159282018390529091146107725760405162461bcd60e51b815260206004820152601b60248201527f54617267657420636861696e20646f6573206e6f74206578697374000000000060448201526064016103e2565b60008381526005602090815260408083209283556001909201805461ffff1916905582518382015183518781529283019190915215158183015290517f47d5894f8301001af385bc40894a4f5999ef78c7c09dfbc3d2fc82710e97d6359181900360600190a1505050565b6107e5610c08565b6002546001600160a01b031661083d5760405162461bcd60e51b815260206004820152601b60248201527f466565207265636569766572206973206e6f7420646566696e6564000000000060448201526064016103e2565b610845610c55565b60008281526005602090815260409182902082516060810184528154815260019091015460ff80821615159383019390935261010090049091161580159282019290925260045490916001600160a01b0390911690806108a757506020820151155b156108f45760405162461bcd60e51b815260206004820152601a60248201527f54617267657420636861696e206973206e6f742061637469766500000000000060448201526064016103e2565b815134101561093d5760405162461bcd60e51b815260206004820152601560248201527414ddd85c0819995948191bd95cdb9d081c185e5959605a1b60448201526064016103e2565b600454610955906001600160a01b0316333086610d82565b604051630852cd8d60e31b8152600481018490526001600160a01b038216906342966c6890602401600060405180830381600087803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b50508351159150610a539050576002546040516000916001600160a01b03169034908381818185875af1925050503d8060008114610a05576040519150601f19603f3d011682016040523d82523d6000602084013e610a0a565b606091505b5050905080610a515760405162461bcd60e51b8152602060048201526013602482015272119959481d1c985b9cd9995c8819985a5b1959606a1b60448201526064016103e2565b505b60408051848152466020820152808201869052905133917f5304d76028f8ff5ac5ed555bed4c0f4412dd20070c103e125dbf0d5e27a914e8919081900360600190a25050610aa060018055565b5050565b610aac610b2b565b61039b81610ddc565b610abd610b2b565b6001600160a01b038116610b225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103e2565b61039b81610d32565b6000546001600160a01b031633146106975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e2565b6001600160a01b038116610be65760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20616464726573732063616e74206265207a65726f206164647265604482015261737360f01b60648201526084016103e2565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a01b900460ff16156106975760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103e2565b600260015403610ca75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e2565b6002600155565b6001600160a01b038116610d105760405162461bcd60e51b8152602060048201526024808201527f4d6573736167652072656c617965722063616e74206265207a65726f206164646044820152637265737360e01b60648201526084016103e2565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261066e908590610e94565b6001600160a01b038116610e405760405162461bcd60e51b815260206004820152602560248201527f526563656976657220616464726573732063616e74206265207a65726f206164604482015264647265737360d81b60648201526084016103e2565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f27aae5db36d94179909d019ae0b1ac7c16d96d953148f63c0f6a0a9c8ead79ee9060200160405180910390a150565b6000610ee9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f6b9092919063ffffffff16565b805190915015610f665780806020019051810190610f0791906111f5565b610f665760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103e2565b505050565b6060610f7a8484600085610f82565b949350505050565b606082471015610fe35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103e2565b600080866001600160a01b03168587604051610fff9190611236565b60006040518083038185875af1925050503d806000811461103c576040519150601f19603f3d011682016040523d82523d6000602084013e611041565b606091505b50915091506110528783838761105d565b979650505050505050565b606083156110cc5782516000036110c5576001600160a01b0385163b6110c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e2565b5081610f7a565b610f7a83838151156110e15781518083602001fd5b8060405162461bcd60e51b81526004016103e29190611252565b6001600160a01b038116811461039b57600080fd5b60006020828403121561112257600080fd5b813561112d816110fb565b9392505050565b801515811461039b57600080fd5b60008060006060848603121561115757600080fd5b8335925060208401359150604084013561117081611134565b809150509250925092565b6000806040838503121561118e57600080fd5b50508035926020909101359150565b600080600080608085870312156111b357600080fd5b843593506020850135925060408501356111cc816110fb565b9396929550929360600135925050565b6000602082840312156111ee57600080fd5b5035919050565b60006020828403121561120757600080fd5b815161112d81611134565b60005b8381101561122d578181015183820152602001611215565b50506000910152565b60008251611248818460208701611212565b9190910192915050565b6020815260008251806020840152611271816040850160208701611212565b601f01601f1916919091016040019291505056fea2646970667358221220fd5bbf67116e3a5c058e6f4fbc95a912ddfac5b8715575decbb75006b613907264736f6c63430008110033000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f000000000000000000000000a922a70569a7555518bf4ded5094661a965e23ca000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f
Deployed Bytecode
0x6080604052600436106100fe5760003560e01c80636cfd26e911610095578063a00b804b11610064578063a00b804b146102f7578063b3f006741461030a578063dc73e49c1461032a578063efdcd9741461034a578063f2fde38b1461036a57600080fd5b80636cfd26e914610284578063715018a6146102a45780637a681df2146102b95780638da5cb5b146102d957600080fd5b806339016762116100d157806339016762146101b057806345e1adc0146101d05780634f3b457e1461022d5780635c975abb1461026557600080fd5b8063144fa6d71461010357806329b29b0d14610125578063306db231146101455780633408e47014610195575b600080fd5b34801561010f57600080fd5b5061012361011e366004611110565b61038a565b005b34801561013157600080fd5b50610123610140366004611142565b61039e565b34801561015157600080fd5b5061018061016036600461117b565b600091825260066020908152604080842092845291905290205460ff1690565b60405190151581526020015b60405180910390f35b3480156101a157600080fd5b5060405146815260200161018c565b3480156101bc57600080fd5b506101236101cb36600461119d565b610493565b3480156101dc57600080fd5b506102106101eb3660046111dc565b6005602052600090815260409020805460019091015460ff8082169161010090041683565b60408051938452911515602084015215159082015260600161018c565b34801561023957600080fd5b5060035461024d906001600160a01b031681565b6040516001600160a01b03909116815260200161018c565b34801561027157600080fd5b50600054600160a01b900460ff16610180565b34801561029057600080fd5b5061012361029f366004611110565b610674565b3480156102b057600080fd5b50610123610685565b3480156102c557600080fd5b506101236102d43660046111dc565b610699565b3480156102e557600080fd5b506000546001600160a01b031661024d565b61012361030536600461117b565b6107dd565b34801561031657600080fd5b5060025461024d906001600160a01b031681565b34801561033657600080fd5b5060045461024d906001600160a01b031681565b34801561035657600080fd5b50610123610365366004611110565b610aa4565b34801561037657600080fd5b50610123610385366004611110565b610ab5565b610392610b2b565b61039b81610b85565b50565b6103a6610b2b565b824681036103eb5760405162461bcd60e51b815260206004820152600d60248201526c24b99039b0b6b29031b430b4b760991b60448201526064015b60405180910390fd5b6000848152600560208181526040808420815160608082018452600180840180548c85528b15158589018181528689019485529a8f905298885284519095559751905161ffff1990941690151561ff0019161761010093151593909302929092179095558151898152928301889052908201929092527f478dd41061ee5e513dbcc0ff2b73e1f24c64f7d7f12fe59e3c839f4223820200910160405180910390a15050505050565b61049b610c08565b6003546001600160a01b0316336001600160a01b0316146104fe5760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c792063616c6c2066726f6d206d6573736167652072656c61796572000060448201526064016103e2565b610506610c55565b600084815260066020908152604080832086845290915290205460ff161561057c5760405162461bcd60e51b815260206004820152602360248201527f546869732073776170207265717565737420616c726561647920636f6d706c656044820152621d195960ea1b60648201526084016103e2565b600084815260066020908152604080832086845290915290819020805460ff191660011790556004805491516340c10f1960e01b81526001600160a01b03858116928201929092526024810184905291169081906340c10f1990604401600060405180830381600087803b1580156105f357600080fd5b505af1158015610607573d6000803e3d6000fd5b50505050826001600160a01b03167ffaada5e2bf1280a33429be771be90ded670733aa2ecca91252b1ebdb81ea217a838761063f4690565b604080519384526020840192909252908201526060810187905260800160405180910390a25061066e60018055565b50505050565b61067c610b2b565b61039b81610cae565b61068d610b2b565b6106976000610d32565b565b6106a1610b2b565b804681036106e15760405162461bcd60e51b815260206004820152600d60248201526c24b99039b0b6b29031b430b4b760991b60448201526064016103e2565b60008281526005602090815260409182902082516060810184528154815260019182015460ff808216151594830194909452610100900490921615159282018390529091146107725760405162461bcd60e51b815260206004820152601b60248201527f54617267657420636861696e20646f6573206e6f74206578697374000000000060448201526064016103e2565b60008381526005602090815260408083209283556001909201805461ffff1916905582518382015183518781529283019190915215158183015290517f47d5894f8301001af385bc40894a4f5999ef78c7c09dfbc3d2fc82710e97d6359181900360600190a1505050565b6107e5610c08565b6002546001600160a01b031661083d5760405162461bcd60e51b815260206004820152601b60248201527f466565207265636569766572206973206e6f7420646566696e6564000000000060448201526064016103e2565b610845610c55565b60008281526005602090815260409182902082516060810184528154815260019091015460ff80821615159383019390935261010090049091161580159282019290925260045490916001600160a01b0390911690806108a757506020820151155b156108f45760405162461bcd60e51b815260206004820152601a60248201527f54617267657420636861696e206973206e6f742061637469766500000000000060448201526064016103e2565b815134101561093d5760405162461bcd60e51b815260206004820152601560248201527414ddd85c0819995948191bd95cdb9d081c185e5959605a1b60448201526064016103e2565b600454610955906001600160a01b0316333086610d82565b604051630852cd8d60e31b8152600481018490526001600160a01b038216906342966c6890602401600060405180830381600087803b15801561099757600080fd5b505af11580156109ab573d6000803e3d6000fd5b50508351159150610a539050576002546040516000916001600160a01b03169034908381818185875af1925050503d8060008114610a05576040519150601f19603f3d011682016040523d82523d6000602084013e610a0a565b606091505b5050905080610a515760405162461bcd60e51b8152602060048201526013602482015272119959481d1c985b9cd9995c8819985a5b1959606a1b60448201526064016103e2565b505b60408051848152466020820152808201869052905133917f5304d76028f8ff5ac5ed555bed4c0f4412dd20070c103e125dbf0d5e27a914e8919081900360600190a25050610aa060018055565b5050565b610aac610b2b565b61039b81610ddc565b610abd610b2b565b6001600160a01b038116610b225760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103e2565b61039b81610d32565b6000546001600160a01b031633146106975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103e2565b6001600160a01b038116610be65760405162461bcd60e51b815260206004820152602260248201527f546f6b656e20616464726573732063616e74206265207a65726f206164647265604482015261737360f01b60648201526084016103e2565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600054600160a01b900460ff16156106975760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016103e2565b600260015403610ca75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103e2565b6002600155565b6001600160a01b038116610d105760405162461bcd60e51b8152602060048201526024808201527f4d6573736167652072656c617965722063616e74206265207a65726f206164646044820152637265737360e01b60648201526084016103e2565b600380546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261066e908590610e94565b6001600160a01b038116610e405760405162461bcd60e51b815260206004820152602560248201527f526563656976657220616464726573732063616e74206265207a65726f206164604482015264647265737360d81b60648201526084016103e2565b600280546001600160a01b0319166001600160a01b0383169081179091556040519081527f27aae5db36d94179909d019ae0b1ac7c16d96d953148f63c0f6a0a9c8ead79ee9060200160405180910390a150565b6000610ee9826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f6b9092919063ffffffff16565b805190915015610f665780806020019051810190610f0791906111f5565b610f665760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103e2565b505050565b6060610f7a8484600085610f82565b949350505050565b606082471015610fe35760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103e2565b600080866001600160a01b03168587604051610fff9190611236565b60006040518083038185875af1925050503d806000811461103c576040519150601f19603f3d011682016040523d82523d6000602084013e611041565b606091505b50915091506110528783838761105d565b979650505050505050565b606083156110cc5782516000036110c5576001600160a01b0385163b6110c55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103e2565b5081610f7a565b610f7a83838151156110e15781518083602001fd5b8060405162461bcd60e51b81526004016103e29190611252565b6001600160a01b038116811461039b57600080fd5b60006020828403121561112257600080fd5b813561112d816110fb565b9392505050565b801515811461039b57600080fd5b60008060006060848603121561115757600080fd5b8335925060208401359150604084013561117081611134565b809150509250925092565b6000806040838503121561118e57600080fd5b50508035926020909101359150565b600080600080608085870312156111b357600080fd5b843593506020850135925060408501356111cc816110fb565b9396929550929360600135925050565b6000602082840312156111ee57600080fd5b5035919050565b60006020828403121561120757600080fd5b815161112d81611134565b60005b8381101561122d578181015183820152602001611215565b50506000910152565b60008251611248818460208701611212565b9190910192915050565b6020815260008251806020840152611271816040850160208701611212565b601f01601f1916919091016040019291505056fea2646970667358221220fd5bbf67116e3a5c058e6f4fbc95a912ddfac5b8715575decbb75006b613907264736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f000000000000000000000000a922a70569a7555518bf4ded5094661a965e23ca000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f
-----Decoded View---------------
Arg [0] : feeReceiver_ (address): 0xa03A9566479130a2EFC918C6A726D030Dd17627F
Arg [1] : token (address): 0xa922a70569a7555518bF4DED5094661a965E23cA
Arg [2] : relayer (address): 0xa03A9566479130a2EFC918C6A726D030Dd17627F
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f
Arg [1] : 000000000000000000000000a922a70569a7555518bf4ded5094661a965e23ca
Arg [2] : 000000000000000000000000a03a9566479130a2efc918c6a726d030dd17627f
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
BSC | 100.00% | $575.29 | 0.002 | $1.15 |
Loading...
Loading
[ Download: CSV Export ]
[ 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.