More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0xe999eb71709f595e86fd420bc683b409ab7127bd831399d81fd34e8df6879cc0 | Claim Rewards | (pending) | 3 days ago | IN | 0 ETH | (Pending) | |||
0xced85c502f8c0436d435bb26d82e72d6bd29806d3f0a986da0cfad3976d7bb9a | Claim Rewards | (pending) | 3 days ago | IN | 0 ETH | (Pending) | |||
0xdebab266450de12eb03f7d69b6f4490aa727c5f1ebee7188ac5b116d057e4bec | Claim Rewards | (pending) | 3 days ago | IN | 0 ETH | (Pending) | |||
0x6e2293b8f8b264f457213af47d5e79c209f451f1a907177e5c06b94714336cd1 | Claim Rewards | (pending) | 3 days ago | IN | 0 ETH | (Pending) | |||
Claim Rewards | 22316043 | 2 days ago | IN | 0 ETH | 0.00022271 | ||||
Claim Rewards | 22316012 | 2 days ago | IN | 0 ETH | 0.00021543 | ||||
Claim Rewards | 22305956 | 3 days ago | IN | 0 ETH | 0.00012712 | ||||
Claim Rewards | 22303581 | 3 days ago | IN | 0 ETH | 0.00009736 | ||||
Claim Rewards | 22293168 | 5 days ago | IN | 0 ETH | 0.0001086 | ||||
Claim Rewards | 22282045 | 6 days ago | IN | 0 ETH | 0.00012133 | ||||
Claim Rewards | 22282042 | 6 days ago | IN | 0 ETH | 0.0005174 | ||||
Claim Rewards | 22282040 | 6 days ago | IN | 0 ETH | 0.00026063 | ||||
Claim Rewards | 22279075 | 7 days ago | IN | 0 ETH | 0.00011601 | ||||
Claim Rewards | 22272893 | 8 days ago | IN | 0 ETH | 0.0001389 | ||||
Claim Rewards | 22272766 | 8 days ago | IN | 0 ETH | 0.00018223 | ||||
Claim Rewards | 22256569 | 10 days ago | IN | 0 ETH | 0.00018691 | ||||
Claim Rewards | 22254881 | 10 days ago | IN | 0 ETH | 0.00017673 | ||||
Claim Rewards | 22252873 | 10 days ago | IN | 0 ETH | 0.00012324 | ||||
Claim Rewards | 22239034 | 12 days ago | IN | 0 ETH | 0.00416364 | ||||
Claim Rewards | 22235645 | 13 days ago | IN | 0 ETH | 0.00011988 | ||||
Claim Rewards | 22233408 | 13 days ago | IN | 0 ETH | 0.00049539 | ||||
Claim Rewards | 22233389 | 13 days ago | IN | 0 ETH | 0.00181666 | ||||
Claim Rewards | 22229871 | 14 days ago | IN | 0 ETH | 0.00031865 | ||||
Claim Rewards | 22227006 | 14 days ago | IN | 0 ETH | 0.00012971 | ||||
Claim Rewards | 22204993 | 17 days ago | IN | 0 ETH | 0.00012669 |
Loading...
Loading
Contract Name:
ClaimsProxy
Compiler Version
v0.7.5+commit.eb77ed08
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0 // Contracts by dYdX Foundation. Individual files are released under different licenses. // // https://dydx.community // https://github.com/dydxfoundation/governance-contracts pragma solidity 0.7.5; pragma experimental ABIEncoderV2; import { SafeMath } from '../dependencies/open-zeppelin/SafeMath.sol'; interface ISafetyModuleV1 { function claimRewardsFor( address staker, address recipient ) external returns (uint256); } interface ILiquidityStakingV1 { function claimRewardsFor( address staker, address recipient ) external returns (uint256); } interface IMerkleDistributorV1 { function claimRewardsFor( address user, uint256 cumulativeAmount, bytes32[] calldata merkleProof ) external returns (uint256); } interface ITreasuryVester { function claim() external; } /** * @title ClaimsProxy * @author dYdX * * @notice Contract which claims DYDX rewards from multiple contracts on behalf of a user. * * Requires the following permissions: * - Set as the CLAIMS_PROXY on the SafetyModuleV1 contract. * - Has role CLAIM_OPERATOR_ROLE on the LiquidityStakingV1 contract. * - Has role CLAIM_OPERATOR_ROLE on the MerkleDistributorV1 contract. */ contract ClaimsProxy { using SafeMath for uint256; // ============ Constants ============ ISafetyModuleV1 public immutable SAFETY_MODULE; ILiquidityStakingV1 public immutable LIQUIDITY_STAKING; IMerkleDistributorV1 public immutable MERKLE_DISTRIBUTOR; ITreasuryVester public immutable REWARDS_TREASURY_VESTER; // ============ Constructor ============ constructor( ISafetyModuleV1 safetyModule, ILiquidityStakingV1 liquidityStaking, IMerkleDistributorV1 merkleDistributor, ITreasuryVester rewardsTreasuryVester ) { SAFETY_MODULE = safetyModule; LIQUIDITY_STAKING = liquidityStaking; MERKLE_DISTRIBUTOR = merkleDistributor; REWARDS_TREASURY_VESTER = rewardsTreasuryVester; } // ============ External Functions ============ /** * @notice Claim rewards from zero or more rewards contracts. All rewards are sent directly to * the sender's address. * * @param claimSafetyRewards Whether or not to claim rewards from SafetyModuleV1. * @param claimLiquidityRewards Whether or not to claim rewards from LiquidityStakingV1. * @param merkleCumulativeAmount The cumulative rewards amount for the user in the * MerkleDistributorV1 rewards Merkle tree, or zero to skip * claiming from this contract. * @param merkleProof The Merkle proof for the user's cumulative rewards. * @param vestFromTreasuryVester Whether or not to vest rewards from the rewards treasury * vester to the rewards treasury (e.g. set to true if rewards * treasury has insufficient funds for users, and false otherwise). * * @return The total number of rewards claimed. */ function claimRewards( bool claimSafetyRewards, bool claimLiquidityRewards, uint256 merkleCumulativeAmount, bytes32[] calldata merkleProof, bool vestFromTreasuryVester ) external returns (uint256) { if (vestFromTreasuryVester) { // call rewards treasury vester so that rewards treasury has sufficient rewards REWARDS_TREASURY_VESTER.claim(); } address user = msg.sender; uint256 amount1 = 0; uint256 amount2 = 0; uint256 amount3 = 0; if (claimSafetyRewards) { amount1 = SAFETY_MODULE.claimRewardsFor(user, user); } if (claimLiquidityRewards) { amount2 = LIQUIDITY_STAKING.claimRewardsFor(user, user); } if (merkleCumulativeAmount != 0) { amount3 = MERKLE_DISTRIBUTOR.claimRewardsFor(user, merkleCumulativeAmount, merkleProof); } return amount1.add(amount2).add(amount3); } }
// 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; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "istanbul", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ISafetyModuleV1","name":"safetyModule","type":"address"},{"internalType":"contract ILiquidityStakingV1","name":"liquidityStaking","type":"address"},{"internalType":"contract IMerkleDistributorV1","name":"merkleDistributor","type":"address"},{"internalType":"contract ITreasuryVester","name":"rewardsTreasuryVester","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"LIQUIDITY_STAKING","outputs":[{"internalType":"contract ILiquidityStakingV1","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MERKLE_DISTRIBUTOR","outputs":[{"internalType":"contract IMerkleDistributorV1","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"REWARDS_TREASURY_VESTER","outputs":[{"internalType":"contract ITreasuryVester","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SAFETY_MODULE","outputs":[{"internalType":"contract ISafetyModuleV1","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"claimSafetyRewards","type":"bool"},{"internalType":"bool","name":"claimLiquidityRewards","type":"bool"},{"internalType":"uint256","name":"merkleCumulativeAmount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"},{"internalType":"bool","name":"vestFromTreasuryVester","type":"bool"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
61010060405234801561001157600080fd5b506040516107053803806107058339810160408190526100309161005f565b6001600160601b0319606094851b811660805292841b831660a05290831b821660c05290911b1660e0526100d5565b60008060008060808587031215610074578384fd5b845161007f816100bd565b6020860151909450610090816100bd565b60408601519093506100a1816100bd565b60608601519092506100b2816100bd565b939692955090935050565b6001600160a01b03811681146100d257600080fd5b50565b60805160601c60a05160601c60c05160601c60e05160601c6105dd6101286000398061010452806103c35250806102ea528061039f52508060b4528061024152508060d8528061019852506105dd6000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c8063320aa2bc1461005c5780633f4304071461007a57806356b40eb7146100825780635ab383e0146100a2578063f61a5ebf146100aa575b600080fd5b6100646100b2565b604051610071919061058a565b60405180910390f35b6100646100d6565b61009561009036600461045b565b6100fa565b604051610071919061059e565b61006461039d565b6100646103c1565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008115610176577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634e71d92d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b505050505b33600080808a156102245760405163028598cd60e61b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a1663340906101cf908790819060040161051d565b602060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190610505565b92505b89156102cd5760405163028598cd60e61b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063a166334090610278908790819060040161051d565b602060405180830381600087803b15801561029257600080fd5b505af11580156102a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ca9190610505565b91505b881561037a57604051633a099ae360e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063741335c6906103259087908d908d908d90600401610537565b602060405180830381600087803b15801561033f57600080fd5b505af1158015610353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103779190610505565b90505b61038e8161038885856103e5565b906103e5565b9b9a5050505050505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008282018381101561043f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b8035801515811461045657600080fd5b919050565b60008060008060008060a08789031215610473578182fd5b61047c87610446565b955061048a60208801610446565b945060408701359350606087013567ffffffffffffffff808211156104ad578384fd5b818901915089601f8301126104c0578384fd5b8135818111156104ce578485fd5b8a602080830285010111156104e1578485fd5b6020830195508094505050506104f960808801610446565b90509295509295509295565b600060208284031215610516578081fd5b5051919050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038516815260208101849052606060408201819052810182905260006001600160fb1b0383111561056d578081fd5b602083028085608085013791909101608001908152949350505050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220fbd9548a68f5a99964b58a26446238e8cccf77866e5a591540b3384870b25fbe64736f6c6343000705003300000000000000000000000065f7ba4ec257af7c55fd5854e5f6356bbd0fb8ec0000000000000000000000005aa653a076c1dbb47cec8c1b4d152444cad9194100000000000000000000000001d3348601968ab85b4bb028979006eac235a588000000000000000000000000b9431e19b29b952d9358025f680077c3fd37292f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063320aa2bc1461005c5780633f4304071461007a57806356b40eb7146100825780635ab383e0146100a2578063f61a5ebf146100aa575b600080fd5b6100646100b2565b604051610071919061058a565b60405180910390f35b6100646100d6565b61009561009036600461045b565b6100fa565b604051610071919061059e565b61006461039d565b6100646103c1565b7f0000000000000000000000005aa653a076c1dbb47cec8c1b4d152444cad9194181565b7f00000000000000000000000065f7ba4ec257af7c55fd5854e5f6356bbd0fb8ec81565b60008115610176577f000000000000000000000000b9431e19b29b952d9358025f680077c3fd37292f6001600160a01b0316634e71d92d6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561015d57600080fd5b505af1158015610171573d6000803e3d6000fd5b505050505b33600080808a156102245760405163028598cd60e61b81526001600160a01b037f00000000000000000000000065f7ba4ec257af7c55fd5854e5f6356bbd0fb8ec169063a1663340906101cf908790819060040161051d565b602060405180830381600087803b1580156101e957600080fd5b505af11580156101fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102219190610505565b92505b89156102cd5760405163028598cd60e61b81526001600160a01b037f0000000000000000000000005aa653a076c1dbb47cec8c1b4d152444cad91941169063a166334090610278908790819060040161051d565b602060405180830381600087803b15801561029257600080fd5b505af11580156102a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102ca9190610505565b91505b881561037a57604051633a099ae360e11b81526001600160a01b037f00000000000000000000000001d3348601968ab85b4bb028979006eac235a588169063741335c6906103259087908d908d908d90600401610537565b602060405180830381600087803b15801561033f57600080fd5b505af1158015610353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103779190610505565b90505b61038e8161038885856103e5565b906103e5565b9b9a5050505050505050505050565b7f00000000000000000000000001d3348601968ab85b4bb028979006eac235a58881565b7f000000000000000000000000b9431e19b29b952d9358025f680077c3fd37292f81565b60008282018381101561043f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b8035801515811461045657600080fd5b919050565b60008060008060008060a08789031215610473578182fd5b61047c87610446565b955061048a60208801610446565b945060408701359350606087013567ffffffffffffffff808211156104ad578384fd5b818901915089601f8301126104c0578384fd5b8135818111156104ce578485fd5b8a602080830285010111156104e1578485fd5b6020830195508094505050506104f960808801610446565b90509295509295509295565b600060208284031215610516578081fd5b5051919050565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b038516815260208101849052606060408201819052810182905260006001600160fb1b0383111561056d578081fd5b602083028085608085013791909101608001908152949350505050565b6001600160a01b0391909116815260200190565b9081526020019056fea2646970667358221220fbd9548a68f5a99964b58a26446238e8cccf77866e5a591540b3384870b25fbe64736f6c63430007050033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000065f7ba4ec257af7c55fd5854e5f6356bbd0fb8ec0000000000000000000000005aa653a076c1dbb47cec8c1b4d152444cad9194100000000000000000000000001d3348601968ab85b4bb028979006eac235a588000000000000000000000000b9431e19b29b952d9358025f680077c3fd37292f
-----Decoded View---------------
Arg [0] : safetyModule (address): 0x65f7BA4Ec257AF7c55fd5854E5f6356bBd0fb8EC
Arg [1] : liquidityStaking (address): 0x5Aa653A076c1dbB47cec8C1B4d152444CAD91941
Arg [2] : merkleDistributor (address): 0x01d3348601968aB85b4bb028979006eac235a588
Arg [3] : rewardsTreasuryVester (address): 0xb9431E19B29B952d9358025f680077C3Fd37292f
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000065f7ba4ec257af7c55fd5854e5f6356bbd0fb8ec
Arg [1] : 0000000000000000000000005aa653a076c1dbb47cec8c1b4d152444cad91941
Arg [2] : 00000000000000000000000001d3348601968ab85b4bb028979006eac235a588
Arg [3] : 000000000000000000000000b9431e19b29b952d9358025f680077c3fd37292f
Loading...
Loading
Loading...
Loading
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.