Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xeb80C515...23a353a55 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
RewardReader
Compiler Version
v0.6.12+commit.27d51765
Optimization Enabled:
Yes with 10 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import "../libraries/token/IERC20.sol"; import "../libraries/math/SafeMath.sol"; import "../staking/interfaces/IVester.sol"; import "../staking/interfaces/IRewardTracker.sol"; contract RewardReader { using SafeMath for uint256; function getDepositBalances(address _account, address[] memory _depositTokens, address[] memory _rewardTrackers) public view returns (uint256[] memory) { uint256[] memory amounts = new uint256[](_rewardTrackers.length); for (uint256 i = 0; i < _rewardTrackers.length; i++) { IRewardTracker rewardTracker = IRewardTracker(_rewardTrackers[i]); amounts[i] = rewardTracker.depositBalances(_account, _depositTokens[i]); } return amounts; } function getStakingInfo(address _account, address[] memory _rewardTrackers) public view returns (uint256[] memory) { uint256 propsLength = 5; uint256[] memory amounts = new uint256[](_rewardTrackers.length * propsLength); for (uint256 i = 0; i < _rewardTrackers.length; i++) { IRewardTracker rewardTracker = IRewardTracker(_rewardTrackers[i]); amounts[i * propsLength] = rewardTracker.claimable(_account); amounts[i * propsLength + 1] = rewardTracker.tokensPerInterval(); amounts[i * propsLength + 2] = rewardTracker.averageStakedAmounts(_account); amounts[i * propsLength + 3] = rewardTracker.cumulativeRewards(_account); amounts[i * propsLength + 4] = IERC20(_rewardTrackers[i]).totalSupply(); } return amounts; } function getVestingInfoV2(address _account, address[] memory _vesters) public view returns (uint256[] memory) { uint256 propsLength = 12; uint256[] memory amounts = new uint256[](_vesters.length * propsLength); for (uint256 i = 0; i < _vesters.length; i++) { IVester vester = IVester(_vesters[i]); IRewardTracker rewardTracker = IRewardTracker(vester.rewardTracker()); amounts[i * propsLength] = vester.pairAmounts(_account); amounts[i * propsLength + 1] = vester.getVestedAmount(_account); amounts[i * propsLength + 2] = IERC20(_vesters[i]).balanceOf(_account); amounts[i * propsLength + 3] = vester.claimedAmounts(_account); amounts[i * propsLength + 4] = vester.claimable(_account); amounts[i * propsLength + 5] = vester.getMaxVestableAmount(_account); amounts[i * propsLength + 6] = vester.getCombinedAverageStakedAmount(_account); amounts[i * propsLength + 7] = rewardTracker.cumulativeRewards(_account); amounts[i * propsLength + 8] = vester.transferredCumulativeRewards(_account); amounts[i * propsLength + 9] = vester.bonusRewards(_account); amounts[i * propsLength + 10] = rewardTracker.averageStakedAmounts(_account); amounts[i * propsLength + 11] = vester.transferredAverageStakedAmounts(_account); } return amounts; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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) { 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; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IRewardTracker { function depositBalances(address _account, address _depositToken) external view returns (uint256); function stakedAmounts(address _account) external view returns (uint256); function updateRewards() external; function stake(address _depositToken, uint256 _amount) external; function stakeForAccount(address _fundingAccount, address _account, address _depositToken, uint256 _amount) external; function unstake(address _depositToken, uint256 _amount) external; function unstakeForAccount(address _account, address _depositToken, uint256 _amount, address _receiver) external; function tokensPerInterval() external view returns (uint256); function claim(address _receiver) external returns (uint256); function claimForAccount(address _account, address _receiver) external returns (uint256); function claimable(address _account) external view returns (uint256); function averageStakedAmounts(address _account) external view returns (uint256); function cumulativeRewards(address _account) external view returns (uint256); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IVester { function rewardTracker() external view returns (address); function claimForAccount(address _account, address _receiver) external returns (uint256); function claimable(address _account) external view returns (uint256); function cumulativeClaimAmounts(address _account) external view returns (uint256); function claimedAmounts(address _account) external view returns (uint256); function pairAmounts(address _account) external view returns (uint256); function getVestedAmount(address _account) external view returns (uint256); function transferredAverageStakedAmounts(address _account) external view returns (uint256); function transferredCumulativeRewards(address _account) external view returns (uint256); function cumulativeRewardDeductions(address _account) external view returns (uint256); function bonusRewards(address _account) external view returns (uint256); function transferStakeValues(address _sender, address _receiver) external; function setTransferredAverageStakedAmounts(address _account, uint256 _amount) external; function setTransferredCumulativeRewards(address _account, uint256 _amount) external; function setCumulativeRewardDeductions(address _account, uint256 _amount) external; function setBonusRewards(address _account, uint256 _amount) external; function getMaxVestableAmount(address _account) external view returns (uint256); function getCombinedAverageStakedAmount(address _account) external view returns (uint256); }
{ "optimizer": { "enabled": true, "runs": 10 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address[]","name":"_depositTokens","type":"address[]"},{"internalType":"address[]","name":"_rewardTrackers","type":"address[]"}],"name":"getDepositBalances","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address[]","name":"_rewardTrackers","type":"address[]"}],"name":"getStakingInfo","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"address[]","name":"_vesters","type":"address[]"}],"name":"getVestingInfoV2","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063575157e414610046578063937a0be8146101c9578063e1fc2a381461027a575b600080fd5b6101796004803603606081101561005c57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561008657600080fd5b82018360208201111561009857600080fd5b803590602001918460208302840111600160201b831117156100b957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561010857600080fd5b82018360208201111561011a57600080fd5b803590602001918460208302840111600160201b8311171561013b57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061032b945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101b557818101518382015260200161019d565b505050509050019250505060405180910390f35b610179600480360360408110156101df57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561020957600080fd5b82018360208201111561021b57600080fd5b803590602001918460208302840111600160201b8311171561023c57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061045e945050505050565b6101796004803603604081101561029057600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156102ba57600080fd5b8201836020820111156102cc57600080fd5b803590602001918460208302840111600160201b831117156102ed57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506107ba945050505050565b60608082516001600160401b038111801561034557600080fd5b5060405190808252806020026020018201604052801561036f578160200160208202803683370190505b50905060005b835181101561045557600084828151811061038c57fe5b60200260200101519050806001600160a01b031663f5d9d63e888885815181106103b257fe5b60200260200101516040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b031681526020019250505060206040518083038186803b15801561040757600080fd5b505afa15801561041b573d6000803e3d6000fd5b505050506040513d602081101561043157600080fd5b5051835184908490811061044157fe5b602090810291909101015250600101610375565b50949350505050565b60606000600590506060818451026001600160401b038111801561048157600080fd5b506040519080825280602002602001820160405280156104ab578160200160208202803683370190505b50905060005b84518110156104555760008582815181106104c857fe5b60200260200101519050806001600160a01b031663402914f5886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561051f57600080fd5b505afa158015610533573d6000803e3d6000fd5b505050506040513d602081101561054957600080fd5b50518351849084870290811061055b57fe5b602002602001018181525050806001600160a01b031663a8d936276040518163ffffffff1660e01b815260040160206040518083038186803b1580156105a057600080fd5b505afa1580156105b4573d6000803e3d6000fd5b505050506040513d60208110156105ca57600080fd5b5051835184906001858802019081106105df57fe5b602002602001018181525050806001600160a01b031663a3180217886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561063857600080fd5b505afa15801561064c573d6000803e3d6000fd5b505050506040513d602081101561066257600080fd5b50518351849060028588020190811061067757fe5b602002602001018181525050806001600160a01b0316633792def3886040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b1580156106d057600080fd5b505afa1580156106e4573d6000803e3d6000fd5b505050506040513d60208110156106fa57600080fd5b50518351849060038588020190811061070f57fe5b60200260200101818152505085828151811061072757fe5b60200260200101516001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561076757600080fd5b505afa15801561077b573d6000803e3d6000fd5b505050506040513d602081101561079157600080fd5b5051835184906004858802019081106107a657fe5b6020908102919091010152506001016104b1565b60606000600c90506060818451026001600160401b03811180156107dd57600080fd5b50604051908082528060200260200182016040528015610807578160200160208202803683370190505b50905060005b845181101561045557600085828151811061082457fe5b602002602001015190506000816001600160a01b0316636bcb411a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561086957600080fd5b505afa15801561087d573d6000803e3d6000fd5b505050506040513d602081101561089357600080fd5b505160408051635d50e72960e01b81526001600160a01b038b81166004830152915192935090841691635d50e72991602480820192602092909190829003018186803b1580156108e257600080fd5b505afa1580156108f6573d6000803e3d6000fd5b505050506040513d602081101561090c57600080fd5b50518451859085880290811061091e57fe5b602002602001018181525050816001600160a01b031663d5a73fdd896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561097757600080fd5b505afa15801561098b573d6000803e3d6000fd5b505050506040513d60208110156109a157600080fd5b5051845185906001868902019081106109b657fe5b6020026020010181815250508683815181106109ce57fe5b60200260200101516001600160a01b03166370a08231896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610a2257600080fd5b505afa158015610a36573d6000803e3d6000fd5b505050506040513d6020811015610a4c57600080fd5b505184518590600286890201908110610a6157fe5b602002602001018181525050816001600160a01b03166371417b32896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610aba57600080fd5b505afa158015610ace573d6000803e3d6000fd5b505050506040513d6020811015610ae457600080fd5b505184518590600386890201908110610af957fe5b602002602001018181525050816001600160a01b031663402914f5896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610b5257600080fd5b505afa158015610b66573d6000803e3d6000fd5b505050506040513d6020811015610b7c57600080fd5b505184518590600486890201908110610b9157fe5b602002602001018181525050816001600160a01b03166308f26c76896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610bea57600080fd5b505afa158015610bfe573d6000803e3d6000fd5b505050506040513d6020811015610c1457600080fd5b505184518590600586890201908110610c2957fe5b602002602001018181525050816001600160a01b03166345f01ee6896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610c8257600080fd5b505afa158015610c96573d6000803e3d6000fd5b505050506040513d6020811015610cac57600080fd5b505184518590600686890201908110610cc157fe5b602002602001018181525050806001600160a01b0316633792def3896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610d1a57600080fd5b505afa158015610d2e573d6000803e3d6000fd5b505050506040513d6020811015610d4457600080fd5b505184518590600786890201908110610d5957fe5b602002602001018181525050816001600160a01b031663b71bce2a896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610db257600080fd5b505afa158015610dc6573d6000803e3d6000fd5b505050506040513d6020811015610ddc57600080fd5b505184518590600886890201908110610df157fe5b602002602001018181525050816001600160a01b031663a2545fa5896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610e4a57600080fd5b505afa158015610e5e573d6000803e3d6000fd5b505050506040513d6020811015610e7457600080fd5b505184518590600986890201908110610e8957fe5b602002602001018181525050806001600160a01b031663a3180217896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610ee257600080fd5b505afa158015610ef6573d6000803e3d6000fd5b505050506040513d6020811015610f0c57600080fd5b505184518590600a86890201908110610f2157fe5b602002602001018181525050816001600160a01b0316637337035c896040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015610f7a57600080fd5b505afa158015610f8e573d6000803e3d6000fd5b505050506040513d6020811015610fa457600080fd5b505184518590600b86890201908110610fb957fe5b6020908102919091010152505060010161080d56fea2646970667358221220de02b1bbd1f469717489309c9ba13a68f237a459dba7a9b2c51feced70e8b0ca64736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.