Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xe1d5181F0DD039aA4f695d4939d682C4cF874086
Balance 0 ETH
Nonce 1
Code Size 5476 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

5476 bytes
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c8063573059201161010f578063961d45c4116100a2578063dd2d2a1211610071578063dd2d2a121461049b578063f00df8b8146104be578063f752fdc3146104ea578063fe4f58901461050d576101e5565b8063961d45c41461043f578063a087163714610447578063b7ae03c01461046a578063d6e882dc14610472576101e5565b80636a146024116100de5780636a146024146103d85780637128b405146103e05780637f1681001461041157806394f3f81d14610419576101e5565b806357305920146103785780635a97f13a1461038057806361d027b3146103885780636614f010146103ac576101e5565b80633425677e1161018757806346f3e81c1161015657806346f3e81c146103135780634f8551421461033057806354f363a31461034d578063552033c414610370576101e5565b80633425677e1461029d57806335b28153146102a55780633c8bb3e6146102cd5780633ef5e445146102f0576101e5565b8063165c4a16116101c3578063165c4a16146102445780631efc0a3d1461026757806324ba58841461026f5780632cc138be14610295576101e5565b806303d11f62146101ea578063056640b7146102045780631021344714610227575b600080fd5b6101f2610530565b60408051918252519081900360200190f35b6101f26004803603604081101561021a57600080fd5b5080359060200135610536565b6101f26004803603602081101561023d57600080fd5b503561055e565b6101f26004803603604081101561025a57600080fd5b5080359060200135610574565b6101f26105d9565b6101f26004803603602081101561028557600080fd5b50356001600160a01b03166105df565b6101f26105f1565b6101f26105f7565b6102cb600480360360208110156102bb57600080fd5b50356001600160a01b031661068e565b005b6101f2600480360360408110156102e357600080fd5b508035906020013561072e565b6101f26004803603604081101561030657600080fd5b5080359060200135610743565b6101f26004803603602081101561032957600080fd5b503561079b565b6101f26004803603602081101561034657600080fd5b50356107b3565b6101f26004803603604081101561036357600080fd5b50803590602001356107c5565b6101f2610816565b6101f2610826565b6101f261082c565b610390610832565b604080516001600160a01b039092168252519081900360200190f35b6102cb600480360360408110156103c257600080fd5b50803590602001356001600160a01b0316610841565b6101f261099b565b6103fd600480360360208110156103f657600080fd5b50356109a7565b604080519115158252519081900360200190f35b6101f26109bc565b6102cb6004803603602081101561042f57600080fd5b50356001600160a01b03166109c2565b610390610a61565b6101f26004803603604081101561045d57600080fd5b5080359060200135610a70565b6101f2610a89565b6101f26004803603606081101561048857600080fd5b5080359060208101359060400135610ab8565b6101f2600480360360408110156104b157600080fd5b5080359060200135610b76565b6102cb600480360360408110156104d457600080fd5b50803590602001356001600160a01b0316610b8f565b6101f26004803603604081101561050057600080fd5b5080359060200135610eee565b6102cb6004803603604081101561052357600080fd5b5080359060200135610f03565b60045481565b60006b033b2e3c9fd0803ce800000061054f8484610574565b8161055657fe5b049392505050565b600061056e82633b9aca00610574565b92915050565b600081158061058f5750508082028282828161058c57fe5b04145b61056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6d756c2d6f766572666c6f7760501b604482015290519081900360640190fd5b60065481565b60006020819052908152604090205481565b60075481565b600254604080516375ad331760e11b81523060048201528151600093849384936001600160a01b039092169263eb5a662e926024808201939291829003018186803b15801561064557600080fd5b505afa158015610659573d6000803e3d6000fd5b505050506040513d604081101561066f57600080fd5b50805160209091015190925090506106878282610b76565b9250505090565b336000908152602081905260409020546001146106dc5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166000818152602081815260409182902060019055815192835290517f599a298163e1678bb1c676052a8930bf0b8a1261ed6e01b8a2391e55f70001029281900390910190a150565b6000670de0b6b3a764000061054f8484610574565b8082038281111561056e576040805162461bcd60e51b815260206004820152601760248201527f75696e742d75696e742d7375622d756e646572666c6f77000000000000000000604482015290519081900360640190fd5b600061056e826b033b2e3c9fd0803ce8000000610574565b60096020526000908152604090205481565b8181018281101561056e576040805162461bcd60e51b815260206004820152601660248201527575696e742d75696e742d6164642d6f766572666c6f7760501b604482015290519081900360640190fd5b6b033b2e3c9fd0803ce800000081565b60015481565b60035481565b6002546001600160a01b031681565b3360009081526020819052604090205460011461088f5760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b0381166108ea576040805162461bcd60e51b815260206004820152601e60248201527f44656274506f70706572526577617264732f6e756c6c2d616464726573730000604482015290519081900360640190fd5b8167747265617375727960c01b141561091d57600280546001600160a01b0319166001600160a01b038316179055610954565b60405162461bcd60e51b815260040180806020018281038252602b815260200180611325602b913960400191505060405180910390fd5b604080518381526001600160a01b038316602082015281517fd91f38cf03346b5dc15fb60f9076f866295231ad3c3841a1051f8443f25170d1929181900390910190a15050565b670de0b6b3a764000081565b60086020526000908152604090205460ff1681565b60055481565b33600090815260208190526040902054600114610a105760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b6001600160a01b03811660008181526020818152604080832092909255815192835290517f8834a87e641e9716be4f34527af5d23e11624f1ddeefede6ad75a9acfc31b9039281900390910190a150565b600a546001600160a01b031681565b60008161054f846b033b2e3c9fd0803ce8000000610574565b6000610ab36001546b033b2e3c9fd0803ce8000000610aa66105f7565b81610aad57fe5b04610b76565b905090565b6000838015610b5857600184168015610ad357859250610ad7565b8392505b50600283046002850494505b8415610b52578586028687820414610afa57600080fd5b81810181811015610b0a57600080fd5b8590049650506001851615610b47578583028387820414158715151615610b3057600080fd5b81810181811015610b4057600080fd5b8590049350505b600285049450610ae3565b50610b6e565b838015610b685760009250610b6c565b8392505b505b509392505050565b600081831115610b865781610b88565b825b9392505050565b600754821015610bd05760405162461bcd60e51b815260040180806020018281038252602f81526020018061146a602f913960400191505060405180910390fd5b428210610c0e5760405162461bcd60e51b815260040180806020018281038252602e8152602001806114d7602e913960400191505060405180910390fd5b600354421015610c65576040805162461bcd60e51b815260206004820152601b60248201527f44656274506f70706572526577617264732f776169742d6d6f72650000000000604482015290519081900360640190fd5b42610c72836005546107c5565b1015610caf5760405162461bcd60e51b81526004018080602001828103825260268152602001806114446026913960400191505060405180910390fd5b600a546040805163a710368760e01b815260048101859052905133926001600160a01b03169163a7103687916024808301926020929190829003018186803b158015610cfa57600080fd5b505afa158015610d0e573d6000803e3d6000fd5b505050506040513d6020811015610d2457600080fd5b50516001600160a01b031614610d6b5760405162461bcd60e51b815260040180806020018281038252602181526020018061137d6021913960400191505060405180910390fd5b60008281526008602052604090205460ff1615610db95760405162461bcd60e51b81526004018080602001828103825260268152602001806113e46026913960400191505060405180910390fd5b600154610dc4610a89565b1015610e015760405162461bcd60e51b815260040180806020018281038252602a815260200180611505602a913960400191505060405180910390fd5b6000828152600860209081526040808320805460ff191660019081179091556003548452600990925290912054610e37916107c5565b600380546000908152600960205260408082209390935560065491548152919091205410610ea357610e6b426004546107c5565b600381905560408051918252517f18e5b1121d12dad34617b8f2514a72628cd1b47fcada4d788998bba364a089539181900360200190a15b60015460408051848152602081019290925280517f7695772d0016f0b49a2e953420acae6312229ca10ab6c82a8c5669ad3cf20e999281900390910190a1610eea81611127565b5050565b60008161054f84670de0b6b3a7640000610574565b33600090815260208190526040902054600114610f515760405162461bcd60e51b815260040180806020018281038252603a81526020018061140a603a913960400191505060405180910390fd5b60008111610fa6576040805162461bcd60e51b815260206004820152601f60248201527f44656274506f70706572526577617264732f696e76616c69642d76616c756500604482015290519081900360640190fd5b816f696e746572506572696f6444656c617960801b1415610fcb5760048190556110e8565b816d72657761726454696d656c696e6560901b1415610fee5760058190556110e8565b816a199a5e195914995dd85c9960aa1b14156110635760008111611059576040805162461bcd60e51b815260206004820152601d60248201527f44656274506f70706572526577617264732f6e756c6c2d726577617264000000604482015290519081900360640190fd5b60018190556110e8565b816f6d6178506572506572696f64506f707360801b14156110885760068190556110e8565b81701c995dd85c9914195c9a5bd914dd185c9d607a1b141561091d574281116110e25760405162461bcd60e51b815260040180806020018281038252602d815260200180611350602d913960400191505060405180910390fd5b60038190555b604080518381526020810183905281517fac7c5c1afaef770ec56ac6268cd3f2fbb1035858ead2601d6553157c33036c3a929181900390910190a15050565b6002546001600160a01b03828116911614156111745760405162461bcd60e51b815260040180806020018281038252604681526020018061139e6046913960600191505060405180910390fd5b600254600154611191916001600160a01b03161515901515611320565b6111cc5760405162461bcd60e51b815260040180806020018281038252603e815260200180611499603e913960400191505060405180910390fd5b60006001600160a01b038216156111e357816111e5565b335b905060006111f1610a89565b6002546040805163a7e9445560e01b815290519293506001600160a01b039091169163201add9b918591849163a7e94455916004808301926020929190829003018186803b15801561124257600080fd5b505afa158015611256573d6000803e3d6000fd5b505050506040513d602081101561126c57600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820185905251606480830192600092919082900301818387803b1580156112c457600080fd5b505af11580156112d8573d6000803e3d6000fd5b50506040805184815290516001600160a01b03861693507fecceda37d3797234769f9d2cb1d47314680fb79283568bdba3f12876c4c244db92509081900360200190a2505050565b169056fe44656274506f70706572526577617264732f6d6f646966792d756e7265636f676e697a65642d706172616d44656274506f70706572526577617264732f696e76616c69642d7265776172642d706572696f642d737461727444656274506f70706572526577617264732f6e6f742d646562742d706f707065724d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f7265776172642d72656365697665722d63616e6e6f742d62652d747265617375727944656274506f70706572526577617264732f706f702d616c72656164792d72657761726465644d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f6163636f756e742d6e6f742d617574686f72697a656444656274506f70706572526577617264732f6d69737365642d7265776172642d77696e646f7744656274506f70706572526577617264732f736c6f742d74696d652d6265666f72652d7265776172642d73746172744d616e6461746f7279466978656454726561737572795265696d62757273656d656e742f696e76616c69642d74726561737572792d6f722d72657761726444656274506f70706572526577617264732f736c6f742d63616e6e6f742d62652d696e2d7468652d66757475726544656274506f70706572526577617264732f696e76616c69642d617661696c61626c652d726577617264a2646970667358221220d13adf38aa76676cad0149fa991da374cd63cdf38490dadb004ba11a62b5cf3864736f6c63430006070033

Verified Source Code Full Match

Compiler: v0.6.7+commit.b8d736ae EVM: istanbul Optimization: Yes (200 runs)
DeployDebtPopperRewards.sol 341 lines
pragma solidity 0.6.7;

contract GebMath {
    uint256 public constant RAY = 10 ** 27;
    uint256 public constant WAD = 10 ** 18;

    function ray(uint x) public pure returns (uint z) {
        z = multiply(x, 10 ** 9);
    }
    function rad(uint x) public pure returns (uint z) {
        z = multiply(x, 10 ** 27);
    }
    function minimum(uint x, uint y) public pure returns (uint z) {
        z = (x <= y) ? x : y;
    }
    function addition(uint x, uint y) public pure returns (uint z) {
        z = x + y;
        require(z >= x, "uint-uint-add-overflow");
    }
    function subtract(uint x, uint y) public pure returns (uint z) {
        z = x - y;
        require(z <= x, "uint-uint-sub-underflow");
    }
    function multiply(uint x, uint y) public pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x, "uint-uint-mul-overflow");
    }
    function rmultiply(uint x, uint y) public pure returns (uint z) {
        z = multiply(x, y) / RAY;
    }
    function rdivide(uint x, uint y) public pure returns (uint z) {
        z = multiply(x, RAY) / y;
    }
    function wdivide(uint x, uint y) public pure returns (uint z) {
        z = multiply(x, WAD) / y;
    }
    function wmultiply(uint x, uint y) public pure returns (uint z) {
        z = multiply(x, y) / WAD;
    }
    function rpower(uint x, uint n, uint base) public pure returns (uint z) {
        assembly {
            switch x case 0 {switch n case 0 {z := base} default {z := 0}}
            default {
                switch mod(n, 2) case 0 { z := base } default { z := x }
                let half := div(base, 2)  // for rounding.
                for { n := div(n, 2) } n { n := div(n,2) } {
                    let xx := mul(x, x)
                    if iszero(eq(div(xx, x), x)) { revert(0,0) }
                    let xxRound := add(xx, half)
                    if lt(xxRound, xx) { revert(0,0) }
                    x := div(xxRound, base)
                    if mod(n,2) {
                        let zx := mul(z, x)
                        if and(iszero(iszero(x)), iszero(eq(div(zx, x), z))) { revert(0,0) }
                        let zxRound := add(zx, half)
                        if lt(zxRound, zx) { revert(0,0) }
                        z := div(zxRound, base)
                    }
                }
            }
        }
    }
}

abstract contract StabilityFeeTreasuryLike {
    function getAllowance(address) virtual external view returns (uint, uint);
    function systemCoin() virtual external view returns (address);
    function pullFunds(address, address, uint) virtual external;
    function setTotalAllowance(address, uint256) external virtual;
    function setPerBlockAllowance(address, uint256) external virtual;    
}

contract MandatoryFixedTreasuryReimbursement is GebMath {
    // --- Auth ---
    mapping (address => uint) public authorizedAccounts;
    /**
     * @notice Add auth to an account
     * @param account Account to add auth to
     */
    function addAuthorization(address account) virtual external isAuthorized {
        authorizedAccounts[account] = 1;
        emit AddAuthorization(account);
    }
    /**
     * @notice Remove auth from an account
     * @param account Account to remove auth from
     */
    function removeAuthorization(address account) virtual external isAuthorized {
        authorizedAccounts[account] = 0;
        emit RemoveAuthorization(account);
    }
    /**
    * @notice Checks whether msg.sender can call an authed function
    **/
    modifier isAuthorized {
        require(authorizedAccounts[msg.sender] == 1, "MandatoryFixedTreasuryReimbursement/account-not-authorized");
        _;
    }

    // --- Variables ---
    // The fixed reward sent by the treasury to a fee receiver
    uint256 public fixedReward;               // [wad]
    // SF treasury
    StabilityFeeTreasuryLike public treasury;

    // --- Events ---
    event AddAuthorization(address account);
    event RemoveAuthorization(address account);
    event ModifyParameters(
      bytes32 parameter,
      address addr
    );
    event ModifyParameters(
      bytes32 parameter,
      uint256 val
    );
    event RewardCaller(address indexed finalFeeReceiver, uint256 fixedReward);

    constructor(address treasury_, uint256 fixedReward_) public {
        require(fixedReward_ > 0, "MandatoryFixedTreasuryReimbursement/null-reward");
        require(treasury_ != address(0), "MandatoryFixedTreasuryReimbursement/null-treasury");

        authorizedAccounts[msg.sender] = 1;

        treasury    = StabilityFeeTreasuryLike(treasury_);
        fixedReward = fixedReward_;

        emit AddAuthorization(msg.sender);
        emit ModifyParameters("treasury", treasury_);
        emit ModifyParameters("fixedReward", fixedReward);
    }

    // --- Boolean Logic ---
    function both(bool x, bool y) internal pure returns (bool z) {
        assembly{ z := and(x, y)}
    }

    // --- Treasury Utils ---
    /*
    * @notify Return the amount of SF that the treasury can transfer in one transaction when called by this contract
    */
    function treasuryAllowance() public view returns (uint256) {
        (uint total, uint perBlock) = treasury.getAllowance(address(this));
        return minimum(total, perBlock);
    }
    /*
    * @notify Get the actual reward to be sent by taking the minimum between the fixed reward and the amount that can be sent by the treasury
    */
    function getCallerReward() public view returns (uint256 reward) {
        reward = minimum(fixedReward, treasuryAllowance() / RAY);
    }
    /*
    * @notice Send a SF reward to a fee receiver by calling the treasury
    * @param proposedFeeReceiver The address that will receive the reward (unless null in which case msg.sender will receive it)
    */
    function rewardCaller(address proposedFeeReceiver) internal {
        // If the receiver is the treasury itself or if the treasury is null or if the reward is zero, revert
        require(address(treasury) != proposedFeeReceiver, "MandatoryFixedTreasuryReimbursement/reward-receiver-cannot-be-treasury");
        require(both(address(treasury) != address(0), fixedReward > 0), "MandatoryFixedTreasuryReimbursement/invalid-treasury-or-reward");

        // Determine the actual fee receiver and reward them
        address finalFeeReceiver = (proposedFeeReceiver == address(0)) ? msg.sender : proposedFeeReceiver;
        uint256 finalReward      = getCallerReward();
        treasury.pullFunds(finalFeeReceiver, treasury.systemCoin(), finalReward);

        emit RewardCaller(finalFeeReceiver, finalReward);
    }
}

abstract contract AccountingEngineLike {
    function debtPoppers(uint256) virtual public view returns (address);
}

contract DebtPopperRewards is MandatoryFixedTreasuryReimbursement {
    // --- Variables ---
    // When the next reward period starts
    uint256 public rewardPeriodStart;                    // [unix timestamp]
    // Delay between two consecutive reward periods
    uint256 public interPeriodDelay;                     // [seconds]
    // Time (after a block of debt is popped) after which no reward can be given anymore
    uint256 public rewardTimeline;                       // [seconds]
    // Amount of pops that can be rewarded per period
    uint256 public maxPerPeriodPops;
    // Timestamp from which the contract accepts requests for rewarding debt poppers
    uint256 public rewardStartTime;

    // Whether a debt block has been popped
    mapping(uint256 => bool)    public rewardedPop;      // [unix timestamp => bool]
    // Amount of pops that were rewarded in each period
    mapping(uint256 => uint256) public rewardsPerPeriod; // [unix timestamp => wad]

    // Accounting engine contract
    AccountingEngineLike        public accountingEngine;

    // --- Events ---
    event SetRewardPeriodStart(uint256 rewardPeriodStart);
    event RewardForPop(uint256 slotTimestamp, uint256 reward);

    constructor(
        address accountingEngine_,
        address treasury_,
        uint256 rewardPeriodStart_,
        uint256 interPeriodDelay_,
        uint256 rewardTimeline_,
        uint256 fixedReward_,
        uint256 maxPerPeriodPops_,
        uint256 rewardStartTime_
    ) public MandatoryFixedTreasuryReimbursement(treasury_, fixedReward_) {
        require(rewardPeriodStart_ >= now, "DebtPopperRewards/invalid-reward-period-start");
        require(interPeriodDelay_ > 0, "DebtPopperRewards/invalid-inter-period-delay");
        require(rewardTimeline_ > 0, "DebtPopperRewards/invalid-harvest-timeline");
        require(maxPerPeriodPops_ > 0, "DebtPopperRewards/invalid-max-per-period-pops");
        require(accountingEngine_ != address(0), "DebtPopperRewards/null-accounting-engine");

        accountingEngine   = AccountingEngineLike(accountingEngine_);

        rewardPeriodStart  = rewardPeriodStart_;
        interPeriodDelay   = interPeriodDelay_;
        rewardTimeline     = rewardTimeline_;
        fixedReward        = fixedReward_;
        maxPerPeriodPops   = maxPerPeriodPops_;
        rewardStartTime    = rewardStartTime_;

        emit ModifyParameters("accountingEngine", accountingEngine_);
        emit ModifyParameters("interPeriodDelay", interPeriodDelay);
        emit ModifyParameters("rewardTimeline", rewardTimeline);
        emit ModifyParameters("rewardStartTime", rewardStartTime);
        emit ModifyParameters("maxPerPeriodPops", maxPerPeriodPops);

        emit SetRewardPeriodStart(rewardPeriodStart);
    }

    // --- Administration ---
    /*
    * @notify Modify a uint256 parameter
    * @param parameter The parameter name
    * @param val The new value for the parameter
    */
    function modifyParameters(bytes32 parameter, uint256 val) external isAuthorized {
        require(val > 0, "DebtPopperRewards/invalid-value");
        if (parameter == "interPeriodDelay") {
          interPeriodDelay = val;
        }
        else if (parameter == "rewardTimeline") {
          rewardTimeline = val;
        }
        else if (parameter == "fixedReward") {
          require(val > 0, "DebtPopperRewards/null-reward");
          fixedReward = val;
        }
        else if (parameter == "maxPerPeriodPops") {
          maxPerPeriodPops = val;
        }
        else if (parameter == "rewardPeriodStart") {
          require(val > now, "DebtPopperRewards/invalid-reward-period-start");
          rewardPeriodStart = val;
        }
        else revert("DebtPopperRewards/modify-unrecognized-param");
        emit ModifyParameters(parameter, val);
    }
    /*
    * @notify Set a new treasury address
    * @param parameter The parameter name
    * @param addr The new address for the parameter
    */
    function modifyParameters(bytes32 parameter, address addr) external isAuthorized {
        require(addr != address(0), "DebtPopperRewards/null-address");
        if (parameter == "treasury") treasury = StabilityFeeTreasuryLike(addr);
        else revert("DebtPopperRewards/modify-unrecognized-param");
        emit ModifyParameters(parameter, addr);
    }

    /*
    * @notify Get rewarded for popping a debt slot from the AccountingEngine debt queue
    * @oaran slotTimestamp The time of the popped slot
    * @param feeReceiver The address that will receive the reward for popping
    */
    function getRewardForPop(uint256 slotTimestamp, address feeReceiver) external {
        // Perform checks
        require(slotTimestamp >= rewardStartTime, "DebtPopperRewards/slot-time-before-reward-start");
        require(slotTimestamp < now, "DebtPopperRewards/slot-cannot-be-in-the-future");
        require(now >= rewardPeriodStart, "DebtPopperRewards/wait-more");
        require(addition(slotTimestamp, rewardTimeline) >= now, "DebtPopperRewards/missed-reward-window");
        require(accountingEngine.debtPoppers(slotTimestamp) == msg.sender, "DebtPopperRewards/not-debt-popper");
        require(!rewardedPop[slotTimestamp], "DebtPopperRewards/pop-already-rewarded");
        require(getCallerReward() >= fixedReward, "DebtPopperRewards/invalid-available-reward");

        // Update state
        rewardedPop[slotTimestamp]          = true;
        rewardsPerPeriod[rewardPeriodStart] = addition(rewardsPerPeriod[rewardPeriodStart], 1);

        // If we offered rewards for too many pops, enforce a delay since rewards are available again
        if (rewardsPerPeriod[rewardPeriodStart] >= maxPerPeriodPops) {
          rewardPeriodStart = addition(now, interPeriodDelay);
          emit SetRewardPeriodStart(rewardPeriodStart);
        }

        emit RewardForPop(slotTimestamp, fixedReward);

        // Give the reward
        rewardCaller(feeReceiver);
    }
}

contract DeployDebtPopperRewards {
    // --- Variables ---
    uint256 public constant WAD = 10**18;
    uint256 public constant RAY = 10**27;
    uint256 public constant RAD = 10**45;

    function execute(
        address _accountingEngine,
        address _treasury
    ) public returns (address) {
        // Define params
        uint256 rewardPeriodStart = now;
        uint256 interPeriodDelay = 1209600;
        uint256 rewardTimeline = 4838400;
        uint256 fixedReward = 5 * WAD;
        uint256 maxPerPeriodPops = 10;
        uint256 rewardStartTime = now;

        // deploy the throttler
        DebtPopperRewards popperRewards = new DebtPopperRewards(
            _accountingEngine,
            _treasury,
            rewardPeriodStart,
            interPeriodDelay,
            rewardTimeline,
            fixedReward,
            maxPerPeriodPops,
            rewardStartTime

        );

        // setting allowances in the SF treasury
        StabilityFeeTreasuryLike(_treasury).setPerBlockAllowance(address(popperRewards), 1 * RAD);
        StabilityFeeTreasuryLike(_treasury).setTotalAllowance(address(popperRewards), uint(-1));

        return address(popperRewards);
    }
}

Read Contract

RAY 0x552033c4 → uint256
WAD 0x6a146024 → uint256
accountingEngine 0x961d45c4 → address
addition 0x54f363a3 → uint256
authorizedAccounts 0x24ba5884 → uint256
fixedReward 0x57305920 → uint256
getCallerReward 0xb7ae03c0 → uint256
interPeriodDelay 0x03d11f62 → uint256
maxPerPeriodPops 0x1efc0a3d → uint256
minimum 0xdd2d2a12 → uint256
multiply 0x165c4a16 → uint256
rad 0x46f3e81c → uint256
ray 0x10213447 → uint256
rdivide 0xa0871637 → uint256
rewardPeriodStart 0x5a97f13a → uint256
rewardStartTime 0x2cc138be → uint256
rewardTimeline 0x7f168100 → uint256
rewardedPop 0x7128b405 → bool
rewardsPerPeriod 0x4f855142 → uint256
rmultiply 0x056640b7 → uint256
rpower 0xd6e882dc → uint256
subtract 0x3ef5e445 → uint256
treasury 0x61d027b3 → address
treasuryAllowance 0x3425677e → uint256
wdivide 0xf752fdc3 → uint256
wmultiply 0x3c8bb3e6 → uint256

Write Contract 5 functions

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

addAuthorization 0x35b28153
address account
getRewardForPop 0xf00df8b8
uint256 slotTimestamp
address feeReceiver
modifyParameters 0x6614f010
bytes32 parameter
address addr
modifyParameters 0xfe4f5890
bytes32 parameter
uint256 val
removeAuthorization 0x94f3f81d
address account

Recent Transactions

No transactions found for this address