BaseBuyback
BaseBuyback
UniswapUniversalRouterUpdated
event UniswapUniversalRouterUpdated(address _address)
RewardsSourceUpdated
event RewardsSourceUpdated(address _address)
TreasuryManagerUpdated
event TreasuryManagerUpdated(address _address)
OTokenBuyback
event OTokenBuyback(address oToken, address swappedFor, uint256 swapAmountIn, uint256 minExpected)
universalRouter
address universalRouter
rewardsSource
address rewardsSource
treasuryManager
address treasuryManager
oToken
address oToken
ogv
address ogv
cvx
address cvx
cvxLocker
address cvxLocker
constructor
constructor(address _oToken, address _ogv, address _cvx, address _cvxLocker) internal
initialize
function initialize(address _uniswapUniversalRouter, address _strategistAddr, address _treasuryManagerAddr, address _rewardsSource) external
Parameters
Name | Type | Description |
---|---|---|
_uniswapUniversalRouter | address | Address of Uniswap V3 Router |
_strategistAddr | address | Address of Strategist multi-sig wallet |
_treasuryManagerAddr | address | Address that receives the treasury's share of OUSD |
_rewardsSource | address | Address of RewardsSource contract |
setUniswapUniversalRouter
function setUniswapUniversalRouter(address _router) external
Set address of Uniswap Universal Router for performing liquidation of platform fee tokens. Setting to 0x0 will pause swaps.
Parameters
Name | Type | Description |
---|---|---|
_router | address | Address of the Uniswap Universal router |
_setUniswapUniversalRouter
function _setUniswapUniversalRouter(address _router) internal
setRewardsSource
function setRewardsSource(address _address) external
Sets the address that receives the OGV buyback rewards
Parameters
Name | Type | Description |
---|---|---|
_address | address | Address |
_setRewardsSource
function _setRewardsSource(address _address) internal
setTreasuryManager
function setTreasuryManager(address _address) external
Sets the address that can receive and manage the funds for Treasury
Parameters
Name | Type | Description |
---|---|---|
_address | address | Address |
_setTreasuryManager
function _setTreasuryManager(address _address) internal
swap
function swap(uint256 oTokenAmount, uint256 minOGV, uint256 minCVX) external
Swaps half of oTokenAmount
to OGV
and the rest to CVX and finally lock up CVX
Parameters
Name | Type | Description |
---|---|---|
oTokenAmount | uint256 | Amount of OUSD/OETH to swap |
minOGV | uint256 | Minimum OGV to receive for oTokenAmount/2 |
minCVX | uint256 | Minimum CVX to receive for oTokenAmount/2 |
lockAllCVX
function lockAllCVX() external
Locks all CVX held by the contract on behalf of the Treasury Manager
_lockAllCVX
function _lockAllCVX() internal
safeApproveAllTokens
function safeApproveAllTokens() external
Approve CVX Locker to move CVX held by this contract
transferToken
function transferToken(address token, uint256 amount) external
Owner function to withdraw a specific amount of a token
Parameters
Name | Type | Description |
---|---|---|
token | address | token to be transferered |
amount | uint256 | amount of the token to be transferred |
_getSwapPath
function _getSwapPath(address toToken) internal view virtual returns (bytes)
Returns the Swap path to use on Uniswap from oToken to toToken
Parameters
Name | Type | Description |
---|---|---|
toToken | address | Target token |