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
Latest 25 from a total of 397 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Draw Down | 21322253 | 26 days ago | IN | 0 ETH | 0.00514914 | ||||
Draw Down | 21131122 | 52 days ago | IN | 0 ETH | 0.00334728 | ||||
Draw Down | 21116844 | 54 days ago | IN | 0 ETH | 0.00136167 | ||||
Draw Down | 19093434 | 337 days ago | IN | 0 ETH | 0.00160248 | ||||
Draw Down | 18929452 | 360 days ago | IN | 0 ETH | 0.00341287 | ||||
Draw Down | 18766639 | 383 days ago | IN | 0 ETH | 0.00520864 | ||||
Draw Down | 18321062 | 446 days ago | IN | 0 ETH | 0.00114047 | ||||
Draw Down | 17389147 | 576 days ago | IN | 0 ETH | 0.00503714 | ||||
Draw Down | 17277166 | 592 days ago | IN | 0 ETH | 0.00615719 | ||||
Draw Down | 16846895 | 653 days ago | IN | 0 ETH | 0.00274471 | ||||
Draw Down | 16730897 | 669 days ago | IN | 0 ETH | 0.00225734 | ||||
Draw Down | 16671641 | 677 days ago | IN | 0 ETH | 0.00410272 | ||||
Draw Down | 16298348 | 730 days ago | IN | 0 ETH | 0.00205945 | ||||
Draw Down | 16232057 | 739 days ago | IN | 0 ETH | 0.00196693 | ||||
Draw Down | 15972459 | 775 days ago | IN | 0 ETH | 0.00251246 | ||||
Draw Down | 15917569 | 783 days ago | IN | 0 ETH | 0.00135819 | ||||
Draw Down | 15877044 | 788 days ago | IN | 0 ETH | 0.00134056 | ||||
Draw Down | 15736266 | 808 days ago | IN | 0 ETH | 0.00237121 | ||||
Draw Down | 15713568 | 811 days ago | IN | 0 ETH | 0.00326482 | ||||
Draw Down | 15647092 | 821 days ago | IN | 0 ETH | 0.00330493 | ||||
Draw Down | 15590527 | 828 days ago | IN | 0 ETH | 0.00169286 | ||||
Draw Down | 15535242 | 836 days ago | IN | 0 ETH | 0.00144355 | ||||
Draw Down | 15451797 | 850 days ago | IN | 0 ETH | 0.00173421 | ||||
Draw Down | 15396138 | 859 days ago | IN | 0 ETH | 0.00130729 | ||||
Draw Down | 15340582 | 868 days ago | IN | 0 ETH | 0.0025077 |
Latest 25 internal transactions (View All)
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x4aABE309...2e0BAa176 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
VestingContract
Compiler Version
v0.5.16+commit.9c3226ce
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2020-09-24 */ pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/ReentrancyGuard.sol // Subject to the MIT license. /** * @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. */ contract ReentrancyGuard { // counter to allow mutex lock with only one SSTORE operation uint256 private _guardCounter; constructor () internal { // The counter starts at one to prevent changing it from zero to a non-zero // value, which is a more expensive operation. _guardCounter = 1; } /** * @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 make it call a * `private` function that does the actual work. */ modifier nonReentrant() { _guardCounter += 1; uint256 localCounter = _guardCounter; _; require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call"); } } /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //solhint-disable max-line-length //solhint-disable no-inline-assembly contract CloneFactory { function createClone(address target) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } } /** * @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); } // Copyright 2020 Compound Labs, Inc. // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. contract FuelToken { /// @notice EIP-20 token name for this token string public constant name = "PowerTrade Fuel Token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "PTF"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public totalSupply; /// @notice Minter address address public minter; /// @notice Allowance amounts on behalf of others mapping (address => mapping (address => uint96)) internal allowances; /// @notice Official record of token balances for each account mapping (address => uint96) internal balances; /// @notice A record of each accounts delegate mapping (address => address) public delegates; /// @notice A checkpoint for marking number of votes from a given block struct Checkpoint { uint32 fromBlock; uint96 votes; } /// @notice A record of votes checkpoints for each account, by index mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; /// @notice The number of checkpoints for each account mapping (address => uint32) public numCheckpoints; /// @notice The EIP-712 typehash for the contract's domain bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); /// @notice The EIP-712 typehash for the delegation struct used by the contract bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); /// @notice A record of states for signing / validating signatures mapping (address => uint) public nonces; /// @notice An event thats emitted when an account changes its delegate event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); /// @notice An event thats emitted when a delegate account's vote balance changes event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); /// @notice The standard EIP-20 transfer event event Transfer(address indexed from, address indexed to, uint256 amount); /// @notice The standard EIP-20 approval event event Approval(address indexed owner, address indexed spender, uint256 amount); /// @notice An event thats emitted when the minter is changed event NewMinter(address minter); modifier onlyMinter { require(msg.sender == minter, "FuelToken:onlyMinter: should only be called by minter"); _; } /** * @notice Construct a new Fuel token * @param initialSupply The initial supply minted at deployment * @param account The initial account to grant all the tokens */ constructor(uint initialSupply, address account, address _minter) public { totalSupply = safe96(initialSupply, "FuelToken::constructor:amount exceeds 96 bits"); balances[account] = uint96(initialSupply); minter = _minter; emit Transfer(address(0), account, initialSupply); } /** * @notice Get the number of tokens `spender` is approved to spend on behalf of `account` * @param account The address of the account holding the funds * @param spender The address of the account spending the funds * @return The number of tokens approved */ function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } /** * @notice Approve `spender` to transfer up to `amount` from `src` * @dev This will overwrite the approval amount for `spender` * and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve) * @param spender The address of the account which may transfer tokens * @param rawAmount The number of tokens that are approved (2^256-1 means infinite) * @return Whether or not the approval succeeded */ function approve(address spender, uint rawAmount) external returns (bool) { uint96 amount; if (rawAmount == uint(-1)) { amount = uint96(-1); } else { amount = safe96(rawAmount, "FuelToken::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Mint `amount` tokens to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to mint * @notice only callable by minter */ function mint(address dst, uint rawAmount) external onlyMinter { uint96 amount = safe96(rawAmount, "FuelToken::mint: amount exceeds 96 bits"); _mintTokens(dst, amount); } /** * @notice Burn `amount` tokens * @param rawAmount The number of tokens to burn */ function burn(uint rawAmount) external { uint96 amount = safe96(rawAmount, "FuelToken::burn: amount exceeds 96 bits"); _burnTokens(msg.sender, amount); } /** * @notice Change minter address to `account` * @param account The address of the new minter * @notice only callable by minter */ function changeMinter(address account) external onlyMinter { minter = account; emit NewMinter(account); } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "FuelToken::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } /** * @notice Transfer `amount` tokens from `src` to `dst` * @param src The address of the source account * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transferFrom(address src, address dst, uint rawAmount) external returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "FuelToken::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "FuelToken::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } /** * @notice Delegate votes from `msg.sender` to `delegatee` * @param delegatee The address to delegate votes to */ function delegate(address delegatee) public { return _delegate(msg.sender, delegatee); } /** * @notice Delegates votes from signatory to `delegatee` * @param delegatee The address to delegate votes to * @param nonce The contract state required to match the signature * @param expiry The time at which to expire the signature * @param v The recovery byte of the signature * @param r Half of the ECDSA signature pair * @param s Half of the ECDSA signature pair */ function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "FuelToken::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "FuelToken::delegateBySig: invalid nonce"); require(now <= expiry, "FuelToken::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } /** * @notice Gets the current votes balance for `account` * @param account The address to get votes balance * @return The number of current votes for `account` */ function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } /** * @notice Determine the prior number of votes for an account as of a block number * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. * @param account The address of the account to check * @param blockNumber The block number to get the vote balance at * @return The number of votes the account had as of the given block */ function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "FuelToken::getPriorVotes: not yet determined"); uint32 nCheckpoints = numCheckpoints[account]; if (nCheckpoints == 0) { return 0; } // First check most recent balance if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { return checkpoints[account][nCheckpoints - 1].votes; } // Next check implicit zero balance if (checkpoints[account][0].fromBlock > blockNumber) { return 0; } uint32 lower = 0; uint32 upper = nCheckpoints - 1; while (upper > lower) { uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow Checkpoint memory cp = checkpoints[account][center]; if (cp.fromBlock == blockNumber) { return cp.votes; } else if (cp.fromBlock < blockNumber) { lower = center; } else { upper = center - 1; } } return checkpoints[account][lower].votes; } function _delegate(address delegator, address delegatee) internal { address currentDelegate = delegates[delegator]; uint96 delegatorBalance = balances[delegator]; delegates[delegator] = delegatee; emit DelegateChanged(delegator, currentDelegate, delegatee); _moveDelegates(currentDelegate, delegatee, delegatorBalance); } function _transferTokens(address src, address dst, uint96 amount) internal { require(src != address(0), "FuelToken::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "FuelToken::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "FuelToken::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "FuelToken::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _mintTokens(address dst, uint96 amount) internal { require(dst != address(0), "FuelToken::_mintTokens: cannot transfer to the zero address"); uint96 supply = safe96(totalSupply, "FuelToken::_mintTokens: totalSupply exceeds 96 bits"); totalSupply = add96(supply, amount, "FuelToken::_mintTokens: totalSupply exceeds 96 bits"); balances[dst] = add96(balances[dst], amount, "FuelToken::_mintTokens: transfer amount overflows"); emit Transfer(address(0), dst, amount); _moveDelegates(address(0), delegates[dst], amount); } function _burnTokens(address src, uint96 amount) internal { uint96 supply = safe96(totalSupply, "FuelToken::_burnTokens: totalSupply exceeds 96 bits"); totalSupply = sub96(supply, amount, "FuelToken::_burnTokens:totalSupply underflow"); balances[src] = sub96(balances[src], amount, "FuelToken::_burnTokens: amount overflows"); emit Transfer(src, address(0), amount); _moveDelegates(delegates[src], address(0), amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "FuelToken::_moveVotes: vote amount underflows"); _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); } if (dstRep != address(0)) { uint32 dstRepNum = numCheckpoints[dstRep]; uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; uint96 dstRepNew = add96(dstRepOld, amount, "FuelToken::_moveVotes: vote amount overflows"); _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); } } } function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal { uint32 blockNumber = safe32(block.number, "FuelToken::_writeCheckpoint: block number exceeds 32 bits"); if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; } else { checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); numCheckpoints[delegatee] = nCheckpoints + 1; } emit DelegateVotesChanged(delegatee, oldVotes, newVotes); } function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { require(n < 2**32, errorMessage); return uint32(n); } function safe96(uint n, string memory errorMessage) internal pure returns (uint96) { require(n < 2**96, errorMessage); return uint96(n); } function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { uint96 c = a + b; require(c >= a, errorMessage); return c; } function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) { require(b <= a, errorMessage); return a - b; } function getChainId() internal pure returns (uint) { uint256 chainId; assembly { chainId := chainid() } return chainId; } } /// @author BlockRocket contract VestingDepositAccount { /// @notice the controlling parent vesting contract address public controller; /// @notice beneficiary who tokens will be transferred to address public beneficiary; /// @notice ERC20 token that is vested (extended with a delegate function) FuelToken public token; /** * @notice Using a minimal proxy contract pattern initialises the contract and sets delegation * @dev initialises the VestingDepositAccount (see https://eips.ethereum.org/EIPS/eip-1167) * @dev only controller */ function init(address _tokenAddress, address _controller, address _beneficiary) external { require(controller == address(0), "VestingDepositAccount::init: Contract already initialized"); token = FuelToken(_tokenAddress); controller = _controller; beneficiary = _beneficiary; // sets the beneficiary as the delegate on the token token.delegate(beneficiary); } /** * @notice Transfer tokens vested in the VestingDepositAccount to the beneficiary * @param _amount amount of tokens (in wei) * @dev only controller */ function transferToBeneficiary(uint256 _amount) external returns (bool) { require(msg.sender == controller, "VestingDepositAccount::transferToBeneficiary: Only controller"); return token.transfer(beneficiary, _amount); } /** * @notice Allows the beneficiary to be switched on the VestingDepositAccount and sets delegation * @param _newBeneficiary address to receive tokens once switched * @dev only controller */ function switchBeneficiary(address _newBeneficiary) external { require(msg.sender == controller, "VestingDepositAccount::switchBeneficiary: Only controller"); beneficiary = _newBeneficiary; // sets the new beneficiary as the delegate on the token token.delegate(_newBeneficiary); } } /// @author BlockRocket contract VestingContract is CloneFactory, ReentrancyGuard { using SafeMath for uint256; /// @notice event emitted when a vesting schedule is created event ScheduleCreated(address indexed _beneficiary, uint256 indexed _amount); /// @notice event emitted when a successful drawn down of vesting tokens is made event DrawDown(address indexed _beneficiary, uint256 indexed _amount, uint256 indexed _time); /// @notice struct to define the total amount vested (this never changes) and the associated deposit account struct Schedule { uint256 amount; VestingDepositAccount depositAccount; } /// @notice owner address set on construction address public owner; /// @notice beneficiary to schedule mapping. Note beneficiary address can not be reused mapping(address => Schedule) public vestingSchedule; /// @notice cumulative total of tokens drawn down (and transferred from the deposit account) per beneficiary mapping(address => uint256) public totalDrawn; /// @notice last drawn down time (seconds) per beneficiary mapping(address => uint256) public lastDrawnAt; /// @notice set when updating beneficiary (via owner) to indicate a voided/completed schedule mapping(address => bool) public voided; /// @notice ERC20 token we are vesting IERC20 public token; /// @notice the blueprint deposit account to clone using CloneFactory (https://eips.ethereum.org/EIPS/eip-1167) address public baseVestingDepositAccount; /// @notice start of vesting period as a timestamp uint256 public start; /// @notice end of vesting period as a timestamp uint256 public end; /// @notice cliff duration in seconds uint256 public cliffDuration; /** * @notice Construct a new vesting contract * @param _token ERC20 token * @param _baseVestingDepositAccount address of the VestingDepositAccount to clone * @param _start start timestamp * @param _end end timestamp * @param _cliffDurationInSecs cliff duration in seconds * @dev caller on constructor set as owner; this can not be changed */ constructor( IERC20 _token, address _baseVestingDepositAccount, uint256 _start, uint256 _end, uint256 _cliffDurationInSecs ) public { require(address(_token) != address(0), "VestingContract::constructor: Invalid token"); require(_end >= _start, "VestingContract::constructor: Start must be before end"); token = _token; owner = msg.sender; baseVestingDepositAccount = _baseVestingDepositAccount; start = _start; end = _end; cliffDuration = _cliffDurationInSecs; } /** * @notice Create a new vesting schedule * @notice A transfer is used to bring tokens into the VestingDepositAccount so pre-approval is required * @notice Delegation is set for the beneficiary on the token during schedule creation * @param _beneficiary beneficiary of the vested tokens * @param _amount amount of tokens (in wei) */ function createVestingSchedule(address _beneficiary, uint256 _amount) external returns (bool) { require(msg.sender == owner, "VestingContract::createVestingSchedule: Only Owner"); require(_beneficiary != address(0), "VestingContract::createVestingSchedule: Beneficiary cannot be empty"); require(_amount > 0, "VestingContract::createVestingSchedule: Amount cannot be empty"); // Ensure only one per address require( vestingSchedule[_beneficiary].amount == 0, "VestingContract::createVestingSchedule: Schedule already in flight" ); // Set up the vesting deposit account for the _beneficiary address depositAccountAddress = createClone(baseVestingDepositAccount); VestingDepositAccount depositAccount = VestingDepositAccount(depositAccountAddress); depositAccount.init(address(token), address(this), _beneficiary); // Create schedule vestingSchedule[_beneficiary] = Schedule({ amount : _amount, depositAccount : depositAccount }); // Vest the tokens into the deposit account and delegate to the beneficiary require( token.transferFrom(msg.sender, address(depositAccount), _amount), "VestingContract::createVestingSchedule: Unable to transfer tokens to VDA" ); emit ScheduleCreated(_beneficiary, _amount); return true; } /** * @notice Draws down any vested tokens due * @dev Must be called directly by the beneficiary assigned the tokens in the schedule */ function drawDown() nonReentrant external returns (bool) { return _drawDown(msg.sender); } /** * @notice Updates a schedule beneficiary * @notice Voids the old schedule and transfers remaining amount to new beneficiary via a new schedule * @dev Only owner * @param _currentBeneficiary beneficiary to be replaced * @param _newBeneficiary beneficiary to vest remaining tokens to */ function updateScheduleBeneficiary(address _currentBeneficiary, address _newBeneficiary) external { require(msg.sender == owner, "VestingContract::updateScheduleBeneficiary: Only owner"); // retrieve existing schedule Schedule memory schedule = vestingSchedule[_currentBeneficiary]; require( schedule.amount > 0, "VestingContract::updateScheduleBeneficiary: There is no schedule currently in flight" ); require(_drawDown(_currentBeneficiary), "VestingContract::_updateScheduleBeneficiary: Unable to drawn down"); // the old schedule is now void voided[_currentBeneficiary] = true; // setup new schedule with the amount left after the previous beneficiary's draw down vestingSchedule[_newBeneficiary] = Schedule({ amount : schedule.amount.sub(totalDrawn[_currentBeneficiary]), depositAccount : schedule.depositAccount }); vestingSchedule[_newBeneficiary].depositAccount.switchBeneficiary(_newBeneficiary); } /** * @notice Transfers ownership role * @notice Changes the owner of this contract to a new address * @dev Only owner * @param _newOwner beneficiary to vest remaining tokens to */ function transferOwnership(address _newOwner) external { require(msg.sender == owner, "VestingContract::transferOwnership: Only owner"); owner = _newOwner; } // Accessors /** * @notice Vested token balance for a beneficiary * @dev Must be called directly by the beneficiary assigned the tokens in the schedule * @return _tokenBalance total balance proxied via the ERC20 token */ function tokenBalance() external view returns (uint256 _tokenBalance) { return token.balanceOf(address(vestingSchedule[msg.sender].depositAccount)); } /** * @notice Vesting schedule and associated data for a beneficiary * @dev Must be called directly by the beneficiary assigned the tokens in the schedule * @return _amount * @return _totalDrawn * @return _lastDrawnAt * @return _drawDownRate * @return _remainingBalance * @return _depositAccountAddress */ function vestingScheduleForBeneficiary(address _beneficiary) external view returns ( uint256 _amount, uint256 _totalDrawn, uint256 _lastDrawnAt, uint256 _drawDownRate, uint256 _remainingBalance, address _depositAccountAddress ) { Schedule memory schedule = vestingSchedule[_beneficiary]; return ( schedule.amount, totalDrawn[_beneficiary], lastDrawnAt[_beneficiary], schedule.amount.div(end.sub(start)), schedule.amount.sub(totalDrawn[_beneficiary]), address(schedule.depositAccount) ); } /** * @notice Draw down amount currently available (based on the block timestamp) * @param _beneficiary beneficiary of the vested tokens * @return _amount tokens due from vesting schedule */ function availableDrawDownAmount(address _beneficiary) external view returns (uint256 _amount) { return _availableDrawDownAmount(_beneficiary); } /** * @notice Balance remaining in vesting schedule * @param _beneficiary beneficiary of the vested tokens * @return _remainingBalance tokens still due (and currently locked) from vesting schedule */ function remainingBalance(address _beneficiary) external view returns (uint256 _remainingBalance) { Schedule memory schedule = vestingSchedule[_beneficiary]; return schedule.amount.sub(totalDrawn[_beneficiary]); } // Internal function _drawDown(address _beneficiary) internal returns (bool) { Schedule memory schedule = vestingSchedule[_beneficiary]; require(schedule.amount > 0, "VestingContract::_drawDown: There is no schedule currently in flight"); uint256 amount = _availableDrawDownAmount(_beneficiary); require(amount > 0, "VestingContract::_drawDown: No allowance left to withdraw"); // Update last drawn to now lastDrawnAt[_beneficiary] = _getNow(); // Increase total drawn amount totalDrawn[_beneficiary] = totalDrawn[_beneficiary].add(amount); // Safety measure - this should never trigger require( totalDrawn[_beneficiary] <= schedule.amount, "VestingContract::_drawDown: Safety Mechanism - Drawn exceeded Amount Vested" ); // Issue tokens to beneficiary require( schedule.depositAccount.transferToBeneficiary(amount), "VestingContract::_drawDown: Unable to transfer tokens" ); emit DrawDown(_beneficiary, amount, _getNow()); return true; } function _getNow() internal view returns (uint256) { return block.timestamp; } function _availableDrawDownAmount(address _beneficiary) internal view returns (uint256 _amount) { Schedule memory schedule = vestingSchedule[_beneficiary]; // voided contract should not allow any draw downs if (voided[_beneficiary]) { return 0; } // cliff if (_getNow() <= start.add(cliffDuration)) { // the cliff period has not ended, no tokens to draw down return 0; } // schedule complete if (_getNow() > end) { return schedule.amount.sub(totalDrawn[_beneficiary]); } // Schedule is active // Work out when the last invocation was uint256 timeLastDrawnOrStart = lastDrawnAt[_beneficiary] == 0 ? start : lastDrawnAt[_beneficiary]; // Find out how much time has past since last invocation uint256 timePassedSinceLastInvocation = _getNow().sub(timeLastDrawnOrStart); // Work out how many due tokens - time passed * rate per second uint256 drawDownRate = schedule.amount.div(end.sub(start)); uint256 amount = timePassedSinceLastInvocation.mul(drawDownRate); return amount; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"address","name":"_baseVestingDepositAccount","type":"address"},{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_end","type":"uint256"},{"internalType":"uint256","name":"_cliffDurationInSecs","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"_time","type":"uint256"}],"name":"DrawDown","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_beneficiary","type":"address"},{"indexed":true,"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"ScheduleCreated","type":"event"},{"constant":true,"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"availableDrawDownAmount","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"baseVestingDepositAccount","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cliffDuration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"createVestingSchedule","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"drawDown","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"end","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"lastDrawnAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"remainingBalance","outputs":[{"internalType":"uint256","name":"_remainingBalance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"start","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenBalance","outputs":[{"internalType":"uint256","name":"_tokenBalance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"totalDrawn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"_currentBeneficiary","type":"address"},{"internalType":"address","name":"_newBeneficiary","type":"address"}],"name":"updateScheduleBeneficiary","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"vestingSchedule","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"contract VestingDepositAccount","name":"depositAccount","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"_beneficiary","type":"address"}],"name":"vestingScheduleForBeneficiary","outputs":[{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_totalDrawn","type":"uint256"},{"internalType":"uint256","name":"_lastDrawnAt","type":"uint256"},{"internalType":"uint256","name":"_drawDownRate","type":"uint256"},{"internalType":"uint256","name":"_remainingBalance","type":"uint256"},{"internalType":"address","name":"_depositAccountAddress","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"voided","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063c570b835116100a2578063eb5d620811610071578063eb5d6208146102d9578063efbe1c1c14610309578063f2fde38b14610311578063fc0c546a14610337578063ffff6b041461033f57610116565b8063c570b83514610223578063d3a637f214610285578063d85349f7146102ab578063da0ebf8e146102b357610116565b80638d8a228d116100e95780638d8a228d146101c15780638da5cb5b146101e55780639e1a4d19146101ed578063b9e02b8b146101f5578063be9a65551461021b57610116565b806315298b5e1461011b578063419544a014610153578063634107f81461019357806365281d151461019b575b600080fd5b6101416004803603602081101561013157600080fd5b50356001600160a01b0316610386565b60408051918252519081900360200190f35b61017f6004803603604081101561016957600080fd5b506001600160a01b038135169060200135610399565b604080519115158252519081900360200190f35b61017f610698565b610141600480360360208110156101b157600080fd5b50356001600160a01b0316610707565b6101c9610767565b604080516001600160a01b039092168252519081900360200190f35b6101c9610776565b610141610785565b61017f6004803603602081101561020b57600080fd5b50356001600160a01b0316610814565b610141610829565b6102496004803603602081101561023957600080fd5b50356001600160a01b031661082f565b60408051968752602087019590955285850193909352606085019190915260808401526001600160a01b031660a0830152519081900360c00190f35b6101416004803603602081101561029b57600080fd5b50356001600160a01b03166108f6565b610141610908565b610141600480360360208110156102c957600080fd5b50356001600160a01b031661090e565b610307600480360360408110156102ef57600080fd5b506001600160a01b0381358116916020013516610920565b005b610141610b1d565b6103076004803603602081101561032757600080fd5b50356001600160a01b0316610b23565b6101c9610b8e565b6103656004803603602081101561035557600080fd5b50356001600160a01b0316610b9d565b604080519283526001600160a01b0390911660208301528051918290030190f35b600061039182610bbf565b90505b919050565b6001546000906001600160a01b031633146103e55760405162461bcd60e51b81526004018080602001828103825260328152602001806112a56032913960400191505060405180910390fd5b6001600160a01b03831661042a5760405162461bcd60e51b815260040180806020018281038252604381526020018061139a6043913960600191505060405180910390fd5b600082116104695760405162461bcd60e51b815260040180806020018281038252603e815260200180611442603e913960400191505060405180910390fd5b6001600160a01b038316600090815260026020526040902054156104be5760405162461bcd60e51b815260040180806020018281038252604281526020018061130d6042913960600191505060405180910390fd5b6007546000906104d6906001600160a01b0316610d21565b6006546040805163184b955960e01b81526001600160a01b0392831660048201523060248201528783166044820152905192935083929183169163184b95599160648082019260009290919082900301818387803b15801561053757600080fd5b505af115801561054b573d6000803e3d6000fd5b50506040805180820182528781526001600160a01b0385811660208084018281528c8416600090815260028352868120955186559051600190950180546001600160a01b0319169585169590951790945560065485516323b872dd60e01b81523360048201526024810193909352604483018c905294519490921695506323b872dd94506064808201949293918390030190829087803b1580156105ee57600080fd5b505af1158015610602573d6000803e3d6000fd5b505050506040513d602081101561061857600080fd5b50516106555760405162461bcd60e51b81526004018080602001828103825260488152602001806114806048913960600191505060405180910390fd5b60405184906001600160a01b038716907f9c52cb9bbb9b7fa6ddb26d1e82afc4e62c9ec50c0f3488c10bb8ad22d4edc4c390600090a36001925050505b92915050565b600080546001018082556106ab33610d73565b91506000548114610703576040805162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604482015290519081900360640190fd5b5090565b6000610711611204565b506001600160a01b03808316600081815260026020908152604080832081518083018352815481526001909101549095168583015292825260039052205481516107609163ffffffff610fcd16565b9392505050565b6007546001600160a01b031681565b6001546001600160a01b031681565b6006543360009081526002602090815260408083206001015481516370a0823160e01b81526001600160a01b0391821660048201529151939416926370a0823192602480840193919291829003018186803b1580156107e357600080fd5b505afa1580156107f7573d6000803e3d6000fd5b505050506040513d602081101561080d57600080fd5b5051905090565b60056020526000908152604090205460ff1681565b60085481565b600080600080600080610840611204565b506001600160a01b0380881660008181526002602090815260408083208151808301835281548082526001909201549096168684015293835260038252808320546004909252909120546008546009546108b2916108a4919063ffffffff610fcd16565b85519063ffffffff61100f16565b6001600160a01b038c1660009081526003602052604090205485516108dc9163ffffffff610fcd16565b602090950151939c929b5090995097509195509350915050565b60036020526000908152604090205481565b600a5481565b60046020526000908152604090205481565b6001546001600160a01b031633146109695760405162461bcd60e51b81526004018080602001828103825260368152602001806112d76036913960400191505060405180910390fd5b610971611204565b506001600160a01b038083166000908152600260209081526040918290208251808401909352805480845260019091015490931690820152906109e55760405162461bcd60e51b81526004018080602001828103825260548152602001806112516054913960600191505060405180910390fd5b6109ee83610d73565b610a295760405162461bcd60e51b81526004018080602001828103825260418152602001806114c86041913960600191505060405180910390fd5b6001600160a01b0383166000908152600560209081526040808320805460ff191660011790558051808201825260039092529091205482518291610a73919063ffffffff610fcd16565b81526020838101516001600160a01b03908116928201929092528482166000818152600283526040808220865181559590930151600190950180546001600160a01b0319169585169590951794859055825162ec4d3560e71b81526004810192909252915193909216926376269a8092602480820193929182900301818387803b158015610b0057600080fd5b505af1158015610b14573d6000803e3d6000fd5b50505050505050565b60095481565b6001546001600160a01b03163314610b6c5760405162461bcd60e51b815260040180806020018281038252602e815260200180611542602e913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6006546001600160a01b031681565b600260205260009081526040902080546001909101546001600160a01b031682565b6000610bc9611204565b506001600160a01b03808316600081815260026020908152604080832081518083018352815481526001909101549095168583015292825260059052205460ff1615610c19576000915050610394565b600a54600854610c2e9163ffffffff61105116565b610c366110ab565b11610c45576000915050610394565b600954610c506110ab565b1115610c88576001600160a01b0383166000908152600360205260409020548151610c809163ffffffff610fcd16565b915050610394565b6001600160a01b03831660009081526004602052604081205415610cc4576001600160a01b038416600090815260046020526040902054610cc8565b6008545b90506000610ce482610cd86110ab565b9063ffffffff610fcd16565b90506000610d026108a4600854600954610fcd90919063ffffffff16565b90506000610d16838363ffffffff6110af16565b979650505050505050565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b6000610d7d611204565b506001600160a01b03808316600090815260026020908152604091829020825180840190935280548084526001909101549093169082015290610df15760405162461bcd60e51b81526004018080602001828103825260448152602001806113dd6044913960600191505060405180910390fd5b6000610dfc84610bbf565b905060008111610e3d5760405162461bcd60e51b81526004018080602001828103825260398152602001806115096039913960400191505060405180910390fd5b610e456110ab565b6001600160a01b038516600090815260046020908152604080832093909355600390522054610e7a908263ffffffff61105116565b6001600160a01b038516600090815260036020526040902081905582511015610ed45760405162461bcd60e51b815260040180806020018281038252604b81526020018061134f604b913960600191505060405180910390fd5b81602001516001600160a01b031663a2061a0c826040518263ffffffff1660e01b815260040180828152602001915050602060405180830381600087803b158015610f1e57600080fd5b505af1158015610f32573d6000803e3d6000fd5b505050506040513d6020811015610f4857600080fd5b5051610f855760405162461bcd60e51b815260040180806020018281038252603581526020018061121c6035913960400191505060405180910390fd5b610f8d6110ab565b60405182906001600160a01b038716907fe201e6531c39b0640b808074009b8aee94328121338eb569f55de6ccb3c317ac90600090a45060019392505050565b600061076083836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f7700815250611108565b600061076083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061119f565b600082820183811015610760576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b4290565b6000826110be57506000610692565b828202828482816110cb57fe5b04146107605760405162461bcd60e51b81526004018080602001828103825260218152602001806114216021913960400191505060405180910390fd5b600081848411156111975760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561115c578181015183820152602001611144565b50505050905090810190601f1680156111895780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836111ee5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561115c578181015183820152602001611144565b5060008385816111fa57fe5b0495945050505050565b60408051808201909152600080825260208201529056fe56657374696e67436f6e74726163743a3a5f64726177446f776e3a20556e61626c6520746f207472616e7366657220746f6b656e7356657374696e67436f6e74726163743a3a7570646174655363686564756c6542656e65666963696172793a205468657265206973206e6f207363686564756c652063757272656e746c7920696e20666c6967687456657374696e67436f6e74726163743a3a63726561746556657374696e675363686564756c653a204f6e6c79204f776e657256657374696e67436f6e74726163743a3a7570646174655363686564756c6542656e65666963696172793a204f6e6c79206f776e657256657374696e67436f6e74726163743a3a63726561746556657374696e675363686564756c653a205363686564756c6520616c726561647920696e20666c6967687456657374696e67436f6e74726163743a3a5f64726177446f776e3a20536166657479204d656368616e69736d202d20447261776e20657863656564656420416d6f756e742056657374656456657374696e67436f6e74726163743a3a63726561746556657374696e675363686564756c653a2042656e65666963696172792063616e6e6f7420626520656d70747956657374696e67436f6e74726163743a3a5f64726177446f776e3a205468657265206973206e6f207363686564756c652063757272656e746c7920696e20666c69676874536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7756657374696e67436f6e74726163743a3a63726561746556657374696e675363686564756c653a20416d6f756e742063616e6e6f7420626520656d70747956657374696e67436f6e74726163743a3a63726561746556657374696e675363686564756c653a20556e61626c6520746f207472616e7366657220746f6b656e7320746f2056444156657374696e67436f6e74726163743a3a5f7570646174655363686564756c6542656e65666963696172793a20556e61626c6520746f20647261776e20646f776e56657374696e67436f6e74726163743a3a5f64726177446f776e3a204e6f20616c6c6f77616e6365206c65667420746f20776974686472617756657374696e67436f6e74726163743a3a7472616e736665724f776e6572736869703a204f6e6c79206f776e6572a265627a7a723158209ee624054ba96d4d69399f0bbd3f83d6969ec90ea7a244b2bd9b09180afb1dba64736f6c63430005100032
Deployed Bytecode Sourcemap
31709:11555:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;31709:11555:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;40136:159;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;40136:159:0;-1:-1:-1;;;;;40136:159:0;;:::i;:::-;;;;;;;;;;;;;;;;34889:1478;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;34889:1478:0;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;36534:104;;;:::i;40532:236::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;40532:236:0;-1:-1:-1;;;;;40532:236:0;;:::i;33220:40::-;;;:::i;:::-;;;;-1:-1:-1;;;;;33220:40:0;;;;;;;;;;;;;;32416:20;;;:::i;38728:164::-;;;:::i;32984:38::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32984:38:0;-1:-1:-1;;;;;32984:38:0;;:::i;33325:20::-;;;:::i;39265:643::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;39265:643:0;-1:-1:-1;;;;;39265:643:0;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;39265:643:0;;;;;;;;;;;;;;32712:45;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32712:45:0;-1:-1:-1;;;;;32712:45:0;;:::i;33478:28::-;;;:::i;32830:46::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32830:46:0;-1:-1:-1;;;;;32830:46:0;;:::i;36976:1083::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;;;;;;36976:1083:0;;;;;;;;;;:::i;:::-;;33408:18;;;:::i;38283:180::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38283:180:0;-1:-1:-1;;;;;38283:180:0;;:::i;33075:19::-;;;:::i;32538:51::-;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;32538:51:0;-1:-1:-1;;;;;32538:51:0;;:::i;:::-;;;;;;;-1:-1:-1;;;;;32538:51:0;;;;;;;;;;;;;;;;40136:159;40214:15;40249:38;40274:12;40249:24;:38::i;:::-;40242:45;;40136:159;;;;:::o;34889:1478::-;35016:5;;34977:4;;-1:-1:-1;;;;;35016:5:0;35002:10;:19;34994:82;;;;-1:-1:-1;;;34994:82:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;35095:26:0;;35087:106;;;;-1:-1:-1;;;35087:106:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35222:1;35212:7;:11;35204:86;;;;-1:-1:-1;;;35204:86:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;35365:29:0;;;;;;:15;:29;;;;;:36;:41;35343:157;;;;-1:-1:-1;;;35343:157:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;35625:25;;35581:29;;35613:38;;-1:-1:-1;;;;;35625:25:0;35613:11;:38::i;:::-;35784:5;;35756:64;;;-1:-1:-1;;;35756:64:0;;-1:-1:-1;;;;;35784:5:0;;;35756:64;;;;35800:4;35756:64;;;;;;;;;;;;;35581:70;;-1:-1:-1;35581:70:0;;35756:19;;;;;;:64;;;;;35662:36;;35756:64;;;;;;;;35662:36;35756:19;:64;;;5:2:-1;;;;30:1;27;20:12;5:2;35756:64:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;-1:-1;;35893:102:0;;;;;;;;;;;-1:-1:-1;;;;;35893:102:0;;;;;;;;;;35861:29;;;-1:-1:-1;35861:29:0;;;:15;:29;;;;;:134;;;;;;;;;;;;-1:-1:-1;;;;;;35861:134:0;;;;;;;;;;;36115:5;;:64;;-1:-1:-1;;;36115:64:0;;36134:10;36115:64;;;;;;;;;;;;;;;;;;;:5;;;;;-1:-1:-1;36115:18:0;;-1:-1:-1;36115:64:0;;;;;35893:102;;36115:64;;;;;;;;:5;:64;;;5:2:-1;;;;30:1;27;20:12;5:2;36115:64:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;36115:64:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;36115:64:0;36093:186;;;;-1:-1:-1;;;36093:186:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36297:38;;36327:7;;-1:-1:-1;;;;;36297:38:0;;;;;;;;36355:4;36348:11;;;;34889:1478;;;;;:::o;36534:104::-;36585:4;8047:18;;8064:1;8047:18;;;;36609:21;36619:10;36609:9;:21::i;:::-;36602:28;;8159:13;;8143:12;:29;8135:73;;;;;-1:-1:-1;;;8135:73:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;36534:104;;:::o;40532:236::-;40603:25;40641:24;;:::i;:::-;-1:-1:-1;;;;;;40668:29:0;;;;;;;:15;:29;;;;;;;;40641:56;;;;;;;;;;;;;;;;;;;;;;;40735:24;;;:10;:24;;;;40715:15;;:45;;;:19;:45;:::i;:::-;40708:52;40532:236;-1:-1:-1;;;40532:236:0:o;33220:40::-;;;-1:-1:-1;;;;;33220:40:0;;:::o;32416:20::-;;;-1:-1:-1;;;;;32416:20:0;;:::o;38728:164::-;38816:5;;38856:10;38775:21;38840:27;;;:15;:27;;;;;;;;38816:5;38840:42;;38816:68;;-1:-1:-1;;;38816:68:0;;-1:-1:-1;;;;;38840:42:0;;;38816:68;;;;;;38775:21;;38816:5;;:15;;:68;;;;;38840:27;;38816:68;;;;;;:5;:68;;;5:2:-1;;;;30:1;27;20:12;5:2;38816:68:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;38816:68:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;38816:68:0;;-1:-1:-1;38728:164:0;:::o;32984:38::-;;;;;;;;;;;;;;;:::o;33325:20::-;;;;:::o;39265:643::-;39369:15;39395:19;39425:20;39456:21;39488:25;39524:30;39573:24;;:::i;:::-;-1:-1:-1;;;;;;39600:29:0;;;;;;;:15;:29;;;;;;;;39573:56;;;;;;;;;;;;;;;;;;;;;;;;39684:24;;;:10;:24;;;;;;39719:11;:25;;;;;;;39783:5;;39775:3;;39755:35;;39775:14;;:3;:14;:7;:14;:::i;:::-;39755:15;;;:35;:19;:35;:::i;:::-;-1:-1:-1;;;;;39821:24:0;;;;;;:10;:24;;;;;;39801:15;;:45;;;:19;:45;:::i;:::-;39865:23;;;;;39640:260;;;;-1:-1:-1;39640:260:0;;-1:-1:-1;39640:260:0;-1:-1:-1;39640:260:0;;-1:-1:-1;39865:23:0;-1:-1:-1;39265:643:0;-1:-1:-1;;39265:643:0:o;32712:45::-;;;;;;;;;;;;;:::o;33478:28::-;;;;:::o;32830:46::-;;;;;;;;;;;;;:::o;36976:1083::-;37107:5;;-1:-1:-1;;;;;37107:5:0;37093:10;:19;37085:86;;;;-1:-1:-1;;;37085:86:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37223:24;;:::i;:::-;-1:-1:-1;;;;;;37250:36:0;;;;;;;:15;:36;;;;;;;;;37223:63;;;;;;;;;;;;;;;;;;;;;;;;;;37297:153;;;;-1:-1:-1;;;37297:153:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;37469:30;37479:19;37469:9;:30::i;:::-;37461:108;;;;-1:-1:-1;;;37461:108:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;37623:27:0;;;;;;:6;:27;;;;;;;;:34;;-1:-1:-1;;37623:34:0;37653:4;37623:34;;;37800:156;;;;;;;37853:10;:31;;;;;;;37833:15;;37800:156;;37833:52;;:15;:52;:19;:52;:::i;:::-;37800:156;;;37917:23;;;;-1:-1:-1;;;;;37800:156:0;;;;;;;;;;37765:32;;;-1:-1:-1;37765:32:0;;;:15;:32;;;;;;:191;;;;;;;;;;;;;;;-1:-1:-1;;;;;;37765:191:0;;;;;;;;;;;;37969:82;;-1:-1:-1;;;37969:82:0;;;;;;;;;;;:47;;;;;:65;;:82;;;;;-1:-1:-1;37969:82:0;;;;;;-1:-1:-1;37969:47:0;:82;;;5:2:-1;;;;30:1;27;20:12;5:2;37969:82:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;37969:82:0;;;;36976:1083;;;:::o;33408:18::-;;;;:::o;38283:180::-;38371:5;;-1:-1:-1;;;;;38371:5:0;38357:10;:19;38349:78;;;;-1:-1:-1;;;38349:78:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;38438:5;:17;;-1:-1:-1;;;;;;38438:17:0;-1:-1:-1;;;;;38438:17:0;;;;;;;;;;38283:180::o;33075:19::-;;;-1:-1:-1;;;;;33075:19:0;;:::o;32538:51::-;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;32538:51:0;;:::o;42044:1217::-;42123:15;42151:24;;:::i;:::-;-1:-1:-1;;;;;;42178:29:0;;;;;;;:15;:29;;;;;;;;42151:56;;;;;;;;;;;;;;;;;;;;;;;42284:20;;;:6;:20;;;;;;42280:61;;;42328:1;42321:8;;;;;42280:61;42398:13;;42388:5;;:24;;;:9;:24;:::i;:::-;42375:9;:7;:9::i;:::-;:37;42371:149;;42507:1;42500:8;;;;;42371:149;42578:3;;42566:9;:7;:9::i;:::-;:15;42562:100;;;-1:-1:-1;;;;;42625:24:0;;;;;;:10;:24;;;;;;42605:15;;:45;;;:19;:45;:::i;:::-;42598:52;;;;;42562:100;-1:-1:-1;;;;;42788:25:0;;42757:28;42788:25;;;:11;:25;;;;;;:30;:66;;-1:-1:-1;;;;;42829:25:0;;;;;;:11;:25;;;;;;42788:66;;;42821:5;;42788:66;42757:97;;42933:37;42973:35;42987:20;42973:9;:7;:9::i;:::-;:13;:35;:13;:35;:::i;:::-;42933:75;;43094:20;43117:35;43137:14;43145:5;;43137:3;;:7;;:14;;;;:::i;43117:35::-;43094:58;-1:-1:-1;43163:14:0;43180:47;:29;43094:58;43180:47;:33;:47;:::i;:::-;43163:64;42044:1217;-1:-1:-1;;;;;;;42044:1217:0:o;9447:494::-;9502:14;9529:19;9559:6;9551:15;;9529:37;;9620:4;9614:11;-1:-1:-1;;;9646:5:0;9639:81;9759:11;9752:4;9745:5;9741:16;9734:37;-1:-1:-1;;;9803:4:0;9796:5;9792:16;9785:92;9918:4;9911:5;9908:1;9901:22;9891:32;9586:348;-1:-1:-1;;;;9586:348:0:o;40795:1141::-;40854:4;40871:24;;:::i;:::-;-1:-1:-1;;;;;;40898:29:0;;;;;;;:15;:29;;;;;;;;;40871:56;;;;;;;;;;;;;;;;;;;;;;;;;;40938:100;;;;-1:-1:-1;;;40938:100:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41051:14;41068:38;41093:12;41068:24;:38::i;:::-;41051:55;;41134:1;41125:6;:10;41117:80;;;;-1:-1:-1;;;41117:80:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41275:9;:7;:9::i;:::-;-1:-1:-1;;;;;41247:25:0;;;;;;:11;:25;;;;;;;;:37;;;;41364:10;:24;;;;:36;;41393:6;41364:36;:28;:36;:::i;:::-;-1:-1:-1;;;;;41337:24:0;;;;;;:10;:24;;;;;:63;;;41518:15;;-1:-1:-1;41490:43:0;41468:168;;;;-1:-1:-1;;;41468:168:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41711:8;:23;;;-1:-1:-1;;;;;41711:45:0;;41757:6;41711:53;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;41711:53:0;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;41711:53:0;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;41711:53:0;41689:156;;;;-1:-1:-1;;;41689:156:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;41894:9;:7;:9::i;:::-;41863:41;;41886:6;;-1:-1:-1;;;;;41863:41:0;;;;;;;;-1:-1:-1;41924:4:0;;40795:1141;-1:-1:-1;;;40795:1141:0:o;1879:137::-;1937:7;1964:44;1968:1;1971;1964:44;;;;;;;;;;;;;;;;;:3;:44::i;4398:132::-;4456:7;4483:39;4487:1;4490;4483:39;;;;;;;;;;;;;;;;;:3;:39::i;986:181::-;1044:7;1076:5;;;1100:6;;;;1092:46;;;;;-1:-1:-1;;;1092:46:0;;;;;;;;;;;;;;;;;;;;;;;;;;;41944:92;42013:15;41944:92;:::o;2740:471::-;2798:7;3043:6;3039:47;;-1:-1:-1;3073:1:0;3066:8;;3039:47;3110:5;;;3114:1;3110;:5;:1;3134:5;;;;;:10;3126:56;;;;-1:-1:-1;;;3126:56:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2305:192;2391:7;2427:12;2419:6;;;;2411:29;;;;-1:-1:-1;;;2411:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2411:29:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;2463:5:0;;;2305:192::o;5018:345::-;5104:7;5206:12;5199:5;5191:28;;;;-1:-1:-1;;;5191:28:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;27:10:-1;;8:100;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;5191:28:0;;5230:9;5246:1;5242;:5;;;;;;;5018:345;-1:-1:-1;;;;;5018:345:0:o;31709:11555::-;;;;;;;;;;-1:-1:-1;31709:11555:0;;;;;;;;:::o
Swarm Source
bzzr://9ee624054ba96d4d69399f0bbd3f83d6969ec90ea7a244b2bd9b09180afb1dba
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.