Contract Address Details

0x901493C71a3c78F5a391076eA4369892E12bfCfb

Contract Name
BoostHandlerProxy
Creator
0xb29cd9–95beec at 0xc366cf–84f168
Balance
0 CRO ( )
Tokens
Fetching tokens...
Transactions
2 Transactions
Transfers
0 Transfers
Gas Used
67,886
Last Balance Update
13215134
Contract name:
BoostHandlerProxy




Optimization enabled
true
Compiler version
v0.6.12+commit.27d51765




Optimization runs
200
EVM Version
default




Verified at
2021-11-29T02:23:28.669589Z

Constructor Arguments

00000000000000000000000018c8a044115bb91e41d25735de41f372fee1df67

Arg [0] (address) : 0x18c8a044115bb91e41d25735de41f372fee1df67

              

Contract source code

pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: UNLICENSED


/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}


/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(_owner, address(0));
        _owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

interface IBoostHandler {

  //Returns ADDY earning boost based on user's veADDY, boost should be divided by 1e18
  function getBoost(address _user, address _vaultAddress) external view returns (uint256);

  //Returns ADDY earning boost based on user's veADDY if the user was to stake in vaultAddress, boost is divided by 1e18
  function getBoostForValueStaked(address _user, address _vaultAddress, uint256 valueStaked) external view returns (uint256);

  //Returns the value in USD for which a user's ADDY earnings are doubled
  function getDoubleLimit(address _user) external view returns (uint256 doubleLimit);

  //Returns the total VeAddy from all sources
  function getTotalVeAddy(address _user) external view returns (uint256);

  //Returns the total VeAddy from locking ADDY in the locked ADDY staking contract
  function getVeAddyFromLockedStaking(address _user) external view returns (uint256);

  function setFeeDist(address _feeDist) external;
}

//A proxy contract for the reward boost handler contract, so I can change the implementation over time
contract BoostHandlerProxy is Ownable, IBoostHandler {

    IBoostHandler public boostHandler;

    constructor(address _handler) public {
        boostHandler = IBoostHandler(_handler);
    }

    // **** Views **** //

    function getBoost(address _user, address _vaultAddress) external override view returns (uint256) {
        return boostHandler.getBoost(_user, _vaultAddress);
    }

    function getBoostForValueStaked(address _user, address _vaultAddress, uint256 valueStaked) external override view returns (uint256) {
        return boostHandler.getBoostForValueStaked(_user, _vaultAddress, valueStaked);
    }

    function getDoubleLimit(address _user) public override view returns (uint256 doubleLimit) {
        return boostHandler.getDoubleLimit(_user);
    }

    function getTotalVeAddy(address _user) external override view returns (uint256) {
        return boostHandler.getTotalVeAddy(_user);
    }

    function getVeAddyFromLockedStaking(address _user) external override view returns (uint256) {
        return boostHandler.getVeAddyFromLockedStaking(_user);
    }

    // **** State Mutations ****

    //used if a token migration happens, which would require a new fee dist contract
    function setFeeDist(address _feeDist) public override onlyOwner {
        boostHandler.setFeeDist(_feeDist);
        emit SetFeeDist(_feeDist);
    }

    function setBoostHandler(address _handler) public onlyOwner {
        boostHandler = IBoostHandler(_handler);
        emit SetHandler(_handler);
    }

    event SetHandler(address indexed handler);
    event SetFeeDist(address indexed feeDist);
}
        

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_handler","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetFeeDist","inputs":[{"type":"address","name":"feeDist","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SetHandler","inputs":[{"type":"address","name":"handler","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract IBoostHandler"}],"name":"boostHandler","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBoost","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"address","name":"_vaultAddress","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getBoostForValueStaked","inputs":[{"type":"address","name":"_user","internalType":"address"},{"type":"address","name":"_vaultAddress","internalType":"address"},{"type":"uint256","name":"valueStaked","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"doubleLimit","internalType":"uint256"}],"name":"getDoubleLimit","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getTotalVeAddy","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getVeAddyFromLockedStaking","inputs":[{"type":"address","name":"_user","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBoostHandler","inputs":[{"type":"address","name":"_handler","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeDist","inputs":[{"type":"address","name":"_feeDist","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
            

Deployed ByteCode

0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063715018a611610071578063715018a6146101275780638da5cb5b1461012f5780639e7497b314610137578063d4b1999e1461014a578063f2fde38b1461015d578063ff58a54b14610170576100a9565b8063053841d3146100ae57806318db03e3146100d757806323e9bb02146100ec5780634fc1743b146101015780635c58155f14610114575b600080fd5b6100c16100bc366004610672565b610183565b6040516100ce91906107e6565b60405180910390f35b6100df61020a565b6040516100ce9190610719565b6100ff6100fa366004610672565b610219565b005b6100c161010f3660046106c1565b6102fa565b6100c1610122366004610672565b610387565b6100ff6103b8565b6100df610441565b6100c1610145366004610672565b610450565b6100ff610158366004610672565b610481565b6100ff61016b366004610672565b61050a565b6100c161017e36600461068d565b6105ca565b60015460405163053841d360e01b81526000916001600160a01b03169063053841d3906101b4908590600401610719565b60206040518083038186803b1580156101cc57600080fd5b505afa1580156101e0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102049190610701565b92915050565b6001546001600160a01b031681565b610221610657565b6001600160a01b0316610232610441565b6001600160a01b0316146102615760405162461bcd60e51b8152600401610258906107b1565b60405180910390fd5b6001546040516311f4dd8160e11b81526001600160a01b03909116906323e9bb0290610291908490600401610719565b600060405180830381600087803b1580156102ab57600080fd5b505af11580156102bf573d6000803e3d6000fd5b50506040516001600160a01b03841692507fc4a9aa4ac80075adf715d6178b635ed847df3cf64f37c82bb53176ba7e7a63b19150600090a250565b600154604051634fc1743b60e01b81526000916001600160a01b031690634fc1743b9061032f90879087908790600401610747565b60206040518083038186803b15801561034757600080fd5b505afa15801561035b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061037f9190610701565b949350505050565b600154604051635c58155f60e01b81526000916001600160a01b031690635c58155f906101b4908590600401610719565b6103c0610657565b6001600160a01b03166103d1610441565b6001600160a01b0316146103f75760405162461bcd60e51b8152600401610258906107b1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b600154604051639e7497b360e01b81526000916001600160a01b031690639e7497b3906101b4908590600401610719565b610489610657565b6001600160a01b031661049a610441565b6001600160a01b0316146104c05760405162461bcd60e51b8152600401610258906107b1565b600180546001600160a01b0319166001600160a01b0383169081179091556040517fff2f24c7f31ba72c93e6105728b285876d4778b3a43cd9ab18232cfe16d23c6290600090a250565b610512610657565b6001600160a01b0316610523610441565b6001600160a01b0316146105495760405162461bcd60e51b8152600401610258906107b1565b6001600160a01b03811661056f5760405162461bcd60e51b81526004016102589061076b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600154604051600162a75ab560e01b031981526000916001600160a01b03169063ff58a54b90610600908690869060040161072d565b60206040518083038186803b15801561061857600080fd5b505afa15801561062c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106509190610701565b9392505050565b3390565b80356001600160a01b038116811461020457600080fd5b600060208284031215610683578081fd5b610650838361065b565b6000806040838503121561069f578081fd5b6106a9848461065b565b91506106b8846020850161065b565b90509250929050565b6000806000606084860312156106d5578081fd5b83356106e0816107ef565b925060208401356106f0816107ef565b929592945050506040919091013590565b600060208284031215610712578081fd5b5051919050565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b90815260200190565b6001600160a01b038116811461080457600080fd5b5056fea2646970667358221220aec32b29be625c19a07d3184d44e9bd38056106be108a3a3cf1caece41805f6d64736f6c634300060c0033