RewardRouterV2.sol

Last Updated At 30th Oct, 2024

State-Changing Functions

handleRewards

function handleRewards(
    bool _shouldClaimWeth,
    bool _shouldConvertWethToEth
) external
  • Processes pending rewards

  • Option to claim WETH rewards

  • Option to convert WETH rewards to ETH

mintAndStakeOlp

function mintAndStakeOlp(
    address _token,
    uint256 _amount,
    uint256 _minUsdg,
    uint256 _minOlp
) external returns (uint256)
  • Mints OLP tokens using provided token

  • Automatically stakes the minted OLP

  • Returns amount of OLP minted and staked

mintAndStakeOlpETH

function mintAndStakeOlpETH(
    uint256 _minUsdg,
    uint256 _minOlp
) external payable returns (uint256)
  • Mints OLP tokens using ETH

  • Automatically stakes the minted OLP

  • Returns amount of OLP minted and staked

unstakeAndRedeemOlp

function unstakeAndRedeemOlp(
    address _tokenOut,
    uint256 _olpAmount,
    uint256 _minOut,
    address _receiver
) external returns (uint256)
  • Unstakes OLP tokens and redeems them for specified token

  • Sends redeemed tokens to specified receiver

  • Returns amount of tokens received

unstakeAndRedeemOlpETH

function unstakeAndRedeemOlpETH(
    uint256 _olpAmount,
    uint256 _minOut,
    address payable _receiver
) external returns (uint256)
  • Unstakes OLP tokens and redeems them for ETH

  • Sends ETH to specified receiver

  • Returns amount of ETH received

Events

StakeOlp

event StakeOlp(
    address indexed account,
    uint256 amount
)
  • Emitted when OLP tokens are staked

  • Records the staking account and amount

UnstakeOlp

event UnstakeOlp(
    address indexed account,
    uint256 amount
)
  • Emitted when OLP tokens are unstaked

  • Records the unstaking account and amount

ABI

[
  {
    "type": "receive",
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "__AuthorityUtil_init__",
    "inputs": [
      {
        "name": "_authority",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "authority",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "claim",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "feeOlpTracker",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "handleRewards",
    "inputs": [
      {
        "name": "_shouldClaimWeth",
        "type": "bool",
        "internalType": "bool"
      },
      {
        "name": "_shouldConvertWethToEth",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "_weth",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olp",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_feeOlpTracker",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olpManager",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_authority",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "mintAndStakeOlp",
    "inputs": [
      {
        "name": "_token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_amount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minUsdg",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOlp",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "mintAndStakeOlpETH",
    "inputs": [
      {
        "name": "_minUsdg",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOlp",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "payable"
  },
  {
    "type": "function",
    "name": "olp",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "olpManager",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "owner",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "renounceOwnership",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setAuthority",
    "inputs": [
      {
        "name": "_newAuthority",
        "type": "address",
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "transferOwnership",
    "inputs": [
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "unstakeAndRedeemOlp",
    "inputs": [
      {
        "name": "_tokenOut",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_olpAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOut",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_receiver",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "unstakeAndRedeemOlpETH",
    "inputs": [
      {
        "name": "_olpAmount",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_minOut",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "_receiver",
        "type": "address",
        "internalType": "address payable"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "weth",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "withdrawToken",
    "inputs": [
      {
        "name": "_token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "AuthorityUpdated",
    "inputs": [
      {
        "name": "authority",
        "type": "address",
        "indexed": true,
        "internalType": "contract IOptionsAuthority"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OwnershipTransferred",
    "inputs": [
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "StakeOlp",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UnstakeOlp",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  }
]

Last updated