Sidechain Contracts
Aura Finance is expanding to become a cross-chain protocol. Deploying to chains beyond Ethereum, with the intent to deploy to wherever the balancer is deployed and emitting rewards. As part of this expansion, a new set of contracts had been deployed.
Sidechain Contracts
AuraBalProxyOFT.sol : L1 Aura BAL proxy OFT
AuraBalOFT.sol : L2 Aura BAL OFT
AuraProxyOFT.sol : L1 Aura proxy OFT
AuraOFT.sol : L2 Aura OFT
Create2Factory.sol : A create2 factory to deploy the sidechain contracts to constant addresses
CrossChainConfig.sol : Abstract contract to handle setting LZ configs
CrossChainMessages.sol : Shared LZ messaging library
L1Coordinator.sol : L1 Coordinator handles sending messages to canonical chain
L2Coordinator.sol : L2 Coordinator handles sending messages to canonical chain
PausableOFT.sol : OFT extension that allows a
guardian
address to perform an emergency pausePausableProxyOFT.sol : Proxy OFT extension that allows a
guardian
address to perform an emergency pausePauseGuardian.sol : Allows to implement pauses triggered by a
guardian
addressL1PoolManagerProxy.sol : Allows to permissionless add pools on any supported sidechain
L2PoolManagerProxy.sol : Given a root gauge on L1PoolManagerProxy it adds a gauge recipient on PoolManagerLite
AuraBalOFT
Sidechain auraBAL
constructor
Constructs the AuraBalOFT contract.
Parameters
Name | Type | Description |
---|---|---|
_name | string | The oft token name |
_symbol | string | The oft token symbol |
initialize
Initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
_lzEndpoint | address | LayerZero endpoint contract |
_guardian | address | Pause guardian |
AuraBalProxyOFT
Send and receive auraBAL to and from all the sidechains. all auraBAL sat in this bridge will be staked in the auraBAL compounder and rewards distributed to the L2 staking contracts
HarvestToken
vault
auraBAL compounder vault contract address
internalTotalSupply
Internally tracking of total auraBAL supply bridged
harvestSrcChainIds
Harvest src chain IDs array
totalClaimable
token address mapped to amount
claimable
token address mapped srcChainId mapped to amount claimable
rewardReceiver
srcChainId mapped to reward receiver
authorizedHarvesters
Authorized harvesters
ofts
Token to OFT
Harvest
Emitted when harvest rewards.
Parameters
Name | Type | Description |
---|---|---|
caller | address | The caller |
totalUnderlyingSum | uint256 | The total amount of auraBal staked on all sidechains. |
constructor
Constructs the AuraBalProxyOFT contract
Parameters
Name | Type | Description |
---|---|---|
_lzEndpoint | address | LayerZero endpoint contract |
_token | address | The proxied token (auraBAL) |
_vault | address | The AuraBal compounder vault |
_guardian | address | The pause guardian address |
_sudo | address | The super user address |
_inflowLimit | uint256 | Initial inflow limit per epoch |
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID. |
_selector | bytes32 | The selector. |
_adapterParams | bytes | The adapter params. |
setRewardReceiver
Set reward receiver for src chain
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID |
_receiver | address | The receiver address |
updateAuthorizedHarvesters
Adds or remove an address from the harvesters' whitelist
Parameters
Name | Type | Description |
---|---|---|
_harvester | address | address of the authorized harvester |
_authorized | bool | Whether to add or remove harvester |
setOFT
Set OFT for token
Parameters
Name | Type | Description |
---|---|---|
_token | address | Token contract address |
_oft | address | OFT contract address |
setHarvestSrcChainIds
Set srcChainIds to loop through for harvest
Parameters
Name | Type | Description |
---|---|---|
_srcChainIds | uint16[] | Source chain IDs |
circulatingSupply
returns the circulating amount of tokens on current chain
harvest
_Harvest rewards from the compounder and distribute them to the source chains
Parameters
Name | Type | Description |
---|---|---|
_totalUnderlying | uint256[] | Array of totalUnderlying auraBAL staked on the source chain |
_totalUnderlyingSum | uint256 | Sum of values in _totalUnderlying array |
processClaimable
Process claimable rewards
Parameters
Name | Type | Description |
---|---|---|
_token | address | The token to process |
_srcChainId | uint16 | The source chain ID |
_zroPaymentAddress | address | The LayerZero ZRO payment address |
vaultExecute
Execute a function on the vault
In order to account for the withdrawalPenalty this contract needs To be the owner of the auraBAL vault. Therefore it needs to be able to call vault owner functions. Rather than wrapping each function we can just use an execute pointing at the vault
rescue
Rescues the specified amount of tokens from the bridge and transfers them to the specified address.
This function is only callable by the sudo address.
Parameters
Name | Type | Description |
---|---|---|
_token | address | The address of the token to be rescued. |
_to | address | The address to which the tokens should be transferred. |
_amount | uint256 | The amount of tokens to be rescued. |
AuraOFT
Sidechain AURA
canonicalChainId
canonical chain ID
Locked
Emitted when locked cvx on the L1 chain
Parameters
Name | Type | Description |
---|---|---|
caller | address | The msg.sender |
amount | uint256 | The amount of cvx locked. |
constructor
Constructs the AuraOFT contract.
Parameters
Name | Type | Description |
---|---|---|
_name | string | The oft token name |
_symbol | string | The oft token symbol |
_canonicalChainId | uint16 | The canonical chain id |
initialize
Initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
_lzEndpoint | address | LayerZero endpoint contract |
_guardian | address | The pause guardian |
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID. |
_selector | bytes32 | The selector. |
_adapterParams | bytes | The adapter params. |
lock
Lock CVX on the L1 chain
Parameters
Name | Type | Description |
---|---|---|
_receiver | address | address that will be receiving the refund and vlaura lock |
_cvxAmount | uint256 | Amount of CVX to lock for vlCVX on L1 |
_zroPaymentAddress | address | The LayerZero ZRO payment address |
AuraProxyOFT
Send and receive AURA to and from all the Sidechains and receives lock requests from the sidechains
locker
Aura Locker contract address
constructor
Constructs the AuraProxyOFT contract
Parameters
Name | Type | Description |
---|---|---|
_lzEndpoint | address | LayerZero endpoint contract |
_token | address | The proxied token (auraBAL) |
_locker | address | The Aura Locker contract address |
_guardian | address | The pause guardian address |
_sudo | address | The super user address |
_inflowLimit | uint256 | Initial inflow limit per epoch |
Create2Factory
Deploy contracts using CREATE2 opcode.
A factory contract that uses the CREATE2 opcode to deploy contracts with a deterministic address.
Deployed
Event emitted when a contract is successfully deployed.
Parameters
Name | Type | Description |
---|---|---|
salt | bytes32 | A unique value used as part of the computation to determine the contract's address. |
deployed | address | The address where the contract has been deployed. |
deployer
updateDeployer
Adds or remove an address from the deployers' whitelist
Parameters
Name | Type | Description |
---|---|---|
_deployer | address | address of the authorized deployer |
_authorized | bool | Whether to add or remove deployer |
deploy
Deploys a contract using the CREATE2 opcode.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of Ether to be sent with the transaction deploying the contract. |
salt | bytes32 | A unique value used as part of the computation to determine the contract's address. |
bytecode | bytes | The bytecode that will be used to create the contract. |
callbacks | bytes[] | Callbacks to execute after contract is created. |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address where the contract has been deployed. |
computeAddress
receive
Fallback function that accepts Ether.
CrossChainConfig
Setter/Getter logic for cross chain layer zero config
getAdapterParams
srcChainId mapped to selector and configuration
SetAdapterParams
Emitted a configuration is set for a given source chain id.
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | The source chain ID. |
selector | bytes32 | The selector. |
adapterParams | bytes | The configuration. |
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID. |
_selector | bytes32 | The selector. |
_adapterParams | bytes | The adapter params. |
CrossChainMessages
Share types for cross chain messages
MAGIC_BYTES
_Magic Bytes to pad the custom message with bytes4(keccak256("isCustomMessage(bytes)"))
MessageType
L1Coordinator
Tracks the amount of fee debt accrued by each sidechain and sends AURA back to each sidechain for rewards
REWARD_MULTIPLIER_DENOMINATOR
balToken
BAL token contract
auraToken
AURA token contract
auraOFT
AURA OFT token contract
treasury
AURA treasury address
booster
Booster contract address
rewardMultiplier
Reward multiplier
feeDebtOf
src chain ID mapped to total feeDebt
settledFeeDebtOf
src chain ID mapped to total settled feeDebt
distributedFeeDebtOf
src chain ID mapped to total distributed feeDebt
bridgeDelegates
src chain ID to bridgeDelegate
l2Coordinators
src chain ID to L2Coordinator address
distributors
sender to isDistributor
BridgeDelegateUpdated
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | Source chain ID |
bridgeDelegate | address | The bridge delegate contract |
L2CoordinatorUpated
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | Source chain ID |
l2Coordinator | address | The l2Coordinator contract |
DisributorUpdated
Parameters
Name | Type | Description |
---|---|---|
distributor | address | Distributor address |
active | bool | If they are an active distributor |
FeeDebtNotified
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | Source chain ID |
amount | uint256 | Amount of fee that was notified |
AuraDistributed
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | Source chain ID |
amount | uint256 | Amount of AURA that was distributed |
FeeDebtSettled
Parameters
Name | Type | Description |
---|---|---|
srcChainId | uint16 | Source chain ID |
amount | uint256 | Amount of fee debt that was settled |
RewardMultiplierUpdated
Parameters
Name | Type | Description |
---|---|---|
multiplier | uint256 | The reward multiplier |
BoosterUpdated
Parameters
Name | Type | Description |
---|---|---|
booster | address | The booster contract |
constructor
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID. |
_selector | bytes32 | The selector. |
_adapterParams | bytes | The adapter params. |
setBridgeDelegate
Set bridge delegate for given srcChainId
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | ID of the source chain |
_bridgeDelegate | address | Address of the bridge delegate |
setL2Coordinator
Set L2 Coordinator for given srcChainId
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | ID of the source chain |
_l2Coordinator | address | Address of l2Coordinator |
setDistributor
Set distributor as valid or invalid so the can call harvest
Parameters
Name | Type | Description |
---|---|---|
_distributor | address | Distributor address |
_active | bool | Is the distributor active |
setRewardMultiplier
Set the reward multiplier
Parameters
Name | Type | Description |
---|---|---|
_multiplier | uint256 | The new multiplier |
setBooster
Set the booster address
Parameters
Name | Type | Description |
---|---|---|
_booster | address | The booster contract address |
distributeAura
Distribute AURA to the src chain using the BAL float in this contract mint AURA by calling distributeL2Fees on the Booster and then send those AURA tokens to the src chain
settleFeeDebt
Receive CRV from the L2 via some thirdpart bridge to settle the feeDebt for the remote chain
receive
L2Coordinator
Coordinates LZ messages and actions from the L1 on the L2
canonicalChainId
canonical chain ID
auraOFT
AuraOFT contract
booster
Booster contract
balToken
The BAL token contract
bridgeDelegate
The bridge delegate contract
accBalRewards
Accumulated BAL rewards
accAuraRewards
Accumulated AURA rewards
BridgeDelegateUpdated
Emitted when the bridge delegate address is updated.
Parameters
Name | Type | Description |
---|---|---|
bridgeDelegate | address | The new bridge delegate address. |
RewardAdded
Emmitted when rewards are added
Parameters
Name | Type | Description |
---|---|---|
token | address | The reward token |
reward | uint256 | The reward amount |
constructor
mintRate
Get mint rate based on accumulated BAL and AURA
Dev mint rate is aura per bal rewards
initialize
Initializes the booster and balToken addresses
This function should only be called by the owner of the contract
Parameters
Name | Type | Description |
---|---|---|
_booster | address | Address of the booster |
_balToken | address | Address of the balToken |
_lzEndpoint | address | LayerZero endpoint contract |
setBridgeDelegate
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Name | Type | Description |
---|---|---|
_srcChainId | uint16 | The source chain ID. |
_selector | bytes32 | The selector. |
_adapterParams | bytes | The adapter params. |
mint
Mint function called by Booster.rewardClaimed. uses the CVX (L2) balance of this contract to transfer tokens
Parameters
Name | Type | Description |
---|---|---|
_to | address | Address to send CVX (L2) to |
_amount | uint256 | Amount of CRV rewardClaimed was called with |
queueNewRewards
Called by the booster.earmarkRewards to register feeDebt with the L1 and receive CVX tokens in return
Parameters
Name | Type | Description |
---|---|---|
_originalSender | address | Sender that initiated the Booster call |
_fees | uint256 | Amount of CRV that was received as fees |
_rewards | uint256 | Amount of CRV that was received by the reward contract |
_zroPaymentAddress | address | The LayerZero ZRO payment address |
PausableOFT
Extension to the OFT standard that allows a guardian
address to perform an emergency pause on the sendFrom
function.
constructor
Constructs the PausableOFT contract
Parameters
Name | Type | Description |
---|---|---|
_name | string | The oft token name |
_symbol | string | The oft token symbol |
sendFrom
Override sendFrom to add pause modifier
PausableProxyOFT
Extension to the ProxyOFT standard that allows a guardian
address to perform an emergency pause.
When paused all messages received are added to a queue to be processed after
queueDelay
time has passed.When paused no messages can be sent via
sendFrom
.
epochDuration
Duration of each inflow epoch
sudo
Addres of super user
inflowLimit
Transfer inflow limit per epoch
queueDelay
Queue delay
outflow
Epoch mapped to transfer outflow
inflow
Epoch mapped to transfer inflow
queue
Transfer queue
QueuedFromChain
Parameters
Name | Type | Description |
---|---|---|
epoch | uint256 | The epoch |
srcChainId | uint16 | The source chain |
to | address | Address to transfer to |
amount | uint256 | Amount to transfer |
timestamp | uint256 | Time the transfer was queued |
Rescue
Parameters
Name | Type | Description |
---|---|---|
token | address | Token address |
to | address | Send to address |
amount | uint256 | Amount to send |
constructor
Parameters
Name | Type | Description |
---|---|---|
_token | address | Proxy token (eg AURA or auraBAL) |
_sudo | address | The super user address |
_inflowLimit | uint256 | Initial inflow limit per epoch |
setQueueDelay
Amount of time that a transfer has to sit in the queue until it can be processed
Parameters
Name | Type | Description |
---|---|---|
_delay | uint256 | Queue delay |
setInflowLimit
Set the inflow limit per epoch
Parameters
Name | Type | Description |
---|---|---|
_limit | uint256 | Inflow limit per epoch |
getCurrentEpoch
Get current epoch
sendFrom
Override sendFrom to add pause modifier
processQueued
Process a queued transfer Transfer has to be a valid root and the queue delay has to have passed
Parameters
Name | Type | Description |
---|---|---|
_epoch | uint256 | Epoch |
_srcChainId | uint16 | Source chain ID |
_to | address | Address to transfer to |
_amount | uint256 | Amount to transfer |
_timestamp | uint256 | Time when this transfer was queued |
rescue
In a doomsday bridge scenario there may be a case where funds need to be rescued.
Parameters
Name | Type | Description |
---|---|---|
_token | address | Token address |
_to | address | Send to address |
_amount | uint256 | Amount to send |
PauseGuardian
Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized immutable guardian address.
guardian
The guardian address
pause
This function pauses the contract.
This function can only be called by the 'guardian'.
unpause
This function is used to unpause the contract.
This function can only be called by the 'guardian' of the contract.
IArbitrumGatewayRouter
outboundTransfer
ArbitrumBridgeSender
gatewayRouter
The Gnosis bridge address
l1Crv
Mainnet CRV token address
constructor
Constructs the GnosisBridgeSender contract.
Parameters
Name | Type | Description |
---|---|---|
_gatewayRouter | address | The arbitrum gatewayRouter address. |
_crv | address | The L2 token address. |
_l1Crv | address | The L1 token address. |
send
_Function to send a specified amount of tokens. Requirements:
The caller must be the owner of the contract._
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The amount of CRV tokens to be sent |
BridgeDelegateReceiver
Receive bridged tokens from the L2 on L1
l1Coordinator
The L1Coordinator address
srcChainId
The source chain id
SettleFeeDebt
Emitted when tokens are sent to a recipient.
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | The amount of fee debt settled. |
constructor
Constructs the BridgeDelegateReceiver contract.
Parameters
Name | Type | Description |
---|---|---|
_l1Coordinator | address | The address of the L1 Coordinator. |
_srcChainId | uint16 | The source chain id. |
settleFeeDebt
Settle fee debt on the L1 Coordinator.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The amount debt to settle Requirements: - The caller must be the owner of the contract. |
BridgeDelegateSender
Sends tokens to L1 via a bridge
crv
The crv token address
l1Receiver
The L1Receiver address
Send
Emitted when tokens are sent to a recipient.
Parameters
Name | Type | Description |
---|---|---|
to | address | The address of the recipient. |
amount | uint256 | The amount of tokens sent. |
L1ReceiverUpated
Emitted when the l1 receiver address is updated.
Parameters
Name | Type | Description |
---|---|---|
l1Receiver | address | The new l1 receiver address. |
setL1Receiver
Allows the owner of the contract to set the L1 receiver address.
This function requires the owner of the contract to call it and pass in a valid address. If the address is valid, the l1Receiver variable is updated and an event is emitted.
Parameters
Name | Type | Description |
---|---|---|
_l1Receiver | address | The new l1 receiver address. |
send
Function to send a specified amount of tokens
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The amount of tokens to be sent |
SimpleBridgeDelegateSender
Only used as an example and for tests Sends tokens to "L1" via a simple transfer
token
The ERC20 bridged token address.
constructor
Constructs the SimpleBridgeDelegateSender contract.
Parameters
Name | Type | Description |
---|---|---|
_token | address | The address of the ERC20 token to be sent. |
send
Sends tokens to a l1Receiver.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The amount of tokens to send. Requirements: - The caller must be the owner of the contract. |
SidechainClaimZap
Claim zap to bundle various reward claims
Claims from all pools, Bridges/Locks to L1 if Wanted and compounds if needed.
receive
cvx
cvxCrv
compounder
owner
canonicalChainID
ClaimRewardsAmounts
Options
initialize
getName
Returns meta data of contract
setApprovals
Approve spending of: cvxCrv -> Compounder
claimRewards
Claim all the rewards
Parameters
Name | Type | Description |
---|---|---|
zroPaymentAddress | address | |
rewardContracts | address[] | Array of addresses for LP token rewards |
extraRewardContracts | address[] | Array of addresses for extra rewards |
tokenRewardContracts | address[] | Array of addresses for token rewards e.g vlCvxExtraRewardDistribution |
tokenRewardTokens | address[] | Array of token reward addresses to use with tokenRewardContracts |
amounts | struct SidechainClaimZap.ClaimRewardsAmounts | Claim rewards amounts. |
options | struct SidechainClaimZap.Options | Claim options |
SimpleStrategy
Simple strategy to harvest all vault's extra rewards and queue them.
auraBalToken
The $AURABAL token address
vault
The AuraBal compounder vault address
constructor
Simple constructor
Parameters
Name | Type | Description |
---|---|---|
_auraBalToken | address | The $AURABAL token address |
_vault | address | The AuraBal compounder vault |
harvest
setApprovals
stake
totalUnderlying
withdraw
Allows the Vault to withdraw a given amount of auraBal.
Only callable by the vault.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | The amount of auraBal to withdraw. |
harvest
This function is used to process extra rewards for the vault.
This function will loop through the extra rewards and transfer the balance of the reward token to the rewards address. It will then queue the new rewards with the balance.
PoolInfo
earmarkRewards
poolLength
lockRewards
poolInfo
lockIncentive
stakerIncentive
earmarkIncentive
platformFee
FEE_DENOMINATOR
AuraClaimZapV3
Claim zap to bundle various reward claims
Claims from all pools, and stakes cvxCrv and CVX if wanted. v2: - change exchange to use curve pool - add getReward(address,token) type - add option to lock cvx - add option use all funds in wallet v3: - add option to deposit to compounder - reduce calls to cvxcrv rewards/compounder - removed enum and option bitshifting - introduced options struct - gas optimisation on use all funds balances - helper functions to reduce code repetition
crv
cvx
cvxCrv
crvDepositWrapper
cvxCrvRewards
locker
owner
compounder
ClaimRewardsAmounts
Options
constructor
Parameters
Name | Type | Description |
---|---|---|
_crv | address | CRV token (0xD533a949740bb3306d119CC777fa900bA034cd52); |
_cvx | address | CVX token (0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B); |
_cvxCrv | address | cvxCRV token (0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7); |
_crvDepositWrapper | address | crvDepositWrapper (0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae); |
_cvxCrvRewards | address | cvxCrvRewards (0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e); |
_locker | address | vlCVX (0xD18140b4B819b895A3dba5442F959fA44994AF50); |
_compounder | address | cvxCrv autocompounder vault |
getName
Returns meta data of contract.
setApprovals
Approve spending of: crv -> crvDepositor cvxCrv -> cvxCrvRewards cvxCrv -> Compounder cvx -> Locker
claimRewards
Claim all the rewards
Parameters
Name | Type | Description |
---|---|---|
rewardContracts | address[] | Array of addresses for LP token rewards |
extraRewardContracts | address[] | Array of addresses for extra rewards |
tokenRewardContracts | address[] | Array of addresses for token rewards e.g vlCvxExtraRewardDistribution |
tokenRewardTokens | address[] | Array of token reward addresses to use with tokenRewardContracts |
amounts | struct AuraClaimZapV3.ClaimRewardsAmounts | Claim rewards amounts. |
options | struct AuraClaimZapV3.Options | Claim options |
AuraViewHelpers
View-only contract to combine calls
IMPORTANT: These functions are extremely gas-intensive and should not be called from within a transaction.
balancerVault
Token
Pool
Vault
VaultAccount
Locker
LockerAccount
RewardsData
ExtraRewards
PoolBalances
getVault
getVaultAccount
getLocker
getLockerAccount
getPools
getCvxCrvRewards
getPool
getPoolsBalances
getPoolBalances
getTokens
getEarmarkingReward
getMultipleEarmarkingRewards
BoosterLiteHelper
Invokes booster.earmarkRewards for multiple pools on BoosterLite
Allows anyone to call earmarkRewards
via the booster.
booster
crv
constructor
Parameters
Name | Type | Description |
---|---|---|
_booster | address | Booster.sol |
_crv | address | Crv e.g. 0xba100000625a3754423978a60c9317c58a424e3D |
earmarkRewards
processIdleRewards
Invoke processIdleRewards for each pool id.
Parameters
Name | Type | Description |
---|---|---|
_pids | uint256[] | Array of pool ids |
Convex Platform "Lite" Contracts
The convex platform contracts developed for the sidechain are ‘lite’ variations of those used on Ethereum. In practice this means that contracts have functionality changed or removed, multiple contracts are merged together or contracts are not utilised on the sidechain.
BaseRewardPool4626
BoosterOwnerLite
BoosterLite
PoolManagerLite
VoterProxyLite
BaseRewardPool4626
Simply wraps the BaseRewardPool with the new IERC4626 Vault standard functions.
See https://github.com/fei-protocol/ERC4626/blob/main/src/interfaces/IERC4626.sol#L58 This is not so much a vault as a Reward Pool, therefore asset:share ratio is always 1:1. To create most utility for this RewardPool, the "asset" has been made to be the crvLP token, as opposed to the cvxLP token. Therefore, users can easily deposit crvLP, and it will first go to the Booster and mint the cvxLP before performing the normal staking function.
asset
The address of the underlying ERC20 token used for the Vault for accounting, depositing, and withdrawing.
constructor
See BaseRewardPool.sol
totalAssets
Total amount of the underlying asset that is "managed" by Vault.
deposit
Mints shares
Vault shares to receiver
.
Because asset
is not actually what is collected here, first wrap to required token in the booster.
mint
Mints exactly shares
Vault shares to receiver
by depositing assets
of underlying tokens.
withdraw
Redeems shares
from owner
and sends assets
of underlying tokens to receiver
.
redeem
Redeems shares
from owner
and sends assets
of underlying tokens to receiver
.
convertToShares
The amount of shares that the vault would exchange for the amount of assets provided, in an ideal scenario where all the conditions are met.
convertToAssets
The amount of assets that the vault would exchange for the amount of shares provided, in an ideal scenario where all the conditions are met.
maxDeposit
Total number of underlying assets that can be deposited by owner
into the Vault, where owner
corresponds to the input parameter receiver
of a deposit
call.
previewDeposit
Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.
maxMint
Total number of underlying shares that can be minted for owner
, where owner
corresponds to the input parameter receiver
of a mint
call.
previewMint
Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.
maxWithdraw
Total number of underlying assets that can be withdrawn from the Vault by owner
, where owner
corresponds to the input parameter of a withdraw
call.
previewWithdraw
Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, given current on-chain conditions.
maxRedeem
Total number of underlying shares that can be redeemed from the Vault by owner
, where owner
corresponds to the input parameter of a redeem
call.
previewRedeem
Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, given current on-chain conditions.
name
Returns the name of the token.
symbol
Returns the symbol of the token.
decimals
Returns the decimals places of the token.
totalSupply
Returns the amount of tokens in existence.
balanceOf
Returns the amount of tokens owned by account
.
transfer
_Moves amount
tokens from the caller's account to recipient
.
Returns a boolean value indicating whether the operation succeeded.
Emits a {Transfer} event._
allowance
See {IERC20-allowance}.
approve
_See {IERC20-approve}.
Requirements:
spender
cannot be the zero address._
transferFrom
Moves amount
tokens from sender
to recipient
using the allowance mechanism. amount
is then deducted from the caller's allowance.
BoosterOwnerLite
Immutable booster owner that requires all pools to be shutdown before shutting down the entire convex system
A timelock is required if forcing a shutdown if there is a bugged pool that can not be withdrawn from. Allow arbitrary calls to other contracts, but limit how calls are made to Booster. A lite version of the original Booster for use on sidechains
poolManager
booster
stashFactory
rescueStash
owner
pendingowner
isSealed
FORCE_DELAY
isForceTimerStarted
forceTimestamp
ShutdownStarted
ShutdownExecuted
TransferOwnership
AcceptedOwnership
OwnershipSealed
constructor
Parameters
Name | Type | Description |
---|---|---|
_owner | address | Owner (e.g. CVX multisig) |
_poolManager | address | PoolManager (e.g. PoolManagerSecondaryProxy or 0xD20904e5916113D11414F083229e9C8C6F91D1e1) |
_booster | address | The booster (e.g. 0xF403C135812408BFbE8713b5A23a04b3D48AAE31) |
_stashFactory | address | Creates stashes (e.g. 0x884da067B66677e72530df91eabb6e3CE69c2bE4) |
_rescueStash | address | Rescues tokens for subsequent vlCVX redistribution (e.g. 0x01140351069af98416cC08b16424b9E765436531) |
_seal | bool |
transferOwnership
acceptOwnership
sealOwnership
setBoosterOwner
setFactories
setFeeManager
shutdownSystem
queueForceShutdown
forceShutdownSystem
execute
setRescueTokenDistribution
setRescueTokenReward
setStashExtraReward
setStashRewardHook
setStashFactoryImplementation
BoosterLite
A lite version of the original Booster for use on sidechains
crv
lockIncentive
stakerIncentive
earmarkIncentive
platformFee
MaxFees
FEE_DENOMINATOR
owner
feeManager
poolManager
staker
minter
rewardFactory
stashFactory
tokenFactory
treasury
rewards
isShutdown
PoolInfo
poolInfo
gaugeMap
Deposited
Withdrawn
PoolAdded
PoolShutdown
OwnerUpdated
FeeManagerUpdated
PoolManagerUpdated
FactoriesUpdated
RewardContractsUpdated
FeesUpdated
TreasuryUpdated
constructor
Constructor doing what constructors do. It is noteworthy that a lot of basic config is set to 0 - expecting subsequent calls setFeeManager etc.
Parameters
Name | Type | Description |
---|---|---|
_staker | address | VoterProxyLite (locks the crv and adds to all gauges) |
initialize
Initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
_minter | address | CVX token, or the thing that mints it |
_crv | address | CRV Token address |
_owner | address | Owner address |
setOwner
Owner is responsible for setting initial config, updating vote delegate and shutting system
setFeeManager
Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
setPoolManager
Pool manager is responsible for adding new pools
setFactories
Factories are used when deploying new pools. Only the stash factory is mutable after init
setRewardContracts
Only called once, to set the addresses of cvxCrv (rewards)
setFees
Fee manager can set all the relevant fees
Parameters
Name | Type | Description |
---|---|---|
_lockFees | uint256 | % for cvxCrv stakers where 1% == 100 |
_stakerFees | uint256 | % for CVX stakers where 1% == 100 |
_callerFees | uint256 | % for whoever calls the claim where 1% == 100 |
_platform | uint256 | % for "treasury" or vlCVX where 1% == 100 |
setTreasury
Set the address of the treasury (i.e. vlCVX)
poolLength
END SETTER SECTION ///
addPool
Called by the PoolManager (i.e. PoolManagerProxy) to add a new pool - creates all the required contracts (DepositToken, RewardPool, Stash) and then adds to the list!
shutdownPool
Shuts down the pool by withdrawing everything from the gauge to here (can later be claimed from depositors by using the withdraw fn) and marking it as shut down
shutdownSystem
Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing for subsequent withdrawal by any depositors.
deposit
Deposits an "_amount" to a given gauge (specified by _pid), mints a DepositToken
and subsequently stakes that on Convex BaseRewardPool
depositAll
Deposits all a senders balance to a given gauge (specified by _pid), mints a DepositToken
and subsequently stakes that on Convex BaseRewardPool
withdraw
Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool - BaseRewardPool uses withdrawAndUnwrap to get around this)
withdrawAll
Withdraw all the senders LP tokens from a given gauge
withdrawTo
Allows the actual BaseRewardPool to withdraw and send directly to the user
claimRewards
Allows a stash to claim secondary rewards from a gauge
setGaugeRedirect
Tells the Curve gauge to redirect any accrued rewards to the given stash via the VoterProxy
earmarkRewards
Basically a hugely pivotal function. Responsible for collecting the crv from gauge, and then redistributing to the correct place. Pays the caller a fee to process this.
rewardClaimed
Callback from reward contract when crv is received.
Goes off and mints a relative amount of CVX
based on the distribution schedule.
PoolManagerLite
Pool Manager Lite
Add pools to the Booster contract
booster
operator
protectAddPool
isShutdown
constructor
setOperator
setProtectPool
addPool
addPool
shutdownPool
shutdownSystem
VoterProxyLite
A lite version of the original VoterProxy for use on sidechains
mintr
crv
rewardDeposit
withdrawer
owner
operator
constructor
initialize
Initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
_mintr | address | CRV minter |
_crv | address | CRV Token address |
_owner | address | The owner |
getName
setOwner
setRewardDeposit
Allows dao to set the reward withdrawal address
Parameters
Name | Type | Description |
---|---|---|
_withdrawer | address | Whitelisted withdrawer |
_rewardDeposit | address | Distributor address |
setSystemConfig
Allows dao to set the external system config, should it change in the future
Parameters
Name | Type | Description |
---|---|---|
_mintr | address | Token minter address for claiming rewards |
setOperator
Set the operator of the VoterProxy
Parameters
Name | Type | Description |
---|---|---|
_operator | address | Address of the operator (Booster) |
setStashAccess
deposit
Deposit tokens into the Curve Gauge
Only can be called by the operator (Booster) once this contract has been whitelisted by the Curve DAO
Parameters
Name | Type | Description |
---|---|---|
_token | address | Deposit LP token address |
_gauge | address | Gauge contract to deposit to |
withdraw
Withdraw ERC20 tokens that have been distributed as extra rewards
Tokens shouldn't end up here if they can help it. However, dao can set a withdrawer that can process these to some ExtraRewardDistribution.
withdraw
Withdraw LP tokens from a gauge
Only callable by the operator
Parameters
Name | Type | Description |
---|---|---|
_token | address | LP token address |
_gauge | address | Gauge for this LP token |
_amount | uint256 | Amount of LP token to withdraw |
withdrawAll
Withdraw all LP tokens from a gauge
Only callable by the operator
Parameters
Name | Type | Description |
---|---|---|
_token | address | LP token address |
_gauge | address | Gauge for this LP token |
claimCrv
Claim CRV from Curve
Claim CRV for LP token staking from the CRV minter contract
claimRewards
Claim extra rewards from gauge
Called by operator (Booster) to claim extra rewards
balanceOfPool
execute
L1PoolManagerProxy
Allows to permissionless add pools on any supported sidechain. 1. Owner must configure gaugeTypes mapping (lzChainId => balancer gauge type) 2. User most provide a root gauge address and the layer zero chain id, with enought native fee to be able to add a pool on the destination chain.
NO_EXTRA_GAS
PT_SEND
lzChainId
LayerZero chain ID for this chain
gaugeController
Gauge controller address
gaugeCheckpointer
Gauge controller address
gaugeTypes
lzChainId => gauge type
AddSidechainPool
constructor
Parameters
Name | Type | Description |
---|---|---|
_lzChainId | uint16 | LayerZero chain ID |
_lzEndpoint | address | LayerZero endpoint |
_gaugeController | address | Gauge controller address |
_gaugeCheckpointer | address | Guage checkpointer address |
receive
setGaugeType
Maps layer zero chain id with balancer gauge type.
Parameters
Name | Type | Description |
---|---|---|
_lzChainId | uint16 | Layer zero chain id. |
gaugeType | string | Balancer gaugeType. |
addPools
Send a message to add a pool on a sidechain.
Set adapterParams correctly per dstChainId to provide enough gas to add a pool on the destination chain.
Parameters
Name | Type | Description |
---|---|---|
_gauges | address[] | The root gauge addresses. |
_dstChainId | uint16 | The LayerZero destination chain ID eg optimism is 111 |
_zroPaymentAddress | address | The LayerZero ZRO payment address |
_adapterParams | bytes | The adapter params, very important as default gas limit is not enough to add a pool on any sidechain. |
L2PoolManagerProxy
Given a root gauge on L1PoolManagerProxy it adds a gauge recipient on PoolManagerLite
poolManager
The poolManager address
isValidGauge
Mapping of valid gauges sent from L1
PoolManagerUpdated
constructor
initialize
Initialize the contract.
Parameters
Name | Type | Description |
---|---|---|
_lzEndpoint | address | LayerZero endpoint contract |
_poolManager | address | Pool Manager address |
isShutdown
setPoolManager
setPoolManagerOperator
sets the poolManager operator.
Usefull to reset pool manager operator value.
ownerAddPool
Adds new pool directly on L2.
Parameters
Name | Type | Description |
---|---|---|
_gauge | address | The gauge address. |
addPool
Adds new pool directly on L2 checking for a valid gauge
Parameters
Name | Type | Description |
---|---|---|
_gauge | address | The gauge address. |
shutdownPool
Shutdowns a given pool.
Parameters
Name | Type | Description |
---|---|---|
_pid | uint256 | The pool id. |
shutdownSystem
Shutdows the system, it is not reversible.
Last updated