Overview
xDAI Balance
xDAI Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 25021303 | 888 days ago | IN | 0 xDAI | 0.0000347 |
View more zero value Internal Transactions in Advanced View mode
Loading...
Loading
Contract Name:
TokenDistro
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at gnosisscan.io on 2022-08-05 */ // File: contracts/Interfaces/IDistro.sol pragma solidity =0.8.6; interface IDistro { /** * @dev Emitted when someone makes a claim of tokens */ event Claim(address indexed grantee, uint256 amount); /** * @dev Emitted when the DISTRIBUTOR allocate an amount to a grantee */ event Allocate( address indexed distributor, address indexed grantee, uint256 amount ); /** * @dev Emitted when the DEFAULT_ADMIN assign an amount to a DISTRIBUTOR */ event Assign( address indexed admin, address indexed distributor, uint256 amount ); /** * @dev Emitted when someone change their reception address */ event ChangeAddress(address indexed oldAddress, address indexed newAddress); /** * @dev Emitted when a new startTime is set */ event StartTimeChanged(uint256 newStartTime, uint256 newCliffTime); /** * @dev Returns the total amount of tokens will be streamed */ function totalTokens() external view returns (uint256); /** * Function that allows the DEFAULT_ADMIN_ROLE to assign set a new startTime if it hasn't started yet * @param newStartTime new startTime * * Emits a {StartTimeChanged} event. * */ function setStartTime(uint256 newStartTime) external; /** * Function that allows the DEFAULT_ADMIN_ROLE to assign tokens to an address who later can distribute them. * @dev It is required that the DISTRIBUTOR_ROLE is already held by the address to which an amount will be assigned * @param distributor the address, generally a smart contract, that will determine who gets how many tokens * @param amount Total amount of tokens to assign to that address for distributing */ function assign(address distributor, uint256 amount) external; /** * Function to claim tokens for a specific address. It uses the current timestamp */ function claim() external; /** * Function that allows to the distributor address to allocate some amount of tokens to a specific recipient * @dev Needs to be initialized: Nobody has the DEFAULT_ADMIN_ROLE and all available tokens have been assigned * @param recipient of token allocation * @param amount allocated amount * @param claim whether claim after allocate */ function allocate( address recipient, uint256 amount, bool claim ) external; /** * Function that allows to the distributor address to allocate some amounts of tokens to specific recipients * @dev Needs to be initialized: Nobody has the DEFAULT_ADMIN_ROLE and all available tokens have been assigned * @param recipients of token allocation * @param amounts allocated amount */ function allocateMany(address[] memory recipients, uint256[] memory amounts) external; function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external; /** * Function that allows a recipient to change its address * @dev The change can only be made to an address that has not previously received an allocation & * the distributor cannot change its address */ function changeAddress(address newAddress) external; /** * Function to get the current timestamp from the block */ function getTimestamp() external view returns (uint256); /** * Function to get the total unlocked tokes at some moment */ function globallyClaimableAt(uint256 timestamp) external view returns (uint256); /** * Function to get the unlocked tokes at some moment for a specific address */ function claimableAt(address recipient, uint256 timestamp) external view returns (uint256); /** * Function to get the unlocked tokens for a specific address. It uses the current timestamp */ function claimableNow(address recipient) external view returns (uint256); function cancelAllocation(address prevRecipient, address newRecipient) external; } // File: openzeppelin-contracts-upgradable-v4/utils/structs/EnumerableSetUpgradeable.sol pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // 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; if (lastIndex != toDeleteIndex) { 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] = valueIndex; // Replace lastvalue's index to valueIndex } // 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) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { return _values(set._inner); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; assembly { result := store } return result; } // 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)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; assembly { result := store } return result; } } // File: openzeppelin-contracts-upgradable-v4/utils/introspection/IERC165Upgradeable.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165Upgradeable { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } // File: openzeppelin-contracts-upgradable-v4/utils/StringsUpgradeable.sol pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } // File: openzeppelin-contracts-upgradable-v4/proxy/utils/Initializable.sol pragma solidity ^0.8.0; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } } // File: openzeppelin-contracts-upgradable-v4/utils/introspection/ERC165Upgradeable.sol pragma solidity ^0.8.0; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable { function __ERC165_init() internal initializer { __ERC165_init_unchained(); } function __ERC165_init_unchained() internal initializer { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165Upgradeable).interfaceId; } uint256[50] private __gap; } // File: openzeppelin-contracts-upgradable-v4/utils/ContextUpgradeable.sol pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; } // File: openzeppelin-contracts-upgradable-v4/access/IAccessControlUpgradeable.sol pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_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) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @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) external; /** * @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) external; /** * @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) external; } // File: openzeppelin-contracts-upgradable-v4/access/AccessControlUpgradeable.sol pragma solidity ^0.8.0; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * 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 AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable { function __AccessControl_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); } function __AccessControl_init_unchained() internal initializer { } struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", StringsUpgradeable.toHexString(uint160(account), 20), " is missing role ", StringsUpgradeable.toHexString(uint256(role), 32) ) ) ); } } /** * @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 override 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 override onlyRole(getRoleAdmin(role)) { _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 override onlyRole(getRoleAdmin(role)) { _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 override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } uint256[49] private __gap; } // File: openzeppelin-contracts-upgradable-v4/access/IAccessControlEnumerableUpgradeable.sol pragma solidity ^0.8.0; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable { /** * @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) external view returns (address); /** * @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) external view returns (uint256); } // File: openzeppelin-contracts-upgradable-v4/access/AccessControlEnumerableUpgradeable.sol pragma solidity ^0.8.0; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable { function __AccessControlEnumerable_init() internal initializer { __Context_init_unchained(); __ERC165_init_unchained(); __AccessControl_init_unchained(); __AccessControlEnumerable_init_unchained(); } function __AccessControlEnumerable_init_unchained() internal initializer { } using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId); } /** * @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 override returns (address) { return _roleMembers[role].at(index); } /** * @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 override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {grantRole} to track enumerable memberships */ function grantRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {revokeRole} to track enumerable memberships */ function revokeRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.revokeRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {renounceRole} to track enumerable memberships */ function renounceRole(bytes32 role, address account) public virtual override(AccessControlUpgradeable, IAccessControlUpgradeable) { super.renounceRole(role, account); _roleMembers[role].remove(account); } /** * @dev Overload {_setupRole} to track enumerable memberships */ function _setupRole(bytes32 role, address account) internal virtual override { super._setupRole(role, account); _roleMembers[role].add(account); } uint256[49] private __gap; } // File: openzeppelin-contracts-upgradable-v4/utils/AddressUpgradeable.sol pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: openzeppelin-contracts-upgradable-v4/token/ERC20/IERC20Upgradeable.sol pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @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-upgradable-v4/token/ERC20/utils/SafeERC20Upgradeable.sol pragma solidity ^0.8.0; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20Upgradeable token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20Upgradeable token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: contracts/TokenDistro/TokenDistro.sol pragma solidity =0.8.6; /** * Contract responsible for managing the release of tokens over time. * The distributor is in charge of releasing the corresponding amounts to its recipients. * This distributor is expected to be another smart contract, such as a merkledrop or the liquidity mining smart contract */ contract TokenDistro is Initializable, IDistro, AccessControlEnumerableUpgradeable { using SafeERC20Upgradeable for IERC20Upgradeable; // bytes32 public constant DISTRIBUTOR_ROLE = keccak256("DISTRIBUTOR_ROLE"); bytes32 public constant DISTRIBUTOR_ROLE = 0xfbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c; // Structure to of the accounting for each account struct accountStatus { uint256 allocatedTokens; uint256 claimed; } mapping(address => accountStatus) public balances; // Mapping with all accounts that have received an allocation uint256 public override totalTokens; // total tokens to be distribute uint256 public startTime; // Instant of time in which distribution begins uint256 public cliffTime; // Instant of time in which tokens will begin to be released uint256 public duration; uint256 public initialAmount; // Initial amount that will be available from startTime uint256 public lockedAmount; // Amount that will be released over time from cliffTime IERC20Upgradeable public token; // Token to be distribute bool public cancelable; // Variable that allows the ADMIN_ROLE to cancel an allocation /** * @dev Emitted when the DISTRIBUTOR allocate an amount of givBack to a recipient */ event GivBackPaid(address distributor); modifier onlyDistributor() { require( hasRole(DISTRIBUTOR_ROLE, msg.sender), "TokenDistro::onlyDistributor: ONLY_DISTRIBUTOR_ROLE" ); require( balances[msg.sender].claimed == 0, "TokenDistro::onlyDistributor: DISTRIBUTOR_CANNOT_CLAIM" ); _; } /** * @dev Initially the deployer of the contract will be able to assign the tokens to one or several addresses, * these addresses (EOA or Smart Contracts) are responsible to allocate tokens to specific addresses which can * later claim them * @param _totalTokens Total amount of tokens to distribute * @param _startTime Unix time that the distribution begins * @param _cliffPeriod Number of seconds to delay the claiming period for the tokens not initially released * @param _duration Time it will take for all tokens to be distributed * @param _initialPercentage Percentage of tokens initially released (2 decimals, 1/10000) * @param _token Address of the token to distribute * @param _cancelable In case the owner wants to have the power to cancel an assignment */ function initialize( uint256 _totalTokens, uint256 _startTime, uint256 _cliffPeriod, uint256 _duration, uint256 _initialPercentage, IERC20Upgradeable _token, bool _cancelable ) public initializer { require( _duration >= _cliffPeriod, "TokenDistro::constructor: DURATION_LESS_THAN_CLIFF" ); require( _initialPercentage <= 10000, "TokenDistro::constructor: INITIALPERCENTAGE_GREATER_THAN_100" ); __AccessControlEnumerable_init(); _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); uint256 _initialAmount = (_totalTokens * _initialPercentage) / 10000; token = _token; duration = _duration; startTime = _startTime; totalTokens = _totalTokens; initialAmount = _initialAmount; cliffTime = _startTime + _cliffPeriod; lockedAmount = _totalTokens - _initialAmount; balances[address(this)].allocatedTokens = _totalTokens; cancelable = _cancelable; } /** * Function that allows the DEFAULT_ADMIN_ROLE to assign set a new startTime if it hasn't started yet * @param newStartTime new startTime * * Emits a {StartTimeChanged} event. * */ function setStartTime(uint256 newStartTime) external override { require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "TokenDistro::assign: ONLY_ADMIN_ROLE" ); require( startTime > getTimestamp() && newStartTime > getTimestamp(), "TokenDistro::assign: IF_HAS_NOT_STARTED_YET" ); uint256 _cliffPeriod = cliffTime - startTime; startTime = newStartTime; cliffTime = newStartTime + _cliffPeriod; emit StartTimeChanged(startTime, cliffTime); } /** * Function that allows the DEFAULT_ADMIN_ROLE to assign tokens to an address who later can distribute them. * @dev It is required that the DISTRIBUTOR_ROLE is already held by the address to which an amount will be assigned * @param distributor the address, generally a smart contract, that will determine who gets how many tokens * @param amount Total amount of tokens to assign to that address for distributing * * Emits a {Assign} event. * */ function assign(address distributor, uint256 amount) external override { require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "TokenDistro::assign: ONLY_ADMIN_ROLE" ); require( hasRole(DISTRIBUTOR_ROLE, distributor), "TokenDistro::assign: ONLY_TO_DISTRIBUTOR_ROLE" ); balances[address(this)].allocatedTokens = balances[address(this)].allocatedTokens - amount; balances[distributor].allocatedTokens = balances[distributor].allocatedTokens + amount; emit Assign(msg.sender, distributor, amount); } /** * Function to claim tokens for a specific address. It uses the current timestamp * * Emits a {claim} event. * */ function claimTo(address account) external { // This check is not necessary as it does not break anything, just changes the claimed value // for this contract //require(address(this) != account, "TokenDistro::claimTo: CANNOT_CLAIM_FOR_CONTRACT_ITSELF"); _claim(account); } /** * Function to claim tokens for a specific address. It uses the current timestamp * * Emits a {claim} event. * */ function claim() external override { _claim(msg.sender); } /** * Function that allows to the distributor address to allocate some amount of tokens to a specific recipient * @param recipient of token allocation * @param amount allocated amount * @param claim whether claim after allocate * * Emits a {Allocate} event. * */ function _allocate( address recipient, uint256 amount, bool claim ) internal { require( !hasRole(DISTRIBUTOR_ROLE, recipient), "TokenDistro::allocate: DISTRIBUTOR_NOT_VALID_RECIPIENT" ); balances[msg.sender].allocatedTokens = balances[msg.sender].allocatedTokens - amount; balances[recipient].allocatedTokens = balances[recipient].allocatedTokens + amount; if (claim && claimableNow(recipient) > 0) { _claim(recipient); } emit Allocate(msg.sender, recipient, amount); } function allocate( address recipient, uint256 amount, bool claim ) external override onlyDistributor { _allocate(recipient, amount, claim); } /** * Function that allows to the distributor address to allocate some amounts of tokens to specific recipients * @dev Needs to be initialized: Nobody has the DEFAULT_ADMIN_ROLE and all available tokens have been assigned * @param recipients of token allocation * @param amounts allocated amount * * Unlike allocate method it doesn't claim recipients available balance */ function _allocateMany( address[] memory recipients, uint256[] memory amounts ) internal onlyDistributor { require( recipients.length == amounts.length, "TokenDistro::allocateMany: INPUT_LENGTH_NOT_MATCH" ); for (uint256 i = 0; i < recipients.length; i++) { _allocate(recipients[i], amounts[i], false); } } function allocateMany(address[] memory recipients, uint256[] memory amounts) external override { _allocateMany(recipients, amounts); } function sendGIVbacks(address[] memory recipients, uint256[] memory amounts) external override { _allocateMany(recipients, amounts); emit GivBackPaid(msg.sender); } /** * Function that allows a recipient to change its address * @dev The change can only be made to an address that has not previously received an allocation & * the distributor cannot change its address * * Emits a {ChangeAddress} event. * */ function changeAddress(address newAddress) external override { require( balances[newAddress].allocatedTokens == 0 && balances[newAddress].claimed == 0, "TokenDistro::changeAddress: ADDRESS_ALREADY_IN_USE" ); require( !hasRole(DISTRIBUTOR_ROLE, msg.sender) && !hasRole(DISTRIBUTOR_ROLE, newAddress), "TokenDistro::changeAddress: DISTRIBUTOR_ROLE_NOT_A_VALID_ADDRESS" ); balances[newAddress].allocatedTokens = balances[msg.sender] .allocatedTokens; balances[msg.sender].allocatedTokens = 0; balances[newAddress].claimed = balances[msg.sender].claimed; balances[msg.sender].claimed = 0; emit ChangeAddress(msg.sender, newAddress); } /** * Function to get the current timestamp from the block */ function getTimestamp() public view virtual override returns (uint256) { return block.timestamp; } /** * Function to get the total claimable tokens at some moment * @param timestamp Unix time to check the number of tokens claimable * @return Number of tokens claimable at that timestamp */ function globallyClaimableAt(uint256 timestamp) public view override returns (uint256) { if (timestamp < startTime) return 0; if (timestamp < cliffTime) return initialAmount; if (timestamp > startTime + duration) return totalTokens; uint256 deltaTime = timestamp - startTime; return initialAmount + (deltaTime * lockedAmount) / duration; } /** * Function to get the unlocked tokes at some moment for a specific address * @param recipient account to query * @param timestamp Instant of time in which the calculation is made */ function claimableAt(address recipient, uint256 timestamp) public view override returns (uint256) { require( !hasRole(DISTRIBUTOR_ROLE, recipient), "TokenDistro::claimableAt: DISTRIBUTOR_ROLE_CANNOT_CLAIM" ); require( timestamp >= getTimestamp(), "TokenDistro::claimableAt: NOT_VALID_PAST_TIMESTAMP" ); uint256 unlockedAmount = (globallyClaimableAt(timestamp) * balances[recipient].allocatedTokens) / totalTokens; return unlockedAmount - balances[recipient].claimed; } /** * Function to get the unlocked tokens for a specific address. It uses the current timestamp * @param recipient account to query */ function claimableNow(address recipient) public view override returns (uint256) { return claimableAt(recipient, getTimestamp()); } /** * Function that allows the DEFAULT_ADMIN_ROLE to change a recipient in case it wants to cancel an allocation * @dev The change can only be made when cancelable is true and to an address that has not previously received * an allocation and the distributor cannot change its address * * Emits a {ChangeAddress} event. * */ function cancelAllocation(address prevRecipient, address newRecipient) external override { require(cancelable, "TokenDistro::cancelAllocation: NOT_CANCELABLE"); require( hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "TokenDistro::cancelAllocation: ONLY_ADMIN_ROLE" ); require( balances[newRecipient].allocatedTokens == 0 && balances[newRecipient].claimed == 0, "TokenDistro::cancelAllocation: ADDRESS_ALREADY_IN_USE" ); require( !hasRole(DISTRIBUTOR_ROLE, prevRecipient) && !hasRole(DISTRIBUTOR_ROLE, newRecipient), "TokenDistro::cancelAllocation: DISTRIBUTOR_ROLE_NOT_A_VALID_ADDRESS" ); balances[newRecipient].allocatedTokens = balances[prevRecipient] .allocatedTokens; balances[prevRecipient].allocatedTokens = 0; balances[newRecipient].claimed = balances[prevRecipient].claimed; balances[prevRecipient].claimed = 0; emit ChangeAddress(prevRecipient, newRecipient); } /** * Function to claim tokens for a specific address. It uses the current timestamp * * Emits a {claim} event. * */ function _claim(address recipient) private { uint256 remainingToClaim = claimableNow(recipient); require( remainingToClaim > 0, "TokenDistro::claim: NOT_ENOUGTH_TOKENS_TO_CLAIM" ); balances[recipient].claimed = balances[recipient].claimed + remainingToClaim; token.safeTransfer(recipient, remainingToClaim); emit Claim(recipient, remainingToClaim); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"distributor","type":"address"},{"indexed":true,"internalType":"address","name":"grantee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Allocate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":true,"internalType":"address","name":"distributor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Assign","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"oldAddress","type":"address"},{"indexed":true,"internalType":"address","name":"newAddress","type":"address"}],"name":"ChangeAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"grantee","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"distributor","type":"address"}],"name":"GivBackPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newStartTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newCliffTime","type":"uint256"}],"name":"StartTimeChanged","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DISTRIBUTOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bool","name":"claim","type":"bool"}],"name":"allocate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"allocateMany","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"distributor","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"assign","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balances","outputs":[{"internalType":"uint256","name":"allocatedTokens","type":"uint256"},{"internalType":"uint256","name":"claimed","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"prevRecipient","type":"address"},{"internalType":"address","name":"newRecipient","type":"address"}],"name":"cancelAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"}],"name":"changeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"claimTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"claimableAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"claimableNow","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"cliffTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"duration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"globallyClaimableAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_totalTokens","type":"uint256"},{"internalType":"uint256","name":"_startTime","type":"uint256"},{"internalType":"uint256","name":"_cliffPeriod","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_initialPercentage","type":"uint256"},{"internalType":"contract IERC20Upgradeable","name":"_token","type":"address"},{"internalType":"bool","name":"_cancelable","type":"bool"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"recipients","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"sendGIVbacks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newStartTime","type":"uint256"}],"name":"setStartTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20Upgradeable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506131b6806100206000396000f3fe608060405234801561001057600080fd5b506004361061020b5760003560e01c8063793286771161012a578063be760488116100bd578063eee565641161008c578063fc0c546a11610071578063fc0c546a146104d1578063fc1ed437146104f1578063fe64d6ff146104fa57600080fd5b8063eee5656414610485578063f0bd87cc146104aa57600080fd5b8063be76048814610439578063c7aaa8d41461044c578063ca15c8731461045f578063d547741f1461047257600080fd5b806391d14854116100f957806391d14854146103c55780639a78ea4a1461040b578063a217fddf1461041e578063a262f5f81461042657600080fd5b8063793286771461035e5780637e1c0c09146103715780637effb5331461037a5780639010d07c1461038d57600080fd5b806336568abe116101a25780636ab28bc8116101715780636ab28bc8146103265780636ca163de1461032f5780636d8500db1461034257806378e979251461035557600080fd5b806336568abe146102e55780633e0a322d146102f85780634e71d92d1461030b5780635066c8931461031357600080fd5b8063188ec356116101de578063188ec3561461026d578063248a9ca31461027357806327e235e3146102965780632f2ff15d146102d257600080fd5b806301ffc9a7146102105780630661c040146102385780630f1a64441461024d5780630fb5a6b414610264575b600080fd5b61022361021e366004612d43565b61050d565b60405190151581526020015b60405180910390f35b61024b610246366004612b56565b610569565b005b61025660cc5481565b60405190815260200161022f565b61025660cd5481565b42610256565b610256610281366004612ce3565b60009081526065602052604090206001015490565b6102bd6102a4366004612b39565b60c9602052600090815260409020805460019091015482565b6040805192835260208301919091520161022f565b61024b6102e0366004612cfc565b61097e565b61024b6102f3366004612cfc565b6109a5565b61024b610306366004612ce3565b6109c7565b61024b610b8d565b610256610321366004612b8f565b610b98565b61025660cf5481565b61024b61033d366004612bbb565b610d84565b610256610350366004612ce3565b610eed565b61025660cb5481565b61024b61036c366004612bfd565b610f73565b61025660ca5481565b61024b610388366004612bfd565b610f81565b6103a061039b366004612d21565b610fbb565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022f565b6102236103d3366004612cfc565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b610256610419366004612b39565b610fd3565b610256600081565b61024b610434366004612b39565b610fdf565b61024b610447366004612b8f565b610feb565b61024b61045a366004612d85565b61123a565b61025661046d366004612ce3565b61156b565b61024b610480366004612cfc565b611582565b60d0546102239074010000000000000000000000000000000000000000900460ff1681565b6102567ffbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c81565b60d0546103a09073ffffffffffffffffffffffffffffffffffffffff1681565b61025660ce5481565b61024b610508366004612b39565b61158c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806105635750610563826117f8565b92915050565b60d05474010000000000000000000000000000000000000000900460ff16610618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204e60448201527f4f545f43414e43454c41424c450000000000000000000000000000000000000060648201526084015b60405180910390fd5b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166106d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204f60448201527f4e4c595f41444d494e5f524f4c45000000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260c9602052604090205415801561072f575073ffffffffffffffffffffffffffffffffffffffff8116600090815260c96020526040902060010154155b6107bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204160448201527f4444524553535f414c52454144595f494e5f5553450000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16158015610855575073ffffffffffffffffffffffffffffffffffffffff811660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16155b610907576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204460448201527f49535452494255544f525f524f4c455f4e4f545f415f56414c49445f4144445260648201527f4553530000000000000000000000000000000000000000000000000000000000608482015260a40161060f565b73ffffffffffffffffffffffffffffffffffffffff808316600081815260c96020526040808220805494861680845282842095865583825560019182018054929096019190915583835293829055517f8839b4e99cbac9b99de60313e9f1679f46d6837a692b8c052bf0bd6cacb19c799190a35050565b610988828261188f565b60008281526097602052604090206109a090826118b5565b505050565b6109af82826118d7565b60008281526097602052604090206109a09082611986565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff16610a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f41444d494e5f60448201527f524f4c4500000000000000000000000000000000000000000000000000000000606482015260840161060f565b4260cb54118015610a9457504281115b610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f546f6b656e44697374726f3a3a61737369676e3a2049465f4841535f4e4f545f60448201527f535441525445445f594554000000000000000000000000000000000000000000606482015260840161060f565b600060cb5460cc54610b329190612fdf565b60cb8390559050610b438183612f4f565b60cc81905560cb546040517fbefe8e3983c0dc663c4ba451fc82d4ff7eb2e4ccc4b944874abea1ecc841feae92610b81928252602082015260400190565b60405180910390a15050565b610b96336119a8565b565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604081205460ff1615610c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f546f6b656e44697374726f3a3a636c61696d61626c6541743a2044495354524960448201527f4255544f525f524f4c455f43414e4e4f545f434c41494d000000000000000000606482015260840161060f565b42821015610cfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a636c61696d61626c6541743a204e4f545f564160448201527f4c49445f504153545f54494d455354414d500000000000000000000000000000606482015260840161060f565b60ca5473ffffffffffffffffffffffffffffffffffffffff8416600090815260c96020526040812054909190610d3285610eed565b610d3c9190612fa2565b610d469190612f67565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260c96020526040902060010154909150610d7c9082612fdf565b949350505050565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16610e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a204f4e60448201527f4c595f4449535452494255544f525f524f4c4500000000000000000000000000606482015260840161060f565b33600090815260c9602052604090206001015415610ee2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a20444960448201527f535452494255544f525f43414e4e4f545f434c41494d00000000000000000000606482015260840161060f565b6109a0838383611b09565b600060cb54821015610f0157506000919050565b60cc54821015610f1357505060ce5490565b60cd5460cb54610f239190612f4f565b821115610f3257505060ca5490565b600060cb5483610f429190612fdf565b905060cd5460cf5482610f559190612fa2565b610f5f9190612f67565b60ce54610f6c9190612f4f565b9392505050565b610f7d8282611cce565b5050565b610f8b8282611cce565b6040513381527f501554fe9eb720f094fa1c09c71f38933a18b834045c8afd91a329cf38021d1c90602001610b81565b6000828152609760205260408120610f6c9083611f19565b60006105638242610b98565b610fe8816119a8565b50565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166110a8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f41444d494e5f60448201527f524f4c4500000000000000000000000000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff1661117c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f544f5f44495360448201527f5452494255544f525f524f4c4500000000000000000000000000000000000000606482015260840161060f565b30600090815260c96020526040902054611197908290612fdf565b30600090815260c960205260408082209290925573ffffffffffffffffffffffffffffffffffffffff8416815220546111d1908290612f4f565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260c960205260409081902092909255905133907e7ae6a979e5d8177867f7c1ca4be1527487a2e43a444b55c3dfaee02c4235449061122e9085815260200190565b60405180910390a35050565b600054610100900460ff1680611253575060005460ff16155b6112df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561131e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b858510156113ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a636f6e7374727563746f723a2044555241544960448201527f4f4e5f4c4553535f5448414e5f434c4946460000000000000000000000000000606482015260840161060f565b612710841115611440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f546f6b656e44697374726f3a3a636f6e7374727563746f723a20494e4954494160448201527f4c50455243454e544147455f475245415445525f5448414e5f31303000000000606482015260840161060f565b611448611f25565b61145360003361205a565b6000612710611462868b612fa2565b61146c9190612f67565b60d080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff871617905560cd87905560cb89905560ca8a905560ce81905590506114cc8789612f4f565b60cc556114d9818a612fdf565b60cf555030600090815260c96020526040902088905560d080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000084151502179055801561156157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050505050505050565b600081815260976020526040812061056390612064565b6109af828261206e565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260c960205260409020541580156115e5575073ffffffffffffffffffffffffffffffffffffffff8116600090815260c96020526040902060010154155b611671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a6368616e6765416464726573733a204144445260448201527f4553535f414c52454144595f494e5f5553450000000000000000000000000000606482015260840161060f565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff161580156116f5575073ffffffffffffffffffffffffffffffffffffffff811660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16155b61178357604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f546f6b656e44697374726f3a3a6368616e6765416464726573733a204449535460448201527f52494255544f525f524f4c455f4e4f545f415f56414c49445f41444452455353606482015260840161060f565b33600081815260c96020526040808220805473ffffffffffffffffffffffffffffffffffffffff861680855283852091825584835560019283018054939092019290925584845283905590519092917f8839b4e99cbac9b99de60313e9f1679f46d6837a692b8c052bf0bd6cacb19c7991a350565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061056357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610563565b6000828152606560205260409020600101546118ab8133612094565b6109a08383612166565b6000610f6c8373ffffffffffffffffffffffffffffffffffffffff841661225a565b73ffffffffffffffffffffffffffffffffffffffff8116331461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161060f565b610f7d82826122a9565b6000610f6c8373ffffffffffffffffffffffffffffffffffffffff8416612364565b60006119b382610fd3565b905060008111611a45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f546f6b656e44697374726f3a3a636c61696d3a204e4f545f454e4f554754485f60448201527f544f4b454e535f544f5f434c41494d0000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260c96020526040902060010154611a79908290612f4f565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260c9602052604090206001019190915560d054611ab591168383612457565b8173ffffffffffffffffffffffffffffffffffffffff167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d482604051611afd91815260200190565b60405180910390a25050565b73ffffffffffffffffffffffffffffffffffffffff831660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff1615611bde576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a616c6c6f636174653a2044495354524942555460448201527f4f525f4e4f545f56414c49445f524543495049454e5400000000000000000000606482015260840161060f565b33600090815260c96020526040902054611bf9908390612fdf565b33600090815260c960205260408082209290925573ffffffffffffffffffffffffffffffffffffffff851681522054611c33908390612f4f565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260c96020526040902055808015611c6e57506000611c6c84610fd3565b115b15611c7c57611c7c836119a8565b60405182815273ffffffffffffffffffffffffffffffffffffffff84169033907f5168bfb88d6125d4580e2b91ecb103a730312c3e8b0be9c4031a0fc794e2cd5f9060200160405180910390a3505050565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16611d8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a204f4e60448201527f4c595f4449535452494255544f525f524f4c4500000000000000000000000000606482015260840161060f565b33600090815260c9602052604090206001015415611e2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a20444960448201527f535452494255544f525f43414e4e4f545f434c41494d00000000000000000000606482015260840161060f565b8051825114611ebd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f546f6b656e44697374726f3a3a616c6c6f636174654d616e793a20494e50555460448201527f5f4c454e4754485f4e4f545f4d41544348000000000000000000000000000000606482015260840161060f565b60005b82518110156109a057611f07838281518110611ede57611ede6130f2565b6020026020010151838381518110611ef857611ef86130f2565b60200260200101516000611b09565b80611f118161305b565b915050611ec0565b6000610f6c83836124e4565b600054610100900460ff1680611f3e575060005460ff16155b611fca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561200957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b61201161250e565b61201961250e565b61202161250e565b61202961250e565b8015610fe857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b6109888282612622565b6000610563825490565b60008281526065602052604090206001015461208a8133612094565b6109a083836122a9565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f7d576120ec8173ffffffffffffffffffffffffffffffffffffffff16601461262c565b6120f783602061262c565b604051602001612108929190612e0a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261060f91600401612e8b565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f7d57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556121fc3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546122a157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610563565b506000610563565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610f7d57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801561244d576000612388600183612fdf565b855490915060009061239c90600190612fdf565b90508181146124015760008660000182815481106123bc576123bc6130f2565b90600052602060002001549050808760000184815481106123df576123df6130f2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612412576124126130c3565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610563565b6000915050610563565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526109a090849061286f565b60008260000182815481106124fb576124fb6130f2565b9060005260206000200154905092915050565b600054610100900460ff1680612527575060005460ff16155b6125b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561202957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790558015610fe857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b610f7d8282612166565b6060600061263b836002612fa2565b612646906002612f4f565b67ffffffffffffffff81111561265e5761265e613121565b6040519080825280601f01601f191660200182016040528015612688576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106126bf576126bf6130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612722576127226130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061275e846002612fa2565b612769906001612f4f565b90505b6001811115612806577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106127aa576127aa6130f2565b1a60f81b8282815181106127c0576127c06130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936127ff81613026565b905061276c565b508315610f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161060f565b60006128d1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661297b9092919063ffffffff16565b8051909150156109a057808060200190518101906128ef9190612cc6565b6109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161060f565b6060610d7c848460008585843b6129ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161060f565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612a179190612dee565b60006040518083038185875af1925050503d8060008114612a54576040519150601f19603f3d011682016040523d82523d6000602084013e612a59565b606091505b5091509150612a69828286612a74565b979650505050505050565b60608315612a83575081610f6c565b825115612a935782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060f9190612e8b565b600082601f830112612ad857600080fd5b81356020612aed612ae883612f2b565b612edc565b80838252828201915082860187848660051b8901011115612b0d57600080fd5b60005b85811015612b2c57813584529284019290840190600101612b10565b5090979650505050505050565b600060208284031215612b4b57600080fd5b8135610f6c81613150565b60008060408385031215612b6957600080fd5b8235612b7481613150565b91506020830135612b8481613150565b809150509250929050565b60008060408385031215612ba257600080fd5b8235612bad81613150565b946020939093013593505050565b600080600060608486031215612bd057600080fd5b8335612bdb81613150565b9250602084013591506040840135612bf281613172565b809150509250925092565b60008060408385031215612c1057600080fd5b823567ffffffffffffffff80821115612c2857600080fd5b818501915085601f830112612c3c57600080fd5b81356020612c4c612ae883612f2b565b8083825282820191508286018a848660051b8901011115612c6c57600080fd5b600096505b84871015612c98578035612c8481613150565b835260019690960195918301918301612c71565b5096505086013592505080821115612caf57600080fd5b50612cbc85828601612ac7565b9150509250929050565b600060208284031215612cd857600080fd5b8151610f6c81613172565b600060208284031215612cf557600080fd5b5035919050565b60008060408385031215612d0f57600080fd5b823591506020830135612b8481613150565b60008060408385031215612d3457600080fd5b50508035926020909101359150565b600060208284031215612d5557600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f6c57600080fd5b600080600080600080600060e0888a031215612da057600080fd5b873596506020880135955060408801359450606088013593506080880135925060a0880135612dce81613150565b915060c0880135612dde81613172565b8091505092959891949750929550565b60008251612e00818460208701612ff6565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612e42816017850160208801612ff6565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612e7f816028840160208801612ff6565b01602801949350505050565b6020815260008251806020840152612eaa816040850160208701612ff6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612f2357612f23613121565b604052919050565b600067ffffffffffffffff821115612f4557612f45613121565b5060051b60200190565b60008219821115612f6257612f62613094565b500190565b600082612f9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fda57612fda613094565b500290565b600082821015612ff157612ff1613094565b500390565b60005b83811015613011578181015183820152602001612ff9565b83811115613020576000848401525b50505050565b60008161303557613035613094565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308d5761308d613094565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610fe857600080fd5b8015158114610fe857600080fdfea26469706673582212208b2f3fb48ce4b52d448480619d00de9aadba0e576d55dfc0574e5a39281432e664736f6c63430008060033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061020b5760003560e01c8063793286771161012a578063be760488116100bd578063eee565641161008c578063fc0c546a11610071578063fc0c546a146104d1578063fc1ed437146104f1578063fe64d6ff146104fa57600080fd5b8063eee5656414610485578063f0bd87cc146104aa57600080fd5b8063be76048814610439578063c7aaa8d41461044c578063ca15c8731461045f578063d547741f1461047257600080fd5b806391d14854116100f957806391d14854146103c55780639a78ea4a1461040b578063a217fddf1461041e578063a262f5f81461042657600080fd5b8063793286771461035e5780637e1c0c09146103715780637effb5331461037a5780639010d07c1461038d57600080fd5b806336568abe116101a25780636ab28bc8116101715780636ab28bc8146103265780636ca163de1461032f5780636d8500db1461034257806378e979251461035557600080fd5b806336568abe146102e55780633e0a322d146102f85780634e71d92d1461030b5780635066c8931461031357600080fd5b8063188ec356116101de578063188ec3561461026d578063248a9ca31461027357806327e235e3146102965780632f2ff15d146102d257600080fd5b806301ffc9a7146102105780630661c040146102385780630f1a64441461024d5780630fb5a6b414610264575b600080fd5b61022361021e366004612d43565b61050d565b60405190151581526020015b60405180910390f35b61024b610246366004612b56565b610569565b005b61025660cc5481565b60405190815260200161022f565b61025660cd5481565b42610256565b610256610281366004612ce3565b60009081526065602052604090206001015490565b6102bd6102a4366004612b39565b60c9602052600090815260409020805460019091015482565b6040805192835260208301919091520161022f565b61024b6102e0366004612cfc565b61097e565b61024b6102f3366004612cfc565b6109a5565b61024b610306366004612ce3565b6109c7565b61024b610b8d565b610256610321366004612b8f565b610b98565b61025660cf5481565b61024b61033d366004612bbb565b610d84565b610256610350366004612ce3565b610eed565b61025660cb5481565b61024b61036c366004612bfd565b610f73565b61025660ca5481565b61024b610388366004612bfd565b610f81565b6103a061039b366004612d21565b610fbb565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161022f565b6102236103d3366004612cfc565b600091825260656020908152604080842073ffffffffffffffffffffffffffffffffffffffff93909316845291905290205460ff1690565b610256610419366004612b39565b610fd3565b610256600081565b61024b610434366004612b39565b610fdf565b61024b610447366004612b8f565b610feb565b61024b61045a366004612d85565b61123a565b61025661046d366004612ce3565b61156b565b61024b610480366004612cfc565b611582565b60d0546102239074010000000000000000000000000000000000000000900460ff1681565b6102567ffbd454f36a7e1a388bd6fc3ab10d434aa4578f811acbbcf33afb1c697486313c81565b60d0546103a09073ffffffffffffffffffffffffffffffffffffffff1681565b61025660ce5481565b61024b610508366004612b39565b61158c565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806105635750610563826117f8565b92915050565b60d05474010000000000000000000000000000000000000000900460ff16610618576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204e60448201527f4f545f43414e43454c41424c450000000000000000000000000000000000000060648201526084015b60405180910390fd5b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166106d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204f60448201527f4e4c595f41444d494e5f524f4c45000000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260c9602052604090205415801561072f575073ffffffffffffffffffffffffffffffffffffffff8116600090815260c96020526040902060010154155b6107bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603560248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204160448201527f4444524553535f414c52454144595f494e5f5553450000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16158015610855575073ffffffffffffffffffffffffffffffffffffffff811660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16155b610907576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152604360248201527f546f6b656e44697374726f3a3a63616e63656c416c6c6f636174696f6e3a204460448201527f49535452494255544f525f524f4c455f4e4f545f415f56414c49445f4144445260648201527f4553530000000000000000000000000000000000000000000000000000000000608482015260a40161060f565b73ffffffffffffffffffffffffffffffffffffffff808316600081815260c96020526040808220805494861680845282842095865583825560019182018054929096019190915583835293829055517f8839b4e99cbac9b99de60313e9f1679f46d6837a692b8c052bf0bd6cacb19c799190a35050565b610988828261188f565b60008281526097602052604090206109a090826118b5565b505050565b6109af82826118d7565b60008281526097602052604090206109a09082611986565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff16610a84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f41444d494e5f60448201527f524f4c4500000000000000000000000000000000000000000000000000000000606482015260840161060f565b4260cb54118015610a9457504281115b610b20576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f546f6b656e44697374726f3a3a61737369676e3a2049465f4841535f4e4f545f60448201527f535441525445445f594554000000000000000000000000000000000000000000606482015260840161060f565b600060cb5460cc54610b329190612fdf565b60cb8390559050610b438183612f4f565b60cc81905560cb546040517fbefe8e3983c0dc663c4ba451fc82d4ff7eb2e4ccc4b944874abea1ecc841feae92610b81928252602082015260400190565b60405180910390a15050565b610b96336119a8565b565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604081205460ff1615610c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603760248201527f546f6b656e44697374726f3a3a636c61696d61626c6541743a2044495354524960448201527f4255544f525f524f4c455f43414e4e4f545f434c41494d000000000000000000606482015260840161060f565b42821015610cfd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a636c61696d61626c6541743a204e4f545f564160448201527f4c49445f504153545f54494d455354414d500000000000000000000000000000606482015260840161060f565b60ca5473ffffffffffffffffffffffffffffffffffffffff8416600090815260c96020526040812054909190610d3285610eed565b610d3c9190612fa2565b610d469190612f67565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260c96020526040902060010154909150610d7c9082612fdf565b949350505050565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16610e42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a204f4e60448201527f4c595f4449535452494255544f525f524f4c4500000000000000000000000000606482015260840161060f565b33600090815260c9602052604090206001015415610ee2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a20444960448201527f535452494255544f525f43414e4e4f545f434c41494d00000000000000000000606482015260840161060f565b6109a0838383611b09565b600060cb54821015610f0157506000919050565b60cc54821015610f1357505060ce5490565b60cd5460cb54610f239190612f4f565b821115610f3257505060ca5490565b600060cb5483610f429190612fdf565b905060cd5460cf5482610f559190612fa2565b610f5f9190612f67565b60ce54610f6c9190612f4f565b9392505050565b610f7d8282611cce565b5050565b610f8b8282611cce565b6040513381527f501554fe9eb720f094fa1c09c71f38933a18b834045c8afd91a329cf38021d1c90602001610b81565b6000828152609760205260408120610f6c9083611f19565b60006105638242610b98565b610fe8816119a8565b50565b3360009081527fffdfc1249c027f9191656349feb0761381bb32c9f557e01f419fd08754bf5a1b602052604090205460ff166110a8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f41444d494e5f60448201527f524f4c4500000000000000000000000000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff821660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff1661117c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f546f6b656e44697374726f3a3a61737369676e3a204f4e4c595f544f5f44495360448201527f5452494255544f525f524f4c4500000000000000000000000000000000000000606482015260840161060f565b30600090815260c96020526040902054611197908290612fdf565b30600090815260c960205260408082209290925573ffffffffffffffffffffffffffffffffffffffff8416815220546111d1908290612f4f565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260c960205260409081902092909255905133907e7ae6a979e5d8177867f7c1ca4be1527487a2e43a444b55c3dfaee02c4235449061122e9085815260200190565b60405180910390a35050565b600054610100900460ff1680611253575060005460ff16155b6112df576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561131e57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b858510156113ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a636f6e7374727563746f723a2044555241544960448201527f4f4e5f4c4553535f5448414e5f434c4946460000000000000000000000000000606482015260840161060f565b612710841115611440576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f546f6b656e44697374726f3a3a636f6e7374727563746f723a20494e4954494160448201527f4c50455243454e544147455f475245415445525f5448414e5f31303000000000606482015260840161060f565b611448611f25565b61145360003361205a565b6000612710611462868b612fa2565b61146c9190612f67565b60d080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff871617905560cd87905560cb89905560ca8a905560ce81905590506114cc8789612f4f565b60cc556114d9818a612fdf565b60cf555030600090815260c96020526040902088905560d080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000084151502179055801561156157600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b5050505050505050565b600081815260976020526040812061056390612064565b6109af828261206e565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260c960205260409020541580156115e5575073ffffffffffffffffffffffffffffffffffffffff8116600090815260c96020526040902060010154155b611671576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f546f6b656e44697374726f3a3a6368616e6765416464726573733a204144445260448201527f4553535f414c52454144595f494e5f5553450000000000000000000000000000606482015260840161060f565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff161580156116f5575073ffffffffffffffffffffffffffffffffffffffff811660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16155b61178357604080517f08c379a00000000000000000000000000000000000000000000000000000000081526020600482015260248101919091527f546f6b656e44697374726f3a3a6368616e6765416464726573733a204449535460448201527f52494255544f525f524f4c455f4e4f545f415f56414c49445f41444452455353606482015260840161060f565b33600081815260c96020526040808220805473ffffffffffffffffffffffffffffffffffffffff861680855283852091825584835560019283018054939092019290925584845283905590519092917f8839b4e99cbac9b99de60313e9f1679f46d6837a692b8c052bf0bd6cacb19c7991a350565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b00000000000000000000000000000000000000000000000000000000148061056357507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610563565b6000828152606560205260409020600101546118ab8133612094565b6109a08383612166565b6000610f6c8373ffffffffffffffffffffffffffffffffffffffff841661225a565b73ffffffffffffffffffffffffffffffffffffffff8116331461197c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c660000000000000000000000000000000000606482015260840161060f565b610f7d82826122a9565b6000610f6c8373ffffffffffffffffffffffffffffffffffffffff8416612364565b60006119b382610fd3565b905060008111611a45576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602f60248201527f546f6b656e44697374726f3a3a636c61696d3a204e4f545f454e4f554754485f60448201527f544f4b454e535f544f5f434c41494d0000000000000000000000000000000000606482015260840161060f565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260c96020526040902060010154611a79908290612f4f565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260c9602052604090206001019190915560d054611ab591168383612457565b8173ffffffffffffffffffffffffffffffffffffffff167f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d482604051611afd91815260200190565b60405180910390a25050565b73ffffffffffffffffffffffffffffffffffffffff831660009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff1615611bde576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a616c6c6f636174653a2044495354524942555460448201527f4f525f4e4f545f56414c49445f524543495049454e5400000000000000000000606482015260840161060f565b33600090815260c96020526040902054611bf9908390612fdf565b33600090815260c960205260408082209290925573ffffffffffffffffffffffffffffffffffffffff851681522054611c33908390612f4f565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260c96020526040902055808015611c6e57506000611c6c84610fd3565b115b15611c7c57611c7c836119a8565b60405182815273ffffffffffffffffffffffffffffffffffffffff84169033907f5168bfb88d6125d4580e2b91ecb103a730312c3e8b0be9c4031a0fc794e2cd5f9060200160405180910390a3505050565b3360009081527fc30845577a48a4875916abdf69c952cec0f19aac3292d053136a35224608de0b602052604090205460ff16611d8c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603360248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a204f4e60448201527f4c595f4449535452494255544f525f524f4c4500000000000000000000000000606482015260840161060f565b33600090815260c9602052604090206001015415611e2c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f546f6b656e44697374726f3a3a6f6e6c794469737472696275746f723a20444960448201527f535452494255544f525f43414e4e4f545f434c41494d00000000000000000000606482015260840161060f565b8051825114611ebd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603160248201527f546f6b656e44697374726f3a3a616c6c6f636174654d616e793a20494e50555460448201527f5f4c454e4754485f4e4f545f4d41544348000000000000000000000000000000606482015260840161060f565b60005b82518110156109a057611f07838281518110611ede57611ede6130f2565b6020026020010151838381518110611ef857611ef86130f2565b60200260200101516000611b09565b80611f118161305b565b915050611ec0565b6000610f6c83836124e4565b600054610100900460ff1680611f3e575060005460ff16155b611fca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561200957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b61201161250e565b61201961250e565b61202161250e565b61202961250e565b8015610fe857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b6109888282612622565b6000610563825490565b60008281526065602052604090206001015461208a8133612094565b6109a083836122a9565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f7d576120ec8173ffffffffffffffffffffffffffffffffffffffff16601461262c565b6120f783602061262c565b604051602001612108929190612e0a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152908290527f08c379a000000000000000000000000000000000000000000000000000000000825261060f91600401612e8b565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff16610f7d57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff85168452909152902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556121fc3390565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546122a157508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610563565b506000610563565b600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516845290915290205460ff1615610f7d57600082815260656020908152604080832073ffffffffffffffffffffffffffffffffffffffff8516808552925280832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000818152600183016020526040812054801561244d576000612388600183612fdf565b855490915060009061239c90600190612fdf565b90508181146124015760008660000182815481106123bc576123bc6130f2565b90600052602060002001549050808760000184815481106123df576123df6130f2565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612412576124126130c3565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610563565b6000915050610563565b6040805173ffffffffffffffffffffffffffffffffffffffff8416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526109a090849061286f565b60008260000182815481106124fb576124fb6130f2565b9060005260206000200154905092915050565b600054610100900460ff1680612527575060005460ff16155b6125b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161060f565b600054610100900460ff1615801561202957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790558015610fe857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16905550565b610f7d8282612166565b6060600061263b836002612fa2565b612646906002612f4f565b67ffffffffffffffff81111561265e5761265e613121565b6040519080825280601f01601f191660200182016040528015612688576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106126bf576126bf6130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612722576127226130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061275e846002612fa2565b612769906001612f4f565b90505b6001811115612806577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106127aa576127aa6130f2565b1a60f81b8282815181106127c0576127c06130f2565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936127ff81613026565b905061276c565b508315610f6c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161060f565b60006128d1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff1661297b9092919063ffffffff16565b8051909150156109a057808060200190518101906128ef9190612cc6565b6109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161060f565b6060610d7c848460008585843b6129ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161060f565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051612a179190612dee565b60006040518083038185875af1925050503d8060008114612a54576040519150601f19603f3d011682016040523d82523d6000602084013e612a59565b606091505b5091509150612a69828286612a74565b979650505050505050565b60608315612a83575081610f6c565b825115612a935782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060f9190612e8b565b600082601f830112612ad857600080fd5b81356020612aed612ae883612f2b565b612edc565b80838252828201915082860187848660051b8901011115612b0d57600080fd5b60005b85811015612b2c57813584529284019290840190600101612b10565b5090979650505050505050565b600060208284031215612b4b57600080fd5b8135610f6c81613150565b60008060408385031215612b6957600080fd5b8235612b7481613150565b91506020830135612b8481613150565b809150509250929050565b60008060408385031215612ba257600080fd5b8235612bad81613150565b946020939093013593505050565b600080600060608486031215612bd057600080fd5b8335612bdb81613150565b9250602084013591506040840135612bf281613172565b809150509250925092565b60008060408385031215612c1057600080fd5b823567ffffffffffffffff80821115612c2857600080fd5b818501915085601f830112612c3c57600080fd5b81356020612c4c612ae883612f2b565b8083825282820191508286018a848660051b8901011115612c6c57600080fd5b600096505b84871015612c98578035612c8481613150565b835260019690960195918301918301612c71565b5096505086013592505080821115612caf57600080fd5b50612cbc85828601612ac7565b9150509250929050565b600060208284031215612cd857600080fd5b8151610f6c81613172565b600060208284031215612cf557600080fd5b5035919050565b60008060408385031215612d0f57600080fd5b823591506020830135612b8481613150565b60008060408385031215612d3457600080fd5b50508035926020909101359150565b600060208284031215612d5557600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610f6c57600080fd5b600080600080600080600060e0888a031215612da057600080fd5b873596506020880135955060408801359450606088013593506080880135925060a0880135612dce81613150565b915060c0880135612dde81613172565b8091505092959891949750929550565b60008251612e00818460208701612ff6565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351612e42816017850160208801612ff6565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612e7f816028840160208801612ff6565b01602801949350505050565b6020815260008251806020840152612eaa816040850160208701612ff6565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612f2357612f23613121565b604052919050565b600067ffffffffffffffff821115612f4557612f45613121565b5060051b60200190565b60008219821115612f6257612f62613094565b500190565b600082612f9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fda57612fda613094565b500290565b600082821015612ff157612ff1613094565b500390565b60005b83811015613011578181015183820152602001612ff9565b83811115613020576000848401525b50505050565b60008161303557613035613094565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308d5761308d613094565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff81168114610fe857600080fd5b8015158114610fe857600080fdfea26469706673582212208b2f3fb48ce4b52d448480619d00de9aadba0e576d55dfc0574e5a39281432e664736f6c63430008060033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.