Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x99AF554d6D9bAF9d4056122e42f18Cf28951eEE4
Balance 0 ETH
Nonce 1
Code Size 8088 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

8088 bytes
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80638da5cb5b11610097578063ebe73ca411610066578063ebe73ca41461027b578063f2fde38b14610297578063f8b4d864146102b3578063f9213fc8146102e357610100565b80638da5cb5b146101db578063a7678b18146101f9578063a85c38ef14610215578063d09ef2411461024b57610100565b80635c622a0e116100d35780635c622a0e146101795780635c975abb146101a9578063715018a6146101c75780638456cb59146101d157610100565b80631ad4aa42146101055780633f4ba83a1461012157806346c368c21461012b5780634afdcbde1461015b575b600080fd5b61011f600480360381019061011a91906116bc565b6102ff565b005b610129610420565b005b61014560048036038101906101409190611756565b6104b1565b6040516101529190611c66565b60405180910390f35b6101636104d3565b6040516101709190611a3d565b60405180910390f35b610193600480360381019061018e91906117f1565b6104f9565b6040516101a09190611bb0565b60405180910390f35b6101b1610523565b6040516101be9190611b50565b60405180910390f35b6101cf610539565b005b6101d96105c1565b005b6101e3610652565b6040516101f09190611a3d565b60405180910390f35b610213600480360381019061020e9190611783565b61067b565b005b61022f600480360381019061022a91906117f1565b6109bf565b6040516102429796959493929190611a81565b60405180910390f35b610265600480360381019061026091906117f1565b610a81565b6040516102729190611c4b565b60405180910390f35b61029560048036038101906102909190611783565b610c24565b005b6102b160048036038101906102ac91906116bc565b610e62565b005b6102cd60048036038101906102c891906116bc565b610f5a565b6040516102da9190611b50565b60405180910390f35b6102fd60048036038101906102f891906116e9565b610f7a565b005b61030761108a565b73ffffffffffffffffffffffffffffffffffffffff16610325610652565b73ffffffffffffffffffffffffffffffffffffffff161461037b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161037290611c2b565b60405180910390fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f49af92e8e702a1adb06ae79c01a1dfed719800edb7f85d9b79e2622ea33f4cf98183604051610414929190611a58565b60405180910390a15050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146104a7576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104af611092565b565b60006104cc828036038101906104c791906117c4565b611133565b9050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006001600083815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900460ff16905090565b61054161108a565b73ffffffffffffffffffffffffffffffffffffffff1661055f610652565b73ffffffffffffffffffffffffffffffffffffffff16146105b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105ac90611c2b565b60405180910390fd5b6105bf6000611141565b565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610648576040517f48f5c3ed00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610650611206565b565b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610683610523565b156106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90611c0b565b60405180910390fd5b6106cd82826112a8565b428260a001351161070a576040517f45fa2d0600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006107258380360381019061072091906117c4565b611133565b90506001600281111561073b5761073a611d81565b5b6001600083815260200190815260200160002060009054906101000a900460ff16600281111561076e5761076d611d81565b5b14156107a6576040517f1f368c2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002808111156107b9576107b8611d81565b5b6001600083815260200190815260200160002060009054906101000a900460ff1660028111156107ec576107eb611d81565b5b1415610824576040517f228f2fb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600180600083815260200190815260200160002060006101000a81548160ff0219169083600281111561085a57610859611d81565b5b021790555082606001602081019061087291906116bc565b73ffffffffffffffffffffffffffffffffffffffff166323b872dd8460200160208101906108a091906116bc565b8560400160208101906108b391906116bc565b86608001356040518463ffffffff1660e01b81526004016108d693929190611af0565b602060405180830381600087803b1580156108f057600080fd5b505af1158015610904573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109289190611729565b5082606001602081019061093c91906116bc565b73ffffffffffffffffffffffffffffffffffffffff168360c001357f427a5c054bf4858fa5eaf4fbc1125a64160741ef59682db0fdc9687b3858094485600001602081019061098b91906116bc565b86604001602081019061099e91906116bc565b87608001356040516109b293929190611af0565b60405180910390a3505050565b60026020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060040154908060050154908060060154905087565b610a896114cc565b600260008381526020019081526020016000206040518060e00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016003820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160048201548152602001600582015481526020016006820154815250509050919050565b610c2c610523565b15610c6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6390611c0b565b60405180910390fd5b610c7682826112a8565b6000610c9183803603810190610c8c91906117c4565b611133565b905060016002811115610ca757610ca6611d81565b5b6001600083815260200190815260200160002060009054906101000a900460ff166002811115610cda57610cd9611d81565b5b1415610d12576040517f1f368c2d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600280811115610d2557610d24611d81565b5b6001600083815260200190815260200160002060009054906101000a900460ff166002811115610d5857610d57611d81565b5b1415610d90576040517f228f2fb200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60026001600083815260200190815260200160002060006101000a81548160ff02191690836002811115610dc757610dc6611d81565b5b0217905550826060016020810190610ddf91906116bc565b73ffffffffffffffffffffffffffffffffffffffff168360c001357f18351c9e93b203d861f9bb52616afdc76a08cf3bb7c23d5d7a9f742fd2f309c1856000016020810190610e2e91906116bc565b866040016020810190610e4191906116bc565b8760800135604051610e5593929190611af0565b60405180910390a3505050565b610e6a61108a565b73ffffffffffffffffffffffffffffffffffffffff16610e88610652565b73ffffffffffffffffffffffffffffffffffffffff1614610ede576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed590611c2b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4590611beb565b60405180910390fd5b610f5781611141565b50565b60036020528060005260406000206000915054906101000a900460ff1681565b610f8261108a565b73ffffffffffffffffffffffffffffffffffffffff16610fa0610652565b73ffffffffffffffffffffffffffffffffffffffff1614610ff6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fed90611c2b565b60405180910390fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f863d338cad74814b108a06288ad5e0e80d56495e0332238b1d2cdcfa0ca8e5ce828260405161107e929190611b27565b60405180910390a15050565b600033905090565b61109a610523565b6110d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d090611bcb565b60405180910390fd5b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61111c61108a565b6040516111299190611a3d565b60405180910390a1565b60008160c001519050919050565b60008060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b61120e610523565b1561124e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124590611c0b565b60405180910390fd5b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861129161108a565b60405161129e9190611a3d565b60405180910390a1565b60008260000160208101906112bd91906116bc565b8360200160208101906112d091906116bc565b8460400160208101906112e391906116bc565b8560600160208101906112f691906116bc565b86608001358760a001358860c0013560405160200161131b9796959493929190611a81565b6040516020818303038152906040528051906020012090506000816040516020016113469190611a17565b6040516020818303038152906040528051906020012090506000600182856000016020810190611376919061181e565b866020013587604001356040516000815260200160405260405161139d9493929190611b6b565b6020604051602081039080840390855afa1580156113bf573d6000803e3d6000fd5b5050506020604051035190508073ffffffffffffffffffffffffffffffffffffffff168560000160208101906113f591906116bc565b73ffffffffffffffffffffffffffffffffffffffff1614611442576040517faf61069300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166114c5576040517f815e1d6400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050505050565b6040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081525090565b60008135905061157081611f06565b92915050565b60008135905061158581611f1d565b92915050565b60008151905061159a81611f1d565b92915050565b600060e082840312156115b6576115b5611ddf565b5b81905092915050565b600060e082840312156115d5576115d4611de4565b5b6115df60e0611c81565b905060006115ef84828501611561565b600083015250602061160384828501611561565b602083015250604061161784828501611561565b604083015250606061162b84828501611561565b606083015250608061163f84828501611692565b60808301525060a061165384828501611692565b60a08301525060c061166784828501611692565b60c08301525092915050565b60006060828403121561168957611688611ddf565b5b81905092915050565b6000813590506116a181611f34565b92915050565b6000813590506116b681611f4b565b92915050565b6000602082840312156116d2576116d1611de9565b5b60006116e084828501611561565b91505092915050565b60008060408385031215611700576116ff611de9565b5b600061170e85828601611561565b925050602061171f85828601611576565b9150509250929050565b60006020828403121561173f5761173e611de9565b5b600061174d8482850161158b565b91505092915050565b600060e0828403121561176c5761176b611de9565b5b600061177a848285016115a0565b91505092915050565b600080610140838503121561179b5761179a611de9565b5b60006117a9858286016115a0565b92505060e06117ba85828601611673565b9150509250929050565b600060e082840312156117da576117d9611de9565b5b60006117e8848285016115bf565b91505092915050565b60006020828403121561180757611806611de9565b5b600061181584828501611692565b91505092915050565b60006020828403121561183457611833611de9565b5b6000611842848285016116a7565b91505092915050565b61185481611cc2565b82525050565b61186381611cc2565b82525050565b61187281611cd4565b82525050565b61188181611ce0565b82525050565b61189861189382611ce0565b611d77565b82525050565b6118a781611d34565b82525050565b60006118ba601483611ca6565b91506118c582611dff565b602082019050919050565b60006118dd601c83611cb7565b91506118e882611e28565b601c82019050919050565b6000611900602683611ca6565b915061190b82611e51565b604082019050919050565b6000611923601083611ca6565b915061192e82611ea0565b602082019050919050565b6000611946602083611ca6565b915061195182611ec9565b602082019050919050565b60e082016000820151611972600085018261184b565b506020820151611985602085018261184b565b506040820151611998604085018261184b565b5060608201516119ab606085018261184b565b5060808201516119be60808501826119ea565b5060a08201516119d160a08501826119ea565b5060c08201516119e460c08501826119ea565b50505050565b6119f381611d1d565b82525050565b611a0281611d1d565b82525050565b611a1181611d27565b82525050565b6000611a22826118d0565b9150611a2e8284611887565b60208201915081905092915050565b6000602082019050611a52600083018461185a565b92915050565b6000604082019050611a6d600083018561185a565b611a7a602083018461185a565b9392505050565b600060e082019050611a96600083018a61185a565b611aa3602083018961185a565b611ab0604083018861185a565b611abd606083018761185a565b611aca60808301866119f9565b611ad760a08301856119f9565b611ae460c08301846119f9565b98975050505050505050565b6000606082019050611b05600083018661185a565b611b12602083018561185a565b611b1f60408301846119f9565b949350505050565b6000604082019050611b3c600083018561185a565b611b496020830184611869565b9392505050565b6000602082019050611b656000830184611869565b92915050565b6000608082019050611b806000830187611878565b611b8d6020830186611a08565b611b9a6040830185611878565b611ba76060830184611878565b95945050505050565b6000602082019050611bc5600083018461189e565b92915050565b60006020820190508181036000830152611be4816118ad565b9050919050565b60006020820190508181036000830152611c04816118f3565b9050919050565b60006020820190508181036000830152611c2481611916565b9050919050565b60006020820190508181036000830152611c4481611939565b9050919050565b600060e082019050611c60600083018461195c565b92915050565b6000602082019050611c7b60008301846119f9565b92915050565b6000611c8b611c9c565b9050611c978282611d46565b919050565b6000604051905090565b600082825260208201905092915050565b600081905092915050565b6000611ccd82611cfd565b9050919050565b60008115159050919050565b6000819050919050565b6000819050611cf882611ef2565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000611d3f82611cea565b9050919050565b611d4f82611dee565b810181811067ffffffffffffffff82111715611d6e57611d6d611db0565b5b80604052505050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f19457468657265756d205369676e6564204d6573736167653a0a333200000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60038110611f0357611f02611d81565b5b50565b611f0f81611cc2565b8114611f1a57600080fd5b50565b611f2681611cd4565b8114611f3157600080fd5b50565b611f3d81611d1d565b8114611f4857600080fd5b50565b611f5481611d27565b8114611f5f57600080fd5b5056fea2646970667358221220af5116da8418cc23e4bf7a851a8222ce25ec6744c40efd88fd4060e45c213eef64736f6c63430008070033

Verified Source Code Partial Match

Compiler: v0.8.7+commit.e28d00a7 EVM: london Optimization: No
Withdrawal.sol 132 lines
// SPDX-License-Identifier: MIT
pragma solidity =0.8.7;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Withdrawal is Pausable, Ownable {
    event WithdrawalEvent(uint256 indexed key, address signer, address to, address indexed token, uint256 amount);
    event CancelEvent(uint256 indexed key, address signer, address to, address indexed token, uint256 amount);
    event UpdateSigner(address signer, bool value);
    event UpdatePauseOperator(address oldOperator, address newOperator);

    enum OrderStatus {
        None,
        Processed,
        Cancelled
    }

    /* An ECDSA signature. */
    struct Sig {
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    struct Order {
        address signer;
        address holder;
        address to;
        address token;
        uint256 amount;
        uint256 expiration;
        uint256 key;
    }

    mapping(uint256 => OrderStatus) private _status;
    mapping(uint256 => Order) public orders;
    mapping(address => bool) public allowedSigners;
    address public pauseOperator;

    error ExpiredOrder();
    error ProcessedOrder();
    error CancelledOrder();
    error InvalidOrder();
    error InvalidCaller();
    error InvalidSigner();

    modifier onlyPauseOperator() {
        if (msg.sender != pauseOperator) revert InvalidCaller();
        _;
    }

    constructor(address pauseOperator_) {
        pauseOperator = pauseOperator_;
    }

    function pause() external onlyPauseOperator {
        _pause();
    }

    function unpause() external onlyPauseOperator {
        _unpause();
    }

    function setAllowedSigner(address signer, bool value) external onlyOwner {
        allowedSigners[signer] = value;
        emit UpdateSigner(signer, value);
    }

    function setPauseOperator(address pauseOperator_) external onlyOwner {
        address oldpauseOperator = pauseOperator;
        pauseOperator = pauseOperator_;
        emit UpdatePauseOperator(oldpauseOperator, pauseOperator_);
    }

    function _getCompletedKey(Order memory order) internal pure returns (uint256) {
        return order.key;
    }

    function withdrawal(Order calldata order, Sig calldata sig) external whenNotPaused {
        validateOrder(order, sig);
        if (order.expiration <= block.timestamp) revert ExpiredOrder();
        uint256 key = _getCompletedKey(order);
        if (_status[key] == OrderStatus.Processed) revert ProcessedOrder();
        if (_status[key] == OrderStatus.Cancelled) revert CancelledOrder();

        _status[key] = OrderStatus.Processed;
        IERC20(order.token).transferFrom(order.holder, order.to, order.amount);
        emit WithdrawalEvent(order.key, order.signer, order.to, order.token, order.amount);
    }

    function cancel(Order calldata order, Sig calldata sig) external whenNotPaused {
        validateOrder(order, sig);
        uint256 key = _getCompletedKey(order);
        if (_status[key] == OrderStatus.Processed) revert ProcessedOrder();
        if (_status[key] == OrderStatus.Cancelled) revert CancelledOrder();

        _status[key] = OrderStatus.Cancelled;
        emit CancelEvent(order.key, order.signer, order.to, order.token, order.amount);
    }

    ///@dev This function will be used in the future
    // function multipleWithdrawal(Order[] calldata order, Sig[] calldata sig) external {
    //     for (uint256 i = 0; i < order.length; i++) {
    //         withdrawal(order[i], sig[i]);
    //     }
    // }

    function validateOrder(Order calldata order, Sig calldata sig) private view {
        bytes32 payloadHash = keccak256(
            abi.encode(order.signer, order.holder, order.to, order.token, order.amount, order.expiration, order.key)
        );
        bytes32 messageHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", payloadHash));

        address actualSigner = ecrecover(messageHash, sig.v, sig.r, sig.s);
        if (order.signer != actualSigner) revert InvalidOrder();
        if (!allowedSigners[actualSigner]) revert InvalidSigner();
    }

    function getCompletedKey(Order calldata order) external pure returns (uint256) {
        return _getCompletedKey(order);
    }

    function getStatus(uint256 key) external view returns (OrderStatus) {
        return _status[key];
    }

    function getOrder(uint256 key) external view returns (Order memory) {
        return orders[key];
    }
}
Context.sol 24 lines
// 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;
    }
}
Ownable.sol 76 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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);
    }
}
Pausable.sol 91 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        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());
    }
}
IERC20.sol 82 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

Read Contract

allowedSigners 0xf8b4d864 → bool
getCompletedKey 0x1fe511cb → uint256
getOrder 0xd09ef241 → tuple
getStatus 0x5c622a0e → uint8
orders 0xa85c38ef → address, address, address, address, uint256, uint256, uint256
owner 0x8da5cb5b → address
pauseOperator 0x4afdcbde → address
paused 0x5c975abb → bool

Write Contract 8 functions

These functions modify contract state and require a wallet transaction to execute.

cancel 0x235cd1c3
tuple order
tuple sig
pause 0x8456cb59
No parameters
renounceOwnership 0x715018a6
No parameters
setAllowedSigner 0xf9213fc8
address signer
bool value
setPauseOperator 0x1ad4aa42
address pauseOperator_
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
withdrawal 0xc87618d7
tuple order
tuple sig

Recent Transactions

No transactions found for this address