ETH Price: $3,090.91 (-1.05%)
Gas: 2 Gwei

Contract

0x08a90Fe0741B7DeF03fB290cc7B273F1855767D8
 

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Claim198830812024-05-16 14:17:593 days ago1715869079IN
dYdX: Community Treasury Vester
0 ETH0.00145266.01650552
Claim185690842023-11-14 8:55:35187 days ago1699952135IN
dYdX: Community Treasury Vester
0 ETH0.004808824.69079616
Claim184917492023-11-03 13:11:59198 days ago1699017119IN
dYdX: Community Treasury Vester
0 ETH0.0048217624.75735246
Claim182226862023-09-26 21:39:59236 days ago1695764399IN
dYdX: Community Treasury Vester
0 ETH0.0032403816.63775691
Claim176697572023-07-11 10:23:35313 days ago1689071015IN
dYdX: Community Treasury Vester
0 ETH0.0033703917.30527164
Claim174828982023-06-15 4:23:59339 days ago1686803039IN
dYdX: Community Treasury Vester
0 ETH0.0030633715.72891465
Claim166473522023-02-17 8:48:47457 days ago1676623727IN
dYdX: Community Treasury Vester
0 ETH0.0043645222.40963789
Claim162297162022-12-21 1:13:23516 days ago1671585203IN
dYdX: Community Treasury Vester
0 ETH0.0029607515.20198026
Claim157448692022-10-14 7:30:35583 days ago1665732635IN
dYdX: Community Treasury Vester
0 ETH0.0028753714.76360996
Claim142541702022-02-22 6:13:13817 days ago1645510393IN
dYdX: Community Treasury Vester
0 ETH0.0139509371.63106637
0x60806040129314792021-07-31 5:30:251023 days ago1627709425IN
 Create: TreasuryVester
0 ETH0.0148623930

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TreasuryVester

Compiler Version
v0.7.5+commit.eb77ed08

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 2 : TreasuryVester.sol
// Contracts by dYdX Foundation. Individual files are released under different licenses.
//
// https://dydx.community
// https://github.com/dydxfoundation/governance-contracts
//
// SPDX-License-Identifier: MIT

pragma solidity 0.7.5;

import { SafeMath } from '../dependencies/open-zeppelin/SafeMath.sol';

contract TreasuryVester {
    using SafeMath for uint256;

    address public dydx;
    address public recipient;

    uint256 public vestingAmount;
    uint256 public vestingBegin;
    uint256 public vestingCliff;
    uint256 public vestingEnd;

    uint256 public lastUpdate;

    constructor(
        address dydx_,
        address recipient_,
        uint256 vestingAmount_,
        uint256 vestingBegin_,
        uint256 vestingCliff_,
        uint256 vestingEnd_
    ) {
        require(vestingBegin_ >= block.timestamp, 'VESTING_BEGIN_TOO_EARLY');
        require(vestingCliff_ >= vestingBegin_, 'VESTING_CLIFF_BEFORE_BEGIN');
        require(vestingEnd_ > vestingCliff_, 'VESTING_END_BEFORE_CLIFF');

        dydx = dydx_;
        recipient = recipient_;

        vestingAmount = vestingAmount_;
        vestingBegin = vestingBegin_;
        vestingCliff = vestingCliff_;
        vestingEnd = vestingEnd_;

        lastUpdate = vestingBegin;
    }

    function setRecipient(address recipient_) public {
        require(msg.sender == recipient, 'SET_RECIPIENT_UNAUTHORIZED');
        recipient = recipient_;
    }

    function claim() public {
        require(block.timestamp >= vestingCliff, 'CLAIM_TOO_EARLY');
        uint256 amount;
        if (block.timestamp >= vestingEnd) {
            amount = IDydx(dydx).balanceOf(address(this));
        } else {
            amount = vestingAmount.mul(block.timestamp - lastUpdate).div(vestingEnd - vestingBegin);
            lastUpdate = block.timestamp;
        }
        IDydx(dydx).transfer(recipient, amount);
    }
}

interface IDydx {
    function balanceOf(address account) external view returns (uint256);
    function transfer(address dst, uint256 rawAmount) external returns (bool);
}

File 2 of 2 : SafeMath.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;

/**
 * @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 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) {
    // 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 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;
  }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"dydx_","type":"address"},{"internalType":"address","name":"recipient_","type":"address"},{"internalType":"uint256","name":"vestingAmount_","type":"uint256"},{"internalType":"uint256","name":"vestingBegin_","type":"uint256"},{"internalType":"uint256","name":"vestingCliff_","type":"uint256"},{"internalType":"uint256","name":"vestingEnd_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"dydx","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"recipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient_","type":"address"}],"name":"setRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"vestingAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingBegin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingCliff","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vestingEnd","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b506040516106bb3803806106bb833981810160405260c081101561003357600080fd5b508051602082015160408301516060840151608085015160a0909501519394929391929091428310156100ad576040805162461bcd60e51b815260206004820152601760248201527f56455354494e475f424547494e5f544f4f5f4541524c59000000000000000000604482015290519081900360640190fd5b82821015610102576040805162461bcd60e51b815260206004820152601a60248201527f56455354494e475f434c4946465f4245464f52455f424547494e000000000000604482015290519081900360640190fd5b818111610156576040805162461bcd60e51b815260206004820152601860248201527f56455354494e475f454e445f4245464f52455f434c4946460000000000000000604482015290519081900360640190fd5b600080546001600160a01b039788166001600160a01b0319918216179091556001805496909716951694909417909455600291909155600381905560049290925560055560065561050f806101ac6000396000f3fe608060405234801561001057600080fd5b50600436106100925760003560e01c806384a1931f1161006657806384a1931f146101055780638e4ec6ef1461010d578063c046371114610115578063e29bc68b1461011d578063f3640e741461012557610092565b8062728f76146100975780633bbed4a0146100b15780634e71d92d146100d957806366d003ac146100e1575b600080fd5b61009f61012d565b60408051918252519081900360200190f35b6100d7600480360360208110156100c757600080fd5b50356001600160a01b0316610133565b005b6100d76101b4565b6100e9610341565b604080516001600160a01b039092168252519081900360200190f35b61009f610350565b6100e9610356565b61009f610365565b61009f61036b565b61009f610371565b60025481565b6001546001600160a01b03163314610192576040805162461bcd60e51b815260206004820152601a60248201527f5345545f524543495049454e545f554e415554484f52495a4544000000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004544210156101fd576040805162461bcd60e51b815260206004820152600f60248201526e434c41494d5f544f4f5f4541524c5960881b604482015290519081900360640190fd5b6000600554421061028657600054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561025357600080fd5b505afa158015610267573d6000803e3d6000fd5b505050506040513d602081101561027d57600080fd5b505190506102b6565b6102af600354600554036102a9600654420360025461037790919063ffffffff16565b906103d9565b4260065590505b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561031257600080fd5b505af1158015610326573d6000803e3d6000fd5b505050506040513d602081101561033c57600080fd5b505050565b6001546001600160a01b031681565b60055481565b6000546001600160a01b031681565b60065481565b60035481565b60045481565b600082610386575060006103d3565b8282028284828161039357fe5b04146103d05760405162461bcd60e51b81526004018080602001828103825260218152602001806104b96021913960400191505060405180910390fd5b90505b92915050565b60006103d083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836104a25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561046757818101518382015260200161044f565b50505050905090810190601f1680156104945780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816104ae57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122087e79d51395641be17d761c90925a7346a52d71967348f6b0dafb4de6684219264736f6c6343000705003300000000000000000000000092d6c1e31e14520e676a687f0a93788b716beff5000000000000000000000000e710ced57456d3a16152c32835b5fb4e72d9ea5b000000000000000000000000000000000000000000295be96e6406697200000000000000000000000000000000000000000000000000000000000000610959f000000000000000000000000000000000000000000000000000000000610959f0000000000000000000000000000000000000000000000000000000006a70acf0

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100925760003560e01c806384a1931f1161006657806384a1931f146101055780638e4ec6ef1461010d578063c046371114610115578063e29bc68b1461011d578063f3640e741461012557610092565b8062728f76146100975780633bbed4a0146100b15780634e71d92d146100d957806366d003ac146100e1575b600080fd5b61009f61012d565b60408051918252519081900360200190f35b6100d7600480360360208110156100c757600080fd5b50356001600160a01b0316610133565b005b6100d76101b4565b6100e9610341565b604080516001600160a01b039092168252519081900360200190f35b61009f610350565b6100e9610356565b61009f610365565b61009f61036b565b61009f610371565b60025481565b6001546001600160a01b03163314610192576040805162461bcd60e51b815260206004820152601a60248201527f5345545f524543495049454e545f554e415554484f52495a4544000000000000604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6004544210156101fd576040805162461bcd60e51b815260206004820152600f60248201526e434c41494d5f544f4f5f4541524c5960881b604482015290519081900360640190fd5b6000600554421061028657600054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561025357600080fd5b505afa158015610267573d6000803e3d6000fd5b505050506040513d602081101561027d57600080fd5b505190506102b6565b6102af600354600554036102a9600654420360025461037790919063ffffffff16565b906103d9565b4260065590505b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018690529051919092169263a9059cbb92604480820193602093909283900390910190829087803b15801561031257600080fd5b505af1158015610326573d6000803e3d6000fd5b505050506040513d602081101561033c57600080fd5b505050565b6001546001600160a01b031681565b60055481565b6000546001600160a01b031681565b60065481565b60035481565b60045481565b600082610386575060006103d3565b8282028284828161039357fe5b04146103d05760405162461bcd60e51b81526004018080602001828103825260218152602001806104b96021913960400191505060405180910390fd5b90505b92915050565b60006103d083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836104a25760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561046757818101518382015260200161044f565b50505050905090810190601f1680156104945780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816104ae57fe5b049594505050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122087e79d51395641be17d761c90925a7346a52d71967348f6b0dafb4de6684219264736f6c63430007050033

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

00000000000000000000000092d6c1e31e14520e676a687f0a93788b716beff5000000000000000000000000e710ced57456d3a16152c32835b5fb4e72d9ea5b000000000000000000000000000000000000000000295be96e6406697200000000000000000000000000000000000000000000000000000000000000610959f000000000000000000000000000000000000000000000000000000000610959f0000000000000000000000000000000000000000000000000000000006a70acf0

-----Decoded View---------------
Arg [0] : dydx_ (address): 0x92D6C1e31e14520e676a687F0a93788B716BEff5
Arg [1] : recipient_ (address): 0xE710CEd57456D3A16152c32835B5FB4E72D9eA5b
Arg [2] : vestingAmount_ (uint256): 50000000000000000000000000
Arg [3] : vestingBegin_ (uint256): 1628002800
Arg [4] : vestingCliff_ (uint256): 1628002800
Arg [5] : vestingEnd_ (uint256): 1785769200

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 00000000000000000000000092d6c1e31e14520e676a687f0a93788b716beff5
Arg [1] : 000000000000000000000000e710ced57456d3a16152c32835b5fb4e72d9ea5b
Arg [2] : 000000000000000000000000000000000000000000295be96e64066972000000
Arg [3] : 00000000000000000000000000000000000000000000000000000000610959f0
Arg [4] : 00000000000000000000000000000000000000000000000000000000610959f0
Arg [5] : 000000000000000000000000000000000000000000000000000000006a70acf0


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

 

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.