Skip to main content

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​

NameTypeDescription
_uniswapUniversalRouteraddressAddress of Uniswap V3 Router
_strategistAddraddressAddress of Strategist multi-sig wallet
_treasuryManagerAddraddressAddress that receives the treasury's share of OUSD
_rewardsSourceaddressAddress 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​

NameTypeDescription
_routeraddressAddress 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​

NameTypeDescription
_addressaddressAddress

_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​

NameTypeDescription
_addressaddressAddress

_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​

NameTypeDescription
oTokenAmountuint256Amount of OUSD/OETH to swap
minOGVuint256Minimum OGV to receive for oTokenAmount/2
minCVXuint256Minimum 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​

NameTypeDescription
tokenaddresstoken to be transferered
amountuint256amount 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​

NameTypeDescription
toTokenaddressTarget token