Contract 0x750F90bB0764139568383AbE0784565a3cD6a318

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xd46a143784cd64f25845170d85dd1e7b5e860bb9a30c136fe7b69bbeb2ff08dbApprove119590852021-10-21 7:37:0544 days 6 hrs ago0x8f9a38bdda02696986192f0e7d83469ff03ddef7 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xf0e055bb3b61d8779df475196498e5b9e06d4d26defa4f30e51f1c6a1d07a02bAdd Keeper119585482021-10-21 7:09:5844 days 6 hrs ago0x8f9a38bdda02696986192f0e7d83469ff03ddef7 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000507325
0xec740913eca0e38016beaf5bacb84e7da028289b4de69f2c39f0f3e5bbdb01e2Approve119573052021-10-21 6:07:3944 days 8 hrs ago0x15963804e1fdae4cf707de3476e8d672520a391d IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x6c542bd3367477c2e59c3036b9a661b622dba1f6305991c20a1de7aa6c88032eAdd Keeper119541702021-10-21 3:24:0844 days 10 hrs ago0x15963804e1fdae4cf707de3476e8d672520a391d IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000582325
0x489de2e2a8f29b9d903d63702993e7c5923d3e51a57b21f299102d5c9aed09cbApprove116110672021-10-09 2:41:4756 days 11 hrs ago0x9c8d8bcffd46b06ba95a04df0074dd7e655def2f IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xffec817a9be7566f5c4acbca2027cfa75426b9d3b4669017410cc96b76126cdeAdd Keeper113330922021-09-29 9:47:2566 days 4 hrs ago0x8e1845c8e03c92ff8c0f95531fa932416b0b54b4 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000507325
0xdf267d381a803d0315d01495f17e405b03f7ff11388d55fe28d9e0329ff48197Approve113239432021-09-29 2:06:4066 days 12 hrs ago0xd039cd83471d3afe5c63438565dfc74c71173fa3 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x4b24f200073996db4cfd07e7d93501f3b67e9e668a43e3901af12ea632a17036Approve111873832021-09-24 7:20:3671 days 6 hrs ago0xa8031a3ff34c6765be304d3068c186f6ce80f373 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xf766d89103d2eecbd7460059a7c93b5372119f39ae7321f72119c439aa468f42Approve111605672021-09-23 8:52:0372 days 5 hrs ago0xa567c731a9c010e0dcdfacca280e0054d8ad1b32 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x10c53d33b0ed06f1779a0bdee60c722c3a2461d23ab7fd0b17f2c0c85c09dab2Add Keeper111599312021-09-23 8:20:1572 days 5 hrs ago0xa567c731a9c010e0dcdfacca280e0054d8ad1b32 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000507325
0x8d1701ccd5180ea27410e512da7a34e66d52026fc0330522906ffcd062ea652dApprove111598772021-09-23 8:17:3372 days 5 hrs ago0xd1a5da5d9d341cd3dc2d6937b858239b776a4d76 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x23dd56aff1c46b2e0dd1759212ce14713a957830e2f80dcc67a378865b67b1a0Add Keeper111593022021-09-23 7:48:4872 days 6 hrs ago0xd1a5da5d9d341cd3dc2d6937b858239b776a4d76 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000507325
0xa65e5465bb204e3ee64eafd14e43fd86d0a3355be2d7b278ddd8a9f08f5bef31Approve111514522021-09-23 1:13:5872 days 12 hrs ago0x0e036913010fcd6d0f75825ede22497b556aaad0 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xd9c91e8d78b79f30976b808ac2c6994bbfb26f424ebcc25ccd8606a17ee20aacApprove111247892021-09-22 2:51:3273 days 11 hrs ago0x7c4fc7cc5c501f2449aad28e12236e00e668ddb2 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x9dc9843b9778573d671a309aae0b0e86dbb6be6bcc21f3c794bdd3f73aa3c999Approve111247792021-09-22 2:51:0273 days 11 hrs ago0x7ae821a009c33a8a0596d2bfe1407540195727aa IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x7e40852a1eb536be5ff421571d16252f6f28795af5a21b4cca93e652483d2f3fApprove110562072021-09-19 17:28:2975 days 20 hrs ago0x8af5651fa3714610557b68cea6f53a3e349acc8c IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x3a8b2683a16ad068e620b9e522c8bf7d3dd52cd7f3af9717ca800775c06e367cAdd Keeper110561532021-09-19 17:25:4775 days 20 hrs ago0x8af5651fa3714610557b68cea6f53a3e349acc8c IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000582325
0x1d44ab9bc99fc38e24e0ddf32738ebe7aab8ad18e8d8993139f68b28389b8b07Approve110545882021-09-19 16:07:3275 days 22 hrs ago0x0a0db09238c705d7b67d6fc7652f8df35355aca1 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x4824ba0c0be88d0ca277f9cadd33fc922e3dd2871408de61049e20d1c1b88316Add Keeper110521912021-09-19 14:07:3976 days 1 min ago0x0a0db09238c705d7b67d6fc7652f8df35355aca1 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000582325
0x1772ec9c9d5b9f7aa5fcd4e66d84ed55f52cd69c16bdf886cd038d39445dcec3Approve110514992021-09-19 13:33:0376 days 35 mins ago0xb5f7484eea77a09d215fb130e9e8000d962acdc7 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x88d2116b68e53c032aaf2ea014af72f57b6d2f1dfc28f5f0b3a7c1e992989907Add Keeper110508782021-09-19 13:02:0076 days 1 hr ago0xb5f7484eea77a09d215fb130e9e8000d962acdc7 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.000582325
0xee206a655b29a8140e7a2d11a01f272f4cf57434a30239a79ed3f3392cde8ce5Approve110479072021-09-19 10:25:1676 days 3 hrs ago0x00dc9bfd8ca42b83e111dd1e02533347fd586bf0 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xdd9ad3ed4ccfaa725f6bc37ee30492ef590b2d0ebeccffe354750f8fb080dfacApprove110464382021-09-19 9:06:2576 days 5 hrs ago0x45166317a03194c24a2b600cd49b1342bd738c01 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0x264f9312bd25e76bb02ae715590f0f35662f52d7843c6c80bf64860b037a82f7Approve110448262021-09-19 7:45:4776 days 6 hrs ago0xd103627817ea674956aac1d8fd665461bfef15e4 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
0xbf3ba0703db72e79a47284cdcfb8a8b6469c9857ed9c33fc64971e38a09f555fApprove110443442021-09-19 7:21:4176 days 6 hrs ago0xc5aff255199683f15d43ec5a60600a112b4532c2 IN  0x750f90bb0764139568383abe0784565a3cd6a3180 BNB0.00022284
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
KeeperRegistry

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 18 : AccessControl.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../utils/EnumerableSet.sol";
import "../utils/Address.sol";
import "../utils/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;
    using Address for address;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 2 of 18 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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 () {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 3 of 18 : Math.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @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, so we distribute
        return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
    }
}

File 4 of 18 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 5 of 18 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

File 6 of 18 : ERC20Burnable.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "../../utils/Context.sol";
import "./ERC20.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    using SafeMath for uint256;

    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance");

        _approve(account, _msgSender(), decreasedAllowance);
        _burn(account, amount);
    }
}

File 7 of 18 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.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);
}

File 8 of 18 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 9 of 18 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 18 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 11 of 18 : EnumerableSet.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 12 of 18 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.7.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 13 of 18 : IBtcRater.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

interface IBtcRater {
    event UpdateRates(address indexed asset, uint256 rate);

    function getConversionRate(address asset) external view returns (uint256);

    function calcAmountInWei(address asset, uint256 amount) external view returns (uint256);

    function calcOrigAmount(address asset, uint256 weiAmount) external view returns (uint256);
}

File 14 of 18 : IKeeperRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

interface IKeeperRegistry {
    struct KeeperData {
        uint256 amount;
        address asset;
        uint32 refCount;
        uint32 joinTimestamp;
    }

    function getCollateralWei(address keeper) external view returns (uint256);

    function isKeeperQualified(address keeper) external view returns (bool);

    function importKeepers(
        uint256 amount,
        address asset,
        address[] calldata keepers
    ) external;

    function addConfiscation(
        address sender,
        address asset,
        uint256 amount
    ) external;

    function incrementRefCount(address keeper) external;

    function decrementRefCount(address keeper) external;

    event MinCollateralUpdated(uint256 amount);

    event SystemUpdated(address oldSystem, address newSystem);
    event AssetAdded(address indexed asset);

    event KeeperAdded(address indexed keeper, address asset, uint256 amount);
    event KeeperDeleted(address indexed keeper, address asset, uint256 amount, uint256 cAmount);
    event KeeperImported(address indexed from, address asset, address[] keepers, uint256 amount);
    event KeeperAssetSwapped(address indexed keeper, address asset, uint256 amount);

    event KeeperRefCount(address indexed keeper, uint256 count);
    event KeeperPunished(address indexed keeper, address asset, uint256 collateral);

    event EarlyExitFeeBpsUpdated(uint8 bps);

    event LiquidationUpdated(address indexed previousLiquidation, address indexed newLiquidation);
    event Confiscated(address indexed liquidation, address asset, uint256 amount);
    event ConfiscationAdded(address asset, uint256 amount);
    event OverissueAdded(uint256 total, uint256 added);
    event OffsetOverissued(
        address indexed operator,
        uint256 satsAmount,
        uint256 remainingOverissueAmount
    );
}

File 15 of 18 : ILiquidation.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

interface ILiquidation {
    function receiveFund(IERC20 asset, uint256 amount) external;

    event AssetAuctioned(
        address indexed operator,
        address asset,
        uint256 amount,
        uint256 discountSatsAmount
    );

    event InitialData(
        uint256 startTimestamp,
        uint256 duration,
        address asset,
        uint256 initialAmount
    );
}

File 16 of 18 : KeeperRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/math/Math.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/utils/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";

import {SATS} from "./SATS.sol";
import {IKeeperRegistry} from "../interfaces/IKeeperRegistry.sol";
import {IBtcRater} from "../interfaces/IBtcRater.sol";
import {ILiquidation} from "../interfaces/ILiquidation.sol";
import {BtcUtility} from "../utils/BtcUtility.sol";

contract KeeperRegistry is
    Ownable,
    IKeeperRegistry,
    ERC20("DeCus CToken", "DCS-CT"),
    ReentrancyGuard
{
    using Math for uint256;
    using SafeERC20 for IERC20;
    using SafeMath for uint256;
    using EnumerableSet for EnumerableSet.AddressSet;

    address public system;
    SATS public immutable sats;
    IBtcRater public immutable btcRater;
    ILiquidation public liquidation;

    EnumerableSet.AddressSet assetSet;
    uint256 public minKeeperCollateral;
    uint32 public MIN_KEEPER_PERIOD = 15552000; // 6 month
    uint8 public earlyExitFeeBps = 100;

    mapping(address => KeeperData) public keeperData;
    uint256 public overissuedTotal;
    mapping(address => uint256) public confiscations;

    modifier onlySystem() {
        require(system == _msgSender(), "require system role");
        _;
    }

    constructor(
        address[] memory _assets,
        SATS _sats,
        IBtcRater _btcRater,
        uint256 _minKeeperCollateral
    ) {
        btcRater = _btcRater;
        minKeeperCollateral = _minKeeperCollateral;
        for (uint256 i = 0; i < _assets.length; i++) {
            _addAsset(_assets[i]);
        }
        sats = _sats;
    }

    function updateMinKeeperCollateral(uint256 amount) external onlyOwner {
        minKeeperCollateral = amount;
        emit MinCollateralUpdated(amount);
    }

    function setSystem(address _system) external onlyOwner {
        emit SystemUpdated(system, _system);
        system = _system;
    }

    function getCollateralWei(address keeper) external view override returns (uint256) {
        return keeperData[keeper].amount;
    }

    function isKeeperQualified(address keeper) external view override returns (bool) {
        return keeperData[keeper].amount >= minKeeperCollateral;
    }

    function getKeeper(address keeper) external view returns (KeeperData memory) {
        return keeperData[keeper];
    }

    function addAsset(address asset) external onlyOwner {
        _addAsset(asset);
    }

    function updateEarlyExitFeeBps(uint8 bps) external onlyOwner {
        earlyExitFeeBps = bps;
        emit EarlyExitFeeBpsUpdated(bps);
    }

    function swapAsset(address asset, uint256 amount) external nonReentrant {
        require(assetSet.contains(asset), "assets not accepted");
        IERC20(asset).safeTransferFrom(msg.sender, address(this), amount);

        KeeperData storage data = keeperData[msg.sender];
        require(data.asset != address(0), "keeper not exist");
        require(data.asset != asset, "same asset");

        uint256 normalizedAmount = btcRater.calcAmountInWei(asset, amount);
        require(normalizedAmount >= data.amount, "cannot reduce amount");

        _refundKeeper(data, data.amount);

        data.asset = asset;
        data.amount = normalizedAmount;
        data.joinTimestamp = _blockTimestamp();

        emit KeeperAssetSwapped(msg.sender, asset, amount);
    }

    function addKeeper(address asset, uint256 amount) external {
        require(assetSet.contains(asset), "assets not accepted");
        IERC20(asset).safeTransferFrom(msg.sender, address(this), amount);

        address origAsset = keeperData[msg.sender].asset;
        require((origAsset == address(0)) || (origAsset == asset), "asset not allowed");

        _addKeeper(msg.sender, asset, btcRater.calcAmountInWei(asset, amount));
    }

    function deleteKeeper(uint256 cAmount) external nonReentrant {
        KeeperData storage data = keeperData[msg.sender];
        require(data.refCount == 0, "ref count > 0");

        _burn(msg.sender, cAmount);

        uint256 refundAmount = _refundKeeper(data, cAmount);

        emit KeeperDeleted(msg.sender, data.asset, refundAmount, cAmount);

        if (data.amount == 0) delete keeperData[msg.sender];
    }

    function importKeepers(
        uint256 amount,
        address asset,
        address[] calldata keepers
    ) external override {
        require(assetSet.contains(asset), "unknown asset");
        require(amount > 0, "amount != 0");

        uint256 totalAmount;
        uint256 normalizedAmount = btcRater.calcAmountInWei(asset, amount);
        for (uint256 i = 0; i < keepers.length; i++) {
            address keeper = keepers[i];
            if (keeper != address(0)) {
                _addKeeper(keeper, asset, normalizedAmount);
                totalAmount = totalAmount.add(amount);
            }
        }

        IERC20(asset).safeTransferFrom(msg.sender, address(this), totalAmount);

        emit KeeperImported(msg.sender, asset, keepers, normalizedAmount);
    }

    function punishKeeper(address[] calldata keepers) external onlyOwner {
        for (uint256 i = 0; i < keepers.length; i++) {
            address keeper = keepers[i];
            KeeperData storage data = keeperData[keeper];

            address asset = data.asset;
            uint256 amount = data.amount;
            confiscations[asset] = confiscations[asset].add(amount);
            data.amount = 0;
            emit KeeperPunished(keeper, asset, amount);
        }
    }

    function updateLiquidation(ILiquidation newLiquidation) external onlyOwner {
        emit LiquidationUpdated(address(liquidation), address(newLiquidation));
        liquidation = newLiquidation;
    }

    function confiscate(address[] calldata assets) external nonReentrant {
        require(liquidation != ILiquidation(0), "liquidation not up yet");

        for (uint256 i = 0; i < assets.length; i++) {
            uint256 confiscation = confiscations[assets[i]];
            uint256 amount = btcRater.calcOrigAmount(assets[i], confiscation);
            IERC20(assets[i]).approve(address(liquidation), amount);
            liquidation.receiveFund(IERC20(assets[i]), amount);
            emit Confiscated(address(liquidation), assets[i], confiscation);
            delete confiscations[assets[i]];
        }
    }

    function addConfiscation(
        address sender,
        address asset,
        uint256 amount
    ) external override {
        IERC20(asset).safeTransferFrom(sender, address(this), amount);
        uint256 normalizedAmount = btcRater.calcAmountInWei(asset, amount);
        confiscations[asset] = confiscations[asset].add(normalizedAmount);
        emit ConfiscationAdded(asset, normalizedAmount);
    }

    function addOverissue(uint256 overissuedAmount) external onlyOwner {
        require(overissuedAmount > 0, "zero overissued amount");
        overissuedTotal = overissuedTotal.add(overissuedAmount);
        emit OverissueAdded(overissuedTotal, overissuedAmount);
    }

    function offsetOverissue(uint256 satsAmount) external {
        overissuedTotal = overissuedTotal.sub(satsAmount);
        confiscations[address(sats)] = confiscations[address(sats)].sub(satsAmount);
        sats.burn(satsAmount);
        emit OffsetOverissued(msg.sender, satsAmount, overissuedTotal);
    }

    function incrementRefCount(address keeper) external override onlySystem {
        KeeperData storage data = keeperData[keeper];
        uint32 refCount = data.refCount + 1;
        require(refCount > data.refCount, "overflow"); // safe math
        data.refCount = refCount;
        emit KeeperRefCount(keeper, refCount);
    }

    function decrementRefCount(address keeper) external override onlySystem {
        KeeperData storage data = keeperData[keeper];
        require(data.refCount > 0); // safe math
        data.refCount = data.refCount - 1;
        emit KeeperRefCount(keeper, data.refCount);
    }

    function _addAsset(address asset) private {
        assetSet.add(asset);
        emit AssetAdded(asset);
    }

    function _blockTimestamp() internal view virtual returns (uint32) {
        return uint32(block.timestamp);
    }

    function _addKeeper(
        address keeper,
        address asset,
        uint256 amount
    ) private {
        KeeperData storage data = keeperData[keeper];
        data.asset = asset;
        data.amount = data.amount.add(amount);
        data.joinTimestamp = _blockTimestamp();
        require(data.amount >= minKeeperCollateral, "not enough collateral");

        _mint(keeper, amount);

        emit KeeperAdded(keeper, asset, amount);
    }

    function _refundKeeper(KeeperData storage data, uint256 cAmount)
        private
        returns (uint256 amount)
    {
        data.amount = data.amount.sub(cAmount);
        amount = cAmount;
        address asset = data.asset;
        if (_blockTimestamp() < data.joinTimestamp + MIN_KEEPER_PERIOD) {
            amount = amount.mul(10000 - earlyExitFeeBps).div(10000);
        }
        IERC20(asset).safeTransfer(msg.sender, btcRater.calcOrigAmount(asset, amount));
    }
}

File 17 of 18 : SATS.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.6;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

contract SATS is AccessControl, ERC20Burnable {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    constructor() ERC20("DeCus Satoshi", "SATS") {
        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);

        _setupDecimals(10);
    }

    function mint(address to, uint256 amount) public {
        require(hasRole(MINTER_ROLE, msg.sender), "require minter role");
        _mint(to, amount);
    }
}

File 18 of 18 : BtcUtility.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

library BtcUtility {
    uint256 public constant ERC20_DECIMAL = 18;
    uint256 public constant SATOSHI_DECIMAL = 8;

    function getSatsAmountMultiplier() internal pure returns (uint256) {
        return 1e10;
    }

    function getWeiMultiplier(uint256 decimal) internal pure returns (uint256) {
        require(ERC20_DECIMAL >= decimal, "asset decimal not supported");

        // the result is strictly <= 10**18, no need to check overflow
        return 10**uint256(ERC20_DECIMAL - decimal);
    }

    function getSatoshiDivisor(uint256 decimal) internal pure returns (uint256) {
        require((SATOSHI_DECIMAL <= decimal) && (decimal <= 18), "asset decimal not supported");

        // the result is strictly <= 10**10, no need to check overflow
        return 10**uint256(decimal - SATOSHI_DECIMAL);
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"_assets","type":"address[]"},{"internalType":"contract SATS","name":"_sats","type":"address"},{"internalType":"contract IBtcRater","name":"_btcRater","type":"address"},{"internalType":"uint256","name":"_minKeeperCollateral","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"asset","type":"address"}],"name":"AssetAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"liquidation","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Confiscated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ConfiscationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"bps","type":"uint8"}],"name":"EarlyExitFeeBpsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"KeeperAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"KeeperAssetSwapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cAmount","type":"uint256"}],"name":"KeeperDeleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"address[]","name":"keepers","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"KeeperImported","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"}],"name":"KeeperPunished","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":false,"internalType":"uint256","name":"count","type":"uint256"}],"name":"KeeperRefCount","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousLiquidation","type":"address"},{"indexed":true,"internalType":"address","name":"newLiquidation","type":"address"}],"name":"LiquidationUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MinCollateralUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"uint256","name":"satsAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"remainingOverissueAmount","type":"uint256"}],"name":"OffsetOverissued","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"total","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"added","type":"uint256"}],"name":"OverissueAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldSystem","type":"address"},{"indexed":false,"internalType":"address","name":"newSystem","type":"address"}],"name":"SystemUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"MIN_KEEPER_PERIOD","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"addAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addConfiscation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"overissuedAmount","type":"uint256"}],"name":"addOverissue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"btcRater","outputs":[{"internalType":"contract IBtcRater","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"}],"name":"confiscate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"confiscations","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"decrementRefCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"cAmount","type":"uint256"}],"name":"deleteKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earlyExitFeeBps","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"getCollateralWei","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"getKeeper","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint32","name":"refCount","type":"uint32"},{"internalType":"uint32","name":"joinTimestamp","type":"uint32"}],"internalType":"struct IKeeperRegistry.KeeperData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"address[]","name":"keepers","type":"address[]"}],"name":"importKeepers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"incrementRefCount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"keeper","type":"address"}],"name":"isKeeperQualified","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"keeperData","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint32","name":"refCount","type":"uint32"},{"internalType":"uint32","name":"joinTimestamp","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"liquidation","outputs":[{"internalType":"contract ILiquidation","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minKeeperCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"satsAmount","type":"uint256"}],"name":"offsetOverissue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"overissuedTotal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"keepers","type":"address[]"}],"name":"punishKeeper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sats","outputs":[{"internalType":"contract SATS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_system","type":"address"}],"name":"setSystem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"swapAsset","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"system","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint8","name":"bps","type":"uint8"}],"name":"updateEarlyExitFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ILiquidation","name":"newLiquidation","type":"address"}],"name":"updateLiquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"updateMinKeeperCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60c0604052600d805462ed4e0063ffffffff199091161760ff60201b19166464000000001790553480156200003357600080fd5b506040516200387d3803806200387d833981016040819052620000569162000349565b6040518060400160405280600c81526020016b2232a1bab99021aa37b5b2b760a11b815250604051806040016040528060068152602001651110d4cb50d560d21b8152506000620000ac620001a260201b60201c565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35081516200010b90600490602085019062000280565b5080516200012190600590602084019062000280565b50506006805460ff191660121790555060016007556001600160601b0319606083901b1660a052600c81905560005b845181101562000188576200017f8582815181106200016b57fe5b6020026020010151620001a660201b60201c565b60010162000150565b50505060601b6001600160601b0319166080525062000435565b3390565b620001c181600a620001f960201b62001f031790919060201c565b506040516001600160a01b038216907f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d790600090a250565b600062000210836001600160a01b03841662000219565b90505b92915050565b600062000227838362000268565b6200025f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000213565b50600062000213565b60009081526001919091016020526040902054151590565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002b8576000855562000303565b82601f10620002d357805160ff191683800117855562000303565b8280016001018555821562000303579182015b8281111562000303578251825591602001919060010190620002e6565b506200031192915062000315565b5090565b5b8082111562000311576000815560010162000316565b80516001600160a01b03811681146200034457600080fd5b919050565b600080600080608085870312156200035f578384fd5b84516001600160401b038082111562000376578586fd5b818701915087601f8301126200038a578586fd5b81516020828211156200039957fe5b80820260405182828201018181108682111715620003b357fe5b604052838152828101945085830182870184018d1015620003d2578a8bfd5b8a96505b84871015620003ff57620003ea816200032c565b865260019690960195948301948301620003d6565b5098506200041190508982016200032c565b96505050505062000425604086016200032c565b6060959095015193969295505050565b60805160601c60a05160601c6133f662000487600039806107f65280610b3e5280610fbe528061137752806117845280611a3452806125785250806111685280611ba05280611be352506133f66000f3fe608060405234801561001057600080fd5b50600436106102685760003560e01c8063834b33b411610151578063cc2be1e4116100c3578063ee529bff11610087578063ee529bff1461051e578063eef36af014610531578063f2dfbf6614610544578063f2fde38b1461054c578063f4f8c0251461055f578063fee48a501461056757610268565b8063cc2be1e4146104ca578063d67f23a9146104dd578063da3f6c24146104f0578063dd62ed3e146104f8578063dde13c461461050b57610268565b8063a457c2d711610115578063a457c2d714610456578063a9059cbb14610469578063aa6e080e1461047c578063bd59955414610491578063bdaabf82146104a4578063cb303fbd146104b757610268565b8063834b33b4146104185780638da5cb5b1461042b57806395bf75fd1461043357806395d89b411461043b5780639790f5e91461044357610268565b8063313ce567116101ea5780635b560a86116101ae5780635b560a86146103b75780635e63edde146103bf5780636f0817b9146103d257806370a08231146103f5578063715018a6146104085780637a5c8f471461041057610268565b8063313ce56714610349578063395093511461035e5780633e7a682314610371578063471ae5221461038457806355837757146103a457610268565b80631323bad4116102315780631323bad4146102e857806318160ddd146102fb5780631df398a21461031057806323b872dd14610323578063298410e51461033657610268565b80621034311461026d57806306fdde0314610282578063095ea7b3146102a05780630c3055f5146102c0578063122e2f16146102d3575b600080fd5b61028061027b366004612bf2565b61057a565b005b61028a610671565b6040516102979190612e95565b60405180910390f35b6102b36102ae366004612c86565b610707565b6040516102979190612e8a565b6102806102ce366004612d11565b610725565b6102db6107f4565b6040516102979190612dbc565b6102806102f6366004612bf2565b610818565b6103036108fb565b604051610297919061314d565b61030361031e366004612bf2565b610901565b6102b3610331366004612c46565b610913565b610280610344366004612bf2565b61099b565b610351610a09565b60405161029791906131a2565b6102b361036c366004612c86565b610a12565b61028061037f366004612cb1565b610a60565b610397610392366004612bf2565b610de1565b604051610297919061310d565b6102806103b2366004612bf2565b610e49565b610351610f14565b6102806103cd366004612c86565b610f25565b6103e56103e0366004612bf2565b611064565b6040516102979493929190613156565b610303610403366004612bf2565b61109f565b6102806110ba565b6102db611166565b610280610426366004612cb1565b61118a565b6102db6112c9565b6102db6112d8565b61028a6112e7565b610280610451366004612c46565b611348565b6102b3610464366004612c86565b611480565b6102b3610477366004612c86565b6114e8565b6104846114fc565b6040516102979190613191565b61030361049f366004612bf2565b611508565b6102b36104b2366004612bf2565b611523565b6102806104c5366004612bf2565b611546565b6102806104d8366004612d11565b611604565b6102806104eb366004612d41565b611738565b6103036118e7565b610303610506366004612c0e565b6118ed565b610280610519366004612c86565b611918565b61028061052c366004612d11565b611b86565b61028061053f366004612d11565b611ca9565b6102db611d40565b61028061055a366004612bf2565b611d4f565b610303611e51565b610280610575366004612d9b565b611e57565b610582611f18565b6008546001600160a01b039081169116146105b85760405162461bcd60e51b81526004016105af90612f96565b60405180910390fd5b6001600160a01b0381166000908152600e6020526040902060018082015463ffffffff600160a01b909104811691820191908216116106095760405162461bcd60e51b81526004016105af906130bb565b60018201805463ffffffff60a01b1916600160a01b63ffffffff8416021790556040516001600160a01b038416907f27937aff960b9928a1a9719d1837f973fd249911354d1e79ecd56c4746f02eeb90610664908490613191565b60405180910390a2505050565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106fd5780601f106106d2576101008083540402835291602001916106fd565b820191906000526020600020905b8154815290600101906020018083116106e057829003601f168201915b5050505050905090565b600061071b610714611f18565b8484611f1c565b5060015b92915050565b61072d611f18565b6001600160a01b031661073e6112c9565b6001600160a01b031614610787576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b600081116107a75760405162461bcd60e51b81526004016105af90612f66565b600f546107b49082612008565b600f8190556040517fdc09d6e1e036efb4227c7a25a83958393218f3a87292a27e7f499ca1278b45d9916107e9918490613183565b60405180910390a150565b7f000000000000000000000000000000000000000000000000000000000000000081565b610820611f18565b6008546001600160a01b0390811691161461084d5760405162461bcd60e51b81526004016105af90612f96565b6001600160a01b0381166000908152600e602052604090206001810154600160a01b900463ffffffff1661088057600080fd5b60018101805463ffffffff60a01b198116600160a01b9182900463ffffffff908116600019018116830291909117928390556040516001600160a01b038616937f27937aff960b9928a1a9719d1837f973fd249911354d1e79ecd56c4746f02eeb936108ef9391041690613191565b60405180910390a25050565b60035490565b60106020526000908152604090205481565b6000610920848484612062565b6109908461092c611f18565b61098b856040518060600160405280602881526020016132c0602891396001600160a01b038a1660009081526002602052604081209061096a611f18565b6001600160a01b0316815260208101919091526040016000205491906121bf565b611f1c565b5060015b9392505050565b6109a3611f18565b6001600160a01b03166109b46112c9565b6001600160a01b0316146109fd576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b610a0681612256565b50565b60065460ff1690565b600061071b610a1f611f18565b8461098b8560026000610a30611f18565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490612008565b60026007541415610ab8576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b60026007556009546001600160a01b0316610ae55760405162461bcd60e51b81526004016105af906130dd565b60005b81811015610dd757600060106000858585818110610b0257fe5b9050602002016020810190610b179190612bf2565b6001600160a01b03166001600160a01b0316815260200190815260200160002054905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e51d4520868686818110610b7757fe5b9050602002016020810190610b8c9190612bf2565b846040518363ffffffff1660e01b8152600401610baa929190612e50565b60206040518083038186803b158015610bc257600080fd5b505afa158015610bd6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bfa9190612d29565b9050848484818110610c0857fe5b9050602002016020810190610c1d9190612bf2565b60095460405163095ea7b360e01b81526001600160a01b039283169263095ea7b392610c50929116908590600401612e50565b602060405180830381600087803b158015610c6a57600080fd5b505af1158015610c7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca29190612cf1565b506009546001600160a01b03166384b92c64868686818110610cc057fe5b9050602002016020810190610cd59190612bf2565b836040518363ffffffff1660e01b8152600401610cf3929190612e50565b600060405180830381600087803b158015610d0d57600080fd5b505af1158015610d21573d6000803e3d6000fd5b50506009546001600160a01b031691507f1d47c187095aefccfdebc8a872d270e98511c7814959be6a804c25428d7fff799050868686818110610d6057fe5b9050602002016020810190610d759190612bf2565b84604051610d84929190612e50565b60405180910390a260106000868686818110610d9c57fe5b9050602002016020810190610db19190612bf2565b6001600160a01b0316815260208101919091526040016000908120555050600101610ae8565b5050600160075550565b610de9612b82565b506001600160a01b039081166000908152600e60209081526040918290208251608081018452815481526001909101549384169181019190915263ffffffff600160a01b8404811692820192909252600160c01b90920416606082015290565b610e51611f18565b6001600160a01b0316610e626112c9565b6001600160a01b031614610eab576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b6008546040517fa6e2b13449f1d6c7eeb3cac7c7457ca2c712fcc0b9962fde10e367ff72f10e7491610eea916001600160a01b03909116908490612dd0565b60405180910390a1600880546001600160a01b0319166001600160a01b0392909216919091179055565b600d54640100000000900460ff1681565b610f30600a83612299565b610f4c5760405162461bcd60e51b81526004016105af90612ee8565b610f616001600160a01b0383163330846122ae565b336000908152600e60205260409020600101546001600160a01b0316801580610f9b5750826001600160a01b0316816001600160a01b0316145b610fb75760405162461bcd60e51b81526004016105af9061303b565b61105f33847f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374b2335387876040518363ffffffff1660e01b815260040161100a929190612e50565b60206040518083038186803b15801561102257600080fd5b505afa158015611036573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105a9190612d29565b61230e565b505050565b600e60205260009081526040902080546001909101546001600160a01b0381169063ffffffff600160a01b8204811691600160c01b90041684565b6001600160a01b031660009081526001602052604090205490565b6110c2611f18565b6001600160a01b03166110d36112c9565b6001600160a01b03161461111c576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b7f000000000000000000000000000000000000000000000000000000000000000081565b611192611f18565b6001600160a01b03166111a36112c9565b6001600160a01b0316146111ec576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b60005b8181101561105f57600083838381811061120557fe5b905060200201602081019061121a9190612bf2565b6001600160a01b038082166000908152600e602090815260408083206001810154815495168085526010909352922054939450909290919061125c9082612008565b6001600160a01b038084166000908152601060205260408082209390935585559051908516907f198a160a2fb6fe31d6b12fc94563783570f80c88e2de58a05d849d5b61dbe9c4906112b19085908590612e50565b60405180910390a25050600190920191506111ef9050565b6000546001600160a01b031690565b6008546001600160a01b031681565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106fd5780601f106106d2576101008083540402835291602001916106fd565b61135d6001600160a01b0383168430846122ae565b6040516374b2335360e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906374b23353906113ae9086908690600401612e50565b60206040518083038186803b1580156113c657600080fd5b505afa1580156113da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113fe9190612d29565b6001600160a01b0384166000908152601060205260409020549091506114249082612008565b6001600160a01b0384166000908152601060205260409081902091909155517ff0a55261e7ddec9f6bc193b27eb01e46468eea35746de9484d28821faa35bc42906114729085908490612e50565b60405180910390a150505050565b600061071b61148d611f18565b8461098b8560405180606001604052806025815260200161339c60259139600260006114b7611f18565b6001600160a01b03908116825260208083019390935260409182016000908120918d168152925290205491906121bf565b600061071b6114f5611f18565b8484612062565b600d5463ffffffff1681565b6001600160a01b03166000908152600e602052604090205490565b600c546001600160a01b0382166000908152600e60205260409020541015919050565b61154e611f18565b6001600160a01b031661155f6112c9565b6001600160a01b0316146115a8576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b6009546040516001600160a01b038084169216907f960ce90a19dfa3c809fb677d4929ae04bfacc9138539566f398b02ac16b6b31e90600090a3600980546001600160a01b0319166001600160a01b0392909216919091179055565b6002600754141561165c576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755336000908152600e602052604090206001810154600160a01b900463ffffffff161561169f5760405162461bcd60e51b81526004016105af90612f15565b6116a933836123f4565b60006116b582846124f0565b600183015460405191925033917f06b7631533b900b7ead1e432d65a3527f75c28916090fc83ea68796a8150cea0916116fd916001600160a01b039091169085908890612e69565b60405180910390a28154610dd757336000908152600e6020526040812090815560010180546001600160e01b03191690555050600160075550565b611743600a84612299565b61175f5760405162461bcd60e51b81526004016105af90613066565b6000841161177f5760405162461bcd60e51b81526004016105af90613016565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166374b2335386886040518363ffffffff1660e01b81526004016117d0929190612e50565b60206040518083038186803b1580156117e857600080fd5b505afa1580156117fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118209190612d29565b905060005b8381101561188257600085858381811061183b57fe5b90506020020160208101906118509190612bf2565b90506001600160a01b038116156118795761186c81888561230e565b6118768489612008565b93505b50600101611825565b506118986001600160a01b0386163330856122ae565b336001600160a01b03167f2f63a3a45a4cfd9e30f44e24284095f439a7e04af40b0b4ca19b51e3adc0de86868686856040516118d79493929190612dea565b60405180910390a2505050505050565b600f5481565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60026007541415611970576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b6002600755611980600a83612299565b61199c5760405162461bcd60e51b81526004016105af90612ee8565b6119b16001600160a01b0383163330846122ae565b336000908152600e6020526040902060018101546001600160a01b03166119ea5760405162461bcd60e51b81526004016105af90612f3c565b60018101546001600160a01b0384811691161415611a1a5760405162461bcd60e51b81526004016105af90612ff2565b6040516374b2335360e01b81526000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906374b2335390611a6b9087908790600401612e50565b60206040518083038186803b158015611a8357600080fd5b505afa158015611a97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611abb9190612d29565b8254909150811015611adf5760405162461bcd60e51b81526004016105af9061308d565b611aed8283600001546124f0565b506001820180546001600160a01b0319166001600160a01b038616179055808255611b1661262c565b8260010160186101000a81548163ffffffff021916908363ffffffff160217905550336001600160a01b03167f64a4f8323ef4b922c8fc418aed8017443f62c3aa093ec29f7a62e8cbf06d25cf8585604051611b73929190612e50565b60405180910390a2505060016007555050565b600f54611b939082612630565b600f556001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016600090815260106020526040902054611bd99082612630565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660008181526010602052604090819020929092559051630852cd8d60e31b81526342966c6890611c3790849060040161314d565b600060405180830381600087803b158015611c5157600080fd5b505af1158015611c65573d6000803e3d6000fd5b5050600f546040513393507fbe43989ace032e7eb39cb9d6d98d37d4b3ef4644f8a190af00046a9176faea479250611c9e918591613183565b60405180910390a250565b611cb1611f18565b6001600160a01b0316611cc26112c9565b6001600160a01b031614611d0b576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b600c8190556040517fd19fe8ad9152af12b174a60210fb798db0767d63973ebb97298dc44d67a5c82d906107e990839061314d565b6009546001600160a01b031681565b611d57611f18565b6001600160a01b0316611d686112c9565b6001600160a01b031614611db1576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b6001600160a01b038116611df65760405162461bcd60e51b815260040180806020018281038252602681526020018061320b6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600c5481565b611e5f611f18565b6001600160a01b0316611e706112c9565b6001600160a01b031614611eb9576040805162461bcd60e51b815260206004820181905260248201526000805160206132e8833981519152604482015290519081900360640190fd5b600d805464ff00000000191664010000000060ff8416021790556040517f5859a024dcec66c2037180ba1326d01a41e33d4ef7b94b17cdc3c017b0498b9a906107e99083906131a2565b6000610994836001600160a01b03841661268d565b3390565b6001600160a01b038316611f615760405162461bcd60e51b815260040180806020018281038252602481526020018061334e6024913960400191505060405180910390fd5b6001600160a01b038216611fa65760405162461bcd60e51b81526004018080602001828103825260228152602001806132316022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600082820183811015610994576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6001600160a01b0383166120a75760405162461bcd60e51b81526004018080602001828103825260258152602001806133296025913960400191505060405180910390fd5b6001600160a01b0382166120ec5760405162461bcd60e51b81526004018080602001828103825260238152602001806131c66023913960400191505060405180910390fd5b6120f783838361105f565b61213481604051806060016040528060268152602001613253602691396001600160a01b03861660009081526001602052604090205491906121bf565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546121639082612008565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6000818484111561224e5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156122135781810151838201526020016121fb565b50505050905090810190601f1680156122405780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b612261600a82611f03565b506040516001600160a01b038216907f0e3c58ebfb2e7465fbb1c32e6b4f40c3c4f5ca77e8218a386aff8617831260d790600090a250565b6000610994836001600160a01b0384166126d7565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b1790526123089085906126ef565b50505050565b6001600160a01b038381166000908152600e602052604090206001810180546001600160a01b03191692851692909217909155805461234d9083612008565b815561235761262c565b60018201805463ffffffff92909216600160c01b0263ffffffff60c01b19909216919091179055600c54815410156123a15760405162461bcd60e51b81526004016105af90612fc3565b6123ab84836127a0565b836001600160a01b03167f9cb76b51144d46005efa8364e8e73c13bed396c03ba2a905e9817b4a1011614f84846040516123e6929190612e50565b60405180910390a250505050565b6001600160a01b0382166124395760405162461bcd60e51b81526004018080602001828103825260218152602001806133086021913960400191505060405180910390fd5b6124458260008361105f565b612482816040518060600160405280602281526020016131e9602291396001600160a01b03851660009081526001602052604090205491906121bf565b6001600160a01b0383166000908152600160205260409020556003546124a89082612630565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b81546000906124ff9083612630565b8355506001820154600d5482916001600160a01b0381169163ffffffff908116600160c01b9092048116919091011661253661262c565b63ffffffff16101561257257600d5461256f9061271090612569908590640100000000900460ff16830361ffff16612892565b906128eb565b91505b612625337f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663e51d452084866040518363ffffffff1660e01b81526004016125c4929190612e50565b60206040518083038186803b1580156125dc57600080fd5b505afa1580156125f0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126149190612d29565b6001600160a01b0384169190612952565b5092915050565b4290565b600082821115612687576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600061269983836126d7565b6126cf5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561071f565b50600061071f565b60009081526001919091016020526040902054151590565b6000612744826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129a49092919063ffffffff16565b80519091501561105f5780806020019051602081101561276357600080fd5b505161105f5760405162461bcd60e51b815260040180806020018281038252602a815260200180613372602a913960400191505060405180910390fd5b6001600160a01b0382166127fb576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6128076000838361105f565b6003546128149082612008565b6003556001600160a01b03821660009081526001602052604090205461283a9082612008565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6000826128a15750600061071f565b828202828482816128ae57fe5b04146109945760405162461bcd60e51b815260040180806020018281038252602181526020018061329f6021913960400191505060405180910390fd5b6000808211612941576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161294a57fe5b049392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b17905261105f9084906126ef565b60606129b384846000856129bb565b949350505050565b6060824710156129fc5760405162461bcd60e51b81526004018080602001828103825260268152602001806132796026913960400191505060405180910390fd5b612a0585612b16565b612a56576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b60208310612a945780518252601f199092019160209182019101612a75565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612af6576040519150601f19603f3d011682016040523d82523d6000602084013e612afb565b606091505b5091509150612b0b828286612b1c565b979650505050505050565b3b151590565b60608315612b2b575081610994565b825115612b3b5782518084602001fd5b60405162461bcd60e51b81526020600482018181528451602484015284518593919283926044019190850190808383600083156122135781810151838201526020016121fb565b60408051608081018252600080825260208201819052918101829052606081019190915290565b60008083601f840112612bba578182fd5b50813567ffffffffffffffff811115612bd1578182fd5b6020830191508360208083028501011115612beb57600080fd5b9250929050565b600060208284031215612c03578081fd5b8135610994816131b0565b60008060408385031215612c20578081fd5b8235612c2b816131b0565b91506020830135612c3b816131b0565b809150509250929050565b600080600060608486031215612c5a578081fd5b8335612c65816131b0565b92506020840135612c75816131b0565b929592945050506040919091013590565b60008060408385031215612c98578182fd5b8235612ca3816131b0565b946020939093013593505050565b60008060208385031215612cc3578182fd5b823567ffffffffffffffff811115612cd9578283fd5b612ce585828601612ba9565b90969095509350505050565b600060208284031215612d02578081fd5b81518015158114610994578182fd5b600060208284031215612d22578081fd5b5035919050565b600060208284031215612d3a578081fd5b5051919050565b60008060008060608587031215612d56578081fd5b843593506020850135612d68816131b0565b9250604085013567ffffffffffffffff811115612d83578182fd5b612d8f87828801612ba9565b95989497509550505050565b600060208284031215612dac578081fd5b813560ff81168114610994578182fd5b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03858116825260606020808401829052908301859052600091869160808501845b88811015612e39578435612e25816131b0565b841682529382019390820190600101612e12565b508094505050505082604083015295945050505050565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b901515815260200190565b6000602080835283518082850152825b81811015612ec157858101830151858201604001528201612ea5565b81811115612ed25783604083870101525b50601f01601f1916929092016040019392505050565b602080825260139082015272185cdcd95d1cc81b9bdd081858d8d95c1d1959606a1b604082015260600190565b6020808252600d908201526c072656620636f756e74203e203609c1b604082015260600190565b60208082526010908201526f1ad9595c195c881b9bdd08195e1a5cdd60821b604082015260600190565b6020808252601690820152751e995c9bc81bdd995c9a5cdcdd595908185b5bdd5b9d60521b604082015260600190565b602080825260139082015272726571756972652073797374656d20726f6c6560681b604082015260600190565b6020808252601590820152741b9bdd08195b9bdd59da0818dbdb1b185d195c985b605a1b604082015260600190565b6020808252600a90820152691cd85b5948185cdcd95d60b21b604082015260600190565b6020808252600b908201526a0616d6f756e7420213d20360ac1b604082015260600190565b602080825260119082015270185cdcd95d081b9bdd08185b1b1bddd959607a1b604082015260600190565b6020808252600d908201526c1d5b9adb9bdddb88185cdcd95d609a1b604082015260600190565b60208082526014908201527318d85b9b9bdd081c99591d58d948185b5bdd5b9d60621b604082015260600190565b6020808252600890820152676f766572666c6f7760c01b604082015260600190565b6020808252601690820152751b1a5c5d5a59185d1a5bdb881b9bdd081d5c081e595d60521b604082015260600190565b815181526020808301516001600160a01b03169082015260408083015163ffffffff90811691830191909152606092830151169181019190915260800190565b90815260200190565b9384526001600160a01b0392909216602084015263ffffffff908116604084015216606082015260800190565b918252602082015260400190565b63ffffffff91909116815260200190565b60ff91909116815260200190565b6001600160a01b0381168114610a0657600080fdfe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122027b8cf4d07cd098a0c911c0c921898c8bf0cdf8ca6df6027c334dd1340f0752b64736f6c634300070600330000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a258b20c6e6220dcf7cd523ff39847fec7a6a0cf000000000000000000000000641c4eb4f168fd728b6073982663eead012d7c5a000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a258b20c6e6220dcf7cd523ff39847fec7a6a0cf000000000000000000000000641c4eb4f168fd728b6073982663eead012d7c5a000000000000000000000000000000000000000000000000016345785d8a000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c

-----Decoded View---------------
Arg [0] : _assets (address[]): 0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c
Arg [1] : _sats (address): 0xa258b20c6e6220dcf7cd523ff39847fec7a6a0cf
Arg [2] : _btcRater (address): 0x641c4eb4f168fd728b6073982663eead012d7c5a
Arg [3] : _minKeeperCollateral (uint256): 100000000000000000

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 000000000000000000000000a258b20c6e6220dcf7cd523ff39847fec7a6a0cf
Arg [2] : 000000000000000000000000641c4eb4f168fd728b6073982663eead012d7c5a
Arg [3] : 000000000000000000000000000000000000000000000000016345785d8a0000
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [5] : 0000000000000000000000007130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.