ETH Price: $3,205.23 (+1.87%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Reward By ...202508892024-07-06 23:55:11207 days ago1720310111IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000181231.628939
Claim Reward By ...169820202023-04-05 10:35:11665 days ago1680690911IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0030040726.99543265
Claim Reward By ...168949992023-03-24 4:31:11678 days ago1679632271IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0019790417.78804453
Claim Reward By ...165936342023-02-09 20:39:35720 days ago1675975175IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0054310548.80491503
Claim Reward By ...160521182022-11-26 5:37:23796 days ago1669441043IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0011315810.17199119
Claim Reward By ...159111712022-11-06 13:07:11815 days ago1667740031IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.001038079.32841053
Claim Reward By ...158127312022-10-23 18:54:35829 days ago1666551275IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0018229216.38307313
Claim Reward By ...156150502022-09-26 4:06:11857 days ago1664165171IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000668846.01041602
Claim Reward By ...156136782022-09-25 23:29:59857 days ago1664148599IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000623655.60490671
Claim Reward By ...154261112022-08-28 5:58:34886 days ago1661666314IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000505325.36656782
Claim Reward By ...153593092022-08-17 14:44:57896 days ago1660747497IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.001983217.8234792
Claim Reward By ...151970892022-07-23 5:36:09922 days ago1658554569IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000227035.83798665
Claim Reward By ...151970892022-07-23 5:36:09922 days ago1658554569IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000649655.83798665
Claim Reward By ...151920832022-07-22 11:27:31922 days ago1658489251IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.000840848.93099351
Claim Reward By ...150496282022-06-30 9:15:20944 days ago1656580520IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0010664935.54984503
Claim Reward By ...148375262022-05-24 19:37:41981 days ago1653421061IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0031606828.40887101
Claim Reward By ...147273382022-05-07 2:58:10999 days ago1651892290IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0032396929.11273058
Claim Reward By ...147265882022-05-07 0:05:51999 days ago1651881951IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0025260822.70246848
Claim Reward By ...147233792022-05-06 11:51:15999 days ago1651837875IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0045077240.5119333
Claim Reward By ...147161622022-05-05 8:21:221000 days ago1651738882IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0045355440.76202494
Claim Reward By ...146946132022-05-01 22:30:201004 days ago1651444220IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0063749857.29347615
Claim Reward By ...146611012022-04-26 16:08:341009 days ago1650989314IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0066640959.88526545
Claim Reward By ...146603092022-04-26 13:04:181009 days ago1650978258IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0036196332.53048652
Claim Reward By ...146454522022-04-24 4:53:181012 days ago1650775998IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0021937219.71548773
Claim Reward By ...146412102022-04-23 13:00:071012 days ago1650718807IN
0x0AeB26a7...B6Cd55f0f
0 ETH0.0026693323.98988335
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PermitFreezerRewardPool

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 16 : PermitFreezerRewardPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import '../../tools/Errors.sol';
import '../interfaces/IRewardController.sol';
import '../calcs/CalcLinearFreezer.sol';
import './BasePermitRewardPool.sol';

contract PermitFreezerRewardPool is BasePermitRewardPool, CalcLinearFreezer {
  uint256 private _rewardLimit;

  event RewardClaimedByPermit(address indexed provider, address indexed spender, uint256 value, uint256 nonce);
  event MeltDownAtUpdated(uint32 at);
  event RewardLimitUpdated(uint256 limit);

  constructor(
    IRewardController controller,
    uint256 rewardLimit,
    uint32 meltDownAt,
    string memory rewardPoolName
  ) ControlledRewardPool(controller, 0, 0) BasePermitRewardPool(rewardPoolName) {
    _rewardLimit = rewardLimit;
    internalSetMeltDownAt(meltDownAt);
    emit MeltDownAtUpdated(meltDownAt);
    emit RewardLimitUpdated(rewardLimit);
  }

  function getClaimTypeHash() internal pure override returns (bytes32) {
    return keccak256('ClaimReward(address provider,address spender,uint256 value,uint256 nonce,uint256 deadline)');
  }

  function setFreezePercentage(uint16 freezePortion) external onlyConfigAdmin {
    internalSetFreezePercentage(freezePortion);
  }

  function setMeltDownAt(uint32 at) external onlyConfigAdmin {
    internalSetMeltDownAt(at);
    emit MeltDownAtUpdated(at);
  }

  function internalGetPreAllocatedLimit() internal view override returns (uint256) {
    return _rewardLimit;
  }

  function availableReward() public view override returns (uint256) {
    return _rewardLimit;
  }

  function claimRewardByPermit(
    address provider,
    address spender,
    uint256 value,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) external notPaused {
    uint256 currentValidNonce = _nonces[spender];

    bytes32 encodedHash = keccak256(abi.encode(CLAIM_TYPEHASH, provider, spender, value, currentValidNonce, deadline));

    doClaimRewardByPermit(provider, spender, spender, value, deadline, encodedHash, currentValidNonce, v, r, s);
    emit RewardClaimedByPermit(provider, spender, value, currentValidNonce);
  }

  function internalCheckNonce(uint256 currentValidNonce, uint256 deadline) internal view override returns (uint256) {
    require(block.timestamp <= deadline, 'INVALID_TIME');
    return currentValidNonce + 1;
  }

  function internalGetReward(address holder)
    internal
    override
    returns (
      uint256 allocated,
      uint32,
      bool
    )
  {
    (allocated, ) = doClaimByPull(holder, 0, 0);
    return (allocated, uint32(block.timestamp), allocated != 0 || internalGetFrozenReward(holder) != 0);
  }

  function internalCalcReward(address holder, uint32 at) internal view override returns (uint256 allocated, uint32) {
    (allocated, ) = doCalcByPull(holder, 0, 0, at, false);
    return (allocated, uint32(block.timestamp));
  }

  function internalPushReward(
    address holder,
    uint256 allocated,
    uint32 since
  ) internal override {
    AllocationMode mode;
    (allocated, since, mode) = doAllocatedByPush(holder, allocated, since);

    if (allocated == 0 && mode == AllocationMode.Push) {
      return;
    }
    internalAllocateReward(holder, allocated, since, mode);
  }

  function calcRewardFor(address holder, uint32 at)
    external
    view
    override
    returns (
      uint256 amount,
      uint256 frozen,
      uint32 since
    )
  {
    require(at >= uint32(block.timestamp));
    (amount, since) = internalCalcReward(holder, at);
    frozen = internalGetFrozenReward(holder);
    if (amount >= frozen) {
      return (amount, 0, since);
    }
    unchecked {
      return (amount, frozen - amount, since);
    }
  }

  function internalUpdateFunds(uint256 value) internal override {
    emit RewardLimitUpdated(_rewardLimit = SafeMath.sub(_rewardLimit, value, Errors.VL_INSUFFICIENT_REWARD_AVAILABLE));
  }

  function _setBaselinePercentage(uint16) internal pure override {
    revert('UNSUPPORTED');
  }

  function internalSetRate(uint256 rate) internal pure override {
    if (rate != 0) {
      revert('UNSUPPORTED');
    }
  }

  function internalGetRate() internal pure override returns (uint256) {
    return 0;
  }
}

File 2 of 16 : SafeMath.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

/// @dev Replacement of SafeMath to use with solc 0.8
library SafeMath {
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    return a + b;
  }

  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    return a - b;
  }

  function sub(
    uint256 a,
    uint256 b,
    string memory errorMessage
  ) internal pure returns (uint256) {
    require(b <= a, errorMessage);
    unchecked {
      return a - b;
    }
  }

  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    return a * b;
  }

  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    return a / b;
  }

  function mod(uint256 a, uint256 b) internal pure returns (uint256) {
    return a % b;
  }
}

File 3 of 16 : Errors.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

/**
 * @title Errors library
 * @notice Defines the error messages emitted by the different contracts
 * @dev Error messages prefix glossary:
 *  - VL = ValidationLogic
 *  - MATH = Math libraries
 *  - CT = Common errors between tokens (DepositToken, VariableDebtToken and StableDebtToken)
 *  - AT = DepositToken
 *  - SDT = StableDebtToken
 *  - VDT = VariableDebtToken
 *  - LP = LendingPool
 *  - LPAPR = AddressesProviderRegistry
 *  - LPC = LendingPoolConfiguration
 *  - RL = ReserveLogic
 *  - LPCM = LendingPoolExtension
 *  - ST = Stake
 */
library Errors {
  //contract specific errors
  string public constant VL_INVALID_AMOUNT = '1'; // Amount must be greater than 0
  string public constant VL_NO_ACTIVE_RESERVE = '2'; // Action requires an active reserve
  string public constant VL_RESERVE_FROZEN = '3'; // Action cannot be performed because the reserve is frozen
  string public constant VL_UNKNOWN_RESERVE = '4'; // Action requires an active reserve
  string public constant VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE = '5'; // User cannot withdraw more than the available balance (above min limit)
  string public constant VL_TRANSFER_NOT_ALLOWED = '6'; // Transfer cannot be allowed.
  string public constant VL_BORROWING_NOT_ENABLED = '7'; // Borrowing is not enabled
  string public constant VL_INVALID_INTEREST_RATE_MODE_SELECTED = '8'; // Invalid interest rate mode selected
  string public constant VL_COLLATERAL_BALANCE_IS_0 = '9'; // The collateral balance is 0
  string public constant VL_HEALTH_FACTOR_LOWER_THAN_LIQUIDATION_THRESHOLD = '10'; // Health factor is lesser than the liquidation threshold
  string public constant VL_COLLATERAL_CANNOT_COVER_NEW_BORROW = '11'; // There is not enough collateral to cover a new borrow
  string public constant VL_STABLE_BORROWING_NOT_ENABLED = '12'; // stable borrowing not enabled
  string public constant VL_COLLATERAL_SAME_AS_BORROWING_CURRENCY = '13'; // collateral is (mostly) the same currency that is being borrowed
  string public constant VL_AMOUNT_BIGGER_THAN_MAX_LOAN_SIZE_STABLE = '14'; // The requested amount is exceeds max size of a stable loan
  string public constant VL_NO_DEBT_OF_SELECTED_TYPE = '15'; // to repay a debt, user needs to specify a correct debt type (variable or stable)
  string public constant VL_NO_EXPLICIT_AMOUNT_TO_REPAY_ON_BEHALF = '16'; // To repay on behalf of an user an explicit amount to repay is needed
  string public constant VL_NO_STABLE_RATE_LOAN_IN_RESERVE = '17'; // User does not have a stable rate loan in progress on this reserve
  string public constant VL_NO_VARIABLE_RATE_LOAN_IN_RESERVE = '18'; // User does not have a variable rate loan in progress on this reserve
  string public constant VL_UNDERLYING_BALANCE_NOT_GREATER_THAN_0 = '19'; // The collateral balance needs to be greater than 0
  string public constant VL_DEPOSIT_ALREADY_IN_USE = '20'; // User deposit is already being used as collateral
  string public constant VL_RESERVE_MUST_BE_COLLATERAL = '21'; // This reserve must be enabled as collateral
  string public constant LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET = '22'; // Interest rate rebalance conditions were not met
  string public constant AT_OVERDRAFT_DISABLED = '23'; // User doesn't accept allocation of overdraft
  string public constant VL_INVALID_SUB_BALANCE_ARGS = '24';
  string public constant AT_INVALID_SLASH_DESTINATION = '25';

  string public constant LP_CALLER_NOT_LENDING_POOL_CONFIGURATOR = '27'; // The caller of the function is not the lending pool configurator

  string public constant LENDING_POOL_REQUIRED = '28'; // The caller of this function must be a lending pool
  string public constant CALLER_NOT_LENDING_POOL = '29'; // The caller of this function must be a lending pool
  string public constant AT_SUB_BALANCE_RESTIRCTED_FUNCTION = '30'; // The caller of this function must be a lending pool or a sub-balance operator

  string public constant RL_RESERVE_ALREADY_INITIALIZED = '32'; // Reserve has already been initialized
  string public constant CALLER_NOT_POOL_ADMIN = '33'; // The caller must be the pool admin
  string public constant LPC_RESERVE_LIQUIDITY_NOT_0 = '34'; // The liquidity of the reserve needs to be 0

  string public constant LPAPR_PROVIDER_NOT_REGISTERED = '41'; // Provider is not registered
  string public constant LPCM_HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '42'; // Health factor is not below the threshold
  string public constant LPCM_COLLATERAL_CANNOT_BE_LIQUIDATED = '43'; // The collateral chosen cannot be liquidated
  string public constant LPCM_SPECIFIED_CURRENCY_NOT_BORROWED_BY_USER = '44'; // User did not borrow the specified currency
  string public constant LPCM_NOT_ENOUGH_LIQUIDITY_TO_LIQUIDATE = '45'; // There isn't enough liquidity available to liquidate

  string public constant MATH_MULTIPLICATION_OVERFLOW = '48';
  string public constant MATH_ADDITION_OVERFLOW = '49';
  string public constant MATH_DIVISION_BY_ZERO = '50';
  string public constant RL_LIQUIDITY_INDEX_OVERFLOW = '51'; //  Liquidity index overflows uint128
  string public constant RL_VARIABLE_BORROW_INDEX_OVERFLOW = '52'; //  Variable borrow index overflows uint128
  string public constant RL_LIQUIDITY_RATE_OVERFLOW = '53'; //  Liquidity rate overflows uint128
  string public constant RL_VARIABLE_BORROW_RATE_OVERFLOW = '54'; //  Variable borrow rate overflows uint128
  string public constant RL_STABLE_BORROW_RATE_OVERFLOW = '55'; //  Stable borrow rate overflows uint128
  string public constant CT_INVALID_MINT_AMOUNT = '56'; //invalid amount to mint
  string public constant CALLER_NOT_STAKE_ADMIN = '57';
  string public constant CT_INVALID_BURN_AMOUNT = '58'; //invalid amount to burn
  string public constant BORROW_ALLOWANCE_NOT_ENOUGH = '59'; // User borrows on behalf, but allowance are too small
  string public constant CALLER_NOT_LIQUIDITY_CONTROLLER = '60';
  string public constant CALLER_NOT_REF_ADMIN = '61';
  string public constant VL_INSUFFICIENT_REWARD_AVAILABLE = '62';
  string public constant LP_CALLER_MUST_BE_DEPOSIT_TOKEN = '63';
  string public constant LP_IS_PAUSED = '64'; // Pool is paused
  string public constant LP_NO_MORE_RESERVES_ALLOWED = '65';
  string public constant LP_INVALID_FLASH_LOAN_EXECUTOR_RETURN = '66';
  string public constant RC_INVALID_LTV = '67';
  string public constant RC_INVALID_LIQ_THRESHOLD = '68';
  string public constant RC_INVALID_LIQ_BONUS = '69';
  string public constant RC_INVALID_DECIMALS = '70';
  string public constant RC_INVALID_RESERVE_FACTOR = '71';
  string public constant LPAPR_INVALID_ADDRESSES_PROVIDER_ID = '72';
  string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = '73';
  string public constant VL_TREASURY_REQUIRED = '74';
  string public constant LPC_INVALID_CONFIGURATION = '75'; // Invalid risk parameters for the reserve
  string public constant CALLER_NOT_EMERGENCY_ADMIN = '76'; // The caller must be the emergency admin
  string public constant UL_INVALID_INDEX = '77';
  string public constant VL_CONTRACT_REQUIRED = '78';
  string public constant SDT_STABLE_DEBT_OVERFLOW = '79';
  string public constant SDT_BURN_EXCEEDS_BALANCE = '80';
  string public constant CALLER_NOT_REWARD_CONFIG_ADMIN = '81'; // The caller of this function must be a reward admin
  string public constant LP_INVALID_PERCENTAGE = '82'; // Percentage can't be more than 100%
  string public constant LP_IS_NOT_TRUSTED_FLASHLOAN = '83';
  string public constant CALLER_NOT_SWEEP_ADMIN = '84';
  string public constant LP_TOO_MANY_NESTED_CALLS = '85';
  string public constant LP_RESTRICTED_FEATURE = '86';
  string public constant LP_TOO_MANY_FLASHLOAN_CALLS = '87';
  string public constant RW_BASELINE_EXCEEDED = '88';
  string public constant CALLER_NOT_REWARD_RATE_ADMIN = '89';
  string public constant CALLER_NOT_REWARD_CONTROLLER = '90';
  string public constant RW_REWARD_PAUSED = '91';
  string public constant CALLER_NOT_TEAM_MANAGER = '92';
  string public constant STK_REDEEM_PAUSED = '93';
  string public constant STK_INSUFFICIENT_COOLDOWN = '94';
  string public constant STK_UNSTAKE_WINDOW_FINISHED = '95';
  string public constant STK_INVALID_BALANCE_ON_COOLDOWN = '96';
  string public constant STK_EXCESSIVE_SLASH_PCT = '97';
  string public constant STK_WRONG_COOLDOWN_OR_UNSTAKE = '98';
  string public constant STK_PAUSED = '99';

  string public constant TXT_OWNABLE_CALLER_NOT_OWNER = 'Ownable: caller is not the owner';
  string public constant TXT_CALLER_NOT_PROXY_OWNER = 'ProxyOwner: caller is not the owner';
  string public constant TXT_ACCESS_RESTRICTED = 'RESTRICTED';
}

File 4 of 16 : IRewardController.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../../access/interfaces/IMarketAccessController.sol';

enum AllocationMode {
  Push,
  SetPull,
  SetPullSpecial
}

interface IRewardController {
  function allocatedByPool(
    address holder,
    uint256 allocated,
    uint32 since,
    AllocationMode mode
  ) external;

  function isRateAdmin(address) external view returns (bool);

  function isConfigAdmin(address) external view returns (bool);

  function getAccessController() external view returns (IMarketAccessController);
}

File 5 of 16 : CalcLinearFreezer.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../../tools/math/PercentageMath.sol';
import {AllocationMode} from '../interfaces/IRewardController.sol';

abstract contract CalcLinearFreezer {
  using PercentageMath for uint256;

  struct FrozenReward {
    uint224 frozenReward;
    uint32 lastUpdatedAt;
  }

  mapping(address => FrozenReward) private _frozenRewards;
  uint32 private _meltdownAt;
  uint16 private _unfrozenPortion;

  function internalSetFreezePercentage(uint16 freezePortion) internal {
    _unfrozenPortion = PercentageMath.ONE - freezePortion;
  }

  function getFreezePercentage() public view returns (uint16) {
    return PercentageMath.ONE - _unfrozenPortion;
  }

  function internalSetMeltDownAt(uint32 at) internal {
    require(_meltdownAt == 0 || _meltdownAt > block.timestamp);
    _meltdownAt = at;
  }

  function getMeltDownAt() public view returns (uint32) {
    return _meltdownAt;
  }

  function doAllocatedByPush(
    address holder,
    uint256 allocated,
    uint32 since
  )
    internal
    returns (
      uint256,
      uint32,
      AllocationMode
    )
  {
    uint256 frozenBefore = _frozenRewards[holder].frozenReward;

    (allocated, ) = internalApplyAllocated(holder, allocated, since, uint32(block.timestamp));

    AllocationMode mode = AllocationMode.Push;
    if (frozenBefore == 0 && _frozenRewards[holder].frozenReward > 0) {
      mode = AllocationMode.SetPull;
    }

    return (allocated, uint32(block.timestamp), mode);
  }

  function doAllocatedByPool(
    address holder,
    uint256 allocated,
    uint32 since
  ) internal returns (uint256) {
    (allocated, ) = internalApplyAllocated(holder, allocated, since, uint32(block.timestamp));
    return allocated;
  }

  function doClaimByPull(
    address holder,
    uint256 allocated,
    uint32 since
  ) internal returns (uint256 claimableAmount, uint256 delayedAmount) {
    return internalApplyAllocated(holder, allocated, since, uint32(block.timestamp));
  }

  enum FrozenRewardState {
    NotRead,
    Read,
    Updated,
    Remove
  }

  function internalCalcAllocated(
    address holder,
    uint256 allocated,
    uint32 since,
    uint32 current,
    bool incremental
  )
    private
    view
    returns (
      uint256 amount,
      uint256 frozenReward,
      FrozenRewardState state
    )
  {
    if (_meltdownAt > 0 && _meltdownAt <= current) {
      if (incremental) {
        return (allocated, 0, FrozenRewardState.NotRead);
      }
      frozenReward = _frozenRewards[holder].frozenReward;
      if (frozenReward == 0) {
        return (allocated, 0, FrozenRewardState.Read);
      }
      allocated = allocated + frozenReward;
      return (allocated, 0, FrozenRewardState.Remove);
    }

    if (_unfrozenPortion < PercentageMath.ONE) {
      amount = allocated.percentMul(_unfrozenPortion);
      allocated -= amount;
    } else {
      amount = allocated;
      allocated = 0;
    }

    if (_meltdownAt > 0) {
      if (allocated > 0 && since != 0 && since < current) {
        // portion of the allocated was already unfreezed
        uint256 unfrozen = calcUnfrozenDuringEmmission(allocated, since, current);
        if (unfrozen > 0) {
          amount += unfrozen;
          allocated -= unfrozen;
        }
      }

      if (!incremental) {
        frozenReward = _frozenRewards[holder].frozenReward;
        state = FrozenRewardState.Read;

        if (frozenReward > 0) {
          uint256 unfrozen = calcUnfrozen(frozenReward, _frozenRewards[holder].lastUpdatedAt, current);
          if (unfrozen > 0) {
            amount += unfrozen;
            frozenReward -= unfrozen;
            state = FrozenRewardState.Updated;
          }
        }
      }
    }

    if (allocated > 0) {
      if (state == FrozenRewardState.NotRead && !incremental) {
        frozenReward = _frozenRewards[holder].frozenReward;
      }
      frozenReward += allocated;
      require(frozenReward <= type(uint224).max, 'reward is too high');
      state = FrozenRewardState.Updated;
    }

    return (amount, frozenReward, state);
  }

  function internalApplyAllocated(
    address holder,
    uint256 allocated,
    uint32 since,
    uint32 current
  ) private returns (uint256, uint256) {
    uint256 frozenBefore = _frozenRewards[holder].frozenReward;

    (uint256 amount, uint256 frozenReward, FrozenRewardState state) = internalCalcAllocated(
      holder,
      allocated,
      since,
      current,
      false
    );

    if (state == FrozenRewardState.Updated) {
      // was updated
      _frozenRewards[holder].frozenReward = uint224(frozenReward);
      _frozenRewards[holder].lastUpdatedAt = current;
    } else if (state == FrozenRewardState.Remove) {
      delete (_frozenRewards[holder]);
    }

    if (frozenBefore < frozenReward) {
      frozenReward = frozenReward - frozenBefore;
    } else {
      frozenReward = 0;
    }

    return (amount, frozenReward);
  }

  function calcUnfrozen(
    uint256 frozenReward,
    uint32 lastUpdatedAt,
    uint32 current
  ) private view returns (uint256) {
    return (frozenReward * (current - lastUpdatedAt)) / (_meltdownAt - lastUpdatedAt);
  }

  function calcUnfrozenDuringEmmission(
    uint256 emittedReward,
    uint32 lastUpdatedAt,
    uint32 current
  ) private view returns (uint256) {
    return (emittedReward * ((current - lastUpdatedAt + 1) >> 1)) / (_meltdownAt - lastUpdatedAt);
  }

  function doCalcByPull(
    address holder,
    uint256 allocated,
    uint32 since,
    uint32 at,
    bool incremental
  ) internal view returns (uint256 claimableAmount, uint256 frozenReward) {
    uint256 frozenBefore = _frozenRewards[holder].frozenReward;

    (claimableAmount, frozenReward, ) = internalCalcAllocated(holder, allocated, since, at, incremental);

    if (frozenBefore < frozenReward) {
      frozenReward = frozenReward - frozenBefore;
    } else {
      frozenReward = 0;
    }

    return (claimableAmount, frozenReward);
  }

  function internalGetFrozenReward(address holder) internal view returns (uint256) {
    return _frozenRewards[holder].frozenReward;
  }
}

File 6 of 16 : BasePermitRewardPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../interfaces/IRewardController.sol';
import './ControlledRewardPool.sol';

abstract contract BasePermitRewardPool is ControlledRewardPool {
  bytes public constant EIP712_REVISION = bytes('1');
  // solhint-disable-next-line var-name-mixedcase
  bytes32 public DOMAIN_SEPARATOR;
  // solhint-disable-next-line var-name-mixedcase
  bytes32 public CLAIM_TYPEHASH;

  bytes32 internal constant EIP712_DOMAIN =
    keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');

  /// @dev spender => next valid nonce to submit with permit()
  mapping(address => uint256) internal _nonces;

  string private _rewardPoolName;

  mapping(address => bool) private _providers;

  constructor(string memory rewardPoolName) {
    _rewardPoolName = rewardPoolName;
    _initializeDomainSeparator();
  }

  function _initialize(
    IRewardController controller,
    uint256 initialRate,
    uint16 baselinePercentage,
    string memory rewardPoolName
  ) internal override {
    _rewardPoolName = rewardPoolName;
    _initializeDomainSeparator();
    super._initialize(controller, initialRate, baselinePercentage, rewardPoolName);
  }

  function _initializeDomainSeparator() internal {
    uint256 chainId;

    // solhint-disable-next-line no-inline-assembly
    assembly {
      chainId := chainid()
    }

    DOMAIN_SEPARATOR = keccak256(
      abi.encode(EIP712_DOMAIN, keccak256(bytes(_rewardPoolName)), keccak256(EIP712_REVISION), chainId, address(this))
    );
    CLAIM_TYPEHASH = getClaimTypeHash();
  }

  /// @dev returns nonce, to comply with eip-2612
  function nonces(address addr) external view returns (uint256) {
    return _nonces[addr];
  }

  function getPoolName() public view override returns (string memory) {
    return _rewardPoolName;
  }

  function availableReward() public view virtual returns (uint256);

  function getClaimTypeHash() internal pure virtual returns (bytes32);

  function addRewardProvider(address provider, address token) external override onlyConfigAdmin {
    require(provider != address(0), 'provider is required');
    require(token == address(0), 'token is unsupported');
    _providers[provider] = true;
    emit ProviderAdded(provider, token);
  }

  function removeRewardProvider(address provider) external override onlyConfigAdmin {
    delete (_providers[provider]);
    emit ProviderRemoved(provider);
  }

  function doClaimRewardByPermit(
    address provider,
    address spender,
    address to,
    uint256 value,
    uint256 at,
    bytes32 encodedHash,
    uint256 currentValidNonce,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) internal {
    require(provider != address(0) && _providers[provider], 'INVALID_PROVIDER');

    bytes32 digest = keccak256(abi.encodePacked('\x19\x01', DOMAIN_SEPARATOR, encodedHash));
    require(provider == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE');

    _nonces[spender] = internalCheckNonce(currentValidNonce, at);

    if (value == 0) {
      return;
    }

    internalUpdateFunds(value);
    internalPushReward(to, value, uint32(block.timestamp));
  }

  function internalUpdateFunds(uint256 value) internal virtual;

  function internalCheckNonce(uint256 nonce, uint256 at) internal virtual returns (uint256);

  function internalPushReward(
    address holder,
    uint256 allocated,
    uint32 since
  ) internal virtual {
    internalAllocateReward(holder, allocated, since, AllocationMode.Push);
  }
}

File 7 of 16 : IMarketAccessController.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import './IAccessController.sol';

/// @dev Main registry of addresses part of or connected to the protocol, including permissioned roles. Also acts a proxy factory.
interface IMarketAccessController is IAccessController {
  function getMarketId() external view returns (string memory);

  function getLendingPool() external view returns (address);

  function getPriceOracle() external view returns (address);

  function getLendingRateOracle() external view returns (address);
}

File 8 of 16 : IAccessController.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import './IRemoteAccessBitmask.sol';
import '../../tools/upgradeability/IProxy.sol';

/// @dev Main registry of permissions and addresses
interface IAccessController is IRemoteAccessBitmask {
  function getAddress(uint256 id) external view returns (address);

  function createProxy(
    address admin,
    address impl,
    bytes calldata params
  ) external returns (IProxy);
}

File 9 of 16 : IRemoteAccessBitmask.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

interface IRemoteAccessBitmask {
  /**
   * @dev Returns access flags granted to the given address and limited by the filterMask. filterMask == 0 has a special meaning.
   * @param addr an to get access perfmissions for
   * @param filterMask limits a subset of flags to be checked.
   * NB! When filterMask == 0 then zero is returned no flags granted, or an unspecified non-zero value otherwise.
   * @return Access flags currently granted
   */
  function queryAccessControlMask(address addr, uint256 filterMask) external view returns (uint256);
}

File 10 of 16 : IProxy.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

interface IProxy {
  function upgradeToAndCall(address newImplementation, bytes calldata data) external payable;
}

File 11 of 16 : PercentageMath.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../Errors.sol';

/// @dev Percentages are defined in basis points. The precision is indicated by ONE. Operations are rounded half up.
library PercentageMath {
  uint16 public constant BP = 1; // basis point
  uint16 public constant PCT = 100 * BP; // basis points per percentage point
  uint16 public constant ONE = 100 * PCT; // basis points per 1 (100%)
  uint16 public constant HALF_ONE = ONE / 2;
  // deprecated
  uint256 public constant PERCENTAGE_FACTOR = ONE; //percentage plus two decimals

  /**
   * @dev Executes a percentage multiplication
   * @param value The value of which the percentage needs to be calculated
   * @param factor Basis points of the value to be calculated
   * @return The percentage of value
   **/
  function percentMul(uint256 value, uint256 factor) internal pure returns (uint256) {
    if (value == 0 || factor == 0) {
      return 0;
    }

    require(value <= (type(uint256).max - HALF_ONE) / factor, Errors.MATH_MULTIPLICATION_OVERFLOW);

    return (value * factor + HALF_ONE) / ONE;
  }

  /**
   * @dev Executes a percentage division
   * @param value The value of which the percentage needs to be calculated
   * @param factor Basis points of the value to be calculated
   * @return The value divided the percentage
   **/
  function percentDiv(uint256 value, uint256 factor) internal pure returns (uint256) {
    require(factor != 0, Errors.MATH_DIVISION_BY_ZERO);
    uint256 halfFactor = factor >> 1;

    require(value <= (type(uint256).max - halfFactor) / ONE, Errors.MATH_MULTIPLICATION_OVERFLOW);

    return (value * ONE + halfFactor) / factor;
  }

  function percentOf(uint256 value, uint256 base) internal pure returns (uint256) {
    require(base != 0, Errors.MATH_DIVISION_BY_ZERO);
    if (value == 0) {
      return 0;
    }

    require(value <= (type(uint256).max - HALF_ONE) / ONE, Errors.MATH_MULTIPLICATION_OVERFLOW);

    return (value * ONE + (base >> 1)) / base;
  }
}

File 12 of 16 : ControlledRewardPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../../tools/math/PercentageMath.sol';
import '../interfaces/IRewardController.sol';
import '../interfaces/IManagedRewardPool.sol';
import '../../access/AccessFlags.sol';
import '../../access/AccessHelper.sol';
import '../../tools/Errors.sol';

abstract contract ControlledRewardPool is IManagedRewardPool {
  using PercentageMath for uint256;

  IRewardController private _controller;

  uint16 private _baselinePercentage;
  bool private _paused;

  constructor(
    IRewardController controller,
    uint256 initialRate,
    uint16 baselinePercentage
  ) {
    _initialize(controller, initialRate, baselinePercentage, '');
  }

  function _initialize(
    IRewardController controller,
    uint256 initialRate,
    uint16 baselinePercentage,
    string memory poolName
  ) internal virtual {
    poolName;
    _controller = controller;

    if (baselinePercentage > 0) {
      _setBaselinePercentage(baselinePercentage);
    }

    if (initialRate > 0) {
      _setRate(initialRate);
    }
  }

  function getPoolName() public view virtual override returns (string memory) {
    return '';
  }

  function updateBaseline(uint256 baseline)
    external
    virtual
    override
    onlyController
    returns (bool hasBaseline, uint256 appliedRate)
  {
    if (_baselinePercentage == 0) {
      return (false, internalGetRate());
    }
    appliedRate = baseline.percentMul(_baselinePercentage);
    _setRate(appliedRate);
    return (true, appliedRate);
  }

  function setBaselinePercentage(uint16 factor) external override onlyController {
    _setBaselinePercentage(factor);
  }

  function getBaselinePercentage() public view override returns (uint16) {
    return _baselinePercentage;
  }

  function _mustHaveController() private view {
    require(address(_controller) != address(0), 'controller is required');
  }

  function _setBaselinePercentage(uint16 factor) internal virtual {
    _mustHaveController();
    require(factor <= PercentageMath.ONE, 'illegal value');
    _baselinePercentage = factor;
    emit BaselinePercentageUpdated(factor);
  }

  function _setRate(uint256 rate) internal {
    _mustHaveController();
    internalSetRate(rate);
    emit RateUpdated(rate);
  }

  function getRate() external view override returns (uint256) {
    return internalGetRate();
  }

  function internalGetRate() internal view virtual returns (uint256);

  function internalSetRate(uint256 rate) internal virtual;

  function setPaused(bool paused) public override onlyEmergencyAdmin {
    if (_paused != paused) {
      _paused = paused;
      internalPause(paused);
    }
    emit EmergencyPaused(msg.sender, paused);
  }

  function isPaused() public view override returns (bool) {
    return _paused;
  }

  function internalPause(bool paused) internal virtual {}

  function getRewardController() public view override returns (address) {
    return address(_controller);
  }

  function claimRewardFor(address holder)
    external
    override
    onlyController
    returns (
      uint256,
      uint32,
      bool
    )
  {
    return internalGetReward(holder);
  }

  function claimRewardWithLimitFor(
    address holder,
    uint256 baseAmount,
    uint256 limit,
    uint16 minPct
  )
    external
    override
    onlyController
    returns (
      uint256 amount,
      uint32 since,
      bool keepPull,
      uint256 newLimit
    )
  {
    return internalGetRewardWithLimit(holder, baseAmount, limit, minPct);
  }

  function calcRewardFor(address holder, uint32 at)
    external
    view
    virtual
    override
    returns (
      uint256 amount,
      uint256,
      uint32 since
    )
  {
    require(at >= uint32(block.timestamp));
    (amount, since) = internalCalcReward(holder, at);
    return (amount, 0, since);
  }

  function internalAllocateReward(
    address holder,
    uint256 allocated,
    uint32 since,
    AllocationMode mode
  ) internal {
    _controller.allocatedByPool(holder, allocated, since, mode);
  }

  function internalGetRewardWithLimit(
    address holder,
    uint256 baseAmount,
    uint256 limit,
    uint16 minBoostPct
  )
    internal
    virtual
    returns (
      uint256 amount,
      uint32 since,
      bool keepPull,
      uint256
    )
  {
    (amount, since, keepPull) = internalGetReward(holder);
    amount += baseAmount;
    if (minBoostPct > 0) {
      limit += PercentageMath.percentMul(amount, minBoostPct);
    }
    return (amount, since, keepPull, limit);
  }

  function internalGetReward(address holder)
    internal
    virtual
    returns (
      uint256,
      uint32,
      bool
    );

  function internalCalcReward(address holder, uint32 at) internal view virtual returns (uint256, uint32);

  function attachedToRewardController() external override onlyController returns (uint256) {
    internalAttachedToRewardController();
    return internalGetPreAllocatedLimit();
  }

  function detachedFromRewardController() external override onlyController returns (uint256) {
    return internalGetPreAllocatedLimit();
  }

  function internalGetPreAllocatedLimit() internal virtual returns (uint256) {
    return 0;
  }

  function internalAttachedToRewardController() internal virtual {}

  function _isController(address addr) internal view virtual returns (bool) {
    return address(_controller) == addr;
  }

  function getAccessController() internal view virtual returns (IMarketAccessController) {
    return _controller.getAccessController();
  }

  function _onlyController() private view {
    require(_isController(msg.sender), Errors.CALLER_NOT_REWARD_CONTROLLER);
  }

  modifier onlyController() {
    _onlyController();
    _;
  }

  function _isConfigAdmin(address addr) internal view returns (bool) {
    return address(_controller) != address(0) && _controller.isConfigAdmin(addr);
  }

  function _onlyConfigAdmin() private view {
    require(_isConfigAdmin(msg.sender), Errors.CALLER_NOT_REWARD_CONFIG_ADMIN);
  }

  modifier onlyConfigAdmin() {
    _onlyConfigAdmin();
    _;
  }

  function _isRateAdmin(address addr) internal view returns (bool) {
    return address(_controller) != address(0) && _controller.isRateAdmin(addr);
  }

  function _onlyRateAdmin() private view {
    require(_isRateAdmin(msg.sender), Errors.CALLER_NOT_REWARD_RATE_ADMIN);
  }

  modifier onlyRateAdmin() {
    _onlyRateAdmin();
    _;
  }

  function _onlyEmergencyAdmin() private view {
    AccessHelper.requireAnyOf(
      getAccessController(),
      msg.sender,
      AccessFlags.EMERGENCY_ADMIN,
      Errors.CALLER_NOT_EMERGENCY_ADMIN
    );
  }

  modifier onlyEmergencyAdmin() {
    _onlyEmergencyAdmin();
    _;
  }

  function _notPaused() private view {
    require(!_paused, Errors.RW_REWARD_PAUSED);
  }

  modifier notPaused() {
    _notPaused();
    _;
  }

  modifier notPausedCustom(string memory err) {
    require(!_paused, err);
    _;
  }
}

File 13 of 16 : IManagedRewardPool.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import '../../interfaces/IEmergencyAccess.sol';

interface IManagedRewardPool is IEmergencyAccess {
  function updateBaseline(uint256) external returns (bool hasBaseline, uint256 appliedRate);

  function setBaselinePercentage(uint16) external;

  function getBaselinePercentage() external view returns (uint16);

  function getRate() external view returns (uint256);

  function getPoolName() external view returns (string memory);

  function claimRewardFor(address holder)
    external
    returns (
      uint256 amount,
      uint32 since,
      bool keepPull
    );

  function claimRewardWithLimitFor(
    address holder,
    uint256 baseAmount,
    uint256 limit,
    uint16 minPct
  )
    external
    returns (
      uint256 amount,
      uint32 since,
      bool keepPull,
      uint256 newLimit
    );

  function calcRewardFor(address holder, uint32 at)
    external
    view
    returns (
      uint256 amount,
      uint256 extra,
      uint32 since
    );

  function addRewardProvider(address provider, address token) external;

  function removeRewardProvider(address provider) external;

  function getRewardController() external view returns (address);

  function attachedToRewardController() external returns (uint256 allocateReward);

  function detachedFromRewardController() external returns (uint256 deallocateReward);

  event RateUpdated(uint256 rate);
  event BaselinePercentageUpdated(uint16);
  event ProviderAdded(address provider, address token);
  event ProviderRemoved(address provider);
}

File 14 of 16 : AccessFlags.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

library AccessFlags {
  // roles that can be assigned to multiple addresses - use range [0..15]
  uint256 public constant EMERGENCY_ADMIN = 1 << 0;
  uint256 public constant POOL_ADMIN = 1 << 1;
  uint256 public constant TREASURY_ADMIN = 1 << 2;
  uint256 public constant REWARD_CONFIG_ADMIN = 1 << 3;
  uint256 public constant REWARD_RATE_ADMIN = 1 << 4;
  uint256 public constant STAKE_ADMIN = 1 << 5;
  uint256 public constant REFERRAL_ADMIN = 1 << 6;
  uint256 public constant LENDING_RATE_ADMIN = 1 << 7;
  uint256 public constant SWEEP_ADMIN = 1 << 8;
  uint256 public constant ORACLE_ADMIN = 1 << 9;

  uint256 public constant ROLES = (uint256(1) << 16) - 1;

  // singletons - use range [16..64] - can ONLY be assigned to a single address
  uint256 public constant SINGLETONS = ((uint256(1) << 64) - 1) & ~ROLES;

  // proxied singletons
  uint256 public constant LENDING_POOL = 1 << 16;
  uint256 public constant LENDING_POOL_CONFIGURATOR = 1 << 17;
  uint256 public constant LIQUIDITY_CONTROLLER = 1 << 18;
  uint256 public constant TREASURY = 1 << 19;
  uint256 public constant REWARD_TOKEN = 1 << 20;
  uint256 public constant REWARD_STAKE_TOKEN = 1 << 21;
  uint256 public constant REWARD_CONTROLLER = 1 << 22;
  uint256 public constant REWARD_CONFIGURATOR = 1 << 23;
  uint256 public constant STAKE_CONFIGURATOR = 1 << 24;
  uint256 public constant REFERRAL_REGISTRY = 1 << 25;

  uint256 public constant PROXIES = ((uint256(1) << 26) - 1) & ~ROLES;

  // non-proxied singletons, numbered down from 31 (as JS has problems with bitmasks over 31 bits)
  uint256 public constant WETH_GATEWAY = 1 << 27;
  uint256 public constant DATA_HELPER = 1 << 28;
  uint256 public constant PRICE_ORACLE = 1 << 29;
  uint256 public constant LENDING_RATE_ORACLE = 1 << 30;

  // any other roles - use range [64..]
  // these roles can be assigned to multiple addresses

  uint256 public constant TRUSTED_FLASHLOAN = 1 << 66;
}

File 15 of 16 : AccessHelper.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

import './interfaces/IRemoteAccessBitmask.sol';

/// @dev Helper/wrapper around IRemoteAccessBitmask
library AccessHelper {
  function getAcl(IRemoteAccessBitmask remote, address subject) internal view returns (uint256) {
    return remote.queryAccessControlMask(subject, ~uint256(0));
  }

  function queryAcl(
    IRemoteAccessBitmask remote,
    address subject,
    uint256 filterMask
  ) internal view returns (uint256) {
    return remote.queryAccessControlMask(subject, filterMask);
  }

  function hasAnyOf(
    IRemoteAccessBitmask remote,
    address subject,
    uint256 flags
  ) internal view returns (bool) {
    uint256 found = queryAcl(remote, subject, flags);
    return found & flags != 0;
  }

  function hasAny(IRemoteAccessBitmask remote, address subject) internal view returns (bool) {
    return remote.queryAccessControlMask(subject, 0) != 0;
  }

  function hasNone(IRemoteAccessBitmask remote, address subject) internal view returns (bool) {
    return remote.queryAccessControlMask(subject, 0) == 0;
  }

  function requireAnyOf(
    IRemoteAccessBitmask remote,
    address subject,
    uint256 flags,
    string memory text
  ) internal view {
    require(hasAnyOf(remote, subject, flags), text);
  }
}

File 16 of 16 : IEmergencyAccess.sol
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.8.4;

interface IEmergencyAccess {
  function setPaused(bool paused) external;

  function isPaused() external view returns (bool);

  event EmergencyPaused(address indexed by, bool paused);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "istanbul",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IRewardController","name":"controller","type":"address"},{"internalType":"uint256","name":"rewardLimit","type":"uint256"},{"internalType":"uint32","name":"meltDownAt","type":"uint32"},{"internalType":"string","name":"rewardPoolName","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint16","name":"","type":"uint16"}],"name":"BaselinePercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"by","type":"address"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"EmergencyPaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"at","type":"uint32"}],"name":"MeltDownAtUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"}],"name":"ProviderAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"provider","type":"address"}],"name":"ProviderRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"}],"name":"RateUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"RewardClaimedByPermit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"RewardLimitUpdated","type":"event"},{"inputs":[],"name":"CLAIM_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"EIP712_REVISION","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"token","type":"address"}],"name":"addRewardProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"attachedToRewardController","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"availableReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint32","name":"at","type":"uint32"}],"name":"calcRewardFor","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"frozen","type":"uint256"},{"internalType":"uint32","name":"since","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"claimRewardByPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"}],"name":"claimRewardFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"holder","type":"address"},{"internalType":"uint256","name":"baseAmount","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint16","name":"minPct","type":"uint16"}],"name":"claimRewardWithLimitFor","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint32","name":"since","type":"uint32"},{"internalType":"bool","name":"keepPull","type":"bool"},{"internalType":"uint256","name":"newLimit","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"detachedFromRewardController","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBaselinePercentage","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFreezePercentage","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getMeltDownAt","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolName","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRewardController","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isPaused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"}],"name":"removeRewardProvider","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"factor","type":"uint16"}],"name":"setBaselinePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint16","name":"freezePortion","type":"uint16"}],"name":"setFreezePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"at","type":"uint32"}],"name":"setMeltDownAt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"paused","type":"bool"}],"name":"setPaused","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"baseline","type":"uint256"}],"name":"updateBaseline","outputs":[{"internalType":"bool","name":"hasBaseline","type":"bool"},{"internalType":"uint256","name":"appliedRate","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200235b3803806200235b833981016040819052620000349162000470565b80846000806200005c838383604051806020016040528060008152506200010660201b60201c565b505081516200007491506004906020840190620003ca565b506200007f62000145565b50600883905562000090826200021f565b60405163ffffffff831681527f14b69f89bf3b4c6b4919d2b11818d5120a74297ccacd8104f14c00161caa4c6a9060200160405180910390a16040518381527ffb0ed2b91624498b82681c31125a03e2c12cc658862051e642da89ef667dedfb9060200160405180910390a15050505062000683565b80516200011b906004906020840190620003ca565b506200012662000145565b6200013f848484846200026460201b6200090c1760201c565b50505050565b60405146907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f906200017a906004906200058d565b60408051918290038220828201825260018352603160f81b6020938401528151928301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018290523060a082015260c00160408051808303601f1901815291905280516020909101206001557ff39baf1a9c9bbd87407da8b12a3929730278d386369d7213dce03dcc1ff0538760025550565b60075463ffffffff1615806200023e57506007544263ffffffff909116115b6200024857600080fd5b6007805463ffffffff191663ffffffff92909216919091179055565b600080546001600160a01b0319166001600160a01b03861617905561ffff82161562000295576200029582620002a7565b82156200013f576200013f83620002e2565b60405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b60448201526064015b60405180910390fd5b620002ec6200032d565b620002f78162000389565b6040518181527fe65c987b2e4668e09ba867026921588005b2b2063607a1e7e7d91683c8f91b7b9060200160405180910390a150565b6000546001600160a01b0316620003875760405162461bcd60e51b815260206004820152601660248201527f636f6e74726f6c6c6572206973207265717569726564000000000000000000006044820152606401620002d9565b565b8015620003c75760405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b6044820152606401620002d9565b50565b828054620003d89062000630565b90600052602060002090601f016020900481019282620003fc576000855562000447565b82601f106200041757805160ff191683800117855562000447565b8280016001018555821562000447579182015b82811115620004475782518255916020019190600101906200042a565b506200045592915062000459565b5090565b5b808211156200045557600081556001016200045a565b6000806000806080858703121562000486578384fd5b84516001600160a01b03811681146200049d578485fd5b809450506020808601519350604086015163ffffffff81168114620004c0578384fd5b60608701519093506001600160401b0380821115620004dd578384fd5b818801915088601f830112620004f1578384fd5b8151818111156200050657620005066200066d565b604051601f8201601f19908116603f011681019083821181831017156200053157620005316200066d565b816040528281528b8684870101111562000549578687fd5b8693505b828410156200056c57848401860151818501870152928501926200054d565b828411156200057d57868684830101525b989b979a50959850505050505050565b600080835482600182811c915080831680620005aa57607f831692505b6020808410821415620005cb57634e487b7160e01b87526022600452602487fd5b818015620005e25760018114620005f45762000622565b60ff1986168952848901965062000622565b60008a815260209020885b868110156200061a5781548b820152908501908301620005ff565b505084890196505b509498975050505050505050565b600181811c908216806200064557607f821691505b602082108114156200066757634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052604160045260246000fd5b611cc880620006936000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c8063679aefce116100de57806392efda7911610097578063b6fe2e9c11610071578063b6fe2e9c14610389578063d29939831461039c578063dcc03ee8146103a4578063ff85a2ba146103b757600080fd5b806392efda7914610313578063a8346a8c1461032e578063b187bd261461036c57600080fd5b8063679aefce146102665780636b0509b11461026d57806371703b871461027657806378160376146102895780637ecebe00146102b65780638abc37d3146102df57600080fd5b80634800df8c116101305780634800df8c146102065780634ad84b34146102195780634d25c4f11461022157806351ca71fc1461024357806355f4f19714610256578063657b931d1461025e57600080fd5b80630746363d146101785780630ca2103d1461019357806316c38b3c146101bd5780631dd0f483146101d2578063354f352c146101e55780633644e515146101fd575b600080fd5b6101806103ec565b6040519081526020015b60405180910390f35b6101a66101a13660046119fb565b610402565b60408051921515835260208301919091520161018a565b6101d06101cb36600461198d565b610457565b005b6101d06101e0366004611842565b6104c9565b60075460405163ffffffff909116815260200161018a565b61018060015481565b6101d06102143660046119e1565b610529565b600854610180565b600054600160a01b900461ffff165b60405161ffff909116815260200161018a565b6101d061025136600461189d565b61053d565b61018061061e565b61023061062d565b6000610180565b61018060025481565b6101d0610284366004611a2b565b610660565b6102a9604051806040016040528060018152602001603160f81b81525081565b60405161018a9190611ae0565b6101806102c4366004611842565b6001600160a01b031660009081526003602052604090205490565b6102f26102ed366004611959565b6106a7565b60408051938452602084019290925263ffffffff169082015260600161018a565b6000546040516001600160a01b03909116815260200161018a565b61034161033c366004611912565b6106fc565b6040805194855263ffffffff909316602085015290151591830191909152606082015260800161018a565b600054600160b01b900460ff16604051901515815260200161018a565b6101d0610397366004611865565b610728565b6102a9610846565b6101d06103b23660046119e1565b6108d8565b6103ca6103c5366004611842565b6108e9565b6040805193845263ffffffff909216602084015215159082015260600161018a565b60006103f661094f565b5060085490565b905090565b60008061040d61094f565b600054600160a01b900461ffff1661042a57506000928392509050565b600054610443908490600160a01b900461ffff16610996565b905061044e81610a94565b60019150915091565b61045f610ad5565b60005460ff600160b01b9091041615158115151461048f576000805460ff60b01b1916600160b01b831515021790555b604051811515815233907facaf4ee8e6a4949ca96787d73dfff5165ff2c555b2304b8517dc5396053add859060200160405180910390a250565b6104d1610b05565b6001600160a01b038116600081815260056020908152604091829020805460ff1916905590519182527f1589f8555933761a3cff8aa925061be3b46e2dd43f621322ab611d300f62b1d991015b60405180910390a150565b61053161094f565b61053a81610b47565b50565b610545610b7d565b6001600160a01b03868116600081815260036020908152604080832054600254825193840152948c169082015260608101929092526080820188905260a0820183905260c082018790529060e0016040516020818303038152906040528051906020012090506105bd89898a8a8a86888c8c8c610bc2565b876001600160a01b0316896001600160a01b03167f6f1fe2f44cdea955bf766955498ab414d71d12aee1ec5b9102f9be8d162375d9898560405161060b929190918252602082015260400190565b60405180910390a3505050505050505050565b600061062861094f565b6103f6565b600754600090640100000000900461ffff1661064b60016064611b68565b610656906064611b68565b6103fd9190611bb1565b610668610b05565b61067181610d6d565b60405163ffffffff821681527f14b69f89bf3b4c6b4919d2b11818d5120a74297ccacd8104f14c00161caa4c6a9060200161051e565b60008060004263ffffffff168463ffffffff1610156106c557600080fd5b6106cf8585610db0565b90935090506106dd85610dcd565b91508183106106ef57600091506106f5565b90829003905b9250925092565b60008060008061070a61094f565b61071688888888610df1565b929b919a509850909650945050505050565b610730610b05565b6001600160a01b0382166107825760405162461bcd60e51b81526020600482015260146024820152731c1c9bdd9a59195c881a5cc81c995c5d5a5c995960621b60448201526064015b60405180910390fd5b6001600160a01b038116156107d05760405162461bcd60e51b81526020600482015260146024820152731d1bdad95b881a5cc81d5b9cdd5c1c1bdc9d195960621b6044820152606401610779565b6001600160a01b03821660009081526005602052604090819020805460ff19166001179055517fcfac21410bfc65e4496174539de6f9373ddaa361e97587fa950b527df5b8d15c9061083a90849084906001600160a01b0392831681529116602082015260400190565b60405180910390a15050565b60606004805461085590611c08565b80601f016020809104026020016040519081016040528092919081815260200182805461088190611c08565b80156108ce5780601f106108a3576101008083540402835291602001916108ce565b820191906000526020600020905b8154815290600101906020018083116108b157829003601f168201915b5050505050905090565b6108e0610b05565b61053a81610e42565b60008060006108f661094f565b6108ff84610e83565b9250925092509193909250565b600080546001600160a01b0319166001600160a01b03861617905561ffff82161561093a5761093a82610b47565b82156109495761094983610a94565b50505050565b6000546001600160a01b0316331460405180604001604052806002815260200161039360f41b8152509061053a5760405162461bcd60e51b81526004016107799190611ae0565b60008215806109a3575081155b156109b057506000610a8e565b8160026109bf60016064611b68565b6109ca906064611b68565b6109d49190611b33565b6109e49061ffff16600019611bd4565b6109ee9190611b54565b83111560405180604001604052806002815260200161068760f31b81525090610a2a5760405162461bcd60e51b81526004016107799190611ae0565b50610a3760016064611b68565b610a42906064611b68565b61ffff166002610a5460016064611b68565b610a5f906064611b68565b610a699190611b33565b61ffff16610a778486611b92565b610a819190611af3565b610a8b9190611b54565b90505b92915050565b610a9c610eba565b610aa581610f0b565b6040518181527fe65c987b2e4668e09ba867026921588005b2b2063607a1e7e7d91683c8f91b7b9060200161051e565b610b03610ae0610f47565b336001604051806040016040528060028152602001611b9b60f11b815250610fce565b565b610b0e33610fff565b60405180604001604052806002815260200161383160f01b8152509061053a5760405162461bcd60e51b81526004016107799190611ae0565b60405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b6044820152606401610779565b600054604080518082019091526002815261393160f01b602082015290600160b01b900460ff161561053a5760405162461bcd60e51b81526004016107799190611ae0565b6001600160a01b038a1615801590610bf257506001600160a01b038a1660009081526005602052604090205460ff165b610c315760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa82927ab24a222a960811b6044820152606401610779565b60015460405161190160f01b602082015260228101919091526042810186905260009060620160408051601f1981840301815282825280516020918201206000845290830180835281905260ff8716918301919091526060820185905260808201849052915060019060a0016020604051602081039080840390855afa158015610cbf573d6000803e3d6000fd5b505050602060405103516001600160a01b03168b6001600160a01b031614610d1d5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b6044820152606401610779565b610d278588611092565b6001600160a01b038b1660009081526003602052604090205587610d4b5750610d61565b610d54886110de565b610d5f898942611139565b505b50505050505050505050565b60075463ffffffff161580610d8b57506007544263ffffffff909116115b610d9457600080fd5b6007805463ffffffff191663ffffffff92909216919091179055565b600080610dc284600080866000611191565b509442945092505050565b6001600160a01b03166000908152600660205260409020546001600160e01b031690565b600080600080610e0088610e83565b91955093509150610e118785611af3565b935061ffff851615610e3857610e2b848661ffff16610996565b610e359087611af3565b95505b5094509450949050565b80610e4f60016064611b68565b610e5a906064611b68565b610e649190611bb1565b600760046101000a81548161ffff021916908361ffff16021790555050565b6000806000610e94846000806111f1565b5092508242811515806108ff5750610eab86610dcd565b15159250925092509193909250565b6000546001600160a01b0316610b035760405162461bcd60e51b815260206004820152601660248201527518dbdb9d1c9bdb1b195c881a5cc81c995c5d5a5c995960521b6044820152606401610779565b801561053a5760405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b6044820152606401610779565b60008060009054906101000a90046001600160a01b03166001600160a01b03166316d6b5f66040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9657600080fd5b505afa158015610faa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fd91906119c5565b610fd984848461120c565b8190610ff85760405162461bcd60e51b81526004016107799190611ae0565b5050505050565b600080546001600160a01b031615801590610a8e575060005460405163ce91a05960e01b81526001600160a01b0384811660048301529091169063ce91a0599060240160206040518083038186803b15801561105a57600080fd5b505afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8e91906119a9565b6000814211156110d35760405162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f54494d4560a01b6044820152606401610779565b610a8b836001611af3565b7ffb0ed2b91624498b82681c31125a03e2c12cc658862051e642da89ef667dedfb61112660085483604051806040016040528060028152602001611b1960f11b815250611227565b600881905560405190815260200161051e565b6000611146848484611253565b919450925090508215801561117a5750600081600281111561117857634e487b7160e01b600052602160045260246000fd5b145b156111855750505050565b610949848484846112ce565b6001600160a01b03851660009081526006602052604081205481906001600160e01b03166111c2888888888861133c565b509093509150818110156111e1576111da8183611bd4565b91506111e6565b600091505b509550959350505050565b600080611200858585426115f4565b91509150935093915050565b60008061121a8585856116fd565b9092161515949350505050565b6000818484111561124b5760405162461bcd60e51b81526004016107799190611ae0565b505050900390565b6001600160a01b038316600090815260066020526040812054819081906001600160e01b0316611285878787426115f4565b5095506000811580156112b857506001600160a01b0388166000908152600660205260409020546001600160e01b031615155b156112c1575060015b9597429750945050505050565b6000546040516316050d6360e31b81526001600160a01b039091169063b0286b1890611304908790879087908790600401611a90565b600060405180830381600087803b15801561131e57600080fd5b505af1158015611332573d6000803e3d6000fd5b5050505050505050565b6007546000908190819063ffffffff1615801590611365575060075463ffffffff808716911611155b156113d257831561137e575085915060009050806115e9565b6001600160a01b0388166000908152600660205260409020546001600160e01b03169150816113b657508591506000905060016115e9565b6113c08288611af3565b965086600060039250925092506115e9565b6113de60016064611b68565b6113e9906064611b68565b60075461ffff91821664010000000090910490911610156114315760075461141e908890640100000000900461ffff16610996565b925061142a8388611bd4565b9650611437565b60009692505b60075463ffffffff16156115305760008711801561145a575063ffffffff861615155b801561147157508463ffffffff168663ffffffff16105b156114a6576000611483888888611789565b905080156114a4576114958185611af3565b93506114a18189611bd4565b97505b505b836115305750506001600160a01b0386166000908152600660205260409020546001600160e01b031660018115611530576001600160a01b038816600090815260066020526040812054611509908490600160e01b900463ffffffff16886117e0565b9050801561152e5761151b8185611af3565b93506115278184611bd4565b9250600291505b505b86156115e957600081600381111561155857634e487b7160e01b600052602160045260246000fd5b148015611563575083155b1561158d576001600160a01b0388166000908152600660205260409020546001600160e01b031691505b6115978783611af3565b91506001600160e01b038211156115e55760405162461bcd60e51b81526020600482015260126024820152710e4caeec2e4c840d2e640e8dede40d0d2ced60731b6044820152606401610779565b5060025b955095509592505050565b6001600160a01b03841660009081526006602052604081205481906001600160e01b03168180806116288a8a8a8a8561133c565b91945092509050600281600381111561165157634e487b7160e01b600052602160045260246000fd5b141561168e576001600160a01b038a16600090815260066020526040902063ffffffff8816600160e01b026001600160e01b0384161790556116d0565b60038160038111156116b057634e487b7160e01b600052602160045260246000fd5b14156116d0576001600160a01b038a166000908152600660205260408120555b818410156116e9576116e28483611bd4565b91506116ee565b600091505b50909890975095505050505050565b60405163cc8b29c160e01b81526001600160a01b038381166004830152602482018390526000919085169063cc8b29c19060440160206040518083038186803b15801561174957600080fd5b505afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190611a13565b949350505050565b6007546000906117a090849063ffffffff16611beb565b63ffffffff1660016117b28585611beb565b6117bd906001611b0b565b63ffffffff16901c63ffffffff16856117d69190611b92565b6117819190611b54565b6007546000906117f790849063ffffffff16611beb565b63ffffffff166118078484611beb565b6117d69063ffffffff1686611b92565b803561ffff8116811461182957600080fd5b919050565b803563ffffffff8116811461182957600080fd5b600060208284031215611853578081fd5b813561185e81611c6f565b9392505050565b60008060408385031215611877578081fd5b823561188281611c6f565b9150602083013561189281611c6f565b809150509250929050565b600080600080600080600060e0888a0312156118b7578283fd5b87356118c281611c6f565b965060208801356118d281611c6f565b95506040880135945060608801359350608088013560ff811681146118f5578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060008060808587031215611927578384fd5b843561193281611c6f565b9350602085013592506040850135915061194e60608601611817565b905092959194509250565b6000806040838503121561196b578182fd5b823561197681611c6f565b91506119846020840161182e565b90509250929050565b60006020828403121561199e578081fd5b813561185e81611c84565b6000602082840312156119ba578081fd5b815161185e81611c84565b6000602082840312156119d6578081fd5b815161185e81611c6f565b6000602082840312156119f2578081fd5b610a8b82611817565b600060208284031215611a0c578081fd5b5035919050565b600060208284031215611a24578081fd5b5051919050565b600060208284031215611a3c578081fd5b610a8b8261182e565b60008151808452815b81811015611a6a57602081850181015186830182015201611a4e565b81811115611a7b5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b03851681526020810184905263ffffffff831660408201526080810160038310611ad157634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b602081526000610a8b6020830184611a45565b60008219821115611b0657611b06611c43565b500190565b600063ffffffff808316818516808303821115611b2a57611b2a611c43565b01949350505050565b600061ffff80841680611b4857611b48611c59565b92169190910492915050565b600082611b6357611b63611c59565b500490565b600061ffff80831681851681830481118215151615611b8957611b89611c43565b02949350505050565b6000816000190483118215151615611bac57611bac611c43565b500290565b600061ffff83811690831681811015611bcc57611bcc611c43565b039392505050565b600082821015611be657611be6611c43565b500390565b600063ffffffff83811690831681811015611bcc57611bcc611c43565b600181811c90821680611c1c57607f821691505b60208210811415611c3d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461053a57600080fd5b801515811461053a57600080fdfea264697066735822122019e8bcc52ab541c16f85621f1d9103de9c6fedda4f713ff0dc94e4d85661de7c64736f6c63430008040033000000000000000000000000d5fc057194472d82e515ccacee976625ca9bde9000000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000000000000000006258b5800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b4275726e657273506f6f6c000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063679aefce116100de57806392efda7911610097578063b6fe2e9c11610071578063b6fe2e9c14610389578063d29939831461039c578063dcc03ee8146103a4578063ff85a2ba146103b757600080fd5b806392efda7914610313578063a8346a8c1461032e578063b187bd261461036c57600080fd5b8063679aefce146102665780636b0509b11461026d57806371703b871461027657806378160376146102895780637ecebe00146102b65780638abc37d3146102df57600080fd5b80634800df8c116101305780634800df8c146102065780634ad84b34146102195780634d25c4f11461022157806351ca71fc1461024357806355f4f19714610256578063657b931d1461025e57600080fd5b80630746363d146101785780630ca2103d1461019357806316c38b3c146101bd5780631dd0f483146101d2578063354f352c146101e55780633644e515146101fd575b600080fd5b6101806103ec565b6040519081526020015b60405180910390f35b6101a66101a13660046119fb565b610402565b60408051921515835260208301919091520161018a565b6101d06101cb36600461198d565b610457565b005b6101d06101e0366004611842565b6104c9565b60075460405163ffffffff909116815260200161018a565b61018060015481565b6101d06102143660046119e1565b610529565b600854610180565b600054600160a01b900461ffff165b60405161ffff909116815260200161018a565b6101d061025136600461189d565b61053d565b61018061061e565b61023061062d565b6000610180565b61018060025481565b6101d0610284366004611a2b565b610660565b6102a9604051806040016040528060018152602001603160f81b81525081565b60405161018a9190611ae0565b6101806102c4366004611842565b6001600160a01b031660009081526003602052604090205490565b6102f26102ed366004611959565b6106a7565b60408051938452602084019290925263ffffffff169082015260600161018a565b6000546040516001600160a01b03909116815260200161018a565b61034161033c366004611912565b6106fc565b6040805194855263ffffffff909316602085015290151591830191909152606082015260800161018a565b600054600160b01b900460ff16604051901515815260200161018a565b6101d0610397366004611865565b610728565b6102a9610846565b6101d06103b23660046119e1565b6108d8565b6103ca6103c5366004611842565b6108e9565b6040805193845263ffffffff909216602084015215159082015260600161018a565b60006103f661094f565b5060085490565b905090565b60008061040d61094f565b600054600160a01b900461ffff1661042a57506000928392509050565b600054610443908490600160a01b900461ffff16610996565b905061044e81610a94565b60019150915091565b61045f610ad5565b60005460ff600160b01b9091041615158115151461048f576000805460ff60b01b1916600160b01b831515021790555b604051811515815233907facaf4ee8e6a4949ca96787d73dfff5165ff2c555b2304b8517dc5396053add859060200160405180910390a250565b6104d1610b05565b6001600160a01b038116600081815260056020908152604091829020805460ff1916905590519182527f1589f8555933761a3cff8aa925061be3b46e2dd43f621322ab611d300f62b1d991015b60405180910390a150565b61053161094f565b61053a81610b47565b50565b610545610b7d565b6001600160a01b03868116600081815260036020908152604080832054600254825193840152948c169082015260608101929092526080820188905260a0820183905260c082018790529060e0016040516020818303038152906040528051906020012090506105bd89898a8a8a86888c8c8c610bc2565b876001600160a01b0316896001600160a01b03167f6f1fe2f44cdea955bf766955498ab414d71d12aee1ec5b9102f9be8d162375d9898560405161060b929190918252602082015260400190565b60405180910390a3505050505050505050565b600061062861094f565b6103f6565b600754600090640100000000900461ffff1661064b60016064611b68565b610656906064611b68565b6103fd9190611bb1565b610668610b05565b61067181610d6d565b60405163ffffffff821681527f14b69f89bf3b4c6b4919d2b11818d5120a74297ccacd8104f14c00161caa4c6a9060200161051e565b60008060004263ffffffff168463ffffffff1610156106c557600080fd5b6106cf8585610db0565b90935090506106dd85610dcd565b91508183106106ef57600091506106f5565b90829003905b9250925092565b60008060008061070a61094f565b61071688888888610df1565b929b919a509850909650945050505050565b610730610b05565b6001600160a01b0382166107825760405162461bcd60e51b81526020600482015260146024820152731c1c9bdd9a59195c881a5cc81c995c5d5a5c995960621b60448201526064015b60405180910390fd5b6001600160a01b038116156107d05760405162461bcd60e51b81526020600482015260146024820152731d1bdad95b881a5cc81d5b9cdd5c1c1bdc9d195960621b6044820152606401610779565b6001600160a01b03821660009081526005602052604090819020805460ff19166001179055517fcfac21410bfc65e4496174539de6f9373ddaa361e97587fa950b527df5b8d15c9061083a90849084906001600160a01b0392831681529116602082015260400190565b60405180910390a15050565b60606004805461085590611c08565b80601f016020809104026020016040519081016040528092919081815260200182805461088190611c08565b80156108ce5780601f106108a3576101008083540402835291602001916108ce565b820191906000526020600020905b8154815290600101906020018083116108b157829003601f168201915b5050505050905090565b6108e0610b05565b61053a81610e42565b60008060006108f661094f565b6108ff84610e83565b9250925092509193909250565b600080546001600160a01b0319166001600160a01b03861617905561ffff82161561093a5761093a82610b47565b82156109495761094983610a94565b50505050565b6000546001600160a01b0316331460405180604001604052806002815260200161039360f41b8152509061053a5760405162461bcd60e51b81526004016107799190611ae0565b60008215806109a3575081155b156109b057506000610a8e565b8160026109bf60016064611b68565b6109ca906064611b68565b6109d49190611b33565b6109e49061ffff16600019611bd4565b6109ee9190611b54565b83111560405180604001604052806002815260200161068760f31b81525090610a2a5760405162461bcd60e51b81526004016107799190611ae0565b50610a3760016064611b68565b610a42906064611b68565b61ffff166002610a5460016064611b68565b610a5f906064611b68565b610a699190611b33565b61ffff16610a778486611b92565b610a819190611af3565b610a8b9190611b54565b90505b92915050565b610a9c610eba565b610aa581610f0b565b6040518181527fe65c987b2e4668e09ba867026921588005b2b2063607a1e7e7d91683c8f91b7b9060200161051e565b610b03610ae0610f47565b336001604051806040016040528060028152602001611b9b60f11b815250610fce565b565b610b0e33610fff565b60405180604001604052806002815260200161383160f01b8152509061053a5760405162461bcd60e51b81526004016107799190611ae0565b60405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b6044820152606401610779565b600054604080518082019091526002815261393160f01b602082015290600160b01b900460ff161561053a5760405162461bcd60e51b81526004016107799190611ae0565b6001600160a01b038a1615801590610bf257506001600160a01b038a1660009081526005602052604090205460ff165b610c315760405162461bcd60e51b815260206004820152601060248201526f24a72b20a624a22fa82927ab24a222a960811b6044820152606401610779565b60015460405161190160f01b602082015260228101919091526042810186905260009060620160408051601f1981840301815282825280516020918201206000845290830180835281905260ff8716918301919091526060820185905260808201849052915060019060a0016020604051602081039080840390855afa158015610cbf573d6000803e3d6000fd5b505050602060405103516001600160a01b03168b6001600160a01b031614610d1d5760405162461bcd60e51b8152602060048201526011602482015270494e56414c49445f5349474e415455524560781b6044820152606401610779565b610d278588611092565b6001600160a01b038b1660009081526003602052604090205587610d4b5750610d61565b610d54886110de565b610d5f898942611139565b505b50505050505050505050565b60075463ffffffff161580610d8b57506007544263ffffffff909116115b610d9457600080fd5b6007805463ffffffff191663ffffffff92909216919091179055565b600080610dc284600080866000611191565b509442945092505050565b6001600160a01b03166000908152600660205260409020546001600160e01b031690565b600080600080610e0088610e83565b91955093509150610e118785611af3565b935061ffff851615610e3857610e2b848661ffff16610996565b610e359087611af3565b95505b5094509450949050565b80610e4f60016064611b68565b610e5a906064611b68565b610e649190611bb1565b600760046101000a81548161ffff021916908361ffff16021790555050565b6000806000610e94846000806111f1565b5092508242811515806108ff5750610eab86610dcd565b15159250925092509193909250565b6000546001600160a01b0316610b035760405162461bcd60e51b815260206004820152601660248201527518dbdb9d1c9bdb1b195c881a5cc81c995c5d5a5c995960521b6044820152606401610779565b801561053a5760405162461bcd60e51b815260206004820152600b60248201526a155394d5541413d495115160aa1b6044820152606401610779565b60008060009054906101000a90046001600160a01b03166001600160a01b03166316d6b5f66040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9657600080fd5b505afa158015610faa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103fd91906119c5565b610fd984848461120c565b8190610ff85760405162461bcd60e51b81526004016107799190611ae0565b5050505050565b600080546001600160a01b031615801590610a8e575060005460405163ce91a05960e01b81526001600160a01b0384811660048301529091169063ce91a0599060240160206040518083038186803b15801561105a57600080fd5b505afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8e91906119a9565b6000814211156110d35760405162461bcd60e51b815260206004820152600c60248201526b494e56414c49445f54494d4560a01b6044820152606401610779565b610a8b836001611af3565b7ffb0ed2b91624498b82681c31125a03e2c12cc658862051e642da89ef667dedfb61112660085483604051806040016040528060028152602001611b1960f11b815250611227565b600881905560405190815260200161051e565b6000611146848484611253565b919450925090508215801561117a5750600081600281111561117857634e487b7160e01b600052602160045260246000fd5b145b156111855750505050565b610949848484846112ce565b6001600160a01b03851660009081526006602052604081205481906001600160e01b03166111c2888888888861133c565b509093509150818110156111e1576111da8183611bd4565b91506111e6565b600091505b509550959350505050565b600080611200858585426115f4565b91509150935093915050565b60008061121a8585856116fd565b9092161515949350505050565b6000818484111561124b5760405162461bcd60e51b81526004016107799190611ae0565b505050900390565b6001600160a01b038316600090815260066020526040812054819081906001600160e01b0316611285878787426115f4565b5095506000811580156112b857506001600160a01b0388166000908152600660205260409020546001600160e01b031615155b156112c1575060015b9597429750945050505050565b6000546040516316050d6360e31b81526001600160a01b039091169063b0286b1890611304908790879087908790600401611a90565b600060405180830381600087803b15801561131e57600080fd5b505af1158015611332573d6000803e3d6000fd5b5050505050505050565b6007546000908190819063ffffffff1615801590611365575060075463ffffffff808716911611155b156113d257831561137e575085915060009050806115e9565b6001600160a01b0388166000908152600660205260409020546001600160e01b03169150816113b657508591506000905060016115e9565b6113c08288611af3565b965086600060039250925092506115e9565b6113de60016064611b68565b6113e9906064611b68565b60075461ffff91821664010000000090910490911610156114315760075461141e908890640100000000900461ffff16610996565b925061142a8388611bd4565b9650611437565b60009692505b60075463ffffffff16156115305760008711801561145a575063ffffffff861615155b801561147157508463ffffffff168663ffffffff16105b156114a6576000611483888888611789565b905080156114a4576114958185611af3565b93506114a18189611bd4565b97505b505b836115305750506001600160a01b0386166000908152600660205260409020546001600160e01b031660018115611530576001600160a01b038816600090815260066020526040812054611509908490600160e01b900463ffffffff16886117e0565b9050801561152e5761151b8185611af3565b93506115278184611bd4565b9250600291505b505b86156115e957600081600381111561155857634e487b7160e01b600052602160045260246000fd5b148015611563575083155b1561158d576001600160a01b0388166000908152600660205260409020546001600160e01b031691505b6115978783611af3565b91506001600160e01b038211156115e55760405162461bcd60e51b81526020600482015260126024820152710e4caeec2e4c840d2e640e8dede40d0d2ced60731b6044820152606401610779565b5060025b955095509592505050565b6001600160a01b03841660009081526006602052604081205481906001600160e01b03168180806116288a8a8a8a8561133c565b91945092509050600281600381111561165157634e487b7160e01b600052602160045260246000fd5b141561168e576001600160a01b038a16600090815260066020526040902063ffffffff8816600160e01b026001600160e01b0384161790556116d0565b60038160038111156116b057634e487b7160e01b600052602160045260246000fd5b14156116d0576001600160a01b038a166000908152600660205260408120555b818410156116e9576116e28483611bd4565b91506116ee565b600091505b50909890975095505050505050565b60405163cc8b29c160e01b81526001600160a01b038381166004830152602482018390526000919085169063cc8b29c19060440160206040518083038186803b15801561174957600080fd5b505afa15801561175d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117819190611a13565b949350505050565b6007546000906117a090849063ffffffff16611beb565b63ffffffff1660016117b28585611beb565b6117bd906001611b0b565b63ffffffff16901c63ffffffff16856117d69190611b92565b6117819190611b54565b6007546000906117f790849063ffffffff16611beb565b63ffffffff166118078484611beb565b6117d69063ffffffff1686611b92565b803561ffff8116811461182957600080fd5b919050565b803563ffffffff8116811461182957600080fd5b600060208284031215611853578081fd5b813561185e81611c6f565b9392505050565b60008060408385031215611877578081fd5b823561188281611c6f565b9150602083013561189281611c6f565b809150509250929050565b600080600080600080600060e0888a0312156118b7578283fd5b87356118c281611c6f565b965060208801356118d281611c6f565b95506040880135945060608801359350608088013560ff811681146118f5578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060008060808587031215611927578384fd5b843561193281611c6f565b9350602085013592506040850135915061194e60608601611817565b905092959194509250565b6000806040838503121561196b578182fd5b823561197681611c6f565b91506119846020840161182e565b90509250929050565b60006020828403121561199e578081fd5b813561185e81611c84565b6000602082840312156119ba578081fd5b815161185e81611c84565b6000602082840312156119d6578081fd5b815161185e81611c6f565b6000602082840312156119f2578081fd5b610a8b82611817565b600060208284031215611a0c578081fd5b5035919050565b600060208284031215611a24578081fd5b5051919050565b600060208284031215611a3c578081fd5b610a8b8261182e565b60008151808452815b81811015611a6a57602081850181015186830182015201611a4e565b81811115611a7b5782602083870101525b50601f01601f19169290920160200192915050565b6001600160a01b03851681526020810184905263ffffffff831660408201526080810160038310611ad157634e487b7160e01b600052602160045260246000fd5b82606083015295945050505050565b602081526000610a8b6020830184611a45565b60008219821115611b0657611b06611c43565b500190565b600063ffffffff808316818516808303821115611b2a57611b2a611c43565b01949350505050565b600061ffff80841680611b4857611b48611c59565b92169190910492915050565b600082611b6357611b63611c59565b500490565b600061ffff80831681851681830481118215151615611b8957611b89611c43565b02949350505050565b6000816000190483118215151615611bac57611bac611c43565b500290565b600061ffff83811690831681811015611bcc57611bcc611c43565b039392505050565b600082821015611be657611be6611c43565b500390565b600063ffffffff83811690831681811015611bcc57611bcc611c43565b600181811c90821680611c1c57607f821691505b60208210811415611c3d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461053a57600080fd5b801515811461053a57600080fdfea264697066735822122019e8bcc52ab541c16f85621f1d9103de9c6fedda4f713ff0dc94e4d85661de7c64736f6c63430008040033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000d5fc057194472d82e515ccacee976625ca9bde9000000000000000000000000000000000000000000000d3c21bcecceda1000000000000000000000000000000000000000000000000000000000000006258b5800000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000b4275726e657273506f6f6c000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : controller (address): 0xD5fC057194472D82e515CCacee976625CA9bDe90
Arg [1] : rewardLimit (uint256): 1000000000000000000000000
Arg [2] : meltDownAt (uint32): 1649980800
Arg [3] : rewardPoolName (string): BurnersPool

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000d5fc057194472d82e515ccacee976625ca9bde90
Arg [1] : 00000000000000000000000000000000000000000000d3c21bcecceda1000000
Arg [2] : 000000000000000000000000000000000000000000000000000000006258b580
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000b
Arg [5] : 4275726e657273506f6f6c000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.