More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 188 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim Allocation | 19845250 | 77 days ago | IN | 0 ETH | 0.00034532 | ||||
Claim Allocation | 19631155 | 107 days ago | IN | 0 ETH | 0.00107085 | ||||
Claim Allocation | 18805622 | 223 days ago | IN | 0 ETH | 0.00235301 | ||||
Claim Allocation | 18723546 | 235 days ago | IN | 0 ETH | 0.00303684 | ||||
Claim Allocation | 18723254 | 235 days ago | IN | 0 ETH | 0.00324834 | ||||
Claim Allocation | 18588754 | 254 days ago | IN | 0 ETH | 0.00133438 | ||||
Claim Allocation | 18554629 | 258 days ago | IN | 0 ETH | 0.00122755 | ||||
Claim Allocation | 18539986 | 260 days ago | IN | 0 ETH | 0.00203143 | ||||
Claim Allocation | 18539978 | 260 days ago | IN | 0 ETH | 0.00195262 | ||||
Claim Allocation | 18539975 | 260 days ago | IN | 0 ETH | 0.00196469 | ||||
Claim Allocation | 18539972 | 260 days ago | IN | 0 ETH | 0.00195094 | ||||
Claim Allocation | 18539959 | 260 days ago | IN | 0 ETH | 0.00195827 | ||||
Claim Allocation | 18539958 | 260 days ago | IN | 0 ETH | 0.00178319 | ||||
Claim Allocation | 18539948 | 260 days ago | IN | 0 ETH | 0.00234408 | ||||
Claim Allocation | 18457358 | 272 days ago | IN | 0 ETH | 0.00135143 | ||||
Claim Allocation | 18455689 | 272 days ago | IN | 0 ETH | 0.00078581 | ||||
Claim Allocation | 18343671 | 288 days ago | IN | 0 ETH | 0.00046987 | ||||
Claim Allocation | 17977702 | 339 days ago | IN | 0 ETH | 0.00176965 | ||||
Claim Allocation | 17894058 | 351 days ago | IN | 0 ETH | 0.00060544 | ||||
Claim Allocation | 17863029 | 355 days ago | IN | 0 ETH | 0.00148817 | ||||
Claim Allocation | 17862829 | 355 days ago | IN | 0 ETH | 0.00128139 | ||||
Claim Allocation | 17862818 | 355 days ago | IN | 0 ETH | 0.00127174 | ||||
Claim Allocation | 17862815 | 355 days ago | IN | 0 ETH | 0.00119792 | ||||
Claim Allocation | 17862811 | 355 days ago | IN | 0 ETH | 0.00114373 | ||||
Claim Allocation | 17862800 | 355 days ago | IN | 0 ETH | 0.0011178 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RealmContinuousVesting
Compiler Version
v0.8.15+commit.e14f2714
Optimization Enabled:
Yes with 1331 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// contracts/RealmTeamVesting.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.15; import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol"; import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol"; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { BokkyPooBahsDateTimeLibrary } from "./BokkyPooBahsDateTimeLibrary.sol"; contract RealmContinuousVesting is AccessControlEnumerable, Pausable { using SafeMath for uint256; using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.AddressSet; bytes32 public constant SCHEDULER_ROLE = keccak256("SCHEDULER_ROLE"); bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE"); event AllocationClaimed(address beneficiary, uint256 amount); struct Schedule { address beneficiary; uint256 startTimestamp; uint256 duration; uint256 totalReleaseAmount; // of all tokens for this schedule uint256 lastClaimedTimestamp; } IERC20 public token; mapping(address => Schedule) public vestingSchedules; // addressed by beneficiary EnumerableSet.AddressSet internal beneficiaries; /** * @dev Grants `DEFAULT_ADMIN_ROLE`, `SCHEDULER_ROLE` and `PAUSER_ROLE` * to the account that deploys the contract. Safe Address is the GNOSIS safe (MultiSig) address which would used in order to control the schedules. */ constructor(address _tokenAddress, address _safeAddress, Schedule[] memory _schedules) { _setupRole(DEFAULT_ADMIN_ROLE, _safeAddress); _setupRole(SCHEDULER_ROLE, _safeAddress); _setupRole(PAUSER_ROLE, _safeAddress); uint256 len = _schedules.length; for (uint256 i = 0; i < len; i++) { _addSchedule( _schedules[i].beneficiary , _schedules[i].startTimestamp , _schedules[i].duration , _schedules[i].totalReleaseAmount , _schedules[i].lastClaimedTimestamp ); } token = IERC20(_tokenAddress); } function addSchedule(Schedule calldata _schedule) public { require(hasRole(SCHEDULER_ROLE, _msgSender()), "Must have scheduler role to add schedule!"); _addSchedule( _schedule.beneficiary , _schedule.startTimestamp , _schedule.duration , _schedule.totalReleaseAmount , _schedule.lastClaimedTimestamp ); } function addSchedulesBatch(Schedule[] calldata _schedules) public { require(hasRole(SCHEDULER_ROLE, _msgSender()), "Must have scheduler role to add schedule!"); uint256 len = _schedules.length; for (uint256 i = 0; i < len; i++) { _addSchedule( _schedules[i].beneficiary , _schedules[i].startTimestamp , _schedules[i].duration , _schedules[i].totalReleaseAmount , _schedules[i].lastClaimedTimestamp ); } } function _addSchedule( address _beneficiary , uint256 _startTimestamp , uint256 _duration , uint256 _totalReleaseAmount , uint256 _lastClaimedTimestamp ) private { vestingSchedules[_beneficiary].beneficiary = _beneficiary; vestingSchedules[_beneficiary].startTimestamp = _startTimestamp; vestingSchedules[_beneficiary].duration = _duration; vestingSchedules[_beneficiary].totalReleaseAmount = _totalReleaseAmount; vestingSchedules[_beneficiary].lastClaimedTimestamp = _lastClaimedTimestamp; beneficiaries.add(_beneficiary); } function removeSchedule(address _beneficiary) public { require(hasRole(SCHEDULER_ROLE, _msgSender()), "Must have scheduler role to remove schedule!"); _removeSchedule(_beneficiary); } function removeSchedulesBatch(address[] calldata _beneficiaries) public { require(hasRole(SCHEDULER_ROLE, _msgSender()), "Must have scheduler role to remove schedule!"); uint256 len = _beneficiaries.length; for (uint256 i = 0; i < len; i++) { _removeSchedule(_beneficiaries[i]); } } function _removeSchedule(address _beneficiary) private { delete vestingSchedules[_beneficiary]; beneficiaries.remove(_beneficiary); } function getAllBeneficiaries() public view returns (address[] memory _beneficiaries) { uint256 len = beneficiaries.length(); _beneficiaries = new address[](len); for (uint256 i = 0; i < len; i++) { _beneficiaries[i] = beneficiaries.at(i); } return _beneficiaries; } function getSchedules(address[] calldata _beneficiaries) public view returns (Schedule[] memory _schedules) { uint256 len = _beneficiaries.length; _schedules = new Schedule[](len); for (uint256 i = 0; i < len; i++) { _schedules[i] = vestingSchedules[_beneficiaries[i]]; } return _schedules; } function calculateAllocation(address beneficiary) public view returns(uint256) { Schedule memory schedule = vestingSchedules[beneficiary]; require(schedule.startTimestamp != 0, "Schedule for beneficiary not found"); require(schedule.startTimestamp <= block.timestamp, "Schedule hasn't started yet"); if(schedule.lastClaimedTimestamp == 0) schedule.lastClaimedTimestamp = schedule.startTimestamp; // Claimed duration days till date of request. If duration days are greater then decided duration then set calimed to maximum duration days. // Also, check if lastclaimed and start time stamp is same then no tokens were vested thus setting to 0. uint256 claimedDurationdays = diffDays(schedule.startTimestamp, schedule.lastClaimedTimestamp); if(claimedDurationdays > schedule.duration) claimedDurationdays = schedule.duration; if(schedule.lastClaimedTimestamp == schedule.startTimestamp) claimedDurationdays = 0; // Calculate total duration from the start. // If total duartion is greater then the schedule duration set total duraiton to scheule duration uint256 totalDurationdays = diffDays(schedule.startTimestamp, block.timestamp); if(totalDurationdays > schedule.duration) totalDurationdays = schedule.duration; // Calcuate the remaining duration days for vesting uint256 unclaimedDurationdays = totalDurationdays - claimedDurationdays; require(unclaimedDurationdays > 0, "Beneficiary doesn't have any unclaimed vesting duration"); if(unclaimedDurationdays > schedule.duration) unclaimedDurationdays = schedule.duration; uint256 releaseAmount = (schedule.totalReleaseAmount * unclaimedDurationdays).div(schedule.duration); return releaseAmount; } // claim your vested allocation // should be able to allocate without multisig function claimAllocation() public whenNotPaused { address sender = _msgSender(); Schedule storage schedule = vestingSchedules[sender]; uint256 releaseAmount = calculateAllocation(sender); uint256 contractBalance = token.balanceOf(address(this)); // since we have decimal of 10**18 require(releaseAmount <= contractBalance, "Not enough tokens in contract for release amount"); // send tokens / add allowance on token contract schedule.lastClaimedTimestamp = block.timestamp; //token.safeIncreaseAllowance(sender, releaseAmount); token.safeTransfer(sender, releaseAmount); emit AllocationClaimed(sender, releaseAmount); } function diffDays(uint fromTimestamp, uint toTimestamp) public pure returns (uint _days) { _days = BokkyPooBahsDateTimeLibrary.diffDays(fromTimestamp, toTimestamp); } /** * @dev Pauses all allocation claims (token payouts). * See {ERC1155Pausable} and {Pausable-_pause}. * * Requirements: * - the caller must have the `PAUSER_ROLE`. */ function pause() public { require(hasRole(PAUSER_ROLE, _msgSender()), "Must have pauser role to pause"); _pause(); } /** * @dev Unpauses all allocation claims (token payouts). * See {Pausable-_unpause}. * * Requirements: * - the caller must have the `PAUSER_ROLE`. */ function unpause() public { require(hasRole(PAUSER_ROLE, _msgSender()), "Must have pauser role to unpause"); _unpause(); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).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 virtual 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 virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 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(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (utils/structs/EnumerableSet.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 EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; // ---------------------------------------------------------------------------- // BokkyPooBah's DateTime Library v1.01 // // A gas-efficient Solidity date and time library // // https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary // // Tested date range 1970/01/01 to 2345/12/31 // // Conventions: // Unit | Range | Notes // :-------- |:-------------:|:----- // timestamp | >= 0 | Unix timestamp, number of seconds since 1970/01/01 00:00:00 UTC // year | 1970 ... 2345 | // month | 1 ... 12 | // day | 1 ... 31 | // hour | 0 ... 23 | // minute | 0 ... 59 | // second | 0 ... 59 | // dayOfWeek | 1 ... 7 | 1 = Monday, ..., 7 = Sunday // // // Enjoy. (c) BokkyPooBah / Bok Consulting Pty Ltd 2018-2019. The MIT Licence. // ---------------------------------------------------------------------------- library BokkyPooBahsDateTimeLibrary { uint constant SECONDS_PER_DAY = 24 * 60 * 60; uint constant SECONDS_PER_HOUR = 60 * 60; uint constant SECONDS_PER_MINUTE = 60; int constant OFFSET19700101 = 2440588; uint constant DOW_MON = 1; uint constant DOW_TUE = 2; uint constant DOW_WED = 3; uint constant DOW_THU = 4; uint constant DOW_FRI = 5; uint constant DOW_SAT = 6; uint constant DOW_SUN = 7; // ------------------------------------------------------------------------ // Calculate the number of days from 1970/01/01 to year/month/day using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and subtracting the offset 2440588 so that 1970/01/01 is day 0 // // days = day // - 32075 // + 1461 * (year + 4800 + (month - 14) / 12) / 4 // + 367 * (month - 2 - (month - 14) / 12 * 12) / 12 // - 3 * ((year + 4900 + (month - 14) / 12) / 100) / 4 // - offset // ------------------------------------------------------------------------ function _daysFromDate(uint year, uint month, uint day) internal pure returns (uint _days) { require(year >= 1970); int _year = int(year); int _month = int(month); int _day = int(day); int __days = _day - 32075 + 1461 * (_year + 4800 + (_month - 14) / 12) / 4 + 367 * (_month - 2 - (_month - 14) / 12 * 12) / 12 - 3 * ((_year + 4900 + (_month - 14) / 12) / 100) / 4 - OFFSET19700101; _days = uint(__days); } // ------------------------------------------------------------------------ // Calculate year/month/day from the number of days since 1970/01/01 using // the date conversion algorithm from // http://aa.usno.navy.mil/faq/docs/JD_Formula.php // and adding the offset 2440588 so that 1970/01/01 is day 0 // // int L = days + 68569 + offset // int N = 4 * L / 146097 // L = L - (146097 * N + 3) / 4 // year = 4000 * (L + 1) / 1461001 // L = L - 1461 * year / 4 + 31 // month = 80 * L / 2447 // dd = L - 2447 * month / 80 // L = month / 11 // month = month + 2 - 12 * L // year = 100 * (N - 49) + year + L // ------------------------------------------------------------------------ function _daysToDate(uint _days) internal pure returns (uint year, uint month, uint day) { int __days = int(_days); int L = __days + 68569 + OFFSET19700101; int N = 4 * L / 146097; L = L - (146097 * N + 3) / 4; int _year = 4000 * (L + 1) / 1461001; L = L - 1461 * _year / 4 + 31; int _month = 80 * L / 2447; int _day = L - 2447 * _month / 80; L = _month / 11; _month = _month + 2 - 12 * L; _year = 100 * (N - 49) + _year + L; year = uint(_year); month = uint(_month); day = uint(_day); } function timestampFromDate(uint year, uint month, uint day) internal pure returns (uint timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY; } function timestampFromDateTime(uint year, uint month, uint day, uint hour, uint minute, uint second) internal pure returns (uint timestamp) { timestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + hour * SECONDS_PER_HOUR + minute * SECONDS_PER_MINUTE + second; } function timestampToDate(uint timestamp) internal pure returns (uint year, uint month, uint day) { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function timestampToDateTime(uint timestamp) internal pure returns (uint year, uint month, uint day, uint hour, uint minute, uint second) { (year, month, day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; secs = secs % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; second = secs % SECONDS_PER_MINUTE; } function isValidDate(uint year, uint month, uint day) internal pure returns (bool valid) { if (year >= 1970 && month > 0 && month <= 12) { uint daysInMonth = _getDaysInMonth(year, month); if (day > 0 && day <= daysInMonth) { valid = true; } } } function isValidDateTime(uint year, uint month, uint day, uint hour, uint minute, uint second) internal pure returns (bool valid) { if (isValidDate(year, month, day)) { if (hour < 24 && minute < 60 && second < 60) { valid = true; } } } function isLeapYear(uint timestamp) internal pure returns (bool leapYear) { (uint year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); leapYear = _isLeapYear(year); } function _isLeapYear(uint year) internal pure returns (bool leapYear) { leapYear = ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); } function isWeekDay(uint timestamp) internal pure returns (bool weekDay) { weekDay = getDayOfWeek(timestamp) <= DOW_FRI; } function isWeekEnd(uint timestamp) internal pure returns (bool weekEnd) { weekEnd = getDayOfWeek(timestamp) >= DOW_SAT; } function getDaysInMonth(uint timestamp) internal pure returns (uint daysInMonth) { (uint year, uint month,) = _daysToDate(timestamp / SECONDS_PER_DAY); daysInMonth = _getDaysInMonth(year, month); } function _getDaysInMonth(uint year, uint month) internal pure returns (uint daysInMonth) { if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12) { daysInMonth = 31; } else if (month != 2) { daysInMonth = 30; } else { daysInMonth = _isLeapYear(year) ? 29 : 28; } } // 1 = Monday, 7 = Sunday function getDayOfWeek(uint timestamp) internal pure returns (uint dayOfWeek) { uint _days = timestamp / SECONDS_PER_DAY; dayOfWeek = (_days + 3) % 7 + 1; } function getYear(uint timestamp) internal pure returns (uint year) { (year,,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getMonth(uint timestamp) internal pure returns (uint month) { (,month,) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getDay(uint timestamp) internal pure returns (uint day) { (,,day) = _daysToDate(timestamp / SECONDS_PER_DAY); } function getHour(uint timestamp) internal pure returns (uint hour) { uint secs = timestamp % SECONDS_PER_DAY; hour = secs / SECONDS_PER_HOUR; } function getMinute(uint timestamp) internal pure returns (uint minute) { uint secs = timestamp % SECONDS_PER_HOUR; minute = secs / SECONDS_PER_MINUTE; } function getSecond(uint timestamp) internal pure returns (uint second) { second = timestamp % SECONDS_PER_MINUTE; } function addYears(uint timestamp, uint _years) internal pure returns (uint newTimestamp) { (uint year, uint month, uint day) = _daysToDate(timestamp / SECONDS_PER_DAY); year += _years; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + timestamp % SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addMonths(uint timestamp, uint _months) internal pure returns (uint newTimestamp) { (uint year, uint month, uint day) = _daysToDate(timestamp / SECONDS_PER_DAY); month += _months; year += (month - 1) / 12; month = (month - 1) % 12 + 1; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + timestamp % SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addDays(uint timestamp, uint _days) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _days * SECONDS_PER_DAY; require(newTimestamp >= timestamp); } function addHours(uint timestamp, uint _hours) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _hours * SECONDS_PER_HOUR; require(newTimestamp >= timestamp); } function addMinutes(uint timestamp, uint _minutes) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _minutes * SECONDS_PER_MINUTE; require(newTimestamp >= timestamp); } function addSeconds(uint timestamp, uint _seconds) internal pure returns (uint newTimestamp) { newTimestamp = timestamp + _seconds; require(newTimestamp >= timestamp); } function subYears(uint timestamp, uint _years) internal pure returns (uint newTimestamp) { (uint year, uint month, uint day) = _daysToDate(timestamp / SECONDS_PER_DAY); year -= _years; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + timestamp % SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subMonths(uint timestamp, uint _months) internal pure returns (uint newTimestamp) { (uint year, uint month, uint day) = _daysToDate(timestamp / SECONDS_PER_DAY); uint yearMonth = year * 12 + (month - 1) - _months; year = yearMonth / 12; month = yearMonth % 12 + 1; uint daysInMonth = _getDaysInMonth(year, month); if (day > daysInMonth) { day = daysInMonth; } newTimestamp = _daysFromDate(year, month, day) * SECONDS_PER_DAY + timestamp % SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subDays(uint timestamp, uint _days) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _days * SECONDS_PER_DAY; require(newTimestamp <= timestamp); } function subHours(uint timestamp, uint _hours) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _hours * SECONDS_PER_HOUR; require(newTimestamp <= timestamp); } function subMinutes(uint timestamp, uint _minutes) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _minutes * SECONDS_PER_MINUTE; require(newTimestamp <= timestamp); } function subSeconds(uint timestamp, uint _seconds) internal pure returns (uint newTimestamp) { newTimestamp = timestamp - _seconds; require(newTimestamp <= timestamp); } function diffYears(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _years) { require(fromTimestamp <= toTimestamp); (uint fromYear,,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint toYear,,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _years = toYear - fromYear; } function diffMonths(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _months) { require(fromTimestamp <= toTimestamp); (uint fromYear, uint fromMonth,) = _daysToDate(fromTimestamp / SECONDS_PER_DAY); (uint toYear, uint toMonth,) = _daysToDate(toTimestamp / SECONDS_PER_DAY); _months = toYear * 12 + toMonth - fromYear * 12 - fromMonth; } function diffDays(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _days) { require(fromTimestamp <= toTimestamp); _days = (toTimestamp - fromTimestamp) / SECONDS_PER_DAY; } function diffHours(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _hours) { require(fromTimestamp <= toTimestamp); _hours = (toTimestamp - fromTimestamp) / SECONDS_PER_HOUR; } function diffMinutes(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _minutes) { require(fromTimestamp <= toTimestamp); _minutes = (toTimestamp - fromTimestamp) / SECONDS_PER_MINUTE; } function diffSeconds(uint fromTimestamp, uint toTimestamp) internal pure returns (uint _seconds) { require(fromTimestamp <= toTimestamp); _seconds = toTimestamp - fromTimestamp; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @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 AccessControl is Context, IAccessControl, ERC165 { 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); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @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 virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.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 virtual 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 revoked `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}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ 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); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @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 ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.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 IERC165 { /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 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 Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(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); } } } }
{ "optimizer": { "enabled": true, "runs": 1331 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_tokenAddress","type":"address"},{"internalType":"address","name":"_safeAddress","type":"address"},{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"totalReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"lastClaimedTimestamp","type":"uint256"}],"internalType":"struct RealmContinuousVesting.Schedule[]","name":"_schedules","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"AllocationClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","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":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SCHEDULER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"totalReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"lastClaimedTimestamp","type":"uint256"}],"internalType":"struct RealmContinuousVesting.Schedule","name":"_schedule","type":"tuple"}],"name":"addSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"totalReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"lastClaimedTimestamp","type":"uint256"}],"internalType":"struct RealmContinuousVesting.Schedule[]","name":"_schedules","type":"tuple[]"}],"name":"addSchedulesBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"beneficiary","type":"address"}],"name":"calculateAllocation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAllocation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fromTimestamp","type":"uint256"},{"internalType":"uint256","name":"toTimestamp","type":"uint256"}],"name":"diffDays","outputs":[{"internalType":"uint256","name":"_days","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"getAllBeneficiaries","outputs":[{"internalType":"address[]","name":"_beneficiaries","type":"address[]"}],"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":[{"internalType":"address[]","name":"_beneficiaries","type":"address[]"}],"name":"getSchedules","outputs":[{"components":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"totalReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"lastClaimedTimestamp","type":"uint256"}],"internalType":"struct RealmContinuousVesting.Schedule[]","name":"_schedules","type":"tuple[]"}],"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":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"removeSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_beneficiaries","type":"address[]"}],"name":"removeSchedulesBatch","outputs":[],"stateMutability":"nonpayable","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":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vestingSchedules","outputs":[{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"startTimestamp","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"totalReleaseAmount","type":"uint256"},{"internalType":"uint256","name":"lastClaimedTimestamp","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040516200267838038062002678833981016040819052620000349162000409565b6002805460ff191690556200004b600083620001ad565b620000777f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8283620001ad565b620000a37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a83620001ad565b805160005b818110156200017b5762000166838281518110620000ca57620000ca62000530565b602002602001015160000151848381518110620000eb57620000eb62000530565b6020026020010151602001518584815181106200010c576200010c62000530565b6020026020010151604001518685815181106200012d576200012d62000530565b6020026020010151606001518786815181106200014e576200014e62000530565b602002602001015160800151620001bd60201b60201c565b80620001728162000546565b915050620000a8565b5050600280546001600160a01b0390941661010002610100600160a81b031990941693909317909255506200056e9050565b620001b9828262000223565b5050565b6001600160a01b038516600081815260036020818152604090922080546001600160a01b03191690931783556001830187905560028301869055820184905560049182018390556200021b91908790620010a662000266821b17901c565b505050505050565b6200023a82826200028660201b620010bb1760201c565b600082815260016020908152604090912062000261918390620010a662000266821b17901c565b505050565b60006200027d836001600160a01b03841662000326565b90505b92915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620001b9576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620002e23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008181526001830160205260408120546200036f5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000280565b50600062000280565b80516001600160a01b03811681146200039057600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715620003d057620003d062000395565b60405290565b604051601f8201601f191681016001600160401b038111828210171562000401576200040162000395565b604052919050565b600080600060608085870312156200042057600080fd5b6200042b8562000378565b935060206200043c81870162000378565b604087810151919550906001600160401b03808211156200045c57600080fd5b818901915089601f8301126200047157600080fd5b81518181111562000486576200048662000395565b62000496858260051b01620003d6565b818152858101925060a091820284018601918c831115620004b657600080fd5b938601935b828510156200051e5780858e031215620004d55760008081fd5b620004df620003ab565b620004ea8662000378565b81528588015188820152868601518782015288860151898201526080808701519082015284529384019392860192620004bb565b50809750505050505050509250925092565b634e487b7160e01b600052603260045260246000fd5b6000600182016200056757634e487b7160e01b600052601160045260246000fd5b5060010190565b6120fa806200057e6000396000f3fe608060405234801561001057600080fd5b50600436106101a35760003560e01c80637debb959116100ee578063c9d3462211610097578063d547741f11610071578063d547741f14610397578063e63ab1e9146103aa578063fc0c546a146103d1578063fdb20ccb146103e957600080fd5b8063c9d3462214610369578063ca15c8731461037c578063d2d1fb251461038f57600080fd5b806391d14854116100c857806391d148541461031757806396f706b01461034e578063a217fddf1461036157600080fd5b80637debb959146102d15780638456cb59146102e45780639010d07c146102ec57600080fd5b806344cd735f116101505780635c975abb1161012a5780635c975abb146102935780636b244a581461029e5780636c0730f5146102be57600080fd5b806344cd735f146102465780634a15615b146102595780635c8ab63d1461026c57600080fd5b80632f2ff15d116101815780632f2ff15d1461021657806336568abe1461022b5780633f4ba83a1461023e57600080fd5b806301ffc9a7146101a8578063248a9ca3146101d05780632f14bae814610201575b600080fd5b6101bb6101b6366004611c01565b610463565b60405190151581526020015b60405180910390f35b6101f36101de366004611c43565b60009081526020819052604090206001015490565b6040519081526020016101c7565b6102096104bf565b6040516101c79190611c5c565b610229610224366004611cc5565b61056b565b005b610229610239366004611cc5565b610595565b610229610626565b610229610254366004611cf1565b6106a6565b610229610267366004611d09565b61075a565b6101f37f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8281565b60025460ff166101bb565b6102b16102ac366004611d09565b610849565b6040516101c79190611d7e565b6102296102cc366004611df5565b61099e565b6101f36102df366004611e58565b610ae4565b610229610d3f565b6102ff6102fa366004611e73565b610dbd565b6040516001600160a01b0390911681526020016101c7565b6101bb610325366004611cc5565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61022961035c366004611e58565b610ddc565b6101f3600081565b6101f3610377366004611e73565b610e81565b6101f361038a366004611c43565b610e8d565b610229610ea4565b6102296103a5366004611cc5565b611081565b6101f37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6002546102ff9061010090046001600160a01b031681565b6104316103f7366004611e58565b6003602081905260009182526040909120805460018201546002830154938301546004909301546001600160a01b03909216939092909185565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101c7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806104b957506104b982611159565b92915050565b606060006104cd60046111f0565b90508067ffffffffffffffff8111156104e8576104e8611e95565b604051908082528060200260200182016040528015610511578160200160208202803683370190505b50915060005b818110156105665761052a6004826111fa565b83828151811061053c5761053c611eab565b6001600160a01b03909216602092830291909101909101528061055e81611ed7565b915050610517565b505090565b60008281526020819052604090206001015461058681611206565b6105908383611210565b505050565b6001600160a01b03811633146106185760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6106228282611232565b5050565b6106507f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610325565b61069c5760405162461bcd60e51b815260206004820181905260248201527f4d75737420686176652070617573657220726f6c6520746f20756e7061757365604482015260640161060f565b6106a4611254565b565b6106d07f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b61072e5760405162461bcd60e51b815260206004820152602960248201527f4d7573742068617665207363686564756c657220726f6c6520746f20616464206044820152687363686564756c652160b81b606482015260840161060f565b61075761073e6020830183611e58565b82602001358360400135846060013585608001356112f0565b50565b6107847f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b6107f65760405162461bcd60e51b815260206004820152602c60248201527f4d7573742068617665207363686564756c657220726f6c6520746f2072656d6f60448201527f7665207363686564756c65210000000000000000000000000000000000000000606482015260840161060f565b8060005b818110156108435761083184848381811061081757610817611eab565b905060200201602081019061082c9190611e58565b611356565b8061083b81611ed7565b9150506107fa565b50505050565b6060818067ffffffffffffffff81111561086557610865611e95565b6040519080825280602002602001820160405280156108d157816020015b6108be6040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816108835790505b50915060005b8181101561099657600360008686848181106108f5576108f5611eab565b905060200201602081019061090a9190611e58565b6001600160a01b0390811682526020808301939093526040918201600020825160a08101845281549092168252600181015493820193909352600283015491810191909152600382015460608201526004909101546080820152835184908390811061097857610978611eab565b6020026020010181905250808061098e90611ed7565b9150506108d7565b505092915050565b6109c87f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b610a265760405162461bcd60e51b815260206004820152602960248201527f4d7573742068617665207363686564756c657220726f6c6520746f20616464206044820152687363686564756c652160b81b606482015260840161060f565b8060005b8181101561084357610ad2848483818110610a4757610a47611eab565b610a5d92602060a0909202019081019150611e58565b858584818110610a6f57610a6f611eab565b905060a0020160200135868685818110610a8b57610a8b611eab565b905060a0020160400135878786818110610aa757610aa7611eab565b905060a0020160600135888887818110610ac357610ac3611eab565b905060a00201608001356112f0565b80610adc81611ed7565b915050610a2a565b6001600160a01b038082166000908152600360208181526040808420815160a08101835281549096168652600181015492860183905260028101549186019190915291820154606085015260049091015460808401529091908203610bb15760405162461bcd60e51b815260206004820152602260248201527f5363686564756c6520666f722062656e6566696369617279206e6f7420666f7560448201527f6e64000000000000000000000000000000000000000000000000000000000000606482015260840161060f565b4281602001511115610c055760405162461bcd60e51b815260206004820152601b60248201527f5363686564756c65206861736e27742073746172746564207965740000000000604482015260640161060f565b8060800151600003610c1c57602081015160808201525b6000610c3082602001518360800151610e81565b90508160400151811115610c45575060408101515b8160200151826080015103610c58575060005b6000610c68836020015142610e81565b90508260400151811115610c7d575060408201515b6000610c898383611ef0565b905060008111610d015760405162461bcd60e51b815260206004820152603760248201527f42656e656669636961727920646f65736e2774206861766520616e7920756e6360448201527f6c61696d65642076657374696e67206475726174696f6e000000000000000000606482015260840161060f565b8360400151811115610d14575060408301515b6000610d348560400151838760600151610d2e9190611f07565b906113b2565b979650505050505050565b610d697f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610325565b610db55760405162461bcd60e51b815260206004820152601e60248201527f4d75737420686176652070617573657220726f6c6520746f2070617573650000604482015260640161060f565b6106a46113be565b6000828152600160205260408120610dd590836111fa565b9392505050565b610e067f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b610e785760405162461bcd60e51b815260206004820152602c60248201527f4d7573742068617665207363686564756c657220726f6c6520746f2072656d6f60448201527f7665207363686564756c65210000000000000000000000000000000000000000606482015260840161060f565b61075781611356565b6000610dd58383611446565b60008181526001602052604081206104b9906111f0565b60025460ff1615610ef75760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161060f565b33600081815260036020526040812090610f1083610ae4565b6002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506000916101009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f9190611f26565b9050808211156110175760405162461bcd60e51b815260206004820152603060248201527f4e6f7420656e6f75676820746f6b656e7320696e20636f6e747261637420666f60448201527f722072656c6561736520616d6f756e7400000000000000000000000000000000606482015260840161060f565b4260048401556002546110399061010090046001600160a01b0316858461146d565b604080516001600160a01b0386168152602081018490527f1747857504b94e5be51b1fe4b467e5d2daa63a0d21577089a13fa99f9414dcc8910160405180910390a150505050565b60008281526020819052604090206001015461109c81611206565b6105908383611232565b6000610dd5836001600160a01b0384166114ed565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610622576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556111153390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104b957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104b9565b60006104b9825490565b6000610dd5838361153c565b6107578133611566565b61121a82826110bb565b600082815260016020526040902061059090826110a6565b61123c82826115e4565b60008281526001602052604090206105909082611663565b60025460ff166112a65760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161060f565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0385166000818152600360208190526040909120805473ffffffffffffffffffffffffffffffffffffffff1916909217825560018201869055600282018590558101839055600490810182905561134e90866110a6565b505050505050565b6001600160a01b03811660009081526003602081905260408220805473ffffffffffffffffffffffffffffffffffffffff1916815560018101839055600281018390559081018290556004908101919091556106229082611663565b6000610dd58284611f3f565b60025460ff16156114115760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161060f565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586112d33390565b60008183111561145557600080fd5b620151806114638484611ef0565b610dd59190611f3f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610590908490611678565b6000818152600183016020526040812054611534575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104b9565b5060006104b9565b600082600001828154811061155357611553611eab565b9060005260206000200154905092915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610622576115a2816001600160a01b0316601461175d565b6115ad83602061175d565b6040516020016115be929190611f8d565b60408051601f198184030181529082905262461bcd60e51b825261060f9160040161200e565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610622576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610dd5836001600160a01b038416611986565b60006116cd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a799092919063ffffffff16565b80519091501561059057808060200190518101906116eb9190612041565b6105905760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161060f565b6060600061176c836002611f07565b611777906002612063565b67ffffffffffffffff81111561178f5761178f611e95565b6040519080825280601f01601f1916602001820160405280156117b9576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117f0576117f0611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061185357611853611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061188f846002611f07565b61189a906001612063565b90505b6001811115611937577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106118db576118db611eab565b1a60f81b8282815181106118f1576118f1611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936119308161207b565b905061189d565b508315610dd55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161060f565b60008181526001830160205260408120548015611a6f5760006119aa600183611ef0565b85549091506000906119be90600190611ef0565b9050818114611a235760008660000182815481106119de576119de611eab565b9060005260206000200154905080876000018481548110611a0157611a01611eab565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a3457611a34612092565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104b9565b60009150506104b9565b6060611a888484600085611a90565b949350505050565b606082471015611b085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161060f565b6001600160a01b0385163b611b5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161060f565b600080866001600160a01b03168587604051611b7b91906120a8565b60006040518083038185875af1925050503d8060008114611bb8576040519150601f19603f3d011682016040523d82523d6000602084013e611bbd565b606091505b5091509150610d3482828660608315611bd7575081610dd5565b825115611be75782518084602001fd5b8160405162461bcd60e51b815260040161060f919061200e565b600060208284031215611c1357600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610dd557600080fd5b600060208284031215611c5557600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015611c9d5783516001600160a01b031683529284019291840191600101611c78565b50909695505050505050565b80356001600160a01b0381168114611cc057600080fd5b919050565b60008060408385031215611cd857600080fd5b82359150611ce860208401611ca9565b90509250929050565b600060a08284031215611d0357600080fd5b50919050565b60008060208385031215611d1c57600080fd5b823567ffffffffffffffff80821115611d3457600080fd5b818501915085601f830112611d4857600080fd5b813581811115611d5757600080fd5b8660208260051b8501011115611d6c57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611de857815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080908101519085015260a09093019290850190600101611d9b565b5091979650505050505050565b60008060208385031215611e0857600080fd5b823567ffffffffffffffff80821115611e2057600080fd5b818501915085601f830112611e3457600080fd5b813581811115611e4357600080fd5b86602060a083028501011115611d6c57600080fd5b600060208284031215611e6a57600080fd5b610dd582611ca9565b60008060408385031215611e8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ee957611ee9611ec1565b5060010190565b600082821015611f0257611f02611ec1565b500390565b6000816000190483118215151615611f2157611f21611ec1565b500290565b600060208284031215611f3857600080fd5b5051919050565b600082611f5c57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015611f7c578181015183820152602001611f64565b838111156108435750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611fc5816017850160208801611f61565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612002816028840160208801611f61565b01602801949350505050565b602081526000825180602084015261202d816040850160208701611f61565b601f01601f19169190910160400192915050565b60006020828403121561205357600080fd5b81518015158114610dd557600080fd5b6000821982111561207657612076611ec1565b500190565b60008161208a5761208a611ec1565b506000190190565b634e487b7160e01b600052603160045260246000fd5b600082516120ba818460208701611f61565b919091019291505056fea26469706673582212207db8dc0f72536079d354957c3eecb2feab976dcdc8d3d1bc33b6419287c541e264736f6c634300080f0033000000000000000000000000464fdb8affc9bac185a7393fd4298137866dcfb8000000000000000000000000df3ed665e9bac427c3c6f16529f5f70e82a7b94500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101a35760003560e01c80637debb959116100ee578063c9d3462211610097578063d547741f11610071578063d547741f14610397578063e63ab1e9146103aa578063fc0c546a146103d1578063fdb20ccb146103e957600080fd5b8063c9d3462214610369578063ca15c8731461037c578063d2d1fb251461038f57600080fd5b806391d14854116100c857806391d148541461031757806396f706b01461034e578063a217fddf1461036157600080fd5b80637debb959146102d15780638456cb59146102e45780639010d07c146102ec57600080fd5b806344cd735f116101505780635c975abb1161012a5780635c975abb146102935780636b244a581461029e5780636c0730f5146102be57600080fd5b806344cd735f146102465780634a15615b146102595780635c8ab63d1461026c57600080fd5b80632f2ff15d116101815780632f2ff15d1461021657806336568abe1461022b5780633f4ba83a1461023e57600080fd5b806301ffc9a7146101a8578063248a9ca3146101d05780632f14bae814610201575b600080fd5b6101bb6101b6366004611c01565b610463565b60405190151581526020015b60405180910390f35b6101f36101de366004611c43565b60009081526020819052604090206001015490565b6040519081526020016101c7565b6102096104bf565b6040516101c79190611c5c565b610229610224366004611cc5565b61056b565b005b610229610239366004611cc5565b610595565b610229610626565b610229610254366004611cf1565b6106a6565b610229610267366004611d09565b61075a565b6101f37f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8281565b60025460ff166101bb565b6102b16102ac366004611d09565b610849565b6040516101c79190611d7e565b6102296102cc366004611df5565b61099e565b6101f36102df366004611e58565b610ae4565b610229610d3f565b6102ff6102fa366004611e73565b610dbd565b6040516001600160a01b0390911681526020016101c7565b6101bb610325366004611cc5565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b61022961035c366004611e58565b610ddc565b6101f3600081565b6101f3610377366004611e73565b610e81565b6101f361038a366004611c43565b610e8d565b610229610ea4565b6102296103a5366004611cc5565b611081565b6101f37f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6002546102ff9061010090046001600160a01b031681565b6104316103f7366004611e58565b6003602081905260009182526040909120805460018201546002830154938301546004909301546001600160a01b03909216939092909185565b604080516001600160a01b0390961686526020860194909452928401919091526060830152608082015260a0016101c7565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f5a05180f0000000000000000000000000000000000000000000000000000000014806104b957506104b982611159565b92915050565b606060006104cd60046111f0565b90508067ffffffffffffffff8111156104e8576104e8611e95565b604051908082528060200260200182016040528015610511578160200160208202803683370190505b50915060005b818110156105665761052a6004826111fa565b83828151811061053c5761053c611eab565b6001600160a01b03909216602092830291909101909101528061055e81611ed7565b915050610517565b505090565b60008281526020819052604090206001015461058681611206565b6105908383611210565b505050565b6001600160a01b03811633146106185760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c66000000000000000000000000000000000060648201526084015b60405180910390fd5b6106228282611232565b5050565b6106507f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610325565b61069c5760405162461bcd60e51b815260206004820181905260248201527f4d75737420686176652070617573657220726f6c6520746f20756e7061757365604482015260640161060f565b6106a4611254565b565b6106d07f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b61072e5760405162461bcd60e51b815260206004820152602960248201527f4d7573742068617665207363686564756c657220726f6c6520746f20616464206044820152687363686564756c652160b81b606482015260840161060f565b61075761073e6020830183611e58565b82602001358360400135846060013585608001356112f0565b50565b6107847f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b6107f65760405162461bcd60e51b815260206004820152602c60248201527f4d7573742068617665207363686564756c657220726f6c6520746f2072656d6f60448201527f7665207363686564756c65210000000000000000000000000000000000000000606482015260840161060f565b8060005b818110156108435761083184848381811061081757610817611eab565b905060200201602081019061082c9190611e58565b611356565b8061083b81611ed7565b9150506107fa565b50505050565b6060818067ffffffffffffffff81111561086557610865611e95565b6040519080825280602002602001820160405280156108d157816020015b6108be6040518060a0016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081525090565b8152602001906001900390816108835790505b50915060005b8181101561099657600360008686848181106108f5576108f5611eab565b905060200201602081019061090a9190611e58565b6001600160a01b0390811682526020808301939093526040918201600020825160a08101845281549092168252600181015493820193909352600283015491810191909152600382015460608201526004909101546080820152835184908390811061097857610978611eab565b6020026020010181905250808061098e90611ed7565b9150506108d7565b505092915050565b6109c87f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b610a265760405162461bcd60e51b815260206004820152602960248201527f4d7573742068617665207363686564756c657220726f6c6520746f20616464206044820152687363686564756c652160b81b606482015260840161060f565b8060005b8181101561084357610ad2848483818110610a4757610a47611eab565b610a5d92602060a0909202019081019150611e58565b858584818110610a6f57610a6f611eab565b905060a0020160200135868685818110610a8b57610a8b611eab565b905060a0020160400135878786818110610aa757610aa7611eab565b905060a0020160600135888887818110610ac357610ac3611eab565b905060a00201608001356112f0565b80610adc81611ed7565b915050610a2a565b6001600160a01b038082166000908152600360208181526040808420815160a08101835281549096168652600181015492860183905260028101549186019190915291820154606085015260049091015460808401529091908203610bb15760405162461bcd60e51b815260206004820152602260248201527f5363686564756c6520666f722062656e6566696369617279206e6f7420666f7560448201527f6e64000000000000000000000000000000000000000000000000000000000000606482015260840161060f565b4281602001511115610c055760405162461bcd60e51b815260206004820152601b60248201527f5363686564756c65206861736e27742073746172746564207965740000000000604482015260640161060f565b8060800151600003610c1c57602081015160808201525b6000610c3082602001518360800151610e81565b90508160400151811115610c45575060408101515b8160200151826080015103610c58575060005b6000610c68836020015142610e81565b90508260400151811115610c7d575060408201515b6000610c898383611ef0565b905060008111610d015760405162461bcd60e51b815260206004820152603760248201527f42656e656669636961727920646f65736e2774206861766520616e7920756e6360448201527f6c61696d65642076657374696e67206475726174696f6e000000000000000000606482015260840161060f565b8360400151811115610d14575060408301515b6000610d348560400151838760600151610d2e9190611f07565b906113b2565b979650505050505050565b610d697f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33610325565b610db55760405162461bcd60e51b815260206004820152601e60248201527f4d75737420686176652070617573657220726f6c6520746f2070617573650000604482015260640161060f565b6106a46113be565b6000828152600160205260408120610dd590836111fa565b9392505050565b610e067f2c0e86ef42968f843b5fc3a6f6d421401da96923e1a6a2299b016956535a3b8233610325565b610e785760405162461bcd60e51b815260206004820152602c60248201527f4d7573742068617665207363686564756c657220726f6c6520746f2072656d6f60448201527f7665207363686564756c65210000000000000000000000000000000000000000606482015260840161060f565b61075781611356565b6000610dd58383611446565b60008181526001602052604081206104b9906111f0565b60025460ff1615610ef75760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161060f565b33600081815260036020526040812090610f1083610ae4565b6002546040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529192506000916101009091046001600160a01b0316906370a0823190602401602060405180830381865afa158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f9190611f26565b9050808211156110175760405162461bcd60e51b815260206004820152603060248201527f4e6f7420656e6f75676820746f6b656e7320696e20636f6e747261637420666f60448201527f722072656c6561736520616d6f756e7400000000000000000000000000000000606482015260840161060f565b4260048401556002546110399061010090046001600160a01b0316858461146d565b604080516001600160a01b0386168152602081018490527f1747857504b94e5be51b1fe4b467e5d2daa63a0d21577089a13fa99f9414dcc8910160405180910390a150505050565b60008281526020819052604090206001015461109c81611206565b6105908383611232565b6000610dd5836001600160a01b0384166114ed565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610622576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556111153390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f7965db0b0000000000000000000000000000000000000000000000000000000014806104b957507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff000000000000000000000000000000000000000000000000000000008316146104b9565b60006104b9825490565b6000610dd5838361153c565b6107578133611566565b61121a82826110bb565b600082815260016020526040902061059090826110a6565b61123c82826115e4565b60008281526001602052604090206105909082611663565b60025460ff166112a65760405162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015260640161060f565b6002805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b0385166000818152600360208190526040909120805473ffffffffffffffffffffffffffffffffffffffff1916909217825560018201869055600282018590558101839055600490810182905561134e90866110a6565b505050505050565b6001600160a01b03811660009081526003602081905260408220805473ffffffffffffffffffffffffffffffffffffffff1916815560018101839055600281018390559081018290556004908101919091556106229082611663565b6000610dd58284611f3f565b60025460ff16156114115760405162461bcd60e51b815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015260640161060f565b6002805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586112d33390565b60008183111561145557600080fd5b620151806114638484611ef0565b610dd59190611f3f565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052610590908490611678565b6000818152600183016020526040812054611534575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104b9565b5060006104b9565b600082600001828154811061155357611553611eab565b9060005260206000200154905092915050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610622576115a2816001600160a01b0316601461175d565b6115ad83602061175d565b6040516020016115be929190611f8d565b60408051601f198184030181529082905262461bcd60e51b825261060f9160040161200e565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610622576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610dd5836001600160a01b038416611986565b60006116cd826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611a799092919063ffffffff16565b80519091501561059057808060200190518101906116eb9190612041565b6105905760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161060f565b6060600061176c836002611f07565b611777906002612063565b67ffffffffffffffff81111561178f5761178f611e95565b6040519080825280601f01601f1916602001820160405280156117b9576020820181803683370190505b5090507f3000000000000000000000000000000000000000000000000000000000000000816000815181106117f0576117f0611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061185357611853611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600061188f846002611f07565b61189a906001612063565b90505b6001811115611937577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106118db576118db611eab565b1a60f81b8282815181106118f1576118f1611eab565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c936119308161207b565b905061189d565b508315610dd55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161060f565b60008181526001830160205260408120548015611a6f5760006119aa600183611ef0565b85549091506000906119be90600190611ef0565b9050818114611a235760008660000182815481106119de576119de611eab565b9060005260206000200154905080876000018481548110611a0157611a01611eab565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611a3457611a34612092565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104b9565b60009150506104b9565b6060611a888484600085611a90565b949350505050565b606082471015611b085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161060f565b6001600160a01b0385163b611b5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161060f565b600080866001600160a01b03168587604051611b7b91906120a8565b60006040518083038185875af1925050503d8060008114611bb8576040519150601f19603f3d011682016040523d82523d6000602084013e611bbd565b606091505b5091509150610d3482828660608315611bd7575081610dd5565b825115611be75782518084602001fd5b8160405162461bcd60e51b815260040161060f919061200e565b600060208284031215611c1357600080fd5b81357fffffffff0000000000000000000000000000000000000000000000000000000081168114610dd557600080fd5b600060208284031215611c5557600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015611c9d5783516001600160a01b031683529284019291840191600101611c78565b50909695505050505050565b80356001600160a01b0381168114611cc057600080fd5b919050565b60008060408385031215611cd857600080fd5b82359150611ce860208401611ca9565b90509250929050565b600060a08284031215611d0357600080fd5b50919050565b60008060208385031215611d1c57600080fd5b823567ffffffffffffffff80821115611d3457600080fd5b818501915085601f830112611d4857600080fd5b813581811115611d5757600080fd5b8660208260051b8501011115611d6c57600080fd5b60209290920196919550909350505050565b602080825282518282018190526000919060409081850190868401855b82811015611de857815180516001600160a01b0316855286810151878601528581015186860152606080820151908601526080908101519085015260a09093019290850190600101611d9b565b5091979650505050505050565b60008060208385031215611e0857600080fd5b823567ffffffffffffffff80821115611e2057600080fd5b818501915085601f830112611e3457600080fd5b813581811115611e4357600080fd5b86602060a083028501011115611d6c57600080fd5b600060208284031215611e6a57600080fd5b610dd582611ca9565b60008060408385031215611e8657600080fd5b50508035926020909101359150565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ee957611ee9611ec1565b5060010190565b600082821015611f0257611f02611ec1565b500390565b6000816000190483118215151615611f2157611f21611ec1565b500290565b600060208284031215611f3857600080fd5b5051919050565b600082611f5c57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015611f7c578181015183820152602001611f64565b838111156108435750506000910152565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611fc5816017850160208801611f61565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351612002816028840160208801611f61565b01602801949350505050565b602081526000825180602084015261202d816040850160208701611f61565b601f01601f19169190910160400192915050565b60006020828403121561205357600080fd5b81518015158114610dd557600080fd5b6000821982111561207657612076611ec1565b500190565b60008161208a5761208a611ec1565b506000190190565b634e487b7160e01b600052603160045260246000fd5b600082516120ba818460208701611f61565b919091019291505056fea26469706673582212207db8dc0f72536079d354957c3eecb2feab976dcdc8d3d1bc33b6419287c541e264736f6c634300080f0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000464fdb8affc9bac185a7393fd4298137866dcfb8000000000000000000000000df3ed665e9bac427c3c6f16529f5f70e82a7b94500000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _tokenAddress (address): 0x464FdB8AFFC9bac185A7393fd4298137866DCFB8
Arg [1] : _safeAddress (address): 0xDf3eD665e9Bac427C3C6F16529F5F70e82A7b945
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000464fdb8affc9bac185a7393fd4298137866dcfb8
Arg [1] : 000000000000000000000000df3ed665e9bac427c3c6f16529f5f70e82a7b945
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.001306 | 220,953.0472 | $288.58 |
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.