Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x7A527d8bB09f7D70C148aB5DE919e9BF68a0d769
Balance 0 ETH
Nonce 1
Code Size 5158 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5158 bytes
0x608060405234801561001057600080fd5b50600436106101585760003560e01c80637dff9def116100c3578063cb22356b1161007c578063cb22356b14610328578063cc64278414610331578063cc7554eb14610354578063d59ba0df14610367578063d6c643bf1461037a578063e4fc6b6d1461038e57600080fd5b80637dff9def146102a25780638da5cb5b146102b557806396ce0795146102d05780639e8bc92a146102e7578063b3a408b8146102fa578063ba1294b81461031557600080fd5b806359af11211161011557806359af1121146102205780635d7a087a1461023b5780635e4fd5881461024e578063614f018814610261578063701fa59f146102745780637d4234461461028757600080fd5b806338f16d281461015d5780633d6955f31461017f5780633fa414ae146101b25780634707d000146101d55780634b5e4723146101ea57806354aa247414610205575b600080fd5b60065461016a9060ff1681565b60405190151581526020015b60405180910390f35b61019a738f55d7c21bdff1a51afaa60f3de7590222a3181e81565b6040516001600160a01b039091168152602001610176565b61016a6101c0366004611199565b60056020526000908152604090205460ff1681565b6101e86101e33660046111b4565b610396565b005b61019a73feef77d3f69374f66429c91d732a244f074bdf7481565b61019a7372a19342e8f1838460ebfccef09f6585e32db86e81565b61019a734f3ad55d7b884cdc48add1e2451a13af17887f2681565b60025461019a906001600160a01b031681565b6101e861025c3660046111f8565b6104dc565b6101e861026f3660046111f8565b610580565b6101e861028236600461122f565b61061c565b61019a733432b6a60d23ca0dfca7761b7ab56459d9c964d081565b60035461019a906001600160a01b031681565b61019a73a3c5a1e09150b75ff251c1a7815a07182c3de2fb81565b6102d961271081565b604051908152602001610176565b60015461019a906001600160a01b031681565b61019a73c9acb83ada68413a6aa57007bc720ee2e2b3c46d81565b6101e8610323366004611278565b6106d4565b6102d960005481565b61016a61033f366004611199565b60046020526000908152604090205460ff1681565b6101e8610362366004611295565b61071a565b6101e86103753660046111f8565b6107c4565b60025461016a90600160a01b900460ff1681565b6101e8610856565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb146103d25760405162461bcd60e51b81526004016103c9906112ae565b60405180910390fd5b6001600160a01b038216733432b6a60d23ca0dfca7761b7ab56459d9c964d01480159061041c57506001600160a01b03821673feef77d3f69374f66429c91d732a244f074bdf7414155b6104565760405162461bcd60e51b815260206004820152600b60248201526a1b9bdd08185b1b1bddd95960aa1b60448201526064016103c9565b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a0823190602401602060405180830381865afa15801561049d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c191906112cd565b90506104d76001600160a01b0384168383610ef6565b505050565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb1461050f5760405162461bcd60e51b81526004016103c9906112ae565b600180546001600160a01b0319166001600160a01b038416908117909155600081815260056020908152604091829020805460ff191685151517905590519182527f461996323e23ab61116a2777b6ee97c0615ae9506e7e41e4d6c3cf7bac35942b91015b60405180910390a15050565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb146105b35760405162461bcd60e51b81526004016103c9906112ae565b600380546001600160a01b0319166001600160a01b038416908117909155600081815260056020908152604091829020805460ff191685151517905590519182527f9a4447c0e144bdfd23b1248f384d3b39c922b8a0166b19a717808fb432bceb789101610574565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb1461064f5760405162461bcd60e51b81526004016103c9906112ae565b600280546001600160a01b0319166001600160a01b0385169081178255600081815260056020908152604091829020805460ff1916871515179055835460ff60a01b1916600160a01b8615150217909355519081527ff063aafdd31bb6a1be320f6f82fea856f315d6eb29a917b7439f55a9e0cfffa3910160405180910390a1505050565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb146107075760405162461bcd60e51b81526004016103c9906112ae565b6006805460ff1916911515919091179055565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb1461074d5760405162461bcd60e51b81526004016103c9906112ae565b60648111156107895760405162461bcd60e51b81526020600482015260086024820152670e8dede40d0d2ced60c31b60448201526064016103c9565b60008190556040518181527fcedf00ec0a123bbc45a7b7e99ea73ee5fb9d8ec2600c163453355aa1f57ca15b9060200160405180910390a150565b3373a3c5a1e09150b75ff251c1a7815a07182c3de2fb146107f75760405162461bcd60e51b81526004016103c9906112ae565b6001600160a01b038216600081815260046020908152604091829020805460ff191685151590811790915591519182527f3bb4fb70bcd6f2a6c7b656049bb6f5ea7c3abc5e6f9aa7d72c621b082938174a910160405180910390a25050565b60065460ff1615610890573360009081526004602052604090205460ff166108905760405162461bcd60e51b81526004016103c9906112ae565b6040516370a0823160e01b8152306004820152600090733432b6a60d23ca0dfca7761b7ab56459d9c964d0906370a0823190602401602060405180830381865afa1580156108e2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090691906112cd565b905060006127106000548361091b91906112fc565b610925919061131b565b9050610931818361133d565b9150600073c9acb83ada68413a6aa57007bc720ee2e2b3c46d6001600160a01b03166313114a9d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab91906112cd565b905060008173c9acb83ada68413a6aa57007bc720ee2e2b3c46d6001600160a01b0316632b0166df6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2691906112cd565b610a3090866112fc565b610a3a919061131b565b905060008273c9acb83ada68413a6aa57007bc720ee2e2b3c46d6001600160a01b031663fd1067746040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab591906112cd565b610abf90876112fc565b610ac9919061131b565b90508315610af057610af0733432b6a60d23ca0dfca7761b7ab56459d9c964d03386610ef6565b600082118015610b095750600254600160a01b900460ff165b15610bfe57604051639a40832160e01b81526004810183905260016024820152738f55d7c21bdff1a51afaa60f3de7590222a3181e90639a40832190604401600060405180830381600087803b158015610b6257600080fd5b505af1158015610b76573d6000803e3d6000fd5b505060405163b66503cf60e01b815273feef77d3f69374f66429c91d732a244f074bdf746004820152602481018590527372a19342e8f1838460ebfccef09f6585e32db86e925063b66503cf9150604401600060405180830381600087803b158015610be157600080fd5b505af1158015610bf5573d6000803e3d6000fd5b50505050610cbc565b8115610cbc57600254610c3090733432b6a60d23ca0dfca7761b7ab56459d9c964d0906001600160a01b031684610ef6565b6002546001600160a01b031660009081526005602052604090205460ff1615610cbc57600260009054906101000a90046001600160a01b03166001600160a01b031663ba69ebed6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610ca357600080fd5b505af1158015610cb7573d6000803e3d6000fd5b505050505b8015610d7a57600154610cee90733432b6a60d23ca0dfca7761b7ab56459d9c964d0906001600160a01b031683610ef6565b6001546001600160a01b031660009081526005602052604090205460ff1615610d7a57600160009054906101000a90046001600160a01b03166001600160a01b031663ba69ebed6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610d6157600080fd5b505af1158015610d75573d6000803e3d6000fd5b505050505b6003546040516370a0823160e01b8152306004820152610e1a916001600160a01b031690733432b6a60d23ca0dfca7761b7ab56459d9c964d0906370a0823190602401602060405180830381865afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe91906112cd565b733432b6a60d23ca0dfca7761b7ab56459d9c964d09190610ef6565b6003546001600160a01b031660009081526005602052604090205460ff1615610ea657600360009054906101000a90046001600160a01b03166001600160a01b031663ba69ebed6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e8d57600080fd5b505af1158015610ea1573d6000803e3d6000fd5b505050505b604051858152733432b6a60d23ca0dfca7761b7ab56459d9c964d0907fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece0869060200160405180910390a25050505050565b604080516001600160a01b03848116602483015260448083018590528351808403909101815260649092018352602080830180516001600160e01b031663a9059cbb60e01b17905283518085019094528084527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564908401526104d792869291600091610f86918516908490611003565b8051909150156104d75780806020019051810190610fa49190611354565b6104d75760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b60648201526084016103c9565b6060611012848460008561101c565b90505b9392505050565b60608247101561107d5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b60648201526084016103c9565b843b6110cb5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103c9565b600080866001600160a01b031685876040516110e791906113a1565b60006040518083038185875af1925050503d8060008114611124576040519150601f19603f3d011682016040523d82523d6000602084013e611129565b606091505b5091509150611139828286611144565b979650505050505050565b60608315611153575081611015565b8251156111635782518084602001fd5b8160405162461bcd60e51b81526004016103c991906113bd565b80356001600160a01b038116811461119457600080fd5b919050565b6000602082840312156111ab57600080fd5b6110158261117d565b600080604083850312156111c757600080fd5b6111d08361117d565b91506111de6020840161117d565b90509250929050565b80151581146111f557600080fd5b50565b6000806040838503121561120b57600080fd5b6112148361117d565b91506020830135611224816111e7565b809150509250929050565b60008060006060848603121561124457600080fd5b61124d8461117d565b9250602084013561125d816111e7565b9150604084013561126d816111e7565b809150509250925092565b60006020828403121561128a57600080fd5b8135611015816111e7565b6000602082840312156112a757600080fd5b5035919050565b602080825260059082015264042c2eae8d60db1b604082015260600190565b6000602082840312156112df57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611316576113166112e6565b500290565b60008261133857634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561134f5761134f6112e6565b500390565b60006020828403121561136657600080fd5b8151611015816111e7565b60005b8381101561138c578181015183820152602001611374565b8381111561139b576000848401525b50505050565b600082516113b3818460208701611371565b9190910192915050565b60208152600082518060208401526113dc816040850160208701611371565b601f01601f1916919091016040019291505056fea264697066735822122026e16ee2d4c8bb237c18c111dd20f50d6f1f7b56366c983539e4a42d7a59b91264736f6c634300080a0033

Verified Source Code Partial Match

Compiler: v0.8.10+commit.fc410830 EVM: london Optimization: Yes (200 runs)
FeeDepositV2.sol 153 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

import "./interfaces/IFxsDepositor.sol";
import "./interfaces/IFeeRegistry.sol";
import "./interfaces/IRewards.sol";
import "./interfaces/IFeeReceiver.sol";
import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol';



contract FeeDepositV2 {
    using SafeERC20 for IERC20;

    //tokens
    address public constant fxs = address(0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0);
    address public constant cvxFxs = address(0xFEEf77d3f69374f66429C91d732A244f074bdf74);

    //convex addresses
    address public constant cvxFxsPoolStash = address(0x4f3AD55D7b884CDC48ADD1e2451A13af17887F26);
    address public constant fxsDeposit = address(0x8f55d7c21bDFf1A51AFAa60f3De7590222A3181e);
    address public constant feeRegistry = address(0xC9aCB83ADa68413a6Aa57007BC720EE2E2b3C46D);
    address public constant vlcvx = address(0x72a19342e8F1838460eBFCCEf09F6585e32db86E);
    
    address public constant owner = address(0xa3C5A1e09150B75ff251c1a7815A07182c3de2FB);

    uint256 public constant denominator = 10000;
    uint256 public callIncentive = 100;
    address public platformReceiver;
    address public vlcvxReceiver;
    bool public convertVlcvxRewards;
    address public cvxfxsReceiver;

    mapping(address => bool) public distributors;
    mapping(address => bool) public requireProcessing;
    bool public UseDistributors = true;

    event SetCallIncentive(uint256 _amount);
    event SetPlatformReceiver(address _account);
    event SetVlcvxReceiver(address _account);
    event SetCvxFxsReceiver(address _account);
    event AddDistributor(address indexed _distro, bool _valid);
    event RewardsDistributed(address indexed token, uint256 amount);

    constructor() {
        distributors[msg.sender] = true;
        IERC20(fxs).approve(fxsDeposit, type(uint256).max);
        IERC20(cvxFxs).approve(vlcvx, type(uint256).max);
    }

    function setCallIncentive(uint256 _incentive) external {
        require(msg.sender == owner, "!auth");
        require(_incentive <= 100, "too high");
        callIncentive = _incentive;
        emit SetCallIncentive(_incentive);
    }

    function setPlatformReceiver(address _receiver, bool _requireProcess) external {
        require(msg.sender == owner, "!auth");
        platformReceiver = _receiver;
        requireProcessing[_receiver] = _requireProcess;
        emit SetPlatformReceiver(_receiver);
    }

    function setVlcvxReceiver(address _receiver, bool _requireProcess, bool _convert) external {
        require(msg.sender == owner, "!auth");
        vlcvxReceiver = _receiver;
        requireProcessing[_receiver] = _requireProcess;
        convertVlcvxRewards = _convert;
        emit SetVlcvxReceiver(_receiver);
    }

    function setCvxFxsReceiver(address _receiver, bool _requireProcess) external {
        require(msg.sender == owner, "!auth");
        cvxfxsReceiver = _receiver;
        requireProcessing[_receiver] = _requireProcess;
        emit SetCvxFxsReceiver(_receiver);
    }

    function setDistributor(address _distro, bool _valid) external {
        require(msg.sender == owner, "!auth");
        distributors[_distro] = _valid;
        emit AddDistributor(_distro, _valid);
    }

    function setUseDistributorList(bool _use) external {
        require(msg.sender == owner, "!auth");
        UseDistributors = _use;
    }

    function rescueToken(address _token, address _to) external {
        require(msg.sender == owner, "!auth");
        require(_token != fxs && _token != cvxFxs, "not allowed");

        uint256 bal = IERC20(_token).balanceOf(address(this));
        IERC20(_token).safeTransfer(_to, bal);
    }

    function distribute() external {
        if(UseDistributors){
            require(distributors[msg.sender], "!auth");
        }

        uint256 fxsbalance = IERC20(fxs).balanceOf(address(this));
        uint256 incentiveAmount = fxsbalance * callIncentive / denominator;

        //remove call incentive first
        fxsbalance -= incentiveAmount;

        //get reward amounts
        uint256 totalFees = IFeeRegistry(feeRegistry).totalFees();
        uint256 cvxRewards = fxsbalance * IFeeRegistry(feeRegistry).cvxIncentive() / totalFees;
        uint256 platformRewards = fxsbalance * IFeeRegistry(feeRegistry).platformIncentive() / totalFees;
        

        //process distro fees
        if(incentiveAmount > 0){
            IERC20(fxs).safeTransfer(msg.sender, incentiveAmount);
        }

        //process vlcvx rewards
        if(cvxRewards > 0 && convertVlcvxRewards){
            //convert to cvxfxs
            IFxsDepositor(fxsDeposit).deposit(cvxRewards, true);
            //send to vlcvx
            IRewards(vlcvx).notifyRewardAmount(cvxFxs, cvxRewards);
        }else if(cvxRewards > 0){
            //vanilla transfer
            IERC20(fxs).safeTransfer(vlcvxReceiver, cvxRewards);
            if(requireProcessing[vlcvxReceiver]){
                IFeeReceiver(vlcvxReceiver).processFees();
            }
        }

        //process platform rewards
        if(platformRewards > 0){
            IERC20(fxs).safeTransfer(platformReceiver, platformRewards);
            if(requireProcessing[platformReceiver]){
                IFeeReceiver(platformReceiver).processFees();
            }
        }

        //send rest to cvxfxs incentives
        IERC20(fxs).safeTransfer(cvxfxsReceiver, IERC20(fxs).balanceOf(address(this)));
        if(requireProcessing[cvxfxsReceiver]){
            IFeeReceiver(cvxfxsReceiver).processFees();
        }

        emit RewardsDistributed(fxs, fxsbalance);
    }

}
IRewards.sol 26 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IRewards{
    struct EarnedData {
        address token;
        uint256 amount;
    }
    
    function initialize(uint256 _pid, bool _startActive) external;
    function addReward(address _rewardsToken, address _distributor) external;
    function approveRewardDistributor(
        address _rewardsToken,
        address _distributor,
        bool _approved
    ) external;
    function deposit(address _owner, uint256 _amount) external;
    function withdraw(address _owner, uint256 _amount) external;
    function getReward(address _forward) external;
    function notifyRewardAmount(address _rewardsToken, uint256 _reward) external;
    function balanceOf(address account) external view returns (uint256);
    function claimableRewards(address _account) external view returns(EarnedData[] memory userRewards);
    function rewardTokens(uint256 _rid) external view returns (address);
    function rewardTokenLength() external view returns(uint256);
    function active() external view returns(bool);
}
IFxsDepositor.sol 6 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IFxsDepositor {
   function deposit(uint256 _amount, bool _lock) external;
}
IFeeRegistry.sol 12 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IFeeRegistry{
    function cvxfxsIncentive() external view returns(uint256);
    function cvxIncentive() external view returns(uint256);
    function platformIncentive() external view returns(uint256);
    function totalFees() external view returns(uint256);
    function maxFees() external view returns(uint256);
    function feeDeposit() external view returns(address);
    function getFeeDepositor(address _from) external view returns(address);
}
IFeeReceiver.sol 6 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;

interface IFeeReceiver {
   function processFees() external;
}
Address.sol 216 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}
SafeERC20.sol 98 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}
IERC20.sol 81 lines
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

Read Contract

UseDistributors 0x38f16d28 → bool
callIncentive 0xcb22356b → uint256
convertVlcvxRewards 0xd6c643bf → bool
cvxFxs 0x4b5e4723 → address
cvxFxsPoolStash 0x59af1121 → address
cvxfxsReceiver 0x7dff9def → address
denominator 0x96ce0795 → uint256
distributors 0xcc642784 → bool
feeRegistry 0xb3a408b8 → address
fxs 0x7d423446 → address
fxsDeposit 0x3d6955f3 → address
owner 0x8da5cb5b → address
platformReceiver 0x9e8bc92a → address
requireProcessing 0x3fa414ae → bool
vlcvx 0x54aa2474 → address
vlcvxReceiver 0x5d7a087a → address

Write Contract 8 functions

These functions modify contract state and require a wallet transaction to execute.

distribute 0xe4fc6b6d
No parameters
rescueToken 0x4707d000
address _token
address _to
setCallIncentive 0xcc7554eb
uint256 _incentive
setCvxFxsReceiver 0x614f0188
address _receiver
bool _requireProcess
setDistributor 0xd59ba0df
address _distro
bool _valid
setPlatformReceiver 0x5e4fd588
address _receiver
bool _requireProcess
setUseDistributorList 0xba1294b8
bool _use
setVlcvxReceiver 0x701fa59f
address _receiver
bool _requireProcess
bool _convert

Recent Transactions

No transactions found for this address