Contract 0x05AFF24f7f653d2F067917C0B157f84971e54966 2

 
 
Txn Hash
Method
Block
From
To
Value
0x2f8ea8aa473eb92f248db7970125ee97eefb800a5614e47f577b59cc5c0485dfWithdraw144812462022-03-29 13:03:32245 days 5 hrs ago0x50936c48d27dc93815ec2f0467259fbfa4cf4a8d IN  0x05aff24f7f653d2f067917c0b157f84971e549660 Ether0.00379271 56.52503914
0xd865b470a87817f470b870674538a461aee43f8b8ef5246db98390a064ef6932Withdraw132478862021-09-18 5:48:22437 days 12 hrs ago0x50936c48d27dc93815ec2f0467259fbfa4cf4a8d IN  0x05aff24f7f653d2f067917c0b157f84971e549660 Ether0.0023602 47.21735635
0x5e45ffce2620467018ce2072c5883e8eb9d77a02a70284bd4e9d4fa8bb3143c8Withdraw123130492021-04-26 1:46:40582 days 16 hrs ago0x50936c48d27dc93815ec2f0467259fbfa4cf4a8d IN  0x05aff24f7f653d2f067917c0b157f84971e549660 Ether0.0023993248
0x4b0dddd2463cf53338dddb5ec76439ef0ca486a8ab75a454b01c5e21422a0f400x60806040118141862021-02-08 6:34:46659 days 11 hrs agoDeri Protocol: Deployer IN  Create: VestingVault0 Ether0.08817175125
[ Download CSV Export 
View more zero value Internal Transactions in Advanced View mode
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
File 1 of 2 : VestingVault.sol
// 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 = 1 days;

    uint256 public constant vestingBatchs = 720;

    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);
}

File 2 of 2 : SafeMath.sol
// 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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"}]

60806040523480156200001157600080fd5b5060405162000cea38038062000cea833981810160405260808110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b506040908152602082810151918301516060909301518651929550929350620001159160009187019062000261565b50600180546001600160a01b03199081166001600160a01b03868116919091179092556002849055600480549091169183169190911790556200016a620151806102d06200017a602090811b620005c317901c565b4201600355506200030d92505050565b6000620001a2838360405180606001604052806021815260200162000cc960219139620001a9565b9392505050565b600083620001ba57506000620001a2565b83830283858281620001c857fe5b04148390620002585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200021c57818101518382015260200162000202565b50505050905090810190601f1680156200024a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002995760008555620002e4565b82601f10620002b457805160ff1916838001178555620002e4565b82800160010185558215620002e4579182015b82811115620002e4578251825591602001919060010190620002c7565b50620002f2929150620002f6565b5090565b5b80821115620002f25760008155600101620002f7565b6109ac806200031d6000396000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c806338af3eed1161006657806338af3eed1461018e578063413ac50a146101965780637313ee5a1461019e578063f3fef3a3146101a6578063f792fd49146101d25761009e565b806306fdde03146100a357806319d152fa146101205780631c31f710146101445780632fb805c21461016c5780633032bbe814610186575b600080fd5b6100ab6101da565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100e55781810151838201526020016100cd565b50505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610128610268565b604080516001600160a01b039092168252519081900360200190f35b61016a6004803603602081101561015a57600080fd5b50356001600160a01b0316610277565b005b61017461032a565b60408051918252519081900360200190f35b610174610388565b61012861038e565b61017461039d565b6101746103a3565b61016a600480360360408110156101bc57600080fd5b506001600160a01b0381351690602001356103aa565b6101746105bd565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156102605780601f1061023557610100808354040283529160200191610260565b820191906000526020600020905b81548152906001019060200180831161024357829003601f168201915b505050505081565b6001546001600160a01b031681565b6004546001600160a01b031633146102c05760405162461bcd60e51b815260040180806020018281038252603e81526020018061090d603e913960400191505060405180910390fd5b600454604080516001600160a01b039283168152918316602083015280517f85c27200c401f4caa94c6fe4b37b37bd053aad74f560e856dc033bb870a9c5559281900390910190a1600480546001600160a01b0319166001600160a01b0392909216919091179055565b60035460009042908110610342576000915050610385565b6103816102d061036f60025461037b60016103756201518061036f896003546105ef90919063ffffffff16565b90610631565b90610673565b906105c3565b9150505b90565b60035481565b6004546001600160a01b031681565b60025481565b6201518081565b6004546001600160a01b031633146103f35760405162461bcd60e51b81526004018080602001828103825260388152602001806108b46038913960400191505060405180910390fd5b6001600160a01b0382166104385760405162461bcd60e51b815260040180806020018281038252602c81526020018061094b602c913960400191505060405180910390fd5b6001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561048e57600080fd5b505af11580156104a2573d6000803e3d6000fd5b505050506040513d60208110156104b857600080fd5b5050600154604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561050557600080fd5b505afa158015610519573d6000803e3d6000fd5b505050506040513d602081101561052f57600080fd5b5051905061053b61032a565b8110156105795760405162461bcd60e51b815260040180806020018281038252603981526020018061087b6039913960400191505060405180910390fd5b6040805183815290516001600160a01b038516917f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364919081900360200190a2505050565b6102d081565b60006105e883836040518060600160405280602181526020016108ec602191396106b5565b9392505050565b60006105e883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610766565b60006105e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506107c0565b60006105e883836040518060400160405280601b81526020017f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815250610825565b6000836106c4575060006105e8565b838302838582816106d157fe5b0414839061075d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561072257818101518382015260200161070a565b50505050905090810190601f16801561074f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50949350505050565b600081848411156107b85760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561072257818101518382015260200161070a565b505050900390565b6000818361080f5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561072257818101518382015260200161070a565b50600083858161081b57fe5b0495945050505050565b6000838301828582101561075d5760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561072257818101518382015260200161070a56fe56657374696e675661756c742e77697468647261773a20616d6f756e74206578636565647320616c6c6f776564206279207363686564756c6556657374696e675661756c742e77697468647261773a2063616e206f6e6c792062652063616c6c65642062792062656e6566696369617279536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7756657374696e675661756c742e73657442656e65666963696172793a2063616e206f6e6c792062652063616c6c65642062792062656e656669636961727956657374696e675661756c742e77697468647261773a20776974686472617720746f20302061646472657373a2646970667358221220b69913763fb205d42f752ad318bdb2d0ec3d44a934718f06cf3bad427f01367d64736f6c63430007060033536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f770000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b900000000000000000000000000000000000000000129c8f71ad02e2a6800000000000000000000000000000050936c48d27dc93815ec2f0467259fbfa4cf4a8d000000000000000000000000000000000000000000000000000000000000001644657269205465616d2056657374696e675661756c7400000000000000000000

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000000000000000000000000000000000000000000080000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b900000000000000000000000000000000000000000129c8f71ad02e2a6800000000000000000000000000000050936c48d27dc93815ec2f0467259fbfa4cf4a8d000000000000000000000000000000000000000000000000000000000000001644657269205465616d2056657374696e675661756c7400000000000000000000

-----Decoded View---------------
Arg [0] : name_ (string): Deri Team VestingVault
Arg [1] : vestingToken_ (address): 0xA487bF43cF3b10dffc97A9A744cbB7036965d3b9
Arg [2] : initialVestedAmount_ (uint256): 360000000000000000000000000
Arg [3] : beneficiary_ (address): 0x50936C48D27Dc93815ec2F0467259fbfa4cF4A8d

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 000000000000000000000000a487bf43cf3b10dffc97a9a744cbb7036965d3b9
Arg [2] : 00000000000000000000000000000000000000000129c8f71ad02e2a68000000
Arg [3] : 00000000000000000000000050936c48d27dc93815ec2f0467259fbfa4cf4a8d
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000016
Arg [5] : 44657269205465616d2056657374696e675661756c7400000000000000000000


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.