Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 19199678 | 268 days ago | IN | 0 ETH | 0.08082977 |
Loading...
Loading
Contract Name:
VestingIDO
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)
// SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.10; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/Math.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; struct CreateVestingInput { address user; uint128 amount; } /** * @param rate percentage vested from total amount during the phase in BPS * @param endAt Time when phase ends * @param minimumClaimablePeriod for linear vesting it would be "1 seconds", for weekly westing it would be "1 weeks", if not set(set to zero) user will be able to claim only after phase ends */ struct Phase { uint256 rate; uint256 endAt; uint256 minimumClaimablePeriod; } /** * @title VestingIDO * @dev no user can claim while contract is in locked state */ contract VestingIDO is Ownable, ReentrancyGuard { using SafeERC20 for IERC20; error VestingIsNotUnlocked(); error NoZeroAddress(string param); error CannotReinitializeAfterFirstClaim(); error NothingToClaimCurrentlyPleaseTryAgainLater(); error DepositedAmountIsInsufficientPleaseDepositMore(); error WrongInputParameters(); error AlreadyUnlocked(); error OnlyOneVestingPerAddress(); error MustNotBeZero(string param); error NoActiveVesting(); error EmptyInputArray(); /** * @param amount Total amount allocated for user * @param amountClaimed Total amount claimed by user so far * @param lastClaimAt Timestamp from user last claim */ struct UserVesting { uint256 amount; uint256 amountClaimed; uint256 lastClaimAt; } bool public locked = false; uint256 public totalAmountAllocated; // Amount owner allocated for all users uint256 public totalAmountClaimed; // Amount claimed by all users uint256 public constant RATE_CONVERTER = 10000; IERC20 public vestedToken; string public name; uint256 public startDateAt; uint256 public vestingEndAt; uint256 public claimableAtStart; // in BPS bool public airdroptedAtStart; Phase[] public phases; mapping(address => UserVesting) public vestings; event NewVestingCreated(address indexed user, uint256 amount); event NewClaim(address indexed user, uint256 amountClaimed); constructor( IERC20 _vestedToken, string memory _name, uint256 _startDateAt, uint256 _claimableAtStart, bool _airdroptedAtStart, Phase[] memory _phases ) { _initialize( _vestedToken, _name, _startDateAt, _claimableAtStart, _airdroptedAtStart, _phases ); } function _initialize( IERC20 _vestedToken, string memory _name, uint256 _startDateAt, uint256 _claimableAtStart, bool _airdroptedAtStart, Phase[] memory _phases ) private { uint256 prevStartDate = _startDateAt; uint256 total = _claimableAtStart; for (uint256 i = 0; i < _phases.length; i++) { Phase memory phase = _phases[i]; if (prevStartDate > phase.endAt) { // phases should be ordered ascending by end date and should not overlap revert WrongInputParameters(); } total += phase.rate; prevStartDate = phase.endAt; } if (total / RATE_CONVERTER != 1) { revert WrongInputParameters(); } if (address(_vestedToken) == address(0)) { revert NoZeroAddress("_vestedToken"); } name = _name; vestedToken = _vestedToken; startDateAt = _startDateAt; // set vesting end date to last phase end date, if there is not phases then set end date to start date(e.g. for 100% claim at TGE) vestingEndAt = _phases.length > 0 ? _phases[_phases.length - 1].endAt : _startDateAt; claimableAtStart = _claimableAtStart; airdroptedAtStart = _airdroptedAtStart; // clear the phases array in case of reinitialization delete phases; for (uint256 i = 0; i < _phases.length; i++) { phases.push(_phases[i]); } } /** * @notice create vesting for user, only one vesting per user address * @dev owner needs to first deploy enough tokens to vesting contract address */ function createVestings( CreateVestingInput[] calldata vestingsInput, bool depositCheck ) external onlyOwner { if (vestingsInput.length == 0) { revert EmptyInputArray(); } uint256 totalDepositedAmount = getDepositedAmount(); uint256 amountAllocated; for (uint64 i = 0; i < vestingsInput.length; i++) { amountAllocated += vestingsInput[i].amount; } if (airdroptedAtStart) { totalAmountClaimed += (amountAllocated * claimableAtStart) / RATE_CONVERTER; } if (depositCheck) { // check if depositor have enough credit if ( (totalDepositedAmount + totalAmountClaimed - totalAmountAllocated) < amountAllocated ) { revert DepositedAmountIsInsufficientPleaseDepositMore(); } } for (uint64 i = 0; i < vestingsInput.length; i++) { _createVesting(vestingsInput[i]); } } /** * @dev can be called any amount of time after vesting contract is unlocked, tokens are vested each block after cliffEnd */ function claim() external nonReentrant { if (locked) { revert VestingIsNotUnlocked(); } UserVesting storage vesting = vestings[msg.sender]; if (vesting.amount - vesting.amountClaimed == 0) { revert NoActiveVesting(); } uint256 claimableAmount = _claimable(vesting); if (claimableAmount == 0) { revert NothingToClaimCurrentlyPleaseTryAgainLater(); } totalAmountClaimed += claimableAmount; vesting.amountClaimed += claimableAmount; vesting.lastClaimAt = block.timestamp; assert(vesting.amountClaimed <= vesting.amount); assert(totalAmountClaimed <= totalAmountAllocated); vestedToken.safeTransfer(msg.sender, claimableAmount); emit NewClaim(msg.sender, claimableAmount); } // return amount user can claim from locked tokens at the moment function claimable(address _user) external view returns (uint256 amount) { if (locked) { return 0; } return _claimable(vestings[_user]); } function getDepositedAmount() public view returns (uint256 amount) { return vestedToken.balanceOf(address(this)); } // create a vesting for an user function _createVesting(CreateVestingInput memory v) private { if (v.user == address(0)) { revert NoZeroAddress("user"); } if (v.amount == 0) { revert MustNotBeZero("amount"); } if (vestings[v.user].amount > 0) { revert OnlyOneVestingPerAddress(); } totalAmountAllocated += v.amount; vestings[v.user] = UserVesting({ amount: v.amount, amountClaimed: airdroptedAtStart ? (v.amount * claimableAtStart) / RATE_CONVERTER : 0, lastClaimAt: airdroptedAtStart ? startDateAt : 0 }); emit NewVestingCreated(v.user, v.amount); } function _claimable(UserVesting memory v) private view returns (uint256 amount) { if (block.timestamp < startDateAt) { // vesting has not started return 0; } uint256 amountLeft = v.amount - v.amountClaimed; // user already claimed everything if (amountLeft == 0) return 0; if (block.timestamp >= vestingEndAt) { // if vesting ended return everything left amount = amountLeft; } else { if (v.lastClaimAt == 0) { // if this is first claim also calculate amount available at start amount += (claimableAtStart * v.amount) / RATE_CONVERTER; } uint256 prevEndDate = startDateAt; for (uint256 i = 0; i < phases.length; i++) { Phase memory phase = phases[i]; uint256 phaseLength = phase.endAt - prevEndDate; // if last claim time is larger than the end of phase then skip it, already calculated in previous claim if (v.lastClaimAt < phase.endAt) { if ( block.timestamp >= phase.endAt && phase.minimumClaimablePeriod == 0 ) { // if phase completely passed then calculate amount with every second in phase amount += (v.amount * phase.rate) / RATE_CONVERTER; } else if (phase.minimumClaimablePeriod != 0) { uint256 start = Math.max(v.lastClaimAt, prevEndDate); uint256 end = Math.min(block.timestamp, phase.endAt); // only take full increments of minimumClaimablePeriod in calculation of amount uint256 timePassed = end - start - ((end - start) % phase.minimumClaimablePeriod); amount += (v.amount * phase.rate * timePassed) / (phaseLength * RATE_CONVERTER); } if (block.timestamp < phase.endAt) { // if current time is less than end of this phase then there is no need to calculate remaining phases break; } } prevEndDate = phase.endAt; } } amount = Math.min(amount, amountLeft); return Math.min(amount, getDepositedAmount()); } /** * @dev Returns time until next vesting batch will be unlocked for vesting contract provided in arguments */ function nextBatchAt() external view returns (uint256) { if (block.timestamp >= vestingEndAt) { return vestingEndAt; } // we assume all vesting contracts release at least some funds on start date/TGE if (block.timestamp < startDateAt) { return startDateAt; } uint256 nextBatchIn; uint256 prevEndDate = startDateAt; // iterate over phases until we find current phase contract does not returns phases length for (uint256 i = 0; block.timestamp > prevEndDate; i++) { Phase memory phase = phases[i]; if (block.timestamp < phase.endAt) { // vesting per sec/block if (phase.minimumClaimablePeriod == 1) { nextBatchIn = 1; } else if (phase.minimumClaimablePeriod == 0) { // vested at the end of the phase nextBatchIn = phase.endAt; } else { // if the funds are released in batches in current phase every `minimumClaimablePeriod` time, nextBatchIn = block.timestamp + phase.minimumClaimablePeriod - ((block.timestamp - prevEndDate) % phase.minimumClaimablePeriod); } break; } prevEndDate = phase.endAt; } return nextBatchIn; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (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 `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); /** * @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 (last updated v4.5.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.sol"; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin Contracts guidelines: functions revert * instead returning `false` on failure. This behavior is nonetheless * conventional and does not conflict with the expectations of ERC20 * applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5.05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, _allowances[owner][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { address owner = _msgSender(); uint256 currentAllowance = _allowances[owner][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. */ function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Spend `amount` form the allowance of `owner` toward `spender`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// 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 (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 (last updated v4.5.0) (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 (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/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// 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 (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": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_vestedToken","type":"address"},{"internalType":"string","name":"_name","type":"string"},{"internalType":"uint256","name":"_startDateAt","type":"uint256"},{"internalType":"uint256","name":"_claimableAtStart","type":"uint256"},{"internalType":"bool","name":"_airdroptedAtStart","type":"bool"},{"components":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"endAt","type":"uint256"},{"internalType":"uint256","name":"minimumClaimablePeriod","type":"uint256"}],"internalType":"struct Phase[]","name":"_phases","type":"tuple[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadyUnlocked","type":"error"},{"inputs":[],"name":"CannotReinitializeAfterFirstClaim","type":"error"},{"inputs":[],"name":"DepositedAmountIsInsufficientPleaseDepositMore","type":"error"},{"inputs":[],"name":"EmptyInputArray","type":"error"},{"inputs":[{"internalType":"string","name":"param","type":"string"}],"name":"MustNotBeZero","type":"error"},{"inputs":[],"name":"NoActiveVesting","type":"error"},{"inputs":[{"internalType":"string","name":"param","type":"string"}],"name":"NoZeroAddress","type":"error"},{"inputs":[],"name":"NothingToClaimCurrentlyPleaseTryAgainLater","type":"error"},{"inputs":[],"name":"OnlyOneVestingPerAddress","type":"error"},{"inputs":[],"name":"VestingIsNotUnlocked","type":"error"},{"inputs":[],"name":"WrongInputParameters","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountClaimed","type":"uint256"}],"name":"NewClaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"NewVestingCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"RATE_CONVERTER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"airdroptedAtStart","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"claimable","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimableAtStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint128","name":"amount","type":"uint128"}],"internalType":"struct CreateVestingInput[]","name":"vestingsInput","type":"tuple[]"},{"internalType":"bool","name":"depositCheck","type":"bool"}],"name":"createVestings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getDepositedAmount","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextBatchAt","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":"uint256","name":"","type":"uint256"}],"name":"phases","outputs":[{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"endAt","type":"uint256"},{"internalType":"uint256","name":"minimumClaimablePeriod","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startDateAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountAllocated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAmountClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingEndAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vestings","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"amountClaimed","type":"uint256"},{"internalType":"uint256","name":"lastClaimAt","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526002805460ff191690553480156200001b57600080fd5b5060405162001bc338038062001bc38339810160408190526200003e9162000507565b620000493362000069565b600180556200005d868686868686620000b9565b50505050505062000713565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b838360005b83518110156200013c576000848281518110620000df57620000df62000634565b6020026020010151905080602001518411156200010f57604051636fb9362f60e01b815260040160405180910390fd5b80516200011d908462000660565b602090910151935091508062000133816200067b565b915050620000be565b506200014b6127108262000699565b6001146200016c57604051636fb9362f60e01b815260040160405180910390fd5b6001600160a01b038816620001b75760405163030cc15560e51b815260206004820152600c60248201526b2fbb32b9ba32b22a37b5b2b760a11b604482015260640160405180910390fd5b8651620001cc9060069060208a0190620002d4565b50600580546001600160a01b0319166001600160a01b038a1617905560078690558251620001fb57856200022c565b82600184516200020c9190620006bc565b815181106200021f576200021f62000634565b6020026020010151602001515b6008556009859055600a805460ff191685151517905562000250600b600062000363565b60005b8351811015620002c957600b84828151811062000274576200027462000634565b6020908102919091018101518254600181810185556000948552938390208251600390920201908155918101519282019290925560409091015160029091015580620002c0816200067b565b91505062000253565b505050505050505050565b828054620002e290620006d6565b90600052602060002090601f01602090048101928262000306576000855562000351565b82601f106200032157805160ff191683800117855562000351565b8280016001018555821562000351579182015b828111156200035157825182559160200191906001019062000334565b506200035f92915062000389565b5090565b5080546000825560030290600052602060002090810190620003869190620003a0565b50565b5b808211156200035f57600081556001016200038a565b5b808211156200035f576000808255600182018190556002820155600301620003a1565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715620003ff57620003ff620003c4565b60405290565b604051601f8201601f191681016001600160401b0381118282101715620004305762000430620003c4565b604052919050565b805180151581146200044957600080fd5b919050565b600082601f8301126200046057600080fd5b815160206001600160401b038211156200047e576200047e620003c4565b6200048e818360051b0162000405565b82815260609283028501820192828201919087851115620004ae57600080fd5b8387015b85811015620004fa5781818a031215620004cc5760008081fd5b620004d6620003da565b815181528582015186820152604080830151908201528452928401928101620004b2565b5090979650505050505050565b60008060008060008060c087890312156200052157600080fd5b86516001600160a01b03811681146200053957600080fd5b602088810151919750906001600160401b03808211156200055957600080fd5b818a0191508a601f8301126200056e57600080fd5b815181811115620005835762000583620003c4565b62000597601f8201601f1916850162000405565b8181528c85838601011115620005ac57600080fd5b60005b82811015620005cc578481018601518282018701528501620005af565b82811115620005de5760008684840101525b50809950505060408a0151965060608a015195506200060060808b0162000438565b945060a08a01519250808311156200061757600080fd5b50506200062789828a016200044e565b9150509295509295509295565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156200067657620006766200064a565b500190565b60006000198214156200069257620006926200064a565b5060010190565b600082620006b757634e487b7160e01b600052601260045260246000fd5b500490565b600082821015620006d157620006d16200064a565b500390565b600181811c90821680620006eb57607f821691505b602082108114156200070d57634e487b7160e01b600052602260045260246000fd5b50919050565b6114a080620007236000396000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80638a4113d7116100ad578063d29af10d11610071578063d29af10d14610247578063daf498631461024f578063e44a05af1461027e578063f2fde38b14610291578063f843664a146102a457600080fd5b80638a4113d71461020e5780638da5cb5b14610217578063918f24d414610228578063bfa5e13c14610231578063cf3090121461023a57600080fd5b8063402914f5116100f4578063402914f5146101b55780634e71d92d146101c8578063549c1a35146101d25780635de29741146101db578063715018a61461020657600080fd5b80630683a0da1461013157806306fdde031461015357806323aaa7fe146101685780632e37eef61461017f578063322ba9f3146101ad575b600080fd5b600a5461013e9060ff1681565b60405190151581526020015b60405180910390f35b61015b6102ad565b60405161014a91906110e5565b61017161271081565b60405190815260200161014a565b61019261018d366004611118565b61033b565b6040805193845260208401929092529082015260600161014a565b61017161036e565b6101716101c336600461114d565b6103e0565b6101d0610444565b005b61017160035481565b6005546101ee906001600160a01b031681565b6040516001600160a01b03909116815260200161014a565b6101d0610607565b61017160075481565b6000546001600160a01b03166101ee565b61017160085481565b61017160045481565b60025461013e9060ff1681565b61017161063d565b61019261025d36600461114d565b600c6020526000908152604090208054600182015460029092015490919083565b6101d061028c366004611176565b610748565b6101d061029f36600461114d565b6108f5565b61017160095481565b600680546102ba906111fc565b80601f01602080910402602001604051908101604052809291908181526020018280546102e6906111fc565b80156103335780601f1061030857610100808354040283529160200191610333565b820191906000526020600020905b81548152906001019060200180831161031657829003601f168201915b505050505081565b600b818154811061034b57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6005546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190611237565b905090565b60025460009060ff16156103f657506000919050565b6001600160a01b0382166000908152600c6020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915261043e90610990565b92915050565b6002600154141561049c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260018190555460ff16156104c55760405163a995904b60e01b815260040160405180910390fd5b336000908152600c60205260409020600181015481546104e59190611266565b61050257604051634186725760e11b815260040160405180910390fd5b60408051606081018252825481526001830154602082015260028301549181019190915260009061053290610990565b905080610552576040516347f9e41d60e01b815260040160405180910390fd5b8060046000828254610564919061127d565b925050819055508082600101600082825461057f919061127d565b909155505042600283015581546001830154111561059f5761059f611295565b60035460045411156105b3576105b3611295565b6005546105ca906001600160a01b03163383610bbc565b60405181815233907f081144d27d70f1f67f67a65289dde411e1a9511c916d13ee3ff9bf22f169cd9a9060200160405180910390a2505060018055565b6000546001600160a01b031633146106315760405162461bcd60e51b8152600401610493906112ab565b61063b6000610c13565b565b6000600854421061064f575060085490565b600754421015610660575060075490565b600754600090815b81421115610740576000600b8281548110610685576106856112e0565b600091825260209182902060408051606081018252600390930290910180548352600181015493830184905260020154908201529150421015610728578060400151600114156106d85760019350610722565b60408101516106ed5780602001519350610722565b60408101516106fc8442611266565b610706919061130c565b6040820151610715904261127d565b61071f9190611266565b93505b50610740565b6020015191508061073881611320565b915050610668565b509092915050565b6000546001600160a01b031633146107725760405162461bcd60e51b8152600401610493906112ab565b816107905760405163af70781d60e01b815260040160405180910390fd5b600061079a61036e565b90506000805b67ffffffffffffffff811685111561080d5785858267ffffffffffffffff168181106107ce576107ce6112e0565b90506040020160200160208101906107e69190611352565b6107f9906001600160801b03168361127d565b9150806108058161136d565b9150506107a0565b50600a5460ff161561084b576127106009548261082a9190611395565b61083491906113b4565b60046000828254610845919061127d565b90915550505b821561088c578060035460045484610863919061127d565b61086d9190611266565b101561088c5760405163409a7ab960e11b815260040160405180910390fd5b60005b67ffffffffffffffff81168511156108ed576108db86868367ffffffffffffffff168181106108c0576108c06112e0565b9050604002018036038101906108d691906113c8565b610c63565b806108e58161136d565b91505061088f565b505050505050565b6000546001600160a01b0316331461091f5760405162461bcd60e51b8152600401610493906112ab565b6001600160a01b0381166109845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610493565b61098d81610c13565b50565b60006007544210156109a457506000919050565b602082015182516000916109b791611266565b9050806109c75750600092915050565b60085442106109d857809150610b98565b6040830151610a0a578251600954612710916109f391611395565b6109fd91906113b4565b610a07908361127d565b91505b60075460005b600b54811015610b95576000600b8281548110610a2f57610a2f6112e0565b600091825260208083206040805160608101825260039094029091018054845260018101549284018390526002015490830152909250610a70908590611266565b9050816020015187604001511015610b7c5781602001514210158015610a9857506040820151155b15610ac9578151875161271091610aae91611395565b610ab891906113b4565b610ac2908761127d565b9550610b69565b604082015115610b69576000610ae3886040015186610e3c565b90506000610af5428560200151610e53565b9050600084604001518383610b0a9190611266565b610b14919061130c565b610b1e8484611266565b610b289190611266565b9050610b3661271085611395565b85518b518391610b4591611395565b610b4f9190611395565b610b5991906113b4565b610b63908a61127d565b98505050505b8160200151421015610b7c575050610b95565b5060200151915080610b8d81611320565b915050610a10565b50505b610ba28282610e53565b9150610bb582610bb061036e565b610e53565b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c0e908490610e62565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0316610ca45760405163030cc15560e51b8152600401610493906020808252600490820152633ab9b2b960e11b604082015260600190565b60208101516001600160801b0316610ce857604051633930c7a960e21b8152602060048201526006602482015265185b5bdd5b9d60d21b6044820152606401610493565b80516001600160a01b03166000908152600c602052604090205415610d20576040516382c06f2f60e01b815260040160405180910390fd5b80602001516001600160801b031660036000828254610d3f919061127d565b909155505060408051606081019091526020808301516001600160801b03168252600a549082019060ff16610d75576000610d9d565b61271060095484602001516001600160801b0316610d939190611395565b610d9d91906113b4565b8152600a5460209091019060ff16610db6576000610dba565b6007545b905281516001600160a01b039081166000908152600c6020908152604091829020845181558482015160018201559382015160029094019390935583518385015191516001600160801b039092168252909116917f1ad52506d5b39a5f36ce7518f02978bb44db2961e116f2a2d8d134cd3f43e957910160405180910390a250565b600081831015610e4c5781610bb5565b5090919050565b6000818310610e4c5781610bb5565b6000610eb7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f349092919063ffffffff16565b805190915015610c0e5780806020019051810190610ed59190611431565b610c0e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610493565b6060610f438484600085610f4b565b949350505050565b606082471015610fac5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610493565b6001600160a01b0385163b6110035760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610493565b600080866001600160a01b0316858760405161101f919061144e565b60006040518083038185875af1925050503d806000811461105c576040519150601f19603f3d011682016040523d82523d6000602084013e611061565b606091505b509150915061107182828661107c565b979650505050505050565b6060831561108b575081610bb5565b82511561109b5782518084602001fd5b8160405162461bcd60e51b815260040161049391906110e5565b60005b838110156110d05781810151838201526020016110b8565b838111156110df576000848401525b50505050565b60208152600082518060208401526111048160408501602087016110b5565b601f01601f19169190910160400192915050565b60006020828403121561112a57600080fd5b5035919050565b80356001600160a01b038116811461114857600080fd5b919050565b60006020828403121561115f57600080fd5b610bb582611131565b801515811461098d57600080fd5b60008060006040848603121561118b57600080fd5b833567ffffffffffffffff808211156111a357600080fd5b818601915086601f8301126111b757600080fd5b8135818111156111c657600080fd5b8760208260061b85010111156111db57600080fd5b602092830195509350508401356111f181611168565b809150509250925092565b600181811c9082168061121057607f821691505b6020821081141561123157634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561124957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561127857611278611250565b500390565b6000821982111561129057611290611250565b500190565b634e487b7160e01b600052600160045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261131b5761131b6112f6565b500690565b600060001982141561133457611334611250565b5060010190565b80356001600160801b038116811461114857600080fd5b60006020828403121561136457600080fd5b610bb58261133b565b600067ffffffffffffffff8083168181141561138b5761138b611250565b6001019392505050565b60008160001904831182151516156113af576113af611250565b500290565b6000826113c3576113c36112f6565b500490565b6000604082840312156113da57600080fd5b6040516040810181811067ffffffffffffffff8211171561140b57634e487b7160e01b600052604160045260246000fd5b60405261141783611131565b81526114256020840161133b565b60208201529392505050565b60006020828403121561144357600080fd5b8151610bb581611168565b600082516114608184602087016110b5565b919091019291505056fea26469706673582212200f0732d77585c19a2a6a86e8550b57a0bda9af0116ff4d58fb9b24d267d3801664736f6c634300080b0033000000000000000000000000fd4f2caf941b6d737382dce420b368de3fc7f2d400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000065d9da4000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001e7061726167656e2d56657374696e6749444f20506174657820546f6b656e0000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065db2bc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000232800000000000000000000000000000000000000000000000000000000699ee4400000000000000000000000000000000000000000000000000000000000000001
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638a4113d7116100ad578063d29af10d11610071578063d29af10d14610247578063daf498631461024f578063e44a05af1461027e578063f2fde38b14610291578063f843664a146102a457600080fd5b80638a4113d71461020e5780638da5cb5b14610217578063918f24d414610228578063bfa5e13c14610231578063cf3090121461023a57600080fd5b8063402914f5116100f4578063402914f5146101b55780634e71d92d146101c8578063549c1a35146101d25780635de29741146101db578063715018a61461020657600080fd5b80630683a0da1461013157806306fdde031461015357806323aaa7fe146101685780632e37eef61461017f578063322ba9f3146101ad575b600080fd5b600a5461013e9060ff1681565b60405190151581526020015b60405180910390f35b61015b6102ad565b60405161014a91906110e5565b61017161271081565b60405190815260200161014a565b61019261018d366004611118565b61033b565b6040805193845260208401929092529082015260600161014a565b61017161036e565b6101716101c336600461114d565b6103e0565b6101d0610444565b005b61017160035481565b6005546101ee906001600160a01b031681565b6040516001600160a01b03909116815260200161014a565b6101d0610607565b61017160075481565b6000546001600160a01b03166101ee565b61017160085481565b61017160045481565b60025461013e9060ff1681565b61017161063d565b61019261025d36600461114d565b600c6020526000908152604090208054600182015460029092015490919083565b6101d061028c366004611176565b610748565b6101d061029f36600461114d565b6108f5565b61017160095481565b600680546102ba906111fc565b80601f01602080910402602001604051908101604052809291908181526020018280546102e6906111fc565b80156103335780601f1061030857610100808354040283529160200191610333565b820191906000526020600020905b81548152906001019060200180831161031657829003601f168201915b505050505081565b600b818154811061034b57600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b6005546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa1580156103b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103db9190611237565b905090565b60025460009060ff16156103f657506000919050565b6001600160a01b0382166000908152600c6020908152604091829020825160608101845281548152600182015492810192909252600201549181019190915261043e90610990565b92915050565b6002600154141561049c5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b600260018190555460ff16156104c55760405163a995904b60e01b815260040160405180910390fd5b336000908152600c60205260409020600181015481546104e59190611266565b61050257604051634186725760e11b815260040160405180910390fd5b60408051606081018252825481526001830154602082015260028301549181019190915260009061053290610990565b905080610552576040516347f9e41d60e01b815260040160405180910390fd5b8060046000828254610564919061127d565b925050819055508082600101600082825461057f919061127d565b909155505042600283015581546001830154111561059f5761059f611295565b60035460045411156105b3576105b3611295565b6005546105ca906001600160a01b03163383610bbc565b60405181815233907f081144d27d70f1f67f67a65289dde411e1a9511c916d13ee3ff9bf22f169cd9a9060200160405180910390a2505060018055565b6000546001600160a01b031633146106315760405162461bcd60e51b8152600401610493906112ab565b61063b6000610c13565b565b6000600854421061064f575060085490565b600754421015610660575060075490565b600754600090815b81421115610740576000600b8281548110610685576106856112e0565b600091825260209182902060408051606081018252600390930290910180548352600181015493830184905260020154908201529150421015610728578060400151600114156106d85760019350610722565b60408101516106ed5780602001519350610722565b60408101516106fc8442611266565b610706919061130c565b6040820151610715904261127d565b61071f9190611266565b93505b50610740565b6020015191508061073881611320565b915050610668565b509092915050565b6000546001600160a01b031633146107725760405162461bcd60e51b8152600401610493906112ab565b816107905760405163af70781d60e01b815260040160405180910390fd5b600061079a61036e565b90506000805b67ffffffffffffffff811685111561080d5785858267ffffffffffffffff168181106107ce576107ce6112e0565b90506040020160200160208101906107e69190611352565b6107f9906001600160801b03168361127d565b9150806108058161136d565b9150506107a0565b50600a5460ff161561084b576127106009548261082a9190611395565b61083491906113b4565b60046000828254610845919061127d565b90915550505b821561088c578060035460045484610863919061127d565b61086d9190611266565b101561088c5760405163409a7ab960e11b815260040160405180910390fd5b60005b67ffffffffffffffff81168511156108ed576108db86868367ffffffffffffffff168181106108c0576108c06112e0565b9050604002018036038101906108d691906113c8565b610c63565b806108e58161136d565b91505061088f565b505050505050565b6000546001600160a01b0316331461091f5760405162461bcd60e51b8152600401610493906112ab565b6001600160a01b0381166109845760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610493565b61098d81610c13565b50565b60006007544210156109a457506000919050565b602082015182516000916109b791611266565b9050806109c75750600092915050565b60085442106109d857809150610b98565b6040830151610a0a578251600954612710916109f391611395565b6109fd91906113b4565b610a07908361127d565b91505b60075460005b600b54811015610b95576000600b8281548110610a2f57610a2f6112e0565b600091825260208083206040805160608101825260039094029091018054845260018101549284018390526002015490830152909250610a70908590611266565b9050816020015187604001511015610b7c5781602001514210158015610a9857506040820151155b15610ac9578151875161271091610aae91611395565b610ab891906113b4565b610ac2908761127d565b9550610b69565b604082015115610b69576000610ae3886040015186610e3c565b90506000610af5428560200151610e53565b9050600084604001518383610b0a9190611266565b610b14919061130c565b610b1e8484611266565b610b289190611266565b9050610b3661271085611395565b85518b518391610b4591611395565b610b4f9190611395565b610b5991906113b4565b610b63908a61127d565b98505050505b8160200151421015610b7c575050610b95565b5060200151915080610b8d81611320565b915050610a10565b50505b610ba28282610e53565b9150610bb582610bb061036e565b610e53565b9392505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610c0e908490610e62565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0316610ca45760405163030cc15560e51b8152600401610493906020808252600490820152633ab9b2b960e11b604082015260600190565b60208101516001600160801b0316610ce857604051633930c7a960e21b8152602060048201526006602482015265185b5bdd5b9d60d21b6044820152606401610493565b80516001600160a01b03166000908152600c602052604090205415610d20576040516382c06f2f60e01b815260040160405180910390fd5b80602001516001600160801b031660036000828254610d3f919061127d565b909155505060408051606081019091526020808301516001600160801b03168252600a549082019060ff16610d75576000610d9d565b61271060095484602001516001600160801b0316610d939190611395565b610d9d91906113b4565b8152600a5460209091019060ff16610db6576000610dba565b6007545b905281516001600160a01b039081166000908152600c6020908152604091829020845181558482015160018201559382015160029094019390935583518385015191516001600160801b039092168252909116917f1ad52506d5b39a5f36ce7518f02978bb44db2961e116f2a2d8d134cd3f43e957910160405180910390a250565b600081831015610e4c5781610bb5565b5090919050565b6000818310610e4c5781610bb5565b6000610eb7826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316610f349092919063ffffffff16565b805190915015610c0e5780806020019051810190610ed59190611431565b610c0e5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610493565b6060610f438484600085610f4b565b949350505050565b606082471015610fac5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610493565b6001600160a01b0385163b6110035760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610493565b600080866001600160a01b0316858760405161101f919061144e565b60006040518083038185875af1925050503d806000811461105c576040519150601f19603f3d011682016040523d82523d6000602084013e611061565b606091505b509150915061107182828661107c565b979650505050505050565b6060831561108b575081610bb5565b82511561109b5782518084602001fd5b8160405162461bcd60e51b815260040161049391906110e5565b60005b838110156110d05781810151838201526020016110b8565b838111156110df576000848401525b50505050565b60208152600082518060208401526111048160408501602087016110b5565b601f01601f19169190910160400192915050565b60006020828403121561112a57600080fd5b5035919050565b80356001600160a01b038116811461114857600080fd5b919050565b60006020828403121561115f57600080fd5b610bb582611131565b801515811461098d57600080fd5b60008060006040848603121561118b57600080fd5b833567ffffffffffffffff808211156111a357600080fd5b818601915086601f8301126111b757600080fd5b8135818111156111c657600080fd5b8760208260061b85010111156111db57600080fd5b602092830195509350508401356111f181611168565b809150509250925092565b600181811c9082168061121057607f821691505b6020821081141561123157634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561124957600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60008282101561127857611278611250565b500390565b6000821982111561129057611290611250565b500190565b634e487b7160e01b600052600160045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261131b5761131b6112f6565b500690565b600060001982141561133457611334611250565b5060010190565b80356001600160801b038116811461114857600080fd5b60006020828403121561136457600080fd5b610bb58261133b565b600067ffffffffffffffff8083168181141561138b5761138b611250565b6001019392505050565b60008160001904831182151516156113af576113af611250565b500290565b6000826113c3576113c36112f6565b500490565b6000604082840312156113da57600080fd5b6040516040810181811067ffffffffffffffff8211171561140b57634e487b7160e01b600052604160045260246000fd5b60405261141783611131565b81526114256020840161133b565b60208201529392505050565b60006020828403121561144357600080fd5b8151610bb581611168565b600082516114608184602087016110b5565b919091019291505056fea26469706673582212200f0732d77585c19a2a6a86e8550b57a0bda9af0116ff4d58fb9b24d267d3801664736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000fd4f2caf941b6d737382dce420b368de3fc7f2d400000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000065d9da4000000000000000000000000000000000000000000000000000000000000003e800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000001e7061726167656e2d56657374696e6749444f20506174657820546f6b656e0000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000065db2bc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000232800000000000000000000000000000000000000000000000000000000699ee4400000000000000000000000000000000000000000000000000000000000000001
-----Decoded View---------------
Arg [0] : _vestedToken (address): 0xFD4f2Caf941B6d737382DCe420b368DE3FC7f2D4
Arg [1] : _name (string): paragen-VestingIDO Patex Token
Arg [2] : _startDateAt (uint256): 1708776000
Arg [3] : _claimableAtStart (uint256): 1000
Arg [4] : _airdroptedAtStart (bool): False
Arg [5] : _phases (tuple[]): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput],System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]
-----Encoded View---------------
15 Constructor Arguments found :
Arg [0] : 000000000000000000000000fd4f2caf941b6d737382dce420b368de3fc7f2d4
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000000000000000000000000000000000000065d9da40
Arg [3] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [6] : 000000000000000000000000000000000000000000000000000000000000001e
Arg [7] : 7061726167656e2d56657374696e6749444f20506174657820546f6b656e0000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [10] : 0000000000000000000000000000000000000000000000000000000065db2bc0
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000002328
Arg [13] : 00000000000000000000000000000000000000000000000000000000699ee440
Arg [14] : 0000000000000000000000000000000000000000000000000000000000000001
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.