Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 7 from a total of 7 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 13798909 | 1160 days ago | IN | 0 ETH | 0.00726731 | ||||
Withdraw | 13798891 | 1160 days ago | IN | 0 ETH | 0.00636477 | ||||
Withdraw | 13604605 | 1191 days ago | IN | 0 ETH | 0.00690837 | ||||
Withdraw | 13409457 | 1221 days ago | IN | 0 ETH | 0.00390146 | ||||
Withdraw | 12669696 | 1336 days ago | IN | 0 ETH | 0.00080503 | ||||
Withdraw | 12254470 | 1401 days ago | IN | 0 ETH | 0.00649974 | ||||
Withdraw | 12033311 | 1435 days ago | IN | 0 ETH | 0.00748096 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
VestingVault
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; import "./SafeMath.sol"; contract VestingVault { using SafeMath for uint256; event ChangeBeneficiary(address oldBeneficiary, address newBeneficiary); event Withdraw(address indexed to, uint256 amount); string public name; address public vestingToken; uint256 public constant vestingPeriod = 30 days; uint256 public constant vestingBatchs = 10; uint256 public initialVestedAmount; uint256 public vestingEndTimestamp; address public beneficiary; constructor (string memory name_, address vestingToken_, uint256 initialVestedAmount_, address beneficiary_) { name = name_; vestingToken = vestingToken_; initialVestedAmount = initialVestedAmount_; beneficiary = beneficiary_; vestingEndTimestamp = block.timestamp + vestingPeriod.mul(vestingBatchs); } function setBeneficiary(address newBeneficiary) public { require(msg.sender == beneficiary, "VestingVault.setBeneficiary: can only be called by beneficiary"); emit ChangeBeneficiary(beneficiary, newBeneficiary); beneficiary = newBeneficiary; } function getRemainingLockedAmount() public view returns (uint256) { //release discretely on a "vestingPeriod" basis (e.g. monthly basis if vestingPeriod = 30 days) //after every vestingPeriod, 1 vestingBatch (1/vestingBatchs of initialVestedAmount) is released //numOfLockedBatches = vestingEndTimestamp.sub(block.timestamp).div(vestingPeriod).add(1); //ratio remaining locked = (1/vestingBatchs) * numOfLockedBatches uint256 currentTimestamp = block.timestamp; if (currentTimestamp >= vestingEndTimestamp) { return 0; } else { return vestingEndTimestamp.sub(currentTimestamp).div(vestingPeriod).add(1).mul(initialVestedAmount).div(vestingBatchs); } } function withdraw(address to, uint256 amount) public { require(msg.sender == beneficiary, "VestingVault.withdraw: can only be called by beneficiary"); require(to != address(0), "VestingVault.withdraw: withdraw to 0 address"); IToken(vestingToken).transfer(to, amount); uint256 balance = IToken(vestingToken).balanceOf(address(this)); require(balance >= getRemainingLockedAmount(), "VestingVault.withdraw: amount exceeds allowed by schedule"); emit Withdraw(to, amount); } } interface IToken { function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @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) { return add(a, b, "SafeMath: addition 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 * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ 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) { return mul(a, b, "SafeMath: multiplication 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) { 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"address","name":"vestingToken_","type":"address"},{"internalType":"uint256","name":"initialVestedAmount_","type":"uint256"},{"internalType":"address","name":"beneficiary_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldBeneficiary","type":"address"},{"indexed":false,"internalType":"address","name":"newBeneficiary","type":"address"}],"name":"ChangeBeneficiary","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"beneficiary","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRemainingLockedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initialVestedAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newBeneficiary","type":"address"}],"name":"setBeneficiary","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingBatchs","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingEndTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b5060405162000ce738038062000ce7833981810160405260808110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b506040908152602082810151918301516060909301518651929550929350620001159160009187019062000260565b50600180546001600160a01b03199081166001600160a01b03868116919091179092556002849055600480549091169183169190911790556200016962278d00600a62000179602090811b620005c117901c565b4201600355506200030c92505050565b6000620001a1838360405180606001604052806021815260200162000cc660219139620001a8565b9392505050565b600083620001b957506000620001a1565b83830283858281620001c757fe5b04148390620002575760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200021b57818101518382015260200162000201565b50505050905090810190601f168015620002495780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002985760008555620002e3565b82601f10620002b357805160ff1916838001178555620002e3565b82800160010185558215620002e3579182015b82811115620002e3578251825591602001919060010190620002c6565b50620002f1929150620002f5565b5090565b5b80821115620002f15760008155600101620002f6565b6109aa806200031c6000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c806338af3eed1161006657806338af3eed1461018e578063413ac50a146101965780637313ee5a1461019e578063f3fef3a3146101a6578063f792fd49146101d25761009e565b806306fdde03146100a357806319d152fa146101205780631c31f710146101445780632fb805c21461016c5780633032bbe814610186575b600080fd5b6100ab6101da565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100e55781810151838201526020016100cd565b50505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610128610268565b604080516001600160a01b039092168252519081900360200190f35b61016a6004803603602081101561015a57600080fd5b50356001600160a01b0316610277565b005b61017461032a565b60408051918252519081900360200190f35b610174610387565b61012861038d565b61017461039c565b6101746103a2565b61016a600480360360408110156101bc57600080fd5b506001600160a01b0381351690602001356103a9565b6101746105bc565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156102605780601f1061023557610100808354040283529160200191610260565b820191906000526020600020905b81548152906001019060200180831161024357829003601f168201915b505050505081565b6001546001600160a01b031681565b6004546001600160a01b031633146102c05760405162461bcd60e51b815260040180806020018281038252603e81526020018061090b603e913960400191505060405180910390fd5b600454604080516001600160a01b039283168152918316602083015280517f85c27200c401f4caa94c6fe4b37b37bd053aad74f560e856dc033bb870a9c5559281900390910190a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b60035460009042908110610342576000915050610384565b610380600a61036e60025461037a600161037462278d0061036e896003546105ed90919063ffffffff16565b9061062f565b90610671565b906105c1565b9150505b90565b60035481565b6004546001600160a01b031681565b60025481565b62278d0081565b6004546001600160a01b031633146103f25760405162461bcd60e51b81526004018080602001828103825260388152602001806108b26038913960400191505060405180910390fd5b6001600160a01b0382166104375760405162461bcd60e51b815260040180806020018281038252602c815260200180610949602c913960400191505060405180910390fd5b6001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561048d57600080fd5b505af11580156104a1573d6000803e3d6000fd5b505050506040513d60208110156104b757600080fd5b5050600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561050457600080fd5b505afa158015610518573d6000803e3d6000fd5b505050506040513d602081101561052e57600080fd5b5051905061053a61032a565b8110156105785760405162461bcd60e51b81526004018080602001828103825260398152602001806108796039913960400191505060405180910390fd5b6040805183815290516001600160a01b038516917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2505050565b600a81565b60006105e683836040518060600160405280602181526020016108ea602191396106b3565b9392505050565b60006105e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610764565b60006105e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506107be565b60006105e683836040518060400160405280601b81526020017f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815250610823565b6000836106c2575060006105e6565b838302838582816106cf57fe5b0414839061075b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610720578181015183820152602001610708565b50505050905090810190601f16801561074d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50949350505050565b600081848411156107b65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610720578181015183820152602001610708565b505050900390565b6000818361080d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610720578181015183820152602001610708565b50600083858161081957fe5b0495945050505050565b6000838301828582101561075b5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561072057818101518382015260200161070856fe56657374696e675661756c742e77697468647261773a20616d6f756e74206578636565647320616c6c6f776564206279207363686564756c6556657374696e675661756c742e77697468647261773a2063616e206f6e6c792062652063616c6c65642062792062656e6566696369617279536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7756657374696e675661756c742e73657442656e65666963696172793a2063616e206f6e6c792062652063616c6c65642062792062656e656669636961727956657374696e675661756c742e77697468647261773a20776974686472617720746f20302061646472657373a2646970667358221220b074f549ba49557a458f545b2598221fc562c5d55e320131e02bd14947ff76f464736f6c63430007060033536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f770000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b90000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000009aad429832394c40a6e8eea7ac3a88b7da795c2e000000000000000000000000000000000000000000000000000000000000000c56657374696e675661756c740000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c806338af3eed1161006657806338af3eed1461018e578063413ac50a146101965780637313ee5a1461019e578063f3fef3a3146101a6578063f792fd49146101d25761009e565b806306fdde03146100a357806319d152fa146101205780631c31f710146101445780632fb805c21461016c5780633032bbe814610186575b600080fd5b6100ab6101da565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100e55781810151838201526020016100cd565b50505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610128610268565b604080516001600160a01b039092168252519081900360200190f35b61016a6004803603602081101561015a57600080fd5b50356001600160a01b0316610277565b005b61017461032a565b60408051918252519081900360200190f35b610174610387565b61012861038d565b61017461039c565b6101746103a2565b61016a600480360360408110156101bc57600080fd5b506001600160a01b0381351690602001356103a9565b6101746105bc565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156102605780601f1061023557610100808354040283529160200191610260565b820191906000526020600020905b81548152906001019060200180831161024357829003601f168201915b505050505081565b6001546001600160a01b031681565b6004546001600160a01b031633146102c05760405162461bcd60e51b815260040180806020018281038252603e81526020018061090b603e913960400191505060405180910390fd5b600454604080516001600160a01b039283168152918316602083015280517f85c27200c401f4caa94c6fe4b37b37bd053aad74f560e856dc033bb870a9c5559281900390910190a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b60035460009042908110610342576000915050610384565b610380600a61036e60025461037a600161037462278d0061036e896003546105ed90919063ffffffff16565b9061062f565b90610671565b906105c1565b9150505b90565b60035481565b6004546001600160a01b031681565b60025481565b62278d0081565b6004546001600160a01b031633146103f25760405162461bcd60e51b81526004018080602001828103825260388152602001806108b26038913960400191505060405180910390fd5b6001600160a01b0382166104375760405162461bcd60e51b815260040180806020018281038252602c815260200180610949602c913960400191505060405180910390fd5b6001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561048d57600080fd5b505af11580156104a1573d6000803e3d6000fd5b505050506040513d60208110156104b757600080fd5b5050600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561050457600080fd5b505afa158015610518573d6000803e3d6000fd5b505050506040513d602081101561052e57600080fd5b5051905061053a61032a565b8110156105785760405162461bcd60e51b81526004018080602001828103825260398152602001806108796039913960400191505060405180910390fd5b6040805183815290516001600160a01b038516917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2505050565b600a81565b60006105e683836040518060600160405280602181526020016108ea602191396106b3565b9392505050565b60006105e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610764565b60006105e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506107be565b60006105e683836040518060400160405280601b81526020017f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815250610823565b6000836106c2575060006105e6565b838302838582816106cf57fe5b0414839061075b5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610720578181015183820152602001610708565b50505050905090810190601f16801561074d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50949350505050565b600081848411156107b65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610720578181015183820152602001610708565b505050900390565b6000818361080d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610720578181015183820152602001610708565b50600083858161081957fe5b0495945050505050565b6000838301828582101561075b5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561072057818101518382015260200161070856fe56657374696e675661756c742e77697468647261773a20616d6f756e74206578636565647320616c6c6f776564206279207363686564756c6556657374696e675661756c742e77697468647261773a2063616e206f6e6c792062652063616c6c65642062792062656e6566696369617279536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7756657374696e675661756c742e73657442656e65666963696172793a2063616e206f6e6c792062652063616c6c65642062792062656e656669636961727956657374696e675661756c742e77697468647261773a20776974686472617720746f20302061646472657373a2646970667358221220b074f549ba49557a458f545b2598221fc562c5d55e320131e02bd14947ff76f464736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b90000000000000000000000000000000000000000000422ca8b0a00a4250000000000000000000000000000009aad429832394c40a6e8eea7ac3a88b7da795c2e000000000000000000000000000000000000000000000000000000000000000c56657374696e675661756c740000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name_ (string): VestingVault
Arg [1] : vestingToken_ (address): 0xA487bF43cF3b10dffc97A9A744cbB7036965d3b9
Arg [2] : initialVestedAmount_ (uint256): 5000000000000000000000000
Arg [3] : beneficiary_ (address): 0x9AAD429832394c40A6E8EEa7AC3A88B7DA795C2e
-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b9
Arg [2] : 0000000000000000000000000000000000000000000422ca8b0a00a425000000
Arg [3] : 0000000000000000000000009aad429832394c40a6e8eea7ac3a88b7da795c2e
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [5] : 56657374696e675661756c740000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.