More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
View more zero value Internal Transactions in Advanced View mode
Loading...
Loading
Contract Name:
HoprDistributor
Compiler Version
v0.6.6+commit.6c089d02
Optimization Enabled:
Yes with 3000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at gnosisscan.io on 2022-08-04 */ // // &&&& // &&&& // &&&& // &&&& &&&&&&&&& &&&&&&&&&&&& &&&&&&&&&&/ &&&&.&&&&&&&&& // &&&&&&&&& &&&&& &&&&&& &&&&&, &&&&& &&&&& &&&&&&&& &&&& // &&&&&& &&&& &&&&# &&&& &&&&& &&&&& &&&&&& &&&&& // &&&&& &&&&/ &&&& &&&& #&&&& &&&& &&&&& // &&&& &&&& &&&&& &&&& &&&& &&&&& &&&&& // %%%% /%%%% %%%%%% %%%%%% %%%% %%%%%%%%% %%%%% // %%%%% %%%% %%%%%%%%%%% %%%% %%%%%% %%%% // %%%% // %%%% // %%%% // // File @openzeppelin/contracts/GSN/[email protected] pragma solidity ^0.6.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. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } 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 @openzeppelin/contracts/access/[email protected] pragma solidity ^0.6.0; /** * @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. */ 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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view 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 @openzeppelin/contracts/utils/[email protected] pragma solidity ^0.6.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.0.0, only sets of type `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]; } // 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(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(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(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(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 @openzeppelin/contracts/utils/[email protected] pragma solidity ^0.6.2; /** * @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) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } /** * @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"); } } // File @openzeppelin/contracts/access/[email protected] pragma solidity ^0.6.0; /** * @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 `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. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { _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 @openzeppelin/contracts/token/ERC777/[email protected] pragma solidity ^0.6.0; /** * @dev Interface of the ERC777Token standard as defined in the EIP. * * This contract uses the * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 registry standard] to let * token holders and recipients react to token movements by using setting implementers * for the associated interfaces in said registry. See {IERC1820Registry} and * {ERC1820Implementer}. */ interface IERC777 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() external view returns (string memory); /** * @dev Returns the smallest part of the token that is not divisible. This * means all token operations (creation, movement and destruction) must have * amounts that are a multiple of this number. * * For most token contracts, this value will equal 1. */ function granularity() external view returns (uint256); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by an account (`owner`). */ function balanceOf(address owner) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * If send or receive hooks are registered for the caller and `recipient`, * the corresponding functions will be called with `data` and empty * `operatorData`. See {IERC777Sender} and {IERC777Recipient}. * * Emits a {Sent} event. * * Requirements * * - the caller must have at least `amount` tokens. * - `recipient` cannot be the zero address. * - if `recipient` is a contract, it must implement the {IERC777Recipient} * interface. */ function send(address recipient, uint256 amount, bytes calldata data) external; /** * @dev Destroys `amount` tokens from the caller's account, reducing the * total supply. * * If a send hook is registered for the caller, the corresponding function * will be called with `data` and empty `operatorData`. See {IERC777Sender}. * * Emits a {Burned} event. * * Requirements * * - the caller must have at least `amount` tokens. */ function burn(uint256 amount, bytes calldata data) external; /** * @dev Returns true if an account is an operator of `tokenHolder`. * Operators can send and burn tokens on behalf of their owners. All * accounts are their own operator. * * See {operatorSend} and {operatorBurn}. */ function isOperatorFor(address operator, address tokenHolder) external view returns (bool); /** * @dev Make an account an operator of the caller. * * See {isOperatorFor}. * * Emits an {AuthorizedOperator} event. * * Requirements * * - `operator` cannot be calling address. */ function authorizeOperator(address operator) external; /** * @dev Revoke an account's operator status for the caller. * * See {isOperatorFor} and {defaultOperators}. * * Emits a {RevokedOperator} event. * * Requirements * * - `operator` cannot be calling address. */ function revokeOperator(address operator) external; /** * @dev Returns the list of default operators. These accounts are operators * for all token holders, even if {authorizeOperator} was never called on * them. * * This list is immutable, but individual holders may revoke these via * {revokeOperator}, in which case {isOperatorFor} will return false. */ function defaultOperators() external view returns (address[] memory); /** * @dev Moves `amount` tokens from `sender` to `recipient`. The caller must * be an operator of `sender`. * * If send or receive hooks are registered for `sender` and `recipient`, * the corresponding functions will be called with `data` and * `operatorData`. See {IERC777Sender} and {IERC777Recipient}. * * Emits a {Sent} event. * * Requirements * * - `sender` cannot be the zero address. * - `sender` must have at least `amount` tokens. * - the caller must be an operator for `sender`. * - `recipient` cannot be the zero address. * - if `recipient` is a contract, it must implement the {IERC777Recipient} * interface. */ function operatorSend( address sender, address recipient, uint256 amount, bytes calldata data, bytes calldata operatorData ) external; /** * @dev Destroys `amount` tokens from `account`, reducing the total supply. * The caller must be an operator of `account`. * * If a send hook is registered for `account`, the corresponding function * will be called with `data` and `operatorData`. See {IERC777Sender}. * * Emits a {Burned} event. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. * - the caller must be an operator for `account`. */ function operatorBurn( address account, uint256 amount, bytes calldata data, bytes calldata operatorData ) external; event Sent( address indexed operator, address indexed from, address indexed to, uint256 amount, bytes data, bytes operatorData ); event Minted(address indexed operator, address indexed to, uint256 amount, bytes data, bytes operatorData); event Burned(address indexed operator, address indexed from, uint256 amount, bytes data, bytes operatorData); event AuthorizedOperator(address indexed operator, address indexed tokenHolder); event RevokedOperator(address indexed operator, address indexed tokenHolder); } // File @openzeppelin/contracts/token/ERC777/[email protected] pragma solidity ^0.6.0; /** * @dev Interface of the ERC777TokensRecipient standard as defined in the EIP. * * Accounts can be notified of {IERC777} tokens being sent to them by having a * contract implement this interface (contract holders can be their own * implementer) and registering it on the * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry]. * * See {IERC1820Registry} and {ERC1820Implementer}. */ interface IERC777Recipient { /** * @dev Called by an {IERC777} token contract whenever tokens are being * moved or created into a registered account (`to`). The type of operation * is conveyed by `from` being the zero address or not. * * This call occurs _after_ the token contract's state is updated, so * {IERC777-balanceOf}, etc., can be used to query the post-operation state. * * This function may revert to prevent the operation from being executed. */ function tokensReceived( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external; } // File @openzeppelin/contracts/token/ERC777/[email protected] pragma solidity ^0.6.0; /** * @dev Interface of the ERC777TokensSender standard as defined in the EIP. * * {IERC777} Token holders can be notified of operations performed on their * tokens by having a contract implement this interface (contract holders can be * their own implementer) and registering it on the * https://eips.ethereum.org/EIPS/eip-1820[ERC1820 global registry]. * * See {IERC1820Registry} and {ERC1820Implementer}. */ interface IERC777Sender { /** * @dev Called by an {IERC777} token contract whenever a registered holder's * (`from`) tokens are about to be moved or destroyed. The type of operation * is conveyed by `to` being the zero address or not. * * This call occurs _before_ the token contract's state is updated, so * {IERC777-balanceOf}, etc., can be used to query the pre-operation state. * * This function may revert to prevent the operation from being executed. */ function tokensToSend( address operator, address from, address to, uint256 amount, bytes calldata userData, bytes calldata operatorData ) external; } // File @openzeppelin/contracts/token/ERC20/[email protected] pragma solidity ^0.6.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 @openzeppelin/contracts/math/[email protected] pragma solidity ^0.6.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, 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) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * 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); uint256 c = a - b; return c; } /** * @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) { // 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 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts 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) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts 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) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // File @openzeppelin/contracts/introspection/[email protected] pragma solidity ^0.6.0; /** * @dev Interface of the global ERC1820 Registry, as defined in the * https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register * implementers for interfaces in this registry, as well as query support. * * Implementers may be shared by multiple accounts, and can also implement more * than a single interface for each account. Contracts can implement interfaces * for themselves, but externally-owned accounts (EOA) must delegate this to a * contract. * * {IERC165} interfaces can also be queried via the registry. * * For an in-depth explanation and source code analysis, see the EIP text. */ interface IERC1820Registry { /** * @dev Sets `newManager` as the manager for `account`. A manager of an * account is able to set interface implementers for it. * * By default, each account is its own manager. Passing a value of `0x0` in * `newManager` will reset the manager to this initial state. * * Emits a {ManagerChanged} event. * * Requirements: * * - the caller must be the current manager for `account`. */ function setManager(address account, address newManager) external; /** * @dev Returns the manager for `account`. * * See {setManager}. */ function getManager(address account) external view returns (address); /** * @dev Sets the `implementer` contract as ``account``'s implementer for * `interfaceHash`. * * `account` being the zero address is an alias for the caller's address. * The zero address can also be used in `implementer` to remove an old one. * * See {interfaceHash} to learn how these are created. * * Emits an {InterfaceImplementerSet} event. * * Requirements: * * - the caller must be the current manager for `account`. * - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not * end in 28 zeroes). * - `implementer` must implement {IERC1820Implementer} and return true when * queried for support, unless `implementer` is the caller. See * {IERC1820Implementer-canImplementInterfaceForAddress}. */ function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external; /** * @dev Returns the implementer of `interfaceHash` for `account`. If no such * implementer is registered, returns the zero address. * * If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28 * zeroes), `account` will be queried for support of it. * * `account` being the zero address is an alias for the caller's address. */ function getInterfaceImplementer(address account, bytes32 interfaceHash) external view returns (address); /** * @dev Returns the interface hash for an `interfaceName`, as defined in the * corresponding * https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP]. */ function interfaceHash(string calldata interfaceName) external pure returns (bytes32); /** * @notice Updates the cache with whether the contract implements an ERC165 interface or not. * @param account Address of the contract for which to update the cache. * @param interfaceId ERC165 interface for which to update the cache. */ function updateERC165Cache(address account, bytes4 interfaceId) external; /** * @notice Checks whether a contract implements an ERC165 interface or not. * If the result is not cached a direct lookup on the contract address is performed. * If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling * {updateERC165Cache} with the contract address. * @param account Address of the contract to check. * @param interfaceId ERC165 interface to check. * @return True if `account` implements `interfaceId`, false otherwise. */ function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool); /** * @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache. * @param account Address of the contract to check. * @param interfaceId ERC165 interface to check. * @return True if `account` implements `interfaceId`, false otherwise. */ function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool); event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer); event ManagerChanged(address indexed account, address indexed newManager); } // File contracts/openzeppelin-contracts/ERC777.sol // SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Implementation of the {IERC777} 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}. * * Support for ERC20 is included in this contract, as specified by the EIP: both * the ERC777 and ERC20 interfaces can be safely used when interacting with it. * Both {IERC777-Sent} and {IERC20-Transfer} events are emitted on token * movements. * * Additionally, the {IERC777-granularity} value is hard-coded to `1`, meaning that there * are no special restrictions in the amount of tokens that created, moved, or * destroyed. This makes integration with ERC20 applications seamless. */ contract ERC777 is Context, IERC777, IERC20 { using SafeMath for uint256; using Address for address; IERC1820Registry constant internal _ERC1820_REGISTRY = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); mapping(address => uint256) private _balances; uint256 private _totalSupply; string private _name; string private _symbol; // We inline the result of the following hashes because Solidity doesn't resolve them at compile time. // See https://github.com/ethereum/solidity/issues/4024. // keccak256("ERC777TokensSender") bytes32 constant private _TOKENS_SENDER_INTERFACE_HASH = 0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895; // keccak256("ERC777TokensRecipient") bytes32 constant private _TOKENS_RECIPIENT_INTERFACE_HASH = 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b; // This isn't ever read from - it's only used to respond to the defaultOperators query. address[] private _defaultOperatorsArray; // Immutable, but accounts may revoke them (tracked in __revokedDefaultOperators). mapping(address => bool) private _defaultOperators; // For each account, a mapping of its operators and revoked default operators. mapping(address => mapping(address => bool)) private _operators; mapping(address => mapping(address => bool)) private _revokedDefaultOperators; // ERC20-allowances mapping (address => mapping (address => uint256)) private _allowances; /** * @dev `defaultOperators` may be an empty array. */ constructor( string memory name_, string memory symbol_, address[] memory defaultOperators_ ) public { _name = name_; _symbol = symbol_; _defaultOperatorsArray = defaultOperators_; for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) { _defaultOperators[_defaultOperatorsArray[i]] = true; } // register interfaces _ERC1820_REGISTRY.setInterfaceImplementer(address(this), keccak256("ERC777Token"), address(this)); _ERC1820_REGISTRY.setInterfaceImplementer(address(this), keccak256("ERC20Token"), address(this)); } /** * @dev See {IERC777-name}. */ function name() public view override returns (string memory) { return _name; } /** * @dev See {IERC777-symbol}. */ function symbol() public view override returns (string memory) { return _symbol; } /** * @dev See {ERC20-decimals}. * * Always returns 18, as per the * [ERC777 EIP](https://eips.ethereum.org/EIPS/eip-777#backward-compatibility). */ function decimals() public pure returns (uint8) { return 18; } /** * @dev See {IERC777-granularity}. * * This implementation always returns `1`. */ function granularity() public view override returns (uint256) { return 1; } /** * @dev See {IERC777-totalSupply}. */ function totalSupply() public view override(IERC20, IERC777) returns (uint256) { return _totalSupply; } /** * @dev Returns the amount of tokens owned by an account (`tokenHolder`). */ function balanceOf(address tokenHolder) public view override(IERC20, IERC777) returns (uint256) { return _balances[tokenHolder]; } /** * @dev See {IERC777-send}. * * Also emits a {IERC20-Transfer} event for ERC20 compatibility. */ function send(address recipient, uint256 amount, bytes memory data) public virtual override { _send(_msgSender(), recipient, amount, data, "", true); } /** * @dev See {IERC20-transfer}. * * Unlike `send`, `recipient` is _not_ required to implement the {IERC777Recipient} * interface if it is a contract. * * Also emits a {Sent} event. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { require(recipient != address(0), "ERC777: transfer to the zero address"); address from = _msgSender(); _callTokensToSend(from, from, recipient, amount, "", ""); _move(from, from, recipient, amount, "", ""); _callTokensReceived(from, from, recipient, amount, "", "", false); return true; } /** * @dev See {IERC777-burn}. * * Also emits a {IERC20-Transfer} event for ERC20 compatibility. */ function burn(uint256 amount, bytes memory data) public virtual override { _burn(_msgSender(), amount, data, ""); } /** * @dev See {IERC777-isOperatorFor}. */ function isOperatorFor(address operator, address tokenHolder) public view override returns (bool) { return operator == tokenHolder || (_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) || _operators[tokenHolder][operator]; } /** * @dev See {IERC777-authorizeOperator}. */ function authorizeOperator(address operator) public virtual override { require(_msgSender() != operator, "ERC777: authorizing self as operator"); if (_defaultOperators[operator]) { delete _revokedDefaultOperators[_msgSender()][operator]; } else { _operators[_msgSender()][operator] = true; } emit AuthorizedOperator(operator, _msgSender()); } /** * @dev See {IERC777-revokeOperator}. */ function revokeOperator(address operator) public virtual override { require(operator != _msgSender(), "ERC777: revoking self as operator"); if (_defaultOperators[operator]) { _revokedDefaultOperators[_msgSender()][operator] = true; } else { delete _operators[_msgSender()][operator]; } emit RevokedOperator(operator, _msgSender()); } /** * @dev See {IERC777-defaultOperators}. */ function defaultOperators() public view override returns (address[] memory) { return _defaultOperatorsArray; } /** * @dev See {IERC777-operatorSend}. * * Emits {Sent} and {IERC20-Transfer} events. */ function operatorSend( address sender, address recipient, uint256 amount, bytes memory data, bytes memory operatorData ) public virtual override { require(isOperatorFor(_msgSender(), sender), "ERC777: caller is not an operator for holder"); _send(sender, recipient, amount, data, operatorData, true); } /** * @dev See {IERC777-operatorBurn}. * * Emits {Burned} and {IERC20-Transfer} events. */ function operatorBurn(address account, uint256 amount, bytes memory data, bytes memory operatorData) public virtual override { require(isOperatorFor(_msgSender(), account), "ERC777: caller is not an operator for holder"); _burn(account, amount, data, operatorData); } /** * @dev See {IERC20-allowance}. * * Note that operator and allowance concepts are orthogonal: operators may * not have allowance, and accounts with allowance may not be operators * themselves. */ function allowance(address holder, address spender) public view override returns (uint256) { return _allowances[holder][spender]; } /** * @dev See {IERC20-approve}. * * Note that accounts cannot have allowance issued by their operators. */ function approve(address spender, uint256 value) public virtual override returns (bool) { address holder = _msgSender(); _approve(holder, spender, value); return true; } /** * @dev See {IERC20-transferFrom}. * * Note that operator and allowance concepts are orthogonal: operators cannot * call `transferFrom` (unless they have allowance), and accounts with * allowance cannot call `operatorSend` (unless they are operators). * * Emits {Sent}, {IERC20-Transfer} and {IERC20-Approval} events. */ function transferFrom(address holder, address recipient, uint256 amount) public virtual override returns (bool) { require(recipient != address(0), "ERC777: transfer to the zero address"); require(holder != address(0), "ERC777: transfer from the zero address"); address spender = _msgSender(); _callTokensToSend(spender, holder, recipient, amount, "", ""); _move(spender, holder, recipient, amount, "", ""); _approve(holder, spender, _allowances[holder][spender].sub(amount, "ERC777: transfer amount exceeds allowance")); _callTokensReceived(spender, holder, recipient, amount, "", "", false); return true; } /** * @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * If a send hook is registered for `account`, the corresponding function * will be called with `operator`, `data` and `operatorData`. * * See {IERC777Sender} and {IERC777Recipient}. * * Emits {Minted} and {IERC20-Transfer} events. * * Requirements * * - `account` cannot be the zero address. * - if `account` is a contract, it must implement the {IERC777Recipient} * interface. */ function _mint( address account, uint256 amount, bytes memory userData, bytes memory operatorData ) internal virtual { require(account != address(0), "ERC777: mint to the zero address"); address operator = _msgSender(); _beforeTokenTransfer(operator, address(0), account, amount); // Update state variables _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); _callTokensReceived(operator, address(0), account, amount, userData, operatorData, true); emit Minted(operator, account, amount, userData, operatorData); emit Transfer(address(0), account, amount); } /** * @dev Send tokens * @param from address token holder address * @param to address recipient address * @param amount uint256 amount of tokens to transfer * @param userData bytes extra information provided by the token holder (if any) * @param operatorData bytes extra information provided by the operator (if any) * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient */ function _send( address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData, bool requireReceptionAck ) internal virtual { require(from != address(0), "ERC777: send from the zero address"); require(to != address(0), "ERC777: send to the zero address"); address operator = _msgSender(); _callTokensToSend(operator, from, to, amount, userData, operatorData); _move(operator, from, to, amount, userData, operatorData); _callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck); } /** * @dev Burn tokens * @param from address token holder address * @param amount uint256 amount of tokens to burn * @param data bytes extra information provided by the token holder * @param operatorData bytes extra information provided by the operator (if any) */ function _burn( address from, uint256 amount, bytes memory data, bytes memory operatorData ) internal virtual { require(from != address(0), "ERC777: burn from the zero address"); address operator = _msgSender(); _callTokensToSend(operator, from, address(0), amount, data, operatorData); _beforeTokenTransfer(operator, from, address(0), amount); // Update state variables _balances[from] = _balances[from].sub(amount, "ERC777: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Burned(operator, from, amount, data, operatorData); emit Transfer(from, address(0), amount); } function _move( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData ) private { _beforeTokenTransfer(operator, from, to, amount); _balances[from] = _balances[from].sub(amount, "ERC777: transfer amount exceeds balance"); _balances[to] = _balances[to].add(amount); emit Sent(operator, from, to, amount, userData, operatorData); emit Transfer(from, to, amount); } /** * @dev See {ERC20-_approve}. * * Note that accounts cannot have allowance issued by their operators. */ function _approve(address holder, address spender, uint256 value) internal { require(holder != address(0), "ERC777: approve from the zero address"); require(spender != address(0), "ERC777: approve to the zero address"); _allowances[holder][spender] = value; emit Approval(holder, spender, value); } /** * @dev Call from.tokensToSend() if the interface is registered * @param operator address operator requesting the transfer * @param from address token holder address * @param to address recipient address * @param amount uint256 amount of tokens to transfer * @param userData bytes extra information provided by the token holder (if any) * @param operatorData bytes extra information provided by the operator (if any) */ function _callTokensToSend( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData ) private { address implementer = _ERC1820_REGISTRY.getInterfaceImplementer(from, _TOKENS_SENDER_INTERFACE_HASH); if (implementer != address(0)) { IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData); } } /** * @dev Call to.tokensReceived() if the interface is registered. Reverts if the recipient is a contract but * tokensReceived() was not registered for the recipient * @param operator address operator requesting the transfer * @param from address token holder address * @param to address recipient address * @param amount uint256 amount of tokens to transfer * @param userData bytes extra information provided by the token holder (if any) * @param operatorData bytes extra information provided by the operator (if any) * @param requireReceptionAck if true, contract recipients are required to implement ERC777TokensRecipient */ function _callTokensReceived( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData, bool requireReceptionAck ) private { address implementer = _ERC1820_REGISTRY.getInterfaceImplementer(to, _TOKENS_RECIPIENT_INTERFACE_HASH); if (implementer != address(0)) { IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData); } else if (requireReceptionAck) { require(!to.isContract(), "ERC777: token recipient contract has no implementer for ERC777TokensRecipient"); } } /** * @dev Hook that is called before any token transfer. This includes * calls to {send}, {transfer}, {operatorSend}, 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 operator, address from, address to, uint256 amount) internal virtual { } } // File contracts/ERC777/ERC777Snapshot.sol // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; /** * @dev This contract extends an ERC777 token with a snapshot mechanism. When a snapshot is created, the balances and * total supply at the time are recorded for later access. * * This can be used to safely create mechanisms based on token balances such as trustless dividends or weighted voting. * In naive implementations it's possible to perform a "double spend" attack by reusing the same balance from different * accounts. By using snapshots to calculate dividends or voting power, those attacks no longer apply. It can also be * used to create an efficient ERC20 forking mechanism. * * Snapshots are created by the internal {updateValueAtNow} function. * To get the total supply at the time of a snapshot, call the function {totalSupplyAt} with a block number. * To get the balance of an account at the time of a snapshot, call the {balanceOfAt} function with a block number * and the account address. */ abstract contract ERC777Snapshot is ERC777 { // Inspired by Jordi Baylina's MiniMeToken to record historical balances: // https://github.com/Giveth/minime/blob/ea04d950eea153a04c51fa510b068b9dded390cb/contracts/MiniMeToken.sol using SafeMath for uint256; /** * @dev `Snapshot` is the structure that attaches a block number to a * given value, the block number attached is the one that last changed the * value */ struct Snapshot { // `fromBlock` is the block number that the value was generated from uint128 fromBlock; // `value` is the amount of tokens at a specific block number uint128 value; } // `accountSnapshots` is the map that tracks the balance of each address, in this // contract when the balance changes the block number that the change // occurred is also included in the map mapping (address => Snapshot[]) public accountSnapshots; // Tracks the history of the `totalSupply` of the token Snapshot[] public totalSupplySnapshots; /** * @dev Queries the balance of `_owner` at a specific `_blockNumber` * @param _owner The address from which the balance will be retrieved * @param _blockNumber The block number when the balance is queried * @return The balance at `_blockNumber` */ function balanceOfAt(address _owner, uint128 _blockNumber) external view returns (uint256) { return _valueAt(accountSnapshots[_owner], _blockNumber); } /** * @notice Total amount of tokens at a specific `_blockNumber`. * @param _blockNumber The block number when the totalSupply is queried * @return The total amount of tokens at `_blockNumber` */ function totalSupplyAt(uint128 _blockNumber) external view returns(uint256) { return _valueAt(totalSupplySnapshots, _blockNumber); } // Update balance and/or total supply snapshots before the values are modified. This is implemented // in the _beforeTokenTransfer hook, which is executed for _mint, _burn, and _transfer operations. function _beforeTokenTransfer(address operator, address from, address to, uint256 amount) internal virtual override { if (from == address(0)) { // mint updateValueAtNow(accountSnapshots[to], balanceOf(to).add(amount)); updateValueAtNow(totalSupplySnapshots, totalSupply().add(amount)); } else if (to == address(0)) { // burn updateValueAtNow(accountSnapshots[from], balanceOf(from).sub(amount)); updateValueAtNow(totalSupplySnapshots, totalSupply().sub(amount)); } else if (from != to) { // transfer updateValueAtNow(accountSnapshots[from], balanceOf(from).sub(amount)); updateValueAtNow(accountSnapshots[to], balanceOf(to).add(amount)); } } /** * @dev `_valueAt` retrieves the number of tokens at a given block number * @param snapshots The history of values being queried * @param _block The block number to retrieve the value at * @return The number of tokens being queried */ function _valueAt( Snapshot[] storage snapshots, uint128 _block ) view internal returns (uint256) { uint256 lenSnapshots = snapshots.length; if (lenSnapshots == 0) return 0; // Shortcut for the actual value if (_block >= snapshots[lenSnapshots - 1].fromBlock) { return snapshots[lenSnapshots - 1].value; } if (_block < snapshots[0].fromBlock) { return 0; } // Binary search of the value in the array uint256 min = 0; uint256 max = lenSnapshots - 1; while (max > min) { uint256 mid = (max + min + 1) / 2; uint256 midSnapshotFrom = snapshots[mid].fromBlock; if (midSnapshotFrom == _block) { return snapshots[mid].value; } else if (midSnapshotFrom < _block) { min = mid; } else { max = mid - 1; } } return snapshots[min].value; } /** * @dev `updateValueAtNow` used to update the `balances` map and the * `totalSupplySnapshots` * @param snapshots The history of data being updated * @param _value The new number of tokens */ function updateValueAtNow(Snapshot[] storage snapshots, uint256 _value) internal { require(_value <= uint128(-1), "casting overflow"); uint256 lenSnapshots = snapshots.length; if ( (lenSnapshots == 0) || (snapshots[lenSnapshots - 1].fromBlock < block.number) ) { snapshots.push( Snapshot( uint128(block.number), uint128(_value) ) ); } else { snapshots[lenSnapshots - 1].value = uint128(_value); } } } // File contracts/HoprToken.sol // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; contract HoprToken is AccessControl, ERC777Snapshot { bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); constructor() public ERC777("HOPR Token", "HOPR", new address[](0)) { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); } /** * @dev Creates `amount` new tokens for `to`. * * See {ERC20-_mint}. * * Requirements: * * - the caller must have the `MINTER_ROLE`. */ function mint( address account, uint256 amount, bytes memory userData, bytes memory operatorData ) public { require(hasRole(MINTER_ROLE, msg.sender), "HoprToken: caller does not have minter role"); _mint(account, amount, userData, operatorData); } } // File contracts/HoprDistributor.sol // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.6.0; contract HoprDistributor is Ownable { // A {Schedule} that defined when and how much will be claimed // from an {Allocation}. // The primary reason we decided to use uint128 is because the allocation // may be used potentially thousands of times, this helps us reduce // casting thus lower gas costs. struct Schedule { uint128[] durations; uint128[] percents; } // An {Allocation} represents how much a account can claim, claimed, // and when last claim occured. // The primary reason we decided to use uint128 is so we can reduce // our gas costs, since this struct will be stored potentially // thousands of times. struct Allocation { uint128 amount; uint128 claimed; uint128 lastClaim; bool revoked; // account can no longer claim } // helps us create more accurate calculations uint128 public constant MULTIPLIER = 10 ** 6; // total amount minted uint128 public totalMinted = 0; // how many tokens will be minted (the sum of all allocations) uint128 public totalToBeMinted = 0; // time where the contract will consider as starting time uint128 public startTime; // token which will be used HoprToken public token; // maximum tokens allowed to be minted uint128 public maxMintAmount; // schedule name -> Schedule mapping(string => Schedule) internal schedules; // account -> schedule name -> Allocation // allows for an account to have more than one type of Schedule mapping(address => mapping(string => Allocation)) public allocations; event ScheduleAdded(uint128[] durations, uint128[] percents, string name); event AllocationAdded(address indexed account, uint128 amount, string scheduleName); event Claimed(address indexed account, uint128 amount, string scheduleName); /** * @param _startTime the timestamp to start counting * @param _token the token which we will mint */ constructor(HoprToken _token, uint128 _startTime, uint128 _maxMintAmount) public { startTime = _startTime; token = _token; maxMintAmount = _maxMintAmount; } /** * @param name the schedule name * @return the schedule */ function getSchedule(string calldata name) external view returns (uint128[] memory, uint128[] memory) { return ( schedules[name].durations, schedules[name].percents ); } /** * @dev Allows the owner to update the start time, * in case there are unforeseen issues in the long schedule. * @param _startTime the new timestamp to start counting */ function updateStartTime(uint128 _startTime) external onlyOwner { require(startTime > _currentBlockTimestamp(), "Previous start time must not be reached"); startTime = _startTime; } /** * @dev Revokes the ability for an account to claim on the * specified schedule. * @param account the account to crevoke * @param scheduleName the schedule name */ function revokeAccount( address account, string calldata scheduleName ) external onlyOwner { Allocation storage allocation = allocations[account][scheduleName]; require(allocation.amount != 0, "Allocation must exist"); require(!allocation.revoked, "Allocation must not be already revoked"); allocation.revoked = true; totalToBeMinted = _subUint128(totalToBeMinted, _subUint128(allocation.amount, allocation.claimed)); } /** * @dev Adds a schedule, the schedule must not already exist. * Owner is expected to insert values in ascending order, * each element in arrays {durations} and {percents} is meant to be * related. * @param durations the durations for each schedule period in seconds (6 months, 1 year) * @param percents the percent of how much can be allocated during that period, * instead of using 100 we scale the value up to {MULTIPLIER} so we can have more accurate * "percentages". */ function addSchedule( uint128[] calldata durations, uint128[] calldata percents, string calldata name ) external onlyOwner { require(schedules[name].durations.length == 0, "Schedule must not exist"); require(durations.length == percents.length, "Durations and percents must have equal length"); uint128 lastDuration = 0; uint128 totalPercent = 0; for (uint256 i = 0; i < durations.length; i++) { require(lastDuration < durations[i], "Durations must be added in ascending order"); lastDuration = durations[i]; require(percents[i] <= MULTIPLIER, "Percent provided must be smaller or equal to MULTIPLIER"); totalPercent = _addUint128(totalPercent, percents[i]); } require(totalPercent == MULTIPLIER, "Percents must sum to MULTIPLIER amount"); schedules[name] = Schedule(durations, percents); emit ScheduleAdded(durations, percents, name); } /** * @dev Adds allocations, all allocations will use the schedule specified, * schedule must be created before and account must not have an allocation * in the specific schedule. * @param accounts accounts to create allocations for * @param amounts total amount to be allocated * @param scheduleName the schedule name */ function addAllocations( address[] calldata accounts, uint128[] calldata amounts, string calldata scheduleName ) external onlyOwner { require(schedules[scheduleName].durations.length != 0, "Schedule must exist"); require(accounts.length == amounts.length, "Accounts and amounts must have equal length"); // gas optimization uint128 _totalToBeMinted = totalToBeMinted; for (uint256 i = 0; i < accounts.length; i++) { require(allocations[accounts[i]][scheduleName].amount == 0, "Allocation must not exist"); allocations[accounts[i]][scheduleName].amount = amounts[i]; _totalToBeMinted = _addUint128(_totalToBeMinted, amounts[i]); assert(_totalToBeMinted <= maxMintAmount); emit AllocationAdded(accounts[i], amounts[i], scheduleName); } totalToBeMinted = _totalToBeMinted; } /** * @dev Claim tokens by specified a schedule. * @param scheduleName the schedule name */ function claim(string calldata scheduleName) external { return _claim(msg.sender, scheduleName); } /** * @dev Claim tokens for a specific account by specified a schedule. * @param account the account to claim for * @param scheduleName the schedule name */ function claimFor(address account, string calldata scheduleName) external { return _claim(account, scheduleName); } /** * @param account the account to get claimable for * @param scheduleName the schedule name * @return claimable amount */ function getClaimable(address account, string calldata scheduleName) external view returns (uint128) { return _getClaimable(schedules[scheduleName], allocations[account][scheduleName]); } /** * @dev Claim claimable tokens, this will mint tokens. * @param account the account to claim for * @param scheduleName the schedule name */ function _claim(address account, string memory scheduleName) internal { Allocation storage allocation = allocations[account][scheduleName]; require(allocation.amount > 0, "There is nothing to claim"); require(!allocation.revoked, "Account is revoked"); Schedule storage schedule = schedules[scheduleName]; uint128 claimable = _getClaimable(schedule, allocation); // Trying to claim more than allocated assert(claimable <= allocation.amount); uint128 newClaimed = _addUint128(allocation.claimed, claimable); // Trying to claim more than allocated assert(newClaimed <= allocation.amount); uint128 newTotalMinted = _addUint128(totalMinted, claimable); // Total amount minted should be less or equal than specified // we only check this when a user claims, not when allocations // are added assert(newTotalMinted <= maxMintAmount); totalMinted = newTotalMinted; allocation.claimed = newClaimed; allocation.lastClaim = _currentBlockTimestamp(); // mint tokens token.mint(account, claimable, "", ""); emit Claimed(account, claimable, scheduleName); } /** * @dev Calculates claimable tokens. * This function expects that the owner has added the schedule * periods in ascending order. */ function _getClaimable( Schedule storage schedule, Allocation storage allocation ) internal view returns (uint128) { // first unlock hasn't passed yet if (_addUint128(startTime, schedule.durations[0]) > _currentBlockTimestamp()) { return 0; } // last unlock has passed if (_addUint128(startTime, schedule.durations[schedule.durations.length - 1]) < _currentBlockTimestamp()) { // make sure to exclude already claimed amount return _subUint128(allocation.amount, allocation.claimed); } uint128 claimable = 0; for (uint256 i = 0; i < schedule.durations.length; i++) { uint128 scheduleDeadline = _addUint128(startTime, schedule.durations[i]); // schedule deadline not passed, exiting if (scheduleDeadline > _currentBlockTimestamp()) break; // already claimed during this period, skipping if (allocation.lastClaim >= scheduleDeadline) continue; claimable = _addUint128(claimable, _divUint128(_mulUint128(allocation.amount, schedule.percents[i]), MULTIPLIER)); } return claimable; } function _currentBlockTimestamp() internal view returns (uint128) { // solhint-disable-next-line return uint128(block.timestamp); } // SafeMath variations function _addUint128(uint128 a, uint128 b) internal pure returns (uint128) { uint128 c = a + b; require(c >= a, "uint128 addition overflow"); return c; } function _subUint128(uint128 a, uint128 b) internal pure returns (uint128) { require(b <= a, "uint128 subtraction overflow"); uint128 c = a - b; return c; } function _mulUint128(uint128 a, uint128 b) internal pure returns (uint128) { if (a == 0) { return 0; } uint128 c = a * b; require(c / a == b, "uint128 multiplication overflow"); return c; } function _divUint128(uint128 a, uint128 b) internal pure returns (uint128) { require(b > 0, "uint128 division by zero"); uint128 c = a / b; return c; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract HoprToken","name":"_token","type":"address"},{"internalType":"uint128","name":"_startTime","type":"uint128"},{"internalType":"uint128","name":"_maxMintAmount","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"string","name":"scheduleName","type":"string"}],"name":"AllocationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint128","name":"amount","type":"uint128"},{"indexed":false,"internalType":"string","name":"scheduleName","type":"string"}],"name":"Claimed","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":"uint128[]","name":"durations","type":"uint128[]"},{"indexed":false,"internalType":"uint128[]","name":"percents","type":"uint128[]"},{"indexed":false,"internalType":"string","name":"name","type":"string"}],"name":"ScheduleAdded","type":"event"},{"inputs":[],"name":"MULTIPLIER","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint128[]","name":"amounts","type":"uint128[]"},{"internalType":"string","name":"scheduleName","type":"string"}],"name":"addAllocations","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128[]","name":"durations","type":"uint128[]"},{"internalType":"uint128[]","name":"percents","type":"uint128[]"},{"internalType":"string","name":"name","type":"string"}],"name":"addSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"string","name":"","type":"string"}],"name":"allocations","outputs":[{"internalType":"uint128","name":"amount","type":"uint128"},{"internalType":"uint128","name":"claimed","type":"uint128"},{"internalType":"uint128","name":"lastClaim","type":"uint128"},{"internalType":"bool","name":"revoked","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"scheduleName","type":"string"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"scheduleName","type":"string"}],"name":"claimFor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"scheduleName","type":"string"}],"name":"getClaimable","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"name","type":"string"}],"name":"getSchedule","outputs":[{"internalType":"uint128[]","name":"","type":"uint128[]"},{"internalType":"uint128[]","name":"","type":"uint128[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxMintAmount","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"string","name":"scheduleName","type":"string"}],"name":"revokeAccount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract HoprToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalMinted","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalToBeMinted","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_startTime","type":"uint128"}],"name":"updateStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052600060015534801561001557600080fd5b506040516123273803806123278339818101604052606081101561003857600080fd5b5080516020820151604090920151909190600061005c6001600160e01b036100f716565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350600280546001600160801b03199081166001600160801b0394851617909155600380546001600160a01b0319166001600160a01b0395909516949094179093556004805490931691161790556100fb565b3390565b61221d8061010a6000396000f3fe608060405234801561001057600080fd5b50600436106101365760003560e01c80638da5cb5b116100b2578063e574297011610081578063f2fde38b11610066578063f2fde38b1461076f578063f3fe12c914610795578063fc0c546a1461080557610136565b8063e5742970146105db578063e82330b2146106ef57610136565b80638da5cb5b1461049e578063a2309ff8146104c2578063b733f67d146104ca578063c31cd7d7146104f057610136565b80632c902c7c11610109578063715018a6116100ee578063715018a61461038557806372840f0e1461038d57806378e979251461049657610136565b80632c902c7c1461028557806370a428981461030557610136565b80630373a3641461013b578063059f8b161461015f57806322bccfd714610167578063239c70ae1461027d575b600080fd5b61014361080d565b604080516001600160801b039092168252519081900360200190f35b610143610823565b61027b6004803603606081101561017d57600080fd5b81019060208101813564010000000081111561019857600080fd5b8201836020820111156101aa57600080fd5b803590602001918460208302840111640100000000831117156101cc57600080fd5b9193909290916020810190356401000000008111156101ea57600080fd5b8201836020820111156101fc57600080fd5b8035906020019184602083028401116401000000008311171561021e57600080fd5b91939092909160208101903564010000000081111561023c57600080fd5b82018360208201111561024e57600080fd5b8035906020019184600183028401116401000000008311171561027057600080fd5b50909250905061082a565b005b610143610c02565b61027b6004803603604081101561029b57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102c657600080fd5b8201836020820111156102d857600080fd5b803590602001918460018302840111640100000000831117156102fa57600080fd5b509092509050610c11565b6101436004803603604081101561031b57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561034657600080fd5b82018360208201111561035857600080fd5b8035906020019184600183028401116401000000008311171561037a57600080fd5b509092509050610dea565b61027b610e6d565b6103fd600480360360208110156103a357600080fd5b8101906020810181356401000000008111156103be57600080fd5b8201836020820111156103d057600080fd5b803590602001918460018302840111640100000000831117156103f257600080fd5b509092509050610f39565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610441578181015183820152602001610429565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610480578181015183820152602001610468565b5050505090500194505050505060405180910390f35b610143611097565b6104a66110a6565b604080516001600160a01b039092168252519081900360200190f35b6101436110b6565b61027b600480360360208110156104e057600080fd5b50356001600160801b03166110c5565b6105a66004803603604081101561050657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561053157600080fd5b82018360208201111561054357600080fd5b8035906020019184600183028401116401000000008311171561056557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111ae945050505050565b604080516001600160801b03958616815293851660208501529190931682820152911515606082015290519081900360800190f35b61027b600480360360608110156105f157600080fd5b81019060208101813564010000000081111561060c57600080fd5b82018360208201111561061e57600080fd5b8035906020019184602083028401116401000000008311171561064057600080fd5b91939092909160208101903564010000000081111561065e57600080fd5b82018360208201111561067057600080fd5b8035906020019184602083028401116401000000008311171561069257600080fd5b9193909290916020810190356401000000008111156106b057600080fd5b8201836020820111156106c257600080fd5b803590602001918460018302840111640100000000831117156106e457600080fd5b509092509050611203565b61027b6004803603604081101561070557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561073057600080fd5b82018360208201111561074257600080fd5b8035906020019184600183028401116401000000008311171561076457600080fd5b50909250905061162a565b61027b6004803603602081101561078557600080fd5b50356001600160a01b031661166f565b61027b600480360360208110156107ab57600080fd5b8101906020810181356401000000008111156107c657600080fd5b8201836020820111156107d857600080fd5b803590602001918460018302840111640100000000831117156107fa57600080fd5b509092509050611791565b6104a66117d5565b600154600160801b90046001600160801b031681565b620f424081565b6108326117e4565b6000546001600160a01b03908116911614610894576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60058282604051808383808284379190910194855250506040519283900360200190922054151591506109109050576040805162461bcd60e51b815260206004820152601360248201527f5363686564756c65206d75737420657869737400000000000000000000000000604482015290519081900360640190fd5b84831461094e5760405162461bcd60e51b815260040180806020018281038252602b815260200180612139602b913960400191505060405180910390fd5b600154600160801b90046001600160801b031660005b86811015610bdc576006600089898481811061097c57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002084846040518083838082843791909101948552505060405192839003602001909220546001600160801b0316159150610a2e9050576040805162461bcd60e51b815260206004820152601960248201527f416c6c6f636174696f6e206d757374206e6f7420657869737400000000000000604482015290519081900360640190fd5b858582818110610a3a57fe5b905060200201356001600160801b0316600660008a8a85818110610a5a57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000208585604051808383808284379190910194855250506040519283900360200190922080546001600160801b03949094166fffffffffffffffffffffffffffffffff199094169390931790925550610afe905082878784818110610ae957fe5b905060200201356001600160801b03166117e8565b6004549092506001600160801b039081169083161115610b1a57fe5b878782818110610b2657fe5b905060200201356001600160a01b03166001600160a01b03167f499c64a5e7cdaa8e72ac9f0f4b080fce7a37c5ef24b2a9f67c7c6a728f5aec09878784818110610b6c57fe5b905060200201356001600160801b0316868660405180846001600160801b03166001600160801b03168152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a2600101610964565b50600180546001600160801b03928316600160801b029216919091179055505050505050565b6004546001600160801b031681565b610c196117e4565b6000546001600160a01b03908116911614610c7b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038316600090815260066020526040808220905184908490808383808284379190910194855250506040519283900360200190922080549093506001600160801b031615159150610d1c9050576040805162461bcd60e51b815260206004820152601560248201527f416c6c6f636174696f6e206d7573742065786973740000000000000000000000604482015290519081900360640190fd5b6001810154600160801b900460ff1615610d675760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b600181810180547fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff16600160801b90811790915590548254610dc7926001600160801b0392819004831692610dc29280821692900416611857565b611857565b600180546001600160801b03928316600160801b02921691909117905550505050565b6000610e6560058484604051808383808284378083019250505092505050908152602001604051809103902060066000876001600160a01b03166001600160a01b03168152602001908152602001600020858560405180838380828437808301925050509250505090815260200160405180910390206118c6565b949350505050565b610e756117e4565b6000546001600160a01b03908116911614610ed7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6060806005848460405180838380828437919091019485525050604051928390036020018320926005925087915086908083838082843791909101948552505060408051938490036020908101852086548083028701830190935282865260010194935085925083018282801561100157602002820191906000526020600020906000905b82829054906101000a90046001600160801b03166001600160801b031681526020019060100190602082600f01049283019260010382029150808411610fbe5790505b505050505091508080548060200260200160405190810160405280929190818152602001828054801561108557602002820191906000526020600020906000905b82829054906101000a90046001600160801b03166001600160801b031681526020019060100190602082600f010492830192600103820291508084116110425790505b50505050509050915091509250929050565b6002546001600160801b031681565b6000546001600160a01b03165b90565b6001546001600160801b031681565b6110cd6117e4565b6000546001600160a01b0390811691161461112f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611137611a8d565b6002546001600160801b039182169116116111835760405162461bcd60e51b81526004018080602001828103825260278152602001806121646027913960400191505060405180910390fd5b600280546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b60066020908152600092835260409092208151808301840180519281529084019290930191909120915280546001909101546001600160801b0380831692600160801b90819004821692918216910460ff1684565b61120b6117e4565b6000546001600160a01b0390811691161461126d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600582826040518083838082843791909101948552505060405192839003602001909220541591506112e89050576040805162461bcd60e51b815260206004820152601760248201527f5363686564756c65206d757374206e6f74206578697374000000000000000000604482015290519081900360640190fd5b8483146113265760405162461bcd60e51b815260040180806020018281038252602d8152602001806120e6602d913960400191505060405180910390fd5b600080805b878110156114455788888281811061133f57fe5b905060200201356001600160801b03166001600160801b0316836001600160801b03161061139e5760405162461bcd60e51b815260040180806020018281038252602a815260200180612096602a913960400191505060405180910390fd5b8888828181106113aa57fe5b905060200201356001600160801b03169250620f42406001600160801b03168787838181106113d557fe5b905060200201356001600160801b03166001600160801b0316111561142b5760405162461bcd60e51b815260040180806020018281038252603781526020018061218b6037913960400191505060405180910390fd5b61143b82888884818110610ae957fe5b915060010161132b565b506001600160801b038116620f4240146114905760405162461bcd60e51b81526004018080602001828103825260268152602001806121136026913960400191505060405180910390fd5b604051806040016040528089898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060408051602089810282810182019093528982529283019290918a918a918291850190849080828437600092019190915250505091525060405160059086908690808383808284379190910194855250506040516020938190038401902084518051919461154494508593500190611fb0565b50602082810151805161155d9260018501920190611fb0565b509050507f14a9427471da7dbb7ecca56162a326853031d8fab46a74ab7b1b797591d9e4688888888888886040518080602001806020018060200184810384528a8a82818152602001925060200280828437600083820152601f01601f19169091018581038452888152602090810191508990890280828437600083820152601f01601f191690910185810383528681526020019050868680828437600083820152604051601f909101601f19169092018290039b50909950505050505050505050a15050505050505050565b61166a8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a9192505050565b505050565b6116776117e4565b6000546001600160a01b039081169116146116d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661171e5760405162461bcd60e51b81526004018080602001828103825260268152602001806120c06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6117d13383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a9192505050565b5050565b6003546001600160a01b031681565b3390565b60008282016001600160801b03808516908216101561184e576040805162461bcd60e51b815260206004820152601960248201527f75696e74313238206164646974696f6e206f766572666c6f7700000000000000604482015290519081900360640190fd5b90505b92915050565b6000826001600160801b0316826001600160801b031611156118c0576040805162461bcd60e51b815260206004820152601c60248201527f75696e74313238207375627472616374696f6e206f766572666c6f7700000000604482015290519081900360640190fd5b50900390565b60006118d0611a8d565b60025484546001600160801b039283169261192092169086906000906118f257fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b03166117e8565b6001600160801b0316111561193757506000611851565b61193f611a8d565b60025484546001600160801b0392831692611966921690869060001981019081106118f257fe5b6001600160801b0316101561199b578154611994906001600160801b0380821691600160801b900416611857565b9050611851565b6000805b8454811015611a855760025485546000916119cc916001600160801b03909116908890859081106118f257fe5b90506119d6611a8d565b6001600160801b0316816001600160801b031611156119f55750611a85565b60018501546001600160801b03808316911610611a125750611a7d565b8454600187018054611a79928692611a7492611a6b926001600160801b0316919088908110611a3d57fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b0316611e9b565b620f4240611f2b565b6117e8565b9250505b60010161199f565b509392505050565b4290565b6001600160a01b0382166000908152600660209081526040808320905184519192859282918401908083835b60208310611adc5780518252601f199092019160209182019101611abd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922080549093506001600160801b031615159150611b6c9050576040805162461bcd60e51b815260206004820152601960248201527f5468657265206973206e6f7468696e6720746f20636c61696d00000000000000604482015290519081900360640190fd5b6001810154600160801b900460ff1615611bcd576040805162461bcd60e51b815260206004820152601260248201527f4163636f756e74206973207265766f6b65640000000000000000000000000000604482015290519081900360640190fd5b60006005836040518082805190602001908083835b60208310611c015780518252601f199092019160209182019101611be2565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220925060009150611c3e905082846118c6565b83549091506001600160801b039081169082161115611c5957fe5b8254600090611c7890600160801b90046001600160801b0316836117e8565b84549091506001600160801b039081169082161115611c9357fe5b600154600090611cac906001600160801b0316846117e8565b6004549091506001600160801b039081169082161115611cc857fe5b600180546001600160801b038084166fffffffffffffffffffffffffffffffff19909216919091179091558554838216600160801b029116178555611d0b611a8d565b6001860180546fffffffffffffffffffffffffffffffff19166001600160801b03928316179055600354604080517fdcdc7dd00000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015293871660248201526080604482015260006084820181905260c0606483015260c482018190529151939092169263dcdc7dd09261010480820193929182900301818387803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b50505050866001600160a01b03167fd6d52022b5ae5ce877753d56a79a1299605b05220771f26b0817599cabd2b6b4848860405180836001600160801b03166001600160801b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611e57578181015183820152602001611e3f565b50505050905090810190601f168015611e845780820380516001836020036101000a031916815260200191505b50935050505060405180910390a250505050505050565b60006001600160801b038316611eb357506000611851565b8282026001600160801b038084169080861690831681611ecf57fe5b046001600160801b03161461184e576040805162461bcd60e51b815260206004820152601f60248201527f75696e74313238206d756c7469706c69636174696f6e206f766572666c6f7700604482015290519081900360640190fd5b600080826001600160801b031611611f8a576040805162461bcd60e51b815260206004820152601860248201527f75696e74313238206469766973696f6e206279207a65726f0000000000000000604482015290519081900360640190fd5b6000826001600160801b0316846001600160801b031681611fa757fe5b04949350505050565b828054828255906000526020600020906001016002900481019282156120585791602002820160005b8382111561202357835183826101000a8154816001600160801b0302191690836001600160801b031602179055509260200192601001602081600f01049283019260010302611fd9565b80156120565782816101000a8154906001600160801b030219169055601001602081600f01049283019260010302612023565b505b50612064929150612068565b5090565b6110b391905b808211156120645780546fffffffffffffffffffffffffffffffff1916815560010161206e56fe4475726174696f6e73206d75737420626520616464656420696e20617363656e64696e67206f726465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734475726174696f6e7320616e642070657263656e7473206d757374206861766520657175616c206c656e67746850657263656e7473206d7573742073756d20746f204d554c5449504c49455220616d6f756e744163636f756e747320616e6420616d6f756e7473206d757374206861766520657175616c206c656e67746850726576696f75732073746172742074696d65206d757374206e6f74206265207265616368656450657263656e742070726f7669646564206d75737420626520736d616c6c6572206f7220657175616c20746f204d554c5449504c494552416c6c6f636174696f6e206d757374206e6f7420626520616c7265616479207265766f6b6564a264697066735822122094cd86ffa2693b962c5c6c5f70b878f28c85808323af5c95741e27e5e0251c1864736f6c63430006060033000000000000000000000000d4fdec44db9d44b8f2b6d529620f9c0c7066a2c1000000000000000000000000000000000000000000000000000000006040d9d00000000000000000000000000000000000000000000b07716e251a2480340000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101365760003560e01c80638da5cb5b116100b2578063e574297011610081578063f2fde38b11610066578063f2fde38b1461076f578063f3fe12c914610795578063fc0c546a1461080557610136565b8063e5742970146105db578063e82330b2146106ef57610136565b80638da5cb5b1461049e578063a2309ff8146104c2578063b733f67d146104ca578063c31cd7d7146104f057610136565b80632c902c7c11610109578063715018a6116100ee578063715018a61461038557806372840f0e1461038d57806378e979251461049657610136565b80632c902c7c1461028557806370a428981461030557610136565b80630373a3641461013b578063059f8b161461015f57806322bccfd714610167578063239c70ae1461027d575b600080fd5b61014361080d565b604080516001600160801b039092168252519081900360200190f35b610143610823565b61027b6004803603606081101561017d57600080fd5b81019060208101813564010000000081111561019857600080fd5b8201836020820111156101aa57600080fd5b803590602001918460208302840111640100000000831117156101cc57600080fd5b9193909290916020810190356401000000008111156101ea57600080fd5b8201836020820111156101fc57600080fd5b8035906020019184602083028401116401000000008311171561021e57600080fd5b91939092909160208101903564010000000081111561023c57600080fd5b82018360208201111561024e57600080fd5b8035906020019184600183028401116401000000008311171561027057600080fd5b50909250905061082a565b005b610143610c02565b61027b6004803603604081101561029b57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156102c657600080fd5b8201836020820111156102d857600080fd5b803590602001918460018302840111640100000000831117156102fa57600080fd5b509092509050610c11565b6101436004803603604081101561031b57600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561034657600080fd5b82018360208201111561035857600080fd5b8035906020019184600183028401116401000000008311171561037a57600080fd5b509092509050610dea565b61027b610e6d565b6103fd600480360360208110156103a357600080fd5b8101906020810181356401000000008111156103be57600080fd5b8201836020820111156103d057600080fd5b803590602001918460018302840111640100000000831117156103f257600080fd5b509092509050610f39565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610441578181015183820152602001610429565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610480578181015183820152602001610468565b5050505090500194505050505060405180910390f35b610143611097565b6104a66110a6565b604080516001600160a01b039092168252519081900360200190f35b6101436110b6565b61027b600480360360208110156104e057600080fd5b50356001600160801b03166110c5565b6105a66004803603604081101561050657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561053157600080fd5b82018360208201111561054357600080fd5b8035906020019184600183028401116401000000008311171561056557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506111ae945050505050565b604080516001600160801b03958616815293851660208501529190931682820152911515606082015290519081900360800190f35b61027b600480360360608110156105f157600080fd5b81019060208101813564010000000081111561060c57600080fd5b82018360208201111561061e57600080fd5b8035906020019184602083028401116401000000008311171561064057600080fd5b91939092909160208101903564010000000081111561065e57600080fd5b82018360208201111561067057600080fd5b8035906020019184602083028401116401000000008311171561069257600080fd5b9193909290916020810190356401000000008111156106b057600080fd5b8201836020820111156106c257600080fd5b803590602001918460018302840111640100000000831117156106e457600080fd5b509092509050611203565b61027b6004803603604081101561070557600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561073057600080fd5b82018360208201111561074257600080fd5b8035906020019184600183028401116401000000008311171561076457600080fd5b50909250905061162a565b61027b6004803603602081101561078557600080fd5b50356001600160a01b031661166f565b61027b600480360360208110156107ab57600080fd5b8101906020810181356401000000008111156107c657600080fd5b8201836020820111156107d857600080fd5b803590602001918460018302840111640100000000831117156107fa57600080fd5b509092509050611791565b6104a66117d5565b600154600160801b90046001600160801b031681565b620f424081565b6108326117e4565b6000546001600160a01b03908116911614610894576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60058282604051808383808284379190910194855250506040519283900360200190922054151591506109109050576040805162461bcd60e51b815260206004820152601360248201527f5363686564756c65206d75737420657869737400000000000000000000000000604482015290519081900360640190fd5b84831461094e5760405162461bcd60e51b815260040180806020018281038252602b815260200180612139602b913960400191505060405180910390fd5b600154600160801b90046001600160801b031660005b86811015610bdc576006600089898481811061097c57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b0316815260200190815260200160002084846040518083838082843791909101948552505060405192839003602001909220546001600160801b0316159150610a2e9050576040805162461bcd60e51b815260206004820152601960248201527f416c6c6f636174696f6e206d757374206e6f7420657869737400000000000000604482015290519081900360640190fd5b858582818110610a3a57fe5b905060200201356001600160801b0316600660008a8a85818110610a5a57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b031681526020019081526020016000208585604051808383808284379190910194855250506040519283900360200190922080546001600160801b03949094166fffffffffffffffffffffffffffffffff199094169390931790925550610afe905082878784818110610ae957fe5b905060200201356001600160801b03166117e8565b6004549092506001600160801b039081169083161115610b1a57fe5b878782818110610b2657fe5b905060200201356001600160a01b03166001600160a01b03167f499c64a5e7cdaa8e72ac9f0f4b080fce7a37c5ef24b2a9f67c7c6a728f5aec09878784818110610b6c57fe5b905060200201356001600160801b0316868660405180846001600160801b03166001600160801b03168152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a2600101610964565b50600180546001600160801b03928316600160801b029216919091179055505050505050565b6004546001600160801b031681565b610c196117e4565b6000546001600160a01b03908116911614610c7b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038316600090815260066020526040808220905184908490808383808284379190910194855250506040519283900360200190922080549093506001600160801b031615159150610d1c9050576040805162461bcd60e51b815260206004820152601560248201527f416c6c6f636174696f6e206d7573742065786973740000000000000000000000604482015290519081900360640190fd5b6001810154600160801b900460ff1615610d675760405162461bcd60e51b81526004018080602001828103825260268152602001806121c26026913960400191505060405180910390fd5b600181810180547fffffffffffffffffffffffffffffff00ffffffffffffffffffffffffffffffff16600160801b90811790915590548254610dc7926001600160801b0392819004831692610dc29280821692900416611857565b611857565b600180546001600160801b03928316600160801b02921691909117905550505050565b6000610e6560058484604051808383808284378083019250505092505050908152602001604051809103902060066000876001600160a01b03166001600160a01b03168152602001908152602001600020858560405180838380828437808301925050509250505090815260200160405180910390206118c6565b949350505050565b610e756117e4565b6000546001600160a01b03908116911614610ed7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6060806005848460405180838380828437919091019485525050604051928390036020018320926005925087915086908083838082843791909101948552505060408051938490036020908101852086548083028701830190935282865260010194935085925083018282801561100157602002820191906000526020600020906000905b82829054906101000a90046001600160801b03166001600160801b031681526020019060100190602082600f01049283019260010382029150808411610fbe5790505b505050505091508080548060200260200160405190810160405280929190818152602001828054801561108557602002820191906000526020600020906000905b82829054906101000a90046001600160801b03166001600160801b031681526020019060100190602082600f010492830192600103820291508084116110425790505b50505050509050915091509250929050565b6002546001600160801b031681565b6000546001600160a01b03165b90565b6001546001600160801b031681565b6110cd6117e4565b6000546001600160a01b0390811691161461112f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b611137611a8d565b6002546001600160801b039182169116116111835760405162461bcd60e51b81526004018080602001828103825260278152602001806121646027913960400191505060405180910390fd5b600280546fffffffffffffffffffffffffffffffff19166001600160801b0392909216919091179055565b60066020908152600092835260409092208151808301840180519281529084019290930191909120915280546001909101546001600160801b0380831692600160801b90819004821692918216910460ff1684565b61120b6117e4565b6000546001600160a01b0390811691161461126d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600582826040518083838082843791909101948552505060405192839003602001909220541591506112e89050576040805162461bcd60e51b815260206004820152601760248201527f5363686564756c65206d757374206e6f74206578697374000000000000000000604482015290519081900360640190fd5b8483146113265760405162461bcd60e51b815260040180806020018281038252602d8152602001806120e6602d913960400191505060405180910390fd5b600080805b878110156114455788888281811061133f57fe5b905060200201356001600160801b03166001600160801b0316836001600160801b03161061139e5760405162461bcd60e51b815260040180806020018281038252602a815260200180612096602a913960400191505060405180910390fd5b8888828181106113aa57fe5b905060200201356001600160801b03169250620f42406001600160801b03168787838181106113d557fe5b905060200201356001600160801b03166001600160801b0316111561142b5760405162461bcd60e51b815260040180806020018281038252603781526020018061218b6037913960400191505060405180910390fd5b61143b82888884818110610ae957fe5b915060010161132b565b506001600160801b038116620f4240146114905760405162461bcd60e51b81526004018080602001828103825260268152602001806121136026913960400191505060405180910390fd5b604051806040016040528089898080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050509082525060408051602089810282810182019093528982529283019290918a918a918291850190849080828437600092019190915250505091525060405160059086908690808383808284379190910194855250506040516020938190038401902084518051919461154494508593500190611fb0565b50602082810151805161155d9260018501920190611fb0565b509050507f14a9427471da7dbb7ecca56162a326853031d8fab46a74ab7b1b797591d9e4688888888888886040518080602001806020018060200184810384528a8a82818152602001925060200280828437600083820152601f01601f19169091018581038452888152602090810191508990890280828437600083820152601f01601f191690910185810383528681526020019050868680828437600083820152604051601f909101601f19169092018290039b50909950505050505050505050a15050505050505050565b61166a8383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a9192505050565b505050565b6116776117e4565b6000546001600160a01b039081169116146116d9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661171e5760405162461bcd60e51b81526004018080602001828103825260268152602001806120c06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6117d13383838080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250611a9192505050565b5050565b6003546001600160a01b031681565b3390565b60008282016001600160801b03808516908216101561184e576040805162461bcd60e51b815260206004820152601960248201527f75696e74313238206164646974696f6e206f766572666c6f7700000000000000604482015290519081900360640190fd5b90505b92915050565b6000826001600160801b0316826001600160801b031611156118c0576040805162461bcd60e51b815260206004820152601c60248201527f75696e74313238207375627472616374696f6e206f766572666c6f7700000000604482015290519081900360640190fd5b50900390565b60006118d0611a8d565b60025484546001600160801b039283169261192092169086906000906118f257fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b03166117e8565b6001600160801b0316111561193757506000611851565b61193f611a8d565b60025484546001600160801b0392831692611966921690869060001981019081106118f257fe5b6001600160801b0316101561199b578154611994906001600160801b0380821691600160801b900416611857565b9050611851565b6000805b8454811015611a855760025485546000916119cc916001600160801b03909116908890859081106118f257fe5b90506119d6611a8d565b6001600160801b0316816001600160801b031611156119f55750611a85565b60018501546001600160801b03808316911610611a125750611a7d565b8454600187018054611a79928692611a7492611a6b926001600160801b0316919088908110611a3d57fe5b90600052602060002090600291828204019190066010029054906101000a90046001600160801b0316611e9b565b620f4240611f2b565b6117e8565b9250505b60010161199f565b509392505050565b4290565b6001600160a01b0382166000908152600660209081526040808320905184519192859282918401908083835b60208310611adc5780518252601f199092019160209182019101611abd565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922080549093506001600160801b031615159150611b6c9050576040805162461bcd60e51b815260206004820152601960248201527f5468657265206973206e6f7468696e6720746f20636c61696d00000000000000604482015290519081900360640190fd5b6001810154600160801b900460ff1615611bcd576040805162461bcd60e51b815260206004820152601260248201527f4163636f756e74206973207265766f6b65640000000000000000000000000000604482015290519081900360640190fd5b60006005836040518082805190602001908083835b60208310611c015780518252601f199092019160209182019101611be2565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220925060009150611c3e905082846118c6565b83549091506001600160801b039081169082161115611c5957fe5b8254600090611c7890600160801b90046001600160801b0316836117e8565b84549091506001600160801b039081169082161115611c9357fe5b600154600090611cac906001600160801b0316846117e8565b6004549091506001600160801b039081169082161115611cc857fe5b600180546001600160801b038084166fffffffffffffffffffffffffffffffff19909216919091179091558554838216600160801b029116178555611d0b611a8d565b6001860180546fffffffffffffffffffffffffffffffff19166001600160801b03928316179055600354604080517fdcdc7dd00000000000000000000000000000000000000000000000000000000081526001600160a01b038b8116600483015293871660248201526080604482015260006084820181905260c0606483015260c482018190529151939092169263dcdc7dd09261010480820193929182900301818387803b158015611dbd57600080fd5b505af1158015611dd1573d6000803e3d6000fd5b50505050866001600160a01b03167fd6d52022b5ae5ce877753d56a79a1299605b05220771f26b0817599cabd2b6b4848860405180836001600160801b03166001600160801b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611e57578181015183820152602001611e3f565b50505050905090810190601f168015611e845780820380516001836020036101000a031916815260200191505b50935050505060405180910390a250505050505050565b60006001600160801b038316611eb357506000611851565b8282026001600160801b038084169080861690831681611ecf57fe5b046001600160801b03161461184e576040805162461bcd60e51b815260206004820152601f60248201527f75696e74313238206d756c7469706c69636174696f6e206f766572666c6f7700604482015290519081900360640190fd5b600080826001600160801b031611611f8a576040805162461bcd60e51b815260206004820152601860248201527f75696e74313238206469766973696f6e206279207a65726f0000000000000000604482015290519081900360640190fd5b6000826001600160801b0316846001600160801b031681611fa757fe5b04949350505050565b828054828255906000526020600020906001016002900481019282156120585791602002820160005b8382111561202357835183826101000a8154816001600160801b0302191690836001600160801b031602179055509260200192601001602081600f01049283019260010302611fd9565b80156120565782816101000a8154906001600160801b030219169055601001602081600f01049283019260010302612023565b505b50612064929150612068565b5090565b6110b391905b808211156120645780546fffffffffffffffffffffffffffffffff1916815560010161206e56fe4475726174696f6e73206d75737420626520616464656420696e20617363656e64696e67206f726465724f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734475726174696f6e7320616e642070657263656e7473206d757374206861766520657175616c206c656e67746850657263656e7473206d7573742073756d20746f204d554c5449504c49455220616d6f756e744163636f756e747320616e6420616d6f756e7473206d757374206861766520657175616c206c656e67746850726576696f75732073746172742074696d65206d757374206e6f74206265207265616368656450657263656e742070726f7669646564206d75737420626520736d616c6c6572206f7220657175616c20746f204d554c5449504c494552416c6c6f636174696f6e206d757374206e6f7420626520616c7265616479207265766f6b6564a264697066735822122094cd86ffa2693b962c5c6c5f70b878f28c85808323af5c95741e27e5e0251c1864736f6c63430006060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d4fdec44db9d44b8f2b6d529620f9c0c7066a2c1000000000000000000000000000000000000000000000000000000006040d9d00000000000000000000000000000000000000000000b07716e251a2480340000
-----Decoded View---------------
Arg [0] : _token (address): 0xD4fdec44DB9D44B8f2b6d529620f9C0C7066A2c1
Arg [1] : _startTime (uint128): 1614862800
Arg [2] : _maxMintAmount (uint128): 13333333000000000000000000
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000d4fdec44db9d44b8f2b6d529620f9c0c7066a2c1
Arg [1] : 000000000000000000000000000000000000000000000000000000006040d9d0
Arg [2] : 0000000000000000000000000000000000000000000b07716e251a2480340000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.