More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 977 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Release | 14901075 | 776 days ago | IN | 0 ETH | 0.00491117 | ||||
Release | 14843199 | 786 days ago | IN | 0 ETH | 0.00306501 | ||||
Release | 14804781 | 792 days ago | IN | 0 ETH | 0.00255664 | ||||
Release | 14804641 | 792 days ago | IN | 0 ETH | 0.00328122 | ||||
Release | 14792907 | 794 days ago | IN | 0 ETH | 0.00759313 | ||||
Release | 14792907 | 794 days ago | IN | 0 ETH | 0.00610285 | ||||
Release | 14704109 | 808 days ago | IN | 0 ETH | 0.00952512 | ||||
Release | 14695303 | 809 days ago | IN | 0 ETH | 0.00797192 | ||||
Release | 14692537 | 810 days ago | IN | 0 ETH | 0.00644677 | ||||
Release | 14684203 | 811 days ago | IN | 0 ETH | 0.00593336 | ||||
Release | 14677925 | 812 days ago | IN | 0 ETH | 0.00579991 | ||||
Release | 14676092 | 812 days ago | IN | 0 ETH | 0.00719749 | ||||
Release | 14651223 | 816 days ago | IN | 0 ETH | 0.00414406 | ||||
Release | 14648832 | 817 days ago | IN | 0 ETH | 0.00644005 | ||||
Release | 14644385 | 817 days ago | IN | 0 ETH | 0.00225898 | ||||
Release | 14642511 | 818 days ago | IN | 0 ETH | 0.00751746 | ||||
Release | 14642478 | 818 days ago | IN | 0 ETH | 0.00600926 | ||||
Release | 14614695 | 822 days ago | IN | 0 ETH | 0.00860009 | ||||
Release | 14614402 | 822 days ago | IN | 0 ETH | 0.00633936 | ||||
Release | 14613530 | 822 days ago | IN | 0 ETH | 0.00707027 | ||||
Release | 14607408 | 823 days ago | IN | 0 ETH | 0.00355874 | ||||
Release | 14606391 | 823 days ago | IN | 0 ETH | 0.0044167 | ||||
Release | 14592238 | 826 days ago | IN | 0 ETH | 0.00992528 | ||||
Release | 14568630 | 829 days ago | IN | 0 ETH | 0.00693499 | ||||
Release | 14568630 | 829 days ago | IN | 0 ETH | 0.0069344 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
TokenVesting
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// contracts/TokenVesting.sol // SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.11; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /** * @title TokenVesting */ contract TokenVesting is Ownable, ReentrancyGuard{ using SafeMath for uint256; using SafeERC20 for IERC20; struct VestingSchedule{ bool initialized; // beneficiary of tokens after they are released address beneficiary; // cliff period in seconds uint256 cliff; // start time of the vesting period uint256 start; // duration of the vesting period in seconds uint256 duration; // duration of a slice period for the vesting in seconds uint256 slicePeriodSeconds; // whether or not the vesting is revocable bool revocable; // total amount of tokens to be released at the end of the vesting uint256 amountTotal; // amount of tokens released uint256 released; // whether or not the vesting has been revoked bool revoked; } // address of the ERC20 token IERC20 immutable private _token; bytes32[] private vestingSchedulesIds; mapping(bytes32 => VestingSchedule) private vestingSchedules; uint256 private vestingSchedulesTotalAmount; mapping(address => uint256) private holdersVestingCount; event Released(uint256 amount); event Revoked(); /** * @dev Reverts if no vesting schedule matches the passed identifier. */ modifier onlyIfVestingScheduleExists(bytes32 vestingScheduleId) { require(vestingSchedules[vestingScheduleId].initialized == true); _; } /** * @dev Reverts if the vesting schedule does not exist or has been revoked. */ modifier onlyIfVestingScheduleNotRevoked(bytes32 vestingScheduleId) { require(vestingSchedules[vestingScheduleId].initialized == true); require(vestingSchedules[vestingScheduleId].revoked == false); _; } /** * @dev Creates a vesting contract. * @param token_ address of the ERC20 token contract */ constructor(address token_) { require(token_ != address(0x0)); _token = IERC20(token_); } receive() external payable {} fallback() external payable {} /** * @dev Returns the number of vesting schedules associated to a beneficiary. * @return the number of vesting schedules */ function getVestingSchedulesCountByBeneficiary(address _beneficiary) external view returns(uint256){ return holdersVestingCount[_beneficiary]; } /** * @dev Returns the vesting schedule id at the given index. * @return the vesting id */ function getVestingIdAtIndex(uint256 index) external view returns(bytes32){ require(index < getVestingSchedulesCount(), "TokenVesting: index out of bounds"); return vestingSchedulesIds[index]; } /** * @notice Returns the vesting schedule information for a given holder and index. * @return the vesting schedule structure information */ function getVestingScheduleByAddressAndIndex(address holder, uint256 index) external view returns(VestingSchedule memory){ return getVestingSchedule(computeVestingScheduleIdForAddressAndIndex(holder, index)); } /** * @notice Returns the total amount of vesting schedules. * @return the total amount of vesting schedules */ function getVestingSchedulesTotalAmount() external view returns(uint256){ return vestingSchedulesTotalAmount; } /** * @dev Returns the address of the ERC20 token managed by the vesting contract. */ function getToken() external view returns(address){ return address(_token); } /** * @notice Creates a new vesting schedule for a beneficiary. * @param _beneficiary address of the beneficiary to whom vested tokens are transferred * @param _start start time of the vesting period * @param _cliff duration in seconds of the cliff in which tokens will begin to vest * @param _duration duration in seconds of the period in which the tokens will vest * @param _slicePeriodSeconds duration of a slice period for the vesting in seconds * @param _revocable whether the vesting is revocable or not * @param _amount total amount of tokens to be released at the end of the vesting */ function createVestingSchedule( address _beneficiary, uint256 _start, uint256 _cliff, uint256 _duration, uint256 _slicePeriodSeconds, bool _revocable, uint256 _amount ) public onlyOwner{ require( this.getWithdrawableAmount() >= _amount, "TokenVesting: cannot create vesting schedule because not sufficient tokens" ); require(_duration > 0, "TokenVesting: duration must be > 0"); require(_amount > 0, "TokenVesting: amount must be > 0"); require(_slicePeriodSeconds >= 1, "TokenVesting: slicePeriodSeconds must be >= 1"); bytes32 vestingScheduleId = this.computeNextVestingScheduleIdForHolder(_beneficiary); uint256 cliff = _start.add(_cliff); vestingSchedules[vestingScheduleId] = VestingSchedule( true, _beneficiary, cliff, _start, _duration, _slicePeriodSeconds, _revocable, _amount, 0, false ); vestingSchedulesTotalAmount = vestingSchedulesTotalAmount.add(_amount); vestingSchedulesIds.push(vestingScheduleId); uint256 currentVestingCount = holdersVestingCount[_beneficiary]; holdersVestingCount[_beneficiary] = currentVestingCount.add(1); } /** * @notice Revokes the vesting schedule for given identifier. * @param vestingScheduleId the vesting schedule identifier */ function revoke(bytes32 vestingScheduleId) public onlyOwner onlyIfVestingScheduleNotRevoked(vestingScheduleId){ VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId]; require(vestingSchedule.revocable == true, "TokenVesting: vesting is not revocable"); uint256 vestedAmount = _computeReleasableAmount(vestingSchedule); if(vestedAmount > 0){ release(vestingScheduleId, vestedAmount); } uint256 unreleased = vestingSchedule.amountTotal.sub(vestingSchedule.released); vestingSchedulesTotalAmount = vestingSchedulesTotalAmount.sub(unreleased); vestingSchedule.revoked = true; } /** * @notice Withdraw the specified amount if possible. * @param amount the amount to withdraw */ function withdraw(uint256 amount) public nonReentrant onlyOwner{ require(this.getWithdrawableAmount() >= amount, "TokenVesting: not enough withdrawable funds"); _token.safeTransfer(owner(), amount); } /** * @notice Release vested amount of tokens. * @param vestingScheduleId the vesting schedule identifier * @param amount the amount to release */ function release( bytes32 vestingScheduleId, uint256 amount ) public nonReentrant onlyIfVestingScheduleNotRevoked(vestingScheduleId){ VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId]; bool isBeneficiary = msg.sender == vestingSchedule.beneficiary; bool isOwner = msg.sender == owner(); require( isBeneficiary || isOwner, "TokenVesting: only beneficiary and owner can release vested tokens" ); uint256 vestedAmount = _computeReleasableAmount(vestingSchedule); require(vestedAmount >= amount, "TokenVesting: cannot release tokens, not enough vested tokens"); vestingSchedule.released = vestingSchedule.released.add(amount); address payable beneficiaryPayable = payable(vestingSchedule.beneficiary); vestingSchedulesTotalAmount = vestingSchedulesTotalAmount.sub(amount); _token.safeTransfer(beneficiaryPayable, amount); } /** * @dev Returns the number of vesting schedules managed by this contract. * @return the number of vesting schedules */ function getVestingSchedulesCount() public view returns(uint256){ return vestingSchedulesIds.length; } /** * @notice Computes the vested amount of tokens for the given vesting schedule identifier. * @return the vested amount */ function computeReleasableAmount(bytes32 vestingScheduleId) public onlyIfVestingScheduleNotRevoked(vestingScheduleId) view returns(uint256){ VestingSchedule storage vestingSchedule = vestingSchedules[vestingScheduleId]; return _computeReleasableAmount(vestingSchedule); } /** * @notice Returns the vesting schedule information for a given identifier. * @return the vesting schedule structure information */ function getVestingSchedule(bytes32 vestingScheduleId) public view returns(VestingSchedule memory){ return vestingSchedules[vestingScheduleId]; } /** * @dev Returns the amount of tokens that can be withdrawn by the owner. * @return the amount of tokens */ function getWithdrawableAmount() public view returns(uint256){ return _token.balanceOf(address(this)).sub(vestingSchedulesTotalAmount); } /** * @dev Computes the next vesting schedule identifier for a given holder address. */ function computeNextVestingScheduleIdForHolder(address holder) public view returns(bytes32){ return computeVestingScheduleIdForAddressAndIndex(holder, holdersVestingCount[holder]); } /** * @dev Returns the last vesting schedule for a given holder address. */ function getLastVestingScheduleForHolder(address holder) public view returns(VestingSchedule memory){ return vestingSchedules[computeVestingScheduleIdForAddressAndIndex(holder, holdersVestingCount[holder] - 1)]; } /** * @dev Computes the vesting schedule identifier for an address and an index. */ function computeVestingScheduleIdForAddressAndIndex(address holder, uint256 index) public pure returns(bytes32){ return keccak256(abi.encodePacked(holder, index)); } /** * @dev Computes the releasable amount of tokens for a vesting schedule. * @return the amount of releasable tokens */ function _computeReleasableAmount(VestingSchedule memory vestingSchedule) internal view returns(uint256){ uint256 currentTime = getCurrentTime(); if ((currentTime < vestingSchedule.cliff) || vestingSchedule.revoked == true) { return 0; } else if (currentTime >= vestingSchedule.start.add(vestingSchedule.duration)) { return vestingSchedule.amountTotal.sub(vestingSchedule.released); } else { uint256 timeFromStart = currentTime.sub(vestingSchedule.start); uint secondsPerSlice = vestingSchedule.slicePeriodSeconds; uint256 vestedSlicePeriods = timeFromStart.div(secondsPerSlice); uint256 vestedSeconds = vestedSlicePeriods.mul(secondsPerSlice); uint256 vestedAmount = vestingSchedule.amountTotal.mul(vestedSeconds).div(vestingSchedule.duration); vestedAmount = vestedAmount.sub(vestingSchedule.released); return vestedAmount; } } function getCurrentTime() internal virtual view returns(uint256){ return block.timestamp; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 substraction 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 v4.4.1 (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a / b + (a % b == 0 ? 0 : 1); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// 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 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev 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); } } } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"token_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Released","type":"event"},{"anonymous":false,"inputs":[],"name":"Revoked","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"computeNextVestingScheduleIdForHolder","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"vestingScheduleId","type":"bytes32"}],"name":"computeReleasableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"computeVestingScheduleIdForAddressAndIndex","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_cliff","type":"uint256"},{"internalType":"uint256","name":"_duration","type":"uint256"},{"internalType":"uint256","name":"_slicePeriodSeconds","type":"uint256"},{"internalType":"bool","name":"_revocable","type":"bool"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createVestingSchedule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"getLastVestingScheduleForHolder","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"slicePeriodSeconds","type":"uint256"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"uint256","name":"amountTotal","type":"uint256"},{"internalType":"uint256","name":"released","type":"uint256"},{"internalType":"bool","name":"revoked","type":"bool"}],"internalType":"struct TokenVesting.VestingSchedule","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getVestingIdAtIndex","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"vestingScheduleId","type":"bytes32"}],"name":"getVestingSchedule","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"slicePeriodSeconds","type":"uint256"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"uint256","name":"amountTotal","type":"uint256"},{"internalType":"uint256","name":"released","type":"uint256"},{"internalType":"bool","name":"revoked","type":"bool"}],"internalType":"struct TokenVesting.VestingSchedule","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getVestingScheduleByAddressAndIndex","outputs":[{"components":[{"internalType":"bool","name":"initialized","type":"bool"},{"internalType":"address","name":"beneficiary","type":"address"},{"internalType":"uint256","name":"cliff","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint256","name":"slicePeriodSeconds","type":"uint256"},{"internalType":"bool","name":"revocable","type":"bool"},{"internalType":"uint256","name":"amountTotal","type":"uint256"},{"internalType":"uint256","name":"released","type":"uint256"},{"internalType":"bool","name":"revoked","type":"bool"}],"internalType":"struct TokenVesting.VestingSchedule","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVestingSchedulesCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"getVestingSchedulesCountByBeneficiary","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVestingSchedulesTotalAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWithdrawableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"vestingScheduleId","type":"bytes32"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"release","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"vestingScheduleId","type":"bytes32"}],"name":"revoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60a06040523480156200001157600080fd5b5060405162001ba338038062001ba38339810160408190526200003491620000b9565b6200003f3362000069565b600180556001600160a01b0381166200005757600080fd5b6001600160a01b0316608052620000eb565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208284031215620000cc57600080fd5b81516001600160a01b0381168114620000e457600080fd5b9392505050565b608051611a876200011c600039600081816101680152818161097f01528181610c480152610dfd0152611a876000f3fe60806040526004361061010c5760003560e01c80638af104da1161009a578063ea1bb3d511610061578063ea1bb3d514610300578063f2fde38b14610320578063f51321d714610340578063f7c469f014610360578063f9079b371461038057005b80638af104da1461026d5780638da5cb5b1461028d57806390be10cc146102ab5780639ef346b4146102c0578063b75c7dc6146102e057005b806348deb471116100de57806348deb471146101c05780635a7bb69a146101d557806366afd8ef1461020b578063715018a61461022b5780637e913dc61461024057005b8063130836171461011557806317e289e91461013957806321df0da7146101595780632e1a7d4d146101a057005b3661011357005b005b34801561012157600080fd5b506002545b6040519081526020015b60405180910390f35b34801561014557600080fd5b50610113610154366004611759565b6103a0565b34801561016557600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610130565b3480156101ac57600080fd5b506101136101bb3660046117c0565b610819565b3480156101cc57600080fd5b50600454610126565b3480156101e157600080fd5b506101266101f03660046117d9565b6001600160a01b031660009081526005602052604090205490565b34801561021757600080fd5b506101136102263660046117f4565b6109ad565b34801561023757600080fd5b50610113610c7d565b34801561024c57600080fd5b5061026061025b3660046117d9565b610cb3565b6040516101309190611816565b34801561027957600080fd5b506101266102883660046118a1565b610d8b565b34801561029957600080fd5b506000546001600160a01b0316610188565b3480156102b757600080fd5b50610126610dd2565b3480156102cc57600080fd5b506102606102db3660046117c0565b610e73565b3480156102ec57600080fd5b506101136102fb3660046117c0565b610f1a565b34801561030c57600080fd5b5061012661031b3660046117c0565b6110e3565b34801561032c57600080fd5b5061011361033b3660046117d9565b6111cd565b34801561034c57600080fd5b5061026061035b3660046118a1565b611268565b34801561036c57600080fd5b5061012661037b3660046117d9565b611284565b34801561038c57600080fd5b5061012661039b3660046117c0565b6112ae565b6000546001600160a01b031633146103d35760405162461bcd60e51b81526004016103ca906118cb565b60405180910390fd5b80306001600160a01b03166390be10cc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104369190611900565b10156104bd5760405162461bcd60e51b815260206004820152604a60248201527f546f6b656e56657374696e673a2063616e6e6f7420637265617465207665737460448201527f696e67207363686564756c652062656361757365206e6f742073756666696369606482015269656e7420746f6b656e7360b01b608482015260a4016103ca565b600084116105185760405162461bcd60e51b815260206004820152602260248201527f546f6b656e56657374696e673a206475726174696f6e206d757374206265203e604482015261020360f41b60648201526084016103ca565b600081116105685760405162461bcd60e51b815260206004820181905260248201527f546f6b656e56657374696e673a20616d6f756e74206d757374206265203e203060448201526064016103ca565b60018310156105cf5760405162461bcd60e51b815260206004820152602d60248201527f546f6b656e56657374696e673a20736c696365506572696f645365636f6e647360448201526c206d757374206265203e3d203160981b60648201526084016103ca565b604051630f7c469f60e41b81526001600160a01b0388166004820152600090309063f7c469f090602401602060405180830381865afa158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190611900565b905060006106488888611336565b90506040518061014001604052806001151581526020018a6001600160a01b03168152602001828152602001898152602001878152602001868152602001851515815260200184815260200160008152602001600015158152506003600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010155606082015181600201556080820151816003015560a0820151816004015560c08201518160050160006101000a81548160ff02191690831515021790555060e0820151816006015561010082015181600701556101208201518160080160006101000a81548160ff0219169083151502179055509050506107988360045461133690919063ffffffff16565b6004556002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018390556001600160a01b038a16600090815260056020526040902054906107f1908290611336565b6001600160a01b03909a16600090815260056020526040902099909955505050505050505050565b6002600154141561086c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ca565b60026001556000546001600160a01b0316331461089b5760405162461bcd60e51b81526004016103ca906118cb565b80306001600160a01b03166390be10cc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fe9190611900565b10156109605760405162461bcd60e51b815260206004820152602b60248201527f546f6b656e56657374696e673a206e6f7420656e6f756768207769746864726160448201526a7761626c652066756e647360a81b60648201526084016103ca565b6109a66109756000546001600160a01b031690565b6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169083611342565b5060018055565b60026001541415610a005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ca565b60026001908155600083815260036020526040902054839160ff909116151514610a2957600080fd5b60008181526003602052604090206008015460ff1615610a4857600080fd5b6000838152600360205260408120805491549091336001600160a01b03610100909204821681149291909116148180610a7e5750805b610afb5760405162461bcd60e51b815260206004820152604260248201527f546f6b656e56657374696e673a206f6e6c792062656e6566696369617279206160448201527f6e64206f776e65722063616e2072656c656173652076657374656420746f6b656064820152616e7360f01b608482015260a4016103ca565b6040805161014081018252845460ff808216151583526001600160a01b03610100928390041660208401526001870154938301939093526002860154606083015260038601546080830152600486015460a083015260058601548316151560c0830152600686015460e083015260078601549082015260088501549091161515610120820152600090610b8d90611399565b905085811015610c055760405162461bcd60e51b815260206004820152603d60248201527f546f6b656e56657374696e673a2063616e6e6f742072656c6561736520746f6b60448201527f656e732c206e6f7420656e6f7567682076657374656420746f6b656e7300000060648201526084016103ca565b6007840154610c149087611336565b600785015583546004546101009091046001600160a01b031690610c38908861147c565b600455610c6f6001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000168289611342565b505060018055505050505050565b6000546001600160a01b03163314610ca75760405162461bcd60e51b81526004016103ca906118cb565b610cb16000611488565b565b610cbb6116cd565b6001600160a01b03821660009081526005602052604081205460039190610cea9085906102889060019061192f565b81526020808201929092526040908101600020815161014081018352815460ff808216151583526001600160a01b036101009283900416958301959095526001830154938201939093526002820154606082015260038201546080820152600482015460a082015260058201548416151560c0820152600682015460e082015260078201549281019290925260080154909116151561012082015292915050565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b600480546040516370a0823160e01b81523092810192909252600091610e6e91906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906370a0823190602401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190611900565b9061147c565b905090565b610e7b6116cd565b50600090815260036020818152604092839020835161014081018552815460ff808216151583526001600160a01b0361010092839004169483019490945260018301549582019590955260028201546060820152928101546080840152600481015460a084015260058101548216151560c0840152600681015460e0840152600781015493830193909352600890920154909116151561012082015290565b6000546001600160a01b03163314610f445760405162461bcd60e51b81526004016103ca906118cb565b600081815260036020526040902054819060ff161515600114610f6657600080fd5b60008181526003602052604090206008015460ff1615610f8557600080fd5b6000828152600360205260409020600581015460ff161515600114610ffb5760405162461bcd60e51b815260206004820152602660248201527f546f6b656e56657374696e673a2076657374696e67206973206e6f74207265766044820152656f6361626c6560d01b60648201526084016103ca565b6040805161014081018252825460ff808216151583526001600160a01b03610100928390041660208401526001850154938301939093526002840154606083015260038401546080830152600484015460a083015260058401548316151560c0830152600684015460e08301526007840154908201526008830154909116151561012082015260009061108d90611399565b9050801561109f5761109f84826109ad565b60006110bc8360070154846006015461147c90919063ffffffff16565b6004549091506110cc908261147c565b6004555050600801805460ff191660011790555050565b600081815260036020526040812054829060ff16151560011461110557600080fd5b60008181526003602052604090206008015460ff161561112457600080fd5b600083815260036020818152604092839020835161014081018552815460ff808216151583526001600160a01b0361010092839004169483019490945260018301549582019590955260028201546060820152928101546080840152600481015460a084015260058101548216151560c0840152600681015460e084015260078101549383019390935260088301541615156101208201526111c590611399565b949350505050565b6000546001600160a01b031633146111f75760405162461bcd60e51b81526004016103ca906118cb565b6001600160a01b03811661125c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ca565b61126581611488565b50565b6112706116cd565b61127d6102db8484610d8b565b9392505050565b6001600160a01b0381166000908152600560205260408120546112a8908390610d8b565b92915050565b60006112b960025490565b82106113115760405162461bcd60e51b815260206004820152602160248201527f546f6b656e56657374696e673a20696e646578206f7574206f6620626f756e646044820152607360f81b60648201526084016103ca565b6002828154811061132457611324611946565b90600052602060002001549050919050565b600061127d828461195c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526113949084906114d8565b505050565b604081015160009042908110806113b7575061012083015115156001145b156113c55750600092915050565b608083015160608401516113d891611336565b81106113f25761010083015160e084015161127d9161147c565b600061140b84606001518361147c90919063ffffffff16565b60a0850151909150600061141f83836115aa565b9050600061142d82846115b6565b905060006114568860800151611450848b60e001516115b690919063ffffffff16565b906115aa565b90506114708861010001518261147c90919063ffffffff16565b98975050505050505050565b600061127d828461192f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061152d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115c29092919063ffffffff16565b805190915015611394578080602001905181019061154b9190611974565b6113945760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ca565b600061127d8284611991565b600061127d82846119b3565b60606111c5848460008585843b61161b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ca565b600080866001600160a01b031685876040516116379190611a02565b60006040518083038185875af1925050503d8060008114611674576040519150601f19603f3d011682016040523d82523d6000602084013e611679565b606091505b5091509150611689828286611694565b979650505050505050565b606083156116a357508161127d565b8251156116b35782518084602001fd5b8160405162461bcd60e51b81526004016103ca9190611a1e565b60405180610140016040528060001515815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081526020016000151581525090565b80356001600160a01b038116811461174657600080fd5b919050565b801515811461126557600080fd5b600080600080600080600060e0888a03121561177457600080fd5b61177d8861172f565b96506020880135955060408801359450606088013593506080880135925060a08801356117a98161174b565b8092505060c0880135905092959891949750929550565b6000602082840312156117d257600080fd5b5035919050565b6000602082840312156117eb57600080fd5b61127d8261172f565b6000806040838503121561180757600080fd5b50508035926020909101359150565b8151151581526101408101602083015161183b60208401826001600160a01b03169052565b5060408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015161187760c084018215159052565b5060e083810151908301526101008084015190830152610120928301511515929091019190915290565b600080604083850312156118b457600080fd5b6118bd8361172f565b946020939093013593505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561191257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561194157611941611919565b500390565b634e487b7160e01b600052603260045260246000fd5b6000821982111561196f5761196f611919565b500190565b60006020828403121561198657600080fd5b815161127d8161174b565b6000826119ae57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cd576119cd611919565b500290565b60005b838110156119ed5781810151838201526020016119d5565b838111156119fc576000848401525b50505050565b60008251611a148184602087016119d2565b9190910192915050565b6020815260008251806020840152611a3d8160408501602087016119d2565b601f01601f1916919091016040019291505056fea264697066735822122093fdfd9b1c4d42666bc3bcfe87ad06dfa3a0b45063c124d5ac325943d20b663764736f6c634300080b0033000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d6
Deployed Bytecode
0x60806040526004361061010c5760003560e01c80638af104da1161009a578063ea1bb3d511610061578063ea1bb3d514610300578063f2fde38b14610320578063f51321d714610340578063f7c469f014610360578063f9079b371461038057005b80638af104da1461026d5780638da5cb5b1461028d57806390be10cc146102ab5780639ef346b4146102c0578063b75c7dc6146102e057005b806348deb471116100de57806348deb471146101c05780635a7bb69a146101d557806366afd8ef1461020b578063715018a61461022b5780637e913dc61461024057005b8063130836171461011557806317e289e91461013957806321df0da7146101595780632e1a7d4d146101a057005b3661011357005b005b34801561012157600080fd5b506002545b6040519081526020015b60405180910390f35b34801561014557600080fd5b50610113610154366004611759565b6103a0565b34801561016557600080fd5b507f000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d65b6040516001600160a01b039091168152602001610130565b3480156101ac57600080fd5b506101136101bb3660046117c0565b610819565b3480156101cc57600080fd5b50600454610126565b3480156101e157600080fd5b506101266101f03660046117d9565b6001600160a01b031660009081526005602052604090205490565b34801561021757600080fd5b506101136102263660046117f4565b6109ad565b34801561023757600080fd5b50610113610c7d565b34801561024c57600080fd5b5061026061025b3660046117d9565b610cb3565b6040516101309190611816565b34801561027957600080fd5b506101266102883660046118a1565b610d8b565b34801561029957600080fd5b506000546001600160a01b0316610188565b3480156102b757600080fd5b50610126610dd2565b3480156102cc57600080fd5b506102606102db3660046117c0565b610e73565b3480156102ec57600080fd5b506101136102fb3660046117c0565b610f1a565b34801561030c57600080fd5b5061012661031b3660046117c0565b6110e3565b34801561032c57600080fd5b5061011361033b3660046117d9565b6111cd565b34801561034c57600080fd5b5061026061035b3660046118a1565b611268565b34801561036c57600080fd5b5061012661037b3660046117d9565b611284565b34801561038c57600080fd5b5061012661039b3660046117c0565b6112ae565b6000546001600160a01b031633146103d35760405162461bcd60e51b81526004016103ca906118cb565b60405180910390fd5b80306001600160a01b03166390be10cc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610412573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104369190611900565b10156104bd5760405162461bcd60e51b815260206004820152604a60248201527f546f6b656e56657374696e673a2063616e6e6f7420637265617465207665737460448201527f696e67207363686564756c652062656361757365206e6f742073756666696369606482015269656e7420746f6b656e7360b01b608482015260a4016103ca565b600084116105185760405162461bcd60e51b815260206004820152602260248201527f546f6b656e56657374696e673a206475726174696f6e206d757374206265203e604482015261020360f41b60648201526084016103ca565b600081116105685760405162461bcd60e51b815260206004820181905260248201527f546f6b656e56657374696e673a20616d6f756e74206d757374206265203e203060448201526064016103ca565b60018310156105cf5760405162461bcd60e51b815260206004820152602d60248201527f546f6b656e56657374696e673a20736c696365506572696f645365636f6e647360448201526c206d757374206265203e3d203160981b60648201526084016103ca565b604051630f7c469f60e41b81526001600160a01b0388166004820152600090309063f7c469f090602401602060405180830381865afa158015610616573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061063a9190611900565b905060006106488888611336565b90506040518061014001604052806001151581526020018a6001600160a01b03168152602001828152602001898152602001878152602001868152602001851515815260200184815260200160008152602001600015158152506003600084815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a8154816001600160a01b0302191690836001600160a01b0316021790555060408201518160010155606082015181600201556080820151816003015560a0820151816004015560c08201518160050160006101000a81548160ff02191690831515021790555060e0820151816006015561010082015181600701556101208201518160080160006101000a81548160ff0219169083151502179055509050506107988360045461133690919063ffffffff16565b6004556002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018390556001600160a01b038a16600090815260056020526040902054906107f1908290611336565b6001600160a01b03909a16600090815260056020526040902099909955505050505050505050565b6002600154141561086c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ca565b60026001556000546001600160a01b0316331461089b5760405162461bcd60e51b81526004016103ca906118cb565b80306001600160a01b03166390be10cc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fe9190611900565b10156109605760405162461bcd60e51b815260206004820152602b60248201527f546f6b656e56657374696e673a206e6f7420656e6f756768207769746864726160448201526a7761626c652066756e647360a81b60648201526084016103ca565b6109a66109756000546001600160a01b031690565b6001600160a01b037f000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d6169083611342565b5060018055565b60026001541415610a005760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103ca565b60026001908155600083815260036020526040902054839160ff909116151514610a2957600080fd5b60008181526003602052604090206008015460ff1615610a4857600080fd5b6000838152600360205260408120805491549091336001600160a01b03610100909204821681149291909116148180610a7e5750805b610afb5760405162461bcd60e51b815260206004820152604260248201527f546f6b656e56657374696e673a206f6e6c792062656e6566696369617279206160448201527f6e64206f776e65722063616e2072656c656173652076657374656420746f6b656064820152616e7360f01b608482015260a4016103ca565b6040805161014081018252845460ff808216151583526001600160a01b03610100928390041660208401526001870154938301939093526002860154606083015260038601546080830152600486015460a083015260058601548316151560c0830152600686015460e083015260078601549082015260088501549091161515610120820152600090610b8d90611399565b905085811015610c055760405162461bcd60e51b815260206004820152603d60248201527f546f6b656e56657374696e673a2063616e6e6f742072656c6561736520746f6b60448201527f656e732c206e6f7420656e6f7567682076657374656420746f6b656e7300000060648201526084016103ca565b6007840154610c149087611336565b600785015583546004546101009091046001600160a01b031690610c38908861147c565b600455610c6f6001600160a01b037f000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d6168289611342565b505060018055505050505050565b6000546001600160a01b03163314610ca75760405162461bcd60e51b81526004016103ca906118cb565b610cb16000611488565b565b610cbb6116cd565b6001600160a01b03821660009081526005602052604081205460039190610cea9085906102889060019061192f565b81526020808201929092526040908101600020815161014081018352815460ff808216151583526001600160a01b036101009283900416958301959095526001830154938201939093526002820154606082015260038201546080820152600482015460a082015260058201548416151560c0820152600682015460e082015260078201549281019290925260080154909116151561012082015292915050565b6040516bffffffffffffffffffffffff19606084901b1660208201526034810182905260009060540160405160208183030381529060405280519060200120905092915050565b600480546040516370a0823160e01b81523092810192909252600091610e6e91906001600160a01b037f000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d616906370a0823190602401602060405180830381865afa158015610e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e689190611900565b9061147c565b905090565b610e7b6116cd565b50600090815260036020818152604092839020835161014081018552815460ff808216151583526001600160a01b0361010092839004169483019490945260018301549582019590955260028201546060820152928101546080840152600481015460a084015260058101548216151560c0840152600681015460e0840152600781015493830193909352600890920154909116151561012082015290565b6000546001600160a01b03163314610f445760405162461bcd60e51b81526004016103ca906118cb565b600081815260036020526040902054819060ff161515600114610f6657600080fd5b60008181526003602052604090206008015460ff1615610f8557600080fd5b6000828152600360205260409020600581015460ff161515600114610ffb5760405162461bcd60e51b815260206004820152602660248201527f546f6b656e56657374696e673a2076657374696e67206973206e6f74207265766044820152656f6361626c6560d01b60648201526084016103ca565b6040805161014081018252825460ff808216151583526001600160a01b03610100928390041660208401526001850154938301939093526002840154606083015260038401546080830152600484015460a083015260058401548316151560c0830152600684015460e08301526007840154908201526008830154909116151561012082015260009061108d90611399565b9050801561109f5761109f84826109ad565b60006110bc8360070154846006015461147c90919063ffffffff16565b6004549091506110cc908261147c565b6004555050600801805460ff191660011790555050565b600081815260036020526040812054829060ff16151560011461110557600080fd5b60008181526003602052604090206008015460ff161561112457600080fd5b600083815260036020818152604092839020835161014081018552815460ff808216151583526001600160a01b0361010092839004169483019490945260018301549582019590955260028201546060820152928101546080840152600481015460a084015260058101548216151560c0840152600681015460e084015260078101549383019390935260088301541615156101208201526111c590611399565b949350505050565b6000546001600160a01b031633146111f75760405162461bcd60e51b81526004016103ca906118cb565b6001600160a01b03811661125c5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103ca565b61126581611488565b50565b6112706116cd565b61127d6102db8484610d8b565b9392505050565b6001600160a01b0381166000908152600560205260408120546112a8908390610d8b565b92915050565b60006112b960025490565b82106113115760405162461bcd60e51b815260206004820152602160248201527f546f6b656e56657374696e673a20696e646578206f7574206f6620626f756e646044820152607360f81b60648201526084016103ca565b6002828154811061132457611324611946565b90600052602060002001549050919050565b600061127d828461195c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526113949084906114d8565b505050565b604081015160009042908110806113b7575061012083015115156001145b156113c55750600092915050565b608083015160608401516113d891611336565b81106113f25761010083015160e084015161127d9161147c565b600061140b84606001518361147c90919063ffffffff16565b60a0850151909150600061141f83836115aa565b9050600061142d82846115b6565b905060006114568860800151611450848b60e001516115b690919063ffffffff16565b906115aa565b90506114708861010001518261147c90919063ffffffff16565b98975050505050505050565b600061127d828461192f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061152d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115c29092919063ffffffff16565b805190915015611394578080602001905181019061154b9190611974565b6113945760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103ca565b600061127d8284611991565b600061127d82846119b3565b60606111c5848460008585843b61161b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103ca565b600080866001600160a01b031685876040516116379190611a02565b60006040518083038185875af1925050503d8060008114611674576040519150601f19603f3d011682016040523d82523d6000602084013e611679565b606091505b5091509150611689828286611694565b979650505050505050565b606083156116a357508161127d565b8251156116b35782518084602001fd5b8160405162461bcd60e51b81526004016103ca9190611a1e565b60405180610140016040528060001515815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160001515815260200160008152602001600081526020016000151581525090565b80356001600160a01b038116811461174657600080fd5b919050565b801515811461126557600080fd5b600080600080600080600060e0888a03121561177457600080fd5b61177d8861172f565b96506020880135955060408801359450606088013593506080880135925060a08801356117a98161174b565b8092505060c0880135905092959891949750929550565b6000602082840312156117d257600080fd5b5035919050565b6000602082840312156117eb57600080fd5b61127d8261172f565b6000806040838503121561180757600080fd5b50508035926020909101359150565b8151151581526101408101602083015161183b60208401826001600160a01b03169052565b5060408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015161187760c084018215159052565b5060e083810151908301526101008084015190830152610120928301511515929091019190915290565b600080604083850312156118b457600080fd5b6118bd8361172f565b946020939093013593505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561191257600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561194157611941611919565b500390565b634e487b7160e01b600052603260045260246000fd5b6000821982111561196f5761196f611919565b500190565b60006020828403121561198657600080fd5b815161127d8161174b565b6000826119ae57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cd576119cd611919565b500290565b60005b838110156119ed5781810151838201526020016119d5565b838111156119fc576000848401525b50505050565b60008251611a148184602087016119d2565b9190910192915050565b6020815260008251806020840152611a3d8160408501602087016119d2565b601f01601f1916919091016040019291505056fea264697066735822122093fdfd9b1c4d42666bc3bcfe87ad06dfa3a0b45063c124d5ac325943d20b663764736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d6
-----Decoded View---------------
Arg [0] : token_ (address): 0xC16B2419494aE0604432297D40CDF0e8d68dE8d6
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000c16b2419494ae0604432297d40cdf0e8d68de8d6
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.