More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 374 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Swap | 20223731 | 5 mins ago | IN | 0 ETH | 0.00028501 | ||||
Swap | 20218146 | 18 hrs ago | IN | 0 ETH | 0.0006215 | ||||
Swap | 20216499 | 24 hrs ago | IN | 0 ETH | 0.00056027 | ||||
Swap | 20203793 | 2 days ago | IN | 0 ETH | 0.00038894 | ||||
Swap | 20187914 | 5 days ago | IN | 0 ETH | 0.00082764 | ||||
Swap | 20181050 | 5 days ago | IN | 0 ETH | 0.00100526 | ||||
Swap | 20165166 | 8 days ago | IN | 0 ETH | 0.00082301 | ||||
Swap | 20159093 | 9 days ago | IN | 0 ETH | 0.00064382 | ||||
Swap | 20131077 | 12 days ago | IN | 0 ETH | 0.00397294 | ||||
Swap | 20123414 | 14 days ago | IN | 0 ETH | 0.00136103 | ||||
Swap | 20118496 | 14 days ago | IN | 0 ETH | 0.00210138 | ||||
Swap | 20108914 | 16 days ago | IN | 0 ETH | 0.00149124 | ||||
Swap | 20087337 | 19 days ago | IN | 0 ETH | 0.0042385 | ||||
Swap | 20081303 | 19 days ago | IN | 0 ETH | 0.01374697 | ||||
Swap | 20073234 | 21 days ago | IN | 0 ETH | 0.00207623 | ||||
Swap | 20067013 | 21 days ago | IN | 0 ETH | 0.00532549 | ||||
Swap | 20060685 | 22 days ago | IN | 0 ETH | 0.00098716 | ||||
Swap | 20060643 | 22 days ago | IN | 0 ETH | 0.00679439 | ||||
Swap | 20023538 | 27 days ago | IN | 0 ETH | 0.00646098 | ||||
Swap | 20009916 | 29 days ago | IN | 0 ETH | 0.00355467 | ||||
Swap | 19988129 | 32 days ago | IN | 0 ETH | 0.00112523 | ||||
Swap | 19988126 | 32 days ago | IN | 0 ETH | 0.0027722 | ||||
Swap | 19986427 | 33 days ago | IN | 0 ETH | 0.0022068 | ||||
Swap | 19979553 | 34 days ago | IN | 0 ETH | 0.00319857 | ||||
Swap | 19973020 | 35 days ago | IN | 0 ETH | 0.00359996 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
Swap
Compiler Version
v0.8.9+commit.e5eed63a
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; abstract contract Relayer is Ownable { mapping(address => bool) private _relayers; function relayer(address _address) public view virtual returns (bool) { return _relayers[_address]; } /** * @dev Throws if called by any account other than the relayer. */ modifier onlyRelayer() { require(relayer(_msgSender()), "Relayer: caller is not the relayer"); _; } /** * @dev Adds a relayer. */ function addRelayer(address _address) public virtual onlyOwner { require(_address != address(0), "Relayer: the relayer is the zero address"); _relayers[_address] = true; } /** * @dev Adds one or more relayers. */ function addRelayers(address[] memory _addresses) public virtual onlyOwner { for (uint256 i = 0; i < _addresses.length; i++) { addRelayer(_addresses[i]); } } /** * @dev Removes a relayer. */ function removeRelayer(address _address) public virtual onlyOwner { require(_address != address(0), "Relayer: the relayer is the zero address"); _relayers[_address] = false; } /** * @dev Removes one or more approvers. */ function removeRelayers(address[] memory _addresses) public virtual onlyOwner { for (uint256 i = 0; i < _addresses.length; i++) { removeRelayer(_addresses[i]); } } } abstract contract Approver is Ownable { mapping(address => bool) private _approvers; function approver(address _address) public view virtual returns (bool) { return _approvers[_address]; } /** * @dev Adds an approver. */ function addApprover(address _address) public virtual onlyOwner { require(_address != address(0), "Approver: the approver is the zero address"); _approvers[_address] = true; } /** * @dev Adds one or more approvers. */ function addApprovers(address[] memory _addresses) public virtual onlyOwner { for (uint256 i = 0; i < _addresses.length; i++) { addApprover(_addresses[i]); } } /** * @dev Removes an approver. */ function removeApprover(address _address) public virtual onlyOwner { require(_address != address(0), "Approver: the approver is the zero address"); _approvers[_address] = false; } /** * @dev Removes one or more approvers. */ function removeApprovers(address[] memory _addresses) public virtual onlyOwner { for (uint256 i = 0; i < _addresses.length; i++) { removeApprover(_addresses[i]); } } } contract Swap is Relayer, Approver, EIP712 { using ECDSA for bytes32; IERC20 public token; mapping(bytes32 => bool) private _batches; mapping(uint256 => bytes32) private _requests; constructor(address _token, address _relayer, address _approver) EIP712("ShareRingSwap", "2.0") { require(_token != address(0), "Swap: the token is the zero address"); token = IERC20(_token); require(token.balanceOf(address(this)) == 0, "Swap: the token must be an ERC20 contract"); addRelayer(_relayer); addApprover(_approver); } event SwapCompleted(uint256[] indexed ids); /** * @dev Returns the token balance of the contract. */ function tokensAvailable() public view returns (uint256) { return token.balanceOf(address(this)); } /** * @dev Withdraws all remaining balance to owner's account. * * Currently it transfers ALL balance. * TBC: support partial withdraw? */ function withdraw() public onlyOwner { uint256 balance = tokensAvailable(); assert(balance > 0); token.transfer(owner(), balance); } /** * @dev Deposits token into the contract address. * * There are two options for transferring tokens into the contract: * - By transfer from address to contract address * - By approve allowance for this contract to transfer with this function * * NOTE: The function only works when the allowance is approved. */ function deposit(uint256 _amount) public onlyOwner { assert(_amount > 0); token.transferFrom(msg.sender, address(this), _amount); } /** * @dev Get a specified batch. */ function batch(bytes32 _digest) external view returns (bool) { return _batches[_digest]; } /** * @dev Get a specified request. */ function request(uint256 _id) external view returns (bytes32) { return _requests[_id]; } /** * @dev Returns the digest. * * NOTE: This function does not actually do any state change. * It is just there for generating the approval digest. * * TBC: make it internal */ function digest(uint256[] memory _ids, address[] memory _tos, uint256[] memory _amounts) public view returns(bytes32) { return _hashTypedDataV4( keccak256( abi.encode( keccak256("Swap(uint256[] ids,address[] tos,uint256[] amounts)"), keccak256(abi.encodePacked(_ids)), keccak256(abi.encodePacked(_tos)), keccak256(abi.encodePacked(_amounts)) ) ) ); } /** * @dev Returns the signer's address if signature is valid, otherwise a strange address (or 0x0). * * NOTE: This function does not actually do any state change. * It is just there for verifying the approval signature. * * TBC: make it internal */ function verify(uint256[] memory _ids, address[] memory _tos, uint256[] memory _amounts, bytes memory signature) public view returns(address) { bytes32 hash = digest(_ids, _tos, _amounts); return verify(hash, signature); } function verify(bytes32 _digest, bytes memory signature) internal pure returns(address) { return _digest.recover(signature); } /** * @dev Proceeds the swaps and transfer tokens. */ function swap(uint256[] memory _ids, address[] memory _tos, uint256[] memory _amounts, bytes memory _signature) public onlyRelayer { // 1. validate inputs require(_ids.length > 0 && _tos.length > 0 && _amounts.length > 0, "Swap: one or more inputs are empty"); require(_tos.length == _amounts.length && _ids.length == _tos.length, "Swap: the input lengths do not match"); bytes32 _digest = digest(_ids, _tos, _amounts); require(_batches[_digest] == false, "Swap: batch already exists"); // 2. validate signature address signer = verify(_digest, _signature); require(signer != address(0), "ECDSA: signature is not valid"); require(approver(signer) == true, "Swap: the signer is not an approver"); _batches[_digest] = true; // 3. proceed with sending tokens for (uint256 i = 0; i < _tos.length; i++) { // additional check if request already proceeded require(_requests[_ids[i]] == 0, "Swap: request already exists"); _requests[_ids[i]] = _digest; token.transfer(_tos[i], _amounts[i]); } emit SwapCompleted(_ids); } }
// 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.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-rc.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0-rc.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// 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.8.0-rc.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0-rc.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
{ "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","name":"_token","type":"address"},{"internalType":"address","name":"_relayer","type":"address"},{"internalType":"address","name":"_approver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":true,"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"SwapCompleted","type":"event"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addApprover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addApprovers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addRelayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"approver","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_digest","type":"bytes32"}],"name":"batch","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"address[]","name":"_tos","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"digest","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"relayer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeApprover","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"removeApprovers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"removeRelayer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"removeRelayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"request","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"address[]","name":"_tos","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"swap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokensAvailable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"internalType":"address[]","name":"_tos","type":"address[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101406040523480156200001257600080fd5b5060405162001c9b38038062001c9b83398101604081905262000035916200049a565b6040518060400160405280600d81526020016c0536861726552696e675377617609c1b815250604051806040016040528060038152602001620322e360ec1b815250620000916200008b6200029860201b60201c565b6200029c565b815160208084019190912082518383012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c00190528051940193909320919290916080523060c05261012052505050506001600160a01b0383166200018a5760405162461bcd60e51b815260206004820152602360248201527f537761703a2074686520746f6b656e20697320746865207a65726f206164647260448201526265737360e81b60648201526084015b60405180910390fd5b600380546001600160a01b0319166001600160a01b0385169081179091556040516370a0823160e01b81523060048201526370a082319060240160206040518083038186803b158015620001dd57600080fd5b505afa158015620001f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002189190620004e4565b15620002795760405162461bcd60e51b815260206004820152602960248201527f537761703a2074686520746f6b656e206d75737420626520616e2045524332306044820152680818dbdb9d1c9858dd60ba1b606482015260840162000181565b6200028482620002ec565b6200028f8162000386565b505050620004fe565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b620002f66200041f565b6001600160a01b0381166200035f5760405162461bcd60e51b815260206004820152602860248201527f52656c617965723a207468652072656c6179657220697320746865207a65726f604482015267206164647265737360c01b606482015260840162000181565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b620003906200041f565b6001600160a01b038116620003fb5760405162461bcd60e51b815260206004820152602a60248201527f417070726f7665723a2074686520617070726f76657220697320746865207a65604482015269726f206164647265737360b01b606482015260840162000181565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000546001600160a01b031633146200047b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640162000181565b565b80516001600160a01b03811681146200049557600080fd5b919050565b600080600060608486031215620004b057600080fd5b620004bb846200047d565b9250620004cb602085016200047d565b9150620004db604085016200047d565b90509250925092565b600060208284031215620004f757600080fd5b5051919050565b60805160a05160c05160e051610100516101205161174d6200054e6000396000610f3e01526000610f8d01526000610f6801526000610ec101526000610eeb01526000610f15015261174d6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c8063b646c194116100b8578063f2fde38b1161007c578063f2fde38b146102d0578063f4cb33cc146102e3578063f5e90f94146102f6578063f6708f9614610309578063fc0c546a1461031c578063fddaa0651461032f57600080fd5b8063b646c1941461024b578063b6b55f251461025e578063c9b5ef8e14610271578063d845a4b31461029d578063dd39f00d146102bd57600080fd5b806360f0a5ac1161010a57806360f0a5ac146101e65780636a882d51146101f95780636cf4c88f1461020c578063715018a61461021f5780637569d66f146102275780638da5cb5b1461023a57600080fd5b80631d3d89b6146101475780633ccfd60b146101775780633f131d9f1461018157806358d937ce146101bd57806360659a92146101d0575b600080fd5b61015a610155366004611387565b610352565b6040516001600160a01b0390911681526020015b60405180910390f35b61017f610376565b005b6101ad61018f366004611485565b6001600160a01b031660009081526002602052604090205460ff1690565b604051901515815260200161016e565b61017f6101cb366004611387565b610442565b6101d86108da565b60405190815260200161016e565b61017f6101f4366004611485565b61095b565b61017f6102073660046114a0565b6109aa565b61017f61021a366004611485565b6109f2565b61017f610a41565b61017f6102353660046114a0565b610a55565b6000546001600160a01b031661015a565b61017f610259366004611485565b610a9d565b61017f61026c3660046114d5565b610aef565b6101ad61027f366004611485565b6001600160a01b031660009081526001602052604090205460ff1690565b6101d86102ab3660046114d5565b60009081526005602052604090205490565b61017f6102cb366004611485565b610b44565b61017f6102de366004611485565b610b99565b61017f6102f13660046114a0565b610c12565b61017f6103043660046114a0565b610c5a565b6101d86103173660046114ee565b610ca2565b60035461015a906001600160a01b031681565b6101ad61033d3660046114d5565b60009081526004602052604090205460ff1690565b600080610360868686610ca2565b905061036c8184610d7f565b9695505050505050565b61037e610d92565b60006103886108da565b90506000811161039a5761039a611576565b6003546001600160a01b031663a9059cbb6103bd6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044015b602060405180830381600087803b15801561040657600080fd5b505af115801561041a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e919061158c565b5050565b61044b3361027f565b6104a75760405162461bcd60e51b815260206004820152602260248201527f52656c617965723a2063616c6c6572206973206e6f74207468652072656c617960448201526132b960f11b60648201526084015b60405180910390fd5b600084511180156104b9575060008351115b80156104c6575060008251115b61051d5760405162461bcd60e51b815260206004820152602260248201527f537761703a206f6e65206f72206d6f726520696e707574732061726520656d70604482015261747960f01b606482015260840161049e565b8151835114801561052f575082518451145b6105875760405162461bcd60e51b8152602060048201526024808201527f537761703a2074686520696e707574206c656e6774687320646f206e6f74206d6044820152630c2e8c6d60e31b606482015260840161049e565b6000610594858585610ca2565b60008181526004602052604090205490915060ff16156105f65760405162461bcd60e51b815260206004820152601a60248201527f537761703a20626174636820616c726561647920657869737473000000000000604482015260640161049e565b60006106028284610d7f565b90506001600160a01b03811661065a5760405162461bcd60e51b815260206004820152601d60248201527f45434453413a207369676e6174757265206973206e6f742076616c6964000000604482015260640161049e565b6001600160a01b03811660009081526002602052604090205460ff1615156001146106d35760405162461bcd60e51b815260206004820152602360248201527f537761703a20746865207369676e6572206973206e6f7420616e20617070726f6044820152623b32b960e91b606482015260840161049e565b6000828152600460205260408120805460ff191660011790555b8551811015610893576005600088838151811061070c5761070c6115ae565b60200260200101518152602001908152602001600020546000801b146107745760405162461bcd60e51b815260206004820152601c60248201527f537761703a207265717565737420616c72656164792065786973747300000000604482015260640161049e565b826005600089848151811061078b5761078b6115ae565b6020026020010151815260200190815260200160002081905550600360009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb8783815181106107db576107db6115ae565b60200260200101518784815181106107f5576107f56115ae565b60200260200101516040518363ffffffff1660e01b815260040161082e9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561084857600080fd5b505af115801561085c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610880919061158c565b508061088b816115c4565b9150506106ed565b50856040516108a291906115ed565b604051908190038120907f796a6fb73c9c09afe863a5d1bc7040da846e5aeb2ad3cb42ee36e08a0c0a3e7190600090a2505050505050565b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109569190611623565b905090565b610963610d92565b6001600160a01b0381166109895760405162461bcd60e51b815260040161049e9061163c565b6001600160a01b03166000908152600160205260409020805460ff19169055565b6109b2610d92565b60005b815181101561043e576109e08282815181106109d3576109d36115ae565b6020026020010151610a9d565b806109ea816115c4565b9150506109b5565b6109fa610d92565b6001600160a01b038116610a205760405162461bcd60e51b815260040161049e90611684565b6001600160a01b03166000908152600260205260409020805460ff19169055565b610a49610d92565b610a536000610dec565b565b610a5d610d92565b60005b815181101561043e57610a8b828281518110610a7e57610a7e6115ae565b60200260200101516109f2565b80610a95816115c4565b915050610a60565b610aa5610d92565b6001600160a01b038116610acb5760405162461bcd60e51b815260040161049e90611684565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b610af7610d92565b60008111610b0757610b07611576565b6003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016103ec565b610b4c610d92565b6001600160a01b038116610b725760405162461bcd60e51b815260040161049e9061163c565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b610ba1610d92565b6001600160a01b038116610c065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161049e565b610c0f81610dec565b50565b610c1a610d92565b60005b815181101561043e57610c48828281518110610c3b57610c3b6115ae565b6020026020010151610b44565b80610c52816115c4565b915050610c1d565b610c62610d92565b60005b815181101561043e57610c90828281518110610c8357610c836115ae565b602002602001015161095b565b80610c9a816115c4565b915050610c65565b6000610d777f09b8a08b090eeab5363e11767a7aa5068ad8ad0003d8600d51b47998093fdae685604051602001610cd991906115ed565b6040516020818303038152906040528051906020012085604051602001610d0091906116ce565b6040516020818303038152906040528051906020012085604051602001610d2791906115ed565b60408051601f198184030181528282528051602091820120908301959095528101929092526060820152608081019190915260a00160405160208183030381529060405280519060200120610e3c565b949350505050565b6000610d8b8383610e90565b9392505050565b6000546001600160a01b03163314610a535760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161049e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610e8a610e49610eb4565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b6000806000610e9f8585610fdb565b91509150610eac81611021565b509392505050565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015610f0d57507f000000000000000000000000000000000000000000000000000000000000000046145b15610f3757507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156110125760208301516040840151606085015160001a6110068782858561116f565b9450945050505061101a565b506000905060025b9250929050565b600081600481111561103557611035611701565b141561103e5750565b600181600481111561105257611052611701565b14156110a05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161049e565b60028160048111156110b4576110b4611701565b14156111025760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161049e565b600381600481111561111657611116611701565b1415610c0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161049e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156111a6575060009050600361122a565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156111fa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166112235760006001925092505061122a565b9150600090505b94509492505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561127257611272611233565b604052919050565b600067ffffffffffffffff82111561129457611294611233565b5060051b60200190565b600082601f8301126112af57600080fd5b813560206112c46112bf8361127a565b611249565b82815260059290921b840181019181810190868411156112e357600080fd5b8286015b848110156112fe57803583529183019183016112e7565b509695505050505050565b80356001600160a01b038116811461132057600080fd5b919050565b600082601f83011261133657600080fd5b813560206113466112bf8361127a565b82815260059290921b8401810191818101908684111561136557600080fd5b8286015b848110156112fe5761137a81611309565b8352918301918301611369565b6000806000806080858703121561139d57600080fd5b843567ffffffffffffffff808211156113b557600080fd5b6113c18883890161129e565b95506020915081870135818111156113d857600080fd5b6113e489828a01611325565b9550506040870135818111156113f957600080fd5b61140589828a0161129e565b94505060608701358181111561141a57600080fd5b8701601f8101891361142b57600080fd5b80358281111561143d5761143d611233565b61144f601f8201601f19168501611249565b9250808352898482840101111561146557600080fd5b808483018585013760008482850101525050809250505092959194509250565b60006020828403121561149757600080fd5b610d8b82611309565b6000602082840312156114b257600080fd5b813567ffffffffffffffff8111156114c957600080fd5b610d7784828501611325565b6000602082840312156114e757600080fd5b5035919050565b60008060006060848603121561150357600080fd5b833567ffffffffffffffff8082111561151b57600080fd5b6115278783880161129e565b9450602086013591508082111561153d57600080fd5b61154987838801611325565b9350604086013591508082111561155f57600080fd5b5061156c8682870161129e565b9150509250925092565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561159e57600080fd5b81518015158114610d8b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60006000198214156115e657634e487b7160e01b600052601160045260246000fd5b5060010190565b815160009082906020808601845b83811015611617578151855293820193908201906001016115fb565b50929695505050505050565b60006020828403121561163557600080fd5b5051919050565b60208082526028908201527f52656c617965723a207468652072656c6179657220697320746865207a65726f604082015267206164647265737360c01b606082015260800190565b6020808252602a908201527f417070726f7665723a2074686520617070726f76657220697320746865207a65604082015269726f206164647265737360b01b606082015260800190565b815160009082906020808601845b838110156116175781516001600160a01b0316855293820193908201906001016116dc565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220fc19831561e43f9280af332d707263d651bbd7a68eacb54e3b604e8f508eb26b64736f6c63430008090033000000000000000000000000d98f75b1a3261dab9eed4956c93f33749027a9640000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a40000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a4
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101425760003560e01c8063b646c194116100b8578063f2fde38b1161007c578063f2fde38b146102d0578063f4cb33cc146102e3578063f5e90f94146102f6578063f6708f9614610309578063fc0c546a1461031c578063fddaa0651461032f57600080fd5b8063b646c1941461024b578063b6b55f251461025e578063c9b5ef8e14610271578063d845a4b31461029d578063dd39f00d146102bd57600080fd5b806360f0a5ac1161010a57806360f0a5ac146101e65780636a882d51146101f95780636cf4c88f1461020c578063715018a61461021f5780637569d66f146102275780638da5cb5b1461023a57600080fd5b80631d3d89b6146101475780633ccfd60b146101775780633f131d9f1461018157806358d937ce146101bd57806360659a92146101d0575b600080fd5b61015a610155366004611387565b610352565b6040516001600160a01b0390911681526020015b60405180910390f35b61017f610376565b005b6101ad61018f366004611485565b6001600160a01b031660009081526002602052604090205460ff1690565b604051901515815260200161016e565b61017f6101cb366004611387565b610442565b6101d86108da565b60405190815260200161016e565b61017f6101f4366004611485565b61095b565b61017f6102073660046114a0565b6109aa565b61017f61021a366004611485565b6109f2565b61017f610a41565b61017f6102353660046114a0565b610a55565b6000546001600160a01b031661015a565b61017f610259366004611485565b610a9d565b61017f61026c3660046114d5565b610aef565b6101ad61027f366004611485565b6001600160a01b031660009081526001602052604090205460ff1690565b6101d86102ab3660046114d5565b60009081526005602052604090205490565b61017f6102cb366004611485565b610b44565b61017f6102de366004611485565b610b99565b61017f6102f13660046114a0565b610c12565b61017f6103043660046114a0565b610c5a565b6101d86103173660046114ee565b610ca2565b60035461015a906001600160a01b031681565b6101ad61033d3660046114d5565b60009081526004602052604090205460ff1690565b600080610360868686610ca2565b905061036c8184610d7f565b9695505050505050565b61037e610d92565b60006103886108da565b90506000811161039a5761039a611576565b6003546001600160a01b031663a9059cbb6103bd6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602481018490526044015b602060405180830381600087803b15801561040657600080fd5b505af115801561041a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043e919061158c565b5050565b61044b3361027f565b6104a75760405162461bcd60e51b815260206004820152602260248201527f52656c617965723a2063616c6c6572206973206e6f74207468652072656c617960448201526132b960f11b60648201526084015b60405180910390fd5b600084511180156104b9575060008351115b80156104c6575060008251115b61051d5760405162461bcd60e51b815260206004820152602260248201527f537761703a206f6e65206f72206d6f726520696e707574732061726520656d70604482015261747960f01b606482015260840161049e565b8151835114801561052f575082518451145b6105875760405162461bcd60e51b8152602060048201526024808201527f537761703a2074686520696e707574206c656e6774687320646f206e6f74206d6044820152630c2e8c6d60e31b606482015260840161049e565b6000610594858585610ca2565b60008181526004602052604090205490915060ff16156105f65760405162461bcd60e51b815260206004820152601a60248201527f537761703a20626174636820616c726561647920657869737473000000000000604482015260640161049e565b60006106028284610d7f565b90506001600160a01b03811661065a5760405162461bcd60e51b815260206004820152601d60248201527f45434453413a207369676e6174757265206973206e6f742076616c6964000000604482015260640161049e565b6001600160a01b03811660009081526002602052604090205460ff1615156001146106d35760405162461bcd60e51b815260206004820152602360248201527f537761703a20746865207369676e6572206973206e6f7420616e20617070726f6044820152623b32b960e91b606482015260840161049e565b6000828152600460205260408120805460ff191660011790555b8551811015610893576005600088838151811061070c5761070c6115ae565b60200260200101518152602001908152602001600020546000801b146107745760405162461bcd60e51b815260206004820152601c60248201527f537761703a207265717565737420616c72656164792065786973747300000000604482015260640161049e565b826005600089848151811061078b5761078b6115ae565b6020026020010151815260200190815260200160002081905550600360009054906101000a90046001600160a01b03166001600160a01b031663a9059cbb8783815181106107db576107db6115ae565b60200260200101518784815181106107f5576107f56115ae565b60200260200101516040518363ffffffff1660e01b815260040161082e9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b15801561084857600080fd5b505af115801561085c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610880919061158c565b508061088b816115c4565b9150506106ed565b50856040516108a291906115ed565b604051908190038120907f796a6fb73c9c09afe863a5d1bc7040da846e5aeb2ad3cb42ee36e08a0c0a3e7190600090a2505050505050565b6003546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a082319060240160206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109569190611623565b905090565b610963610d92565b6001600160a01b0381166109895760405162461bcd60e51b815260040161049e9061163c565b6001600160a01b03166000908152600160205260409020805460ff19169055565b6109b2610d92565b60005b815181101561043e576109e08282815181106109d3576109d36115ae565b6020026020010151610a9d565b806109ea816115c4565b9150506109b5565b6109fa610d92565b6001600160a01b038116610a205760405162461bcd60e51b815260040161049e90611684565b6001600160a01b03166000908152600260205260409020805460ff19169055565b610a49610d92565b610a536000610dec565b565b610a5d610d92565b60005b815181101561043e57610a8b828281518110610a7e57610a7e6115ae565b60200260200101516109f2565b80610a95816115c4565b915050610a60565b610aa5610d92565b6001600160a01b038116610acb5760405162461bcd60e51b815260040161049e90611684565b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b610af7610d92565b60008111610b0757610b07611576565b6003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016103ec565b610b4c610d92565b6001600160a01b038116610b725760405162461bcd60e51b815260040161049e9061163c565b6001600160a01b03166000908152600160208190526040909120805460ff19169091179055565b610ba1610d92565b6001600160a01b038116610c065760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161049e565b610c0f81610dec565b50565b610c1a610d92565b60005b815181101561043e57610c48828281518110610c3b57610c3b6115ae565b6020026020010151610b44565b80610c52816115c4565b915050610c1d565b610c62610d92565b60005b815181101561043e57610c90828281518110610c8357610c836115ae565b602002602001015161095b565b80610c9a816115c4565b915050610c65565b6000610d777f09b8a08b090eeab5363e11767a7aa5068ad8ad0003d8600d51b47998093fdae685604051602001610cd991906115ed565b6040516020818303038152906040528051906020012085604051602001610d0091906116ce565b6040516020818303038152906040528051906020012085604051602001610d2791906115ed565b60408051601f198184030181528282528051602091820120908301959095528101929092526060820152608081019190915260a00160405160208183030381529060405280519060200120610e3c565b949350505050565b6000610d8b8383610e90565b9392505050565b6000546001600160a01b03163314610a535760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161049e565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610e8a610e49610eb4565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b92915050565b6000806000610e9f8585610fdb565b91509150610eac81611021565b509392505050565b6000306001600160a01b037f000000000000000000000000e503f9a8653cdeb807c41aeeaccb9c0de3c9aac116148015610f0d57507f000000000000000000000000000000000000000000000000000000000000000146145b15610f3757507f1d38bab1dd311b33a39c5d7e9f1b727d40bac3ce52b70173cf94c2edebd5ea1490565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f1d6ce926126a7a404be012b8bac2f9eaa7e344eec3c8586dccda9cca6a5c0090828401527f88f72b566ae0c96f6fffac4bc8ac74909f61512ac0c06a8124d5ed420d306f9060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604114156110125760208301516040840151606085015160001a6110068782858561116f565b9450945050505061101a565b506000905060025b9250929050565b600081600481111561103557611035611701565b141561103e5750565b600181600481111561105257611052611701565b14156110a05760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161049e565b60028160048111156110b4576110b4611701565b14156111025760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161049e565b600381600481111561111657611116611701565b1415610c0f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161049e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156111a6575060009050600361122a565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156111fa573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166112235760006001925092505061122a565b9150600090505b94509492505050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561127257611272611233565b604052919050565b600067ffffffffffffffff82111561129457611294611233565b5060051b60200190565b600082601f8301126112af57600080fd5b813560206112c46112bf8361127a565b611249565b82815260059290921b840181019181810190868411156112e357600080fd5b8286015b848110156112fe57803583529183019183016112e7565b509695505050505050565b80356001600160a01b038116811461132057600080fd5b919050565b600082601f83011261133657600080fd5b813560206113466112bf8361127a565b82815260059290921b8401810191818101908684111561136557600080fd5b8286015b848110156112fe5761137a81611309565b8352918301918301611369565b6000806000806080858703121561139d57600080fd5b843567ffffffffffffffff808211156113b557600080fd5b6113c18883890161129e565b95506020915081870135818111156113d857600080fd5b6113e489828a01611325565b9550506040870135818111156113f957600080fd5b61140589828a0161129e565b94505060608701358181111561141a57600080fd5b8701601f8101891361142b57600080fd5b80358281111561143d5761143d611233565b61144f601f8201601f19168501611249565b9250808352898482840101111561146557600080fd5b808483018585013760008482850101525050809250505092959194509250565b60006020828403121561149757600080fd5b610d8b82611309565b6000602082840312156114b257600080fd5b813567ffffffffffffffff8111156114c957600080fd5b610d7784828501611325565b6000602082840312156114e757600080fd5b5035919050565b60008060006060848603121561150357600080fd5b833567ffffffffffffffff8082111561151b57600080fd5b6115278783880161129e565b9450602086013591508082111561153d57600080fd5b61154987838801611325565b9350604086013591508082111561155f57600080fd5b5061156c8682870161129e565b9150509250925092565b634e487b7160e01b600052600160045260246000fd5b60006020828403121561159e57600080fd5b81518015158114610d8b57600080fd5b634e487b7160e01b600052603260045260246000fd5b60006000198214156115e657634e487b7160e01b600052601160045260246000fd5b5060010190565b815160009082906020808601845b83811015611617578151855293820193908201906001016115fb565b50929695505050505050565b60006020828403121561163557600080fd5b5051919050565b60208082526028908201527f52656c617965723a207468652072656c6179657220697320746865207a65726f604082015267206164647265737360c01b606082015260800190565b6020808252602a908201527f417070726f7665723a2074686520617070726f76657220697320746865207a65604082015269726f206164647265737360b01b606082015260800190565b815160009082906020808601845b838110156116175781516001600160a01b0316855293820193908201906001016116dc565b634e487b7160e01b600052602160045260246000fdfea2646970667358221220fc19831561e43f9280af332d707263d651bbd7a68eacb54e3b604e8f508eb26b64736f6c63430008090033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d98f75b1a3261dab9eed4956c93f33749027a9640000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a40000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a4
-----Decoded View---------------
Arg [0] : _token (address): 0xd98F75b1A3261dab9eEd4956c93F33749027a964
Arg [1] : _relayer (address): 0x5ff4e128e7dC3a3ab4f2a61510272472fDd759A4
Arg [2] : _approver (address): 0x5ff4e128e7dC3a3ab4f2a61510272472fDd759A4
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d98f75b1a3261dab9eed4956c93f33749027a964
Arg [1] : 0000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a4
Arg [2] : 0000000000000000000000005ff4e128e7dc3a3ab4f2a61510272472fdd759a4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.002107 | 746,106.36 | $1,572.14 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.