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 pause
PausableProxyOFT.sol : Proxy OFT extension that allows a guardian address to perform an emergency pause
PauseGuardian.sol : Allows to implement pauses triggered by a guardian address
L1PoolManagerProxy.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
Sidechain auraBAL
Constructs the AuraBalOFT contract.
Parameters
Initialize the contract.
Parameters
LayerZero endpoint contract
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
auraBAL compounder vault contract address
internalTotalSupply
Internally tracking of total auraBAL supply bridged
harvestSrcChainIds
Harvest src chain IDs array
token address mapped to amount
token address mapped srcChainId mapped to amount claimable
srcChainId mapped to reward receiver
authorizedHarvesters
Authorized harvesters
Token to OFT
Emitted when harvest rewards.
Parameters
The total amount of auraBal staked on all sidechains.
Constructs the AuraBalProxyOFT contract
Parameters
LayerZero endpoint contract
The proxied token (auraBAL)
The AuraBal compounder vault
The pause guardian address
Initial inflow limit per epoch
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
setRewardReceiver
Set reward receiver for src chain
Parameters
updateAuthorizedHarvesters
Adds or remove an address from the harvesters' whitelist
Parameters
address of the authorized harvester
Whether to add or remove harvester
Set OFT for token
Parameters
setHarvestSrcChainIds
Set srcChainIds to loop through for harvest
Parameters
circulatingSupply
returns the circulating amount of tokens on current chain
_Harvest rewards from the compounder and distribute them to the source chains
Parameters
Array of totalUnderlying auraBAL staked on the source chain
Sum of values in _totalUnderlying array
processClaimable
Process claimable rewards
Parameters
The LayerZero ZRO payment address
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
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
The address of the token to be rescued.
The address to which the tokens should be transferred.
The amount of tokens to be rescued.
Sidechain AURA
canonicalChainId
canonical chain ID
Emitted when locked cvx on the L1 chain
Parameters
The amount of cvx locked.
Constructs the AuraOFT contract.
Parameters
Initialize the contract.
Parameters
LayerZero endpoint contract
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Lock CVX on the L1 chain
Parameters
address that will be receiving the refund and vlaura lock
Amount of CVX to lock for vlCVX on L1
The LayerZero ZRO payment address
Send and receive AURA to and from all the Sidechains and receives lock requests from the sidechains
Aura Locker contract address
Constructs the AuraProxyOFT contract
Parameters
LayerZero endpoint contract
The proxied token (auraBAL)
The Aura Locker contract address
The pause guardian address
Initial inflow limit per epoch
Deploy contracts using CREATE2 opcode.
A factory contract that uses the CREATE2 opcode to deploy contracts with a deterministic address.
Event emitted when a contract is successfully deployed.
Parameters
A unique value used as part of the computation to determine the contract's address.
The address where the contract has been deployed.
Adds or remove an address from the deployers' whitelist
Parameters
address of the authorized deployer
Whether to add or remove deployer
Deploys a contract using the CREATE2 opcode.
Parameters
The amount of Ether to be sent with the transaction deploying the contract.
A unique value used as part of the computation to determine the contract's address.
The bytecode that will be used to create the contract.
Callbacks to execute after contract is created.
Return Values
The address where the contract has been deployed.
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
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
CrossChainMessages
Share types for cross chain messages
_Magic Bytes to pad the custom message with bytes4(keccak256("isCustomMessage(bytes)"))
Tracks the amount of fee debt accrued by each sidechain and sends AURA back to each sidechain for rewards
REWARD_MULTIPLIER_DENOMINATOR
BAL token contract
AURA token contract
AURA OFT token contract
AURA treasury address
Booster contract address
rewardMultiplier
Reward multiplier
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
src chain ID to L2Coordinator address
sender to isDistributor
BridgeDelegateUpdated
Parameters
The bridge delegate contract
L2CoordinatorUpated
Parameters
The l2Coordinator contract
DisributorUpdated
Parameters
If they are an active distributor
FeeDebtNotified
Parameters
Amount of fee that was notified
AuraDistributed
Parameters
Amount of AURA that was distributed
Parameters
Amount of fee debt that was settled
RewardMultiplierUpdated
Parameters
Parameters
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
setBridgeDelegate
Set bridge delegate for given srcChainId
Parameters
Address of the bridge delegate
setL2Coordinator
Set L2 Coordinator for given srcChainId
Parameters
Set distributor as valid or invalid so the can call harvest
Parameters
Is the distributor active
setRewardMultiplier
Set the reward multiplier
Parameters
Set the booster address
Parameters
The booster contract address
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
Receive CRV from the L2 via some thirdpart bridge to settle the feeDebt for the remote chain
Coordinates LZ messages and actions from the L1 on the L2
canonicalChainId
canonical chain ID
AuraOFT contract
Booster contract
The BAL token contract
The bridge delegate contract
Accumulated BAL rewards
Accumulated AURA rewards
BridgeDelegateUpdated
Emitted when the bridge delegate address is updated.
Parameters
The new bridge delegate address.
Emmitted when rewards are added
Parameters
Get mint rate based on accumulated BAL and AURA
Dev mint rate is aura per bal rewards
Initializes the booster and balToken addresses
This function should only be called by the owner of the contract
Parameters
LayerZero endpoint contract
setBridgeDelegate
setAdapterParams
Sets the configuration for a given source chain ID and selector.
Parameters
Mint function called by Booster.rewardClaimed. uses the CVX (L2) balance of this contract to transfer tokens
Parameters
Address to send CVX (L2) to
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
Sender that initiated the Booster call
Amount of CRV that was received as fees
Amount of CRV that was received by the reward contract
The LayerZero ZRO payment address
Extension to the OFT standard that allows a guardian address to perform an emergency pause on the sendFrom function.
Constructs the PausableOFT contract
Parameters
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.
Duration of each inflow epoch
Addres of super user
Transfer inflow limit per epoch
Queue delay
Epoch mapped to transfer outflow
Epoch mapped to transfer inflow
Transfer queue
QueuedFromChain
Parameters
Time the transfer was queued
Parameters
Parameters
Proxy token (eg AURA or auraBAL)
Initial inflow limit per epoch
Amount of time that a transfer has to sit in the queue until it can be processed
Parameters
Set the inflow limit per epoch
Parameters
getCurrentEpoch
Get current epoch
Override sendFrom to add pause modifier
Process a queued transfer Transfer has to be a valid root and the queue delay has to have passed
Parameters
Time when this transfer was queued
In a doomsday bridge scenario there may be a case where funds need to be rescued.
Parameters
Contract module which allows children to implement an emergency stop mechanism that can be triggered by an authorized immutable guardian address.
The guardian address
This function pauses the contract.
This function can only be called by the 'guardian'.
This function is used to unpause the contract.
This function can only be called by the 'guardian' of the contract.
IArbitrumGatewayRouter
outboundTransfer
ArbitrumBridgeSender
The Gnosis bridge address
Mainnet CRV token address
Constructs the GnosisBridgeSender contract.
Parameters
The arbitrum gatewayRouter address.
_Function to send a specified amount of tokens. Requirements:
The caller must be the owner of the contract._
Parameters
The amount of CRV tokens to be sent
BridgeDelegateReceiver
Receive bridged tokens from the L2 on L1
The L1Coordinator address
The source chain id
Emitted when tokens are sent to a recipient.
Parameters
The amount of fee debt settled.
Constructs the BridgeDelegateReceiver contract.
Parameters
The address of the L1 Coordinator.
Settle fee debt on the L1 Coordinator.
Parameters
The amount debt to settle Requirements: - The caller must be the owner of the contract.
BridgeDelegateSender
Sends tokens to L1 via a bridge
The crv token address
The L1Receiver address
Emitted when tokens are sent to a recipient.
Parameters
The address of the recipient.
The amount of tokens sent.
L1ReceiverUpated
Emitted when the l1 receiver address is updated.
Parameters
The new l1 receiver address.
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
The new l1 receiver address.
Function to send a specified amount of tokens
Parameters
The amount of tokens to be sent
SimpleBridgeDelegateSender
Only used as an example and for tests Sends tokens to "L1" via a simple transfer
The ERC20 bridged token address.
Constructs the SimpleBridgeDelegateSender contract.
Parameters
The address of the ERC20 token to be sent.
Sends tokens to a l1Receiver.
Parameters
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.
canonicalChainID
ClaimRewardsAmounts
Returns meta data of contract
Approve spending of: cvxCrv -> Compounder
Claim all the rewards
Parameters
Array of addresses for LP token rewards
Array of addresses for extra rewards
Array of addresses for token rewards e.g vlCvxExtraRewardDistribution
Array of token reward addresses to use with tokenRewardContracts
struct SidechainClaimZap.ClaimRewardsAmounts
struct SidechainClaimZap.Options
Simple strategy to harvest all vault's extra rewards and queue them.
The $AURABAL token address
The AuraBal compounder vault address
Simple constructor
Parameters
The $AURABAL token address
The AuraBal compounder vault
totalUnderlying
Allows the Vault to withdraw a given amount of auraBal.
Only callable by the vault.
Parameters
The amount of auraBal to withdraw.
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.
stakerIncentive
earmarkIncentive
FEE_DENOMINATOR
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
crvDepositWrapper
ClaimRewardsAmounts
Parameters
CRV token (0xD533a949740bb3306d119CC777fa900bA034cd52);
CVX token (0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B);
cvxCRV token (0x62B9c7356A2Dc64a1969e19C23e4f579F9810Aa7);
crvDepositWrapper (0x8014595F2AB54cD7c604B00E9fb932176fDc86Ae);
cvxCrvRewards (0x3Fe65692bfCD0e6CF84cB1E7d24108E434A7587e);
vlCVX (0xD18140b4B819b895A3dba5442F959fA44994AF50);
cvxCrv autocompounder vault
Returns meta data of contract.
Approve spending of: crv -> crvDepositor cvxCrv -> cvxCrvRewards cvxCrv -> Compounder cvx -> Locker
Claim all the rewards
Parameters
Array of addresses for LP token rewards
Array of addresses for extra rewards
Array of addresses for token rewards e.g vlCvxExtraRewardDistribution
Array of token reward addresses to use with tokenRewardContracts
struct AuraClaimZapV3.ClaimRewardsAmounts
struct AuraClaimZapV3.Options
AuraViewHelpers
View-only contract to combine calls
IMPORTANT: These functions are extremely gas-intensive and should not be called from within a transaction.
getVaultAccount
getLockerAccount
getCvxCrvRewards
getPoolsBalances
getPoolBalances
getEarmarkingReward
getMultipleEarmarkingRewards
BoosterLiteHelper
Invokes booster.earmarkRewards for multiple pools on BoosterLite
Allows anyone to call earmarkRewards via the booster.
Parameters
Crv e.g. 0xba100000625a3754423978a60c9317c58a424e3D
processIdleRewards
Invoke processIdleRewards for each pool id.
Parameters
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
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.
The address of the underlying ERC20 token used for the Vault for accounting, depositing, and withdrawing.
See BaseRewardPool.sol
Total amount of the underlying asset that is "managed" by Vault.
Mints shares Vault shares to receiver.
Because asset is not actually what is collected here, first wrap to required token in the booster.
Mints exactly shares Vault shares to receiver by depositing assets of underlying tokens.
Redeems shares from owner and sends assets of underlying tokens to receiver.
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.
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.
Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.
Total number of underlying shares that can be minted for owner, where owner corresponds to the input parameter receiver of a mint call.
Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.
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.
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.
Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, given current on-chain conditions.
Returns the name of the token.
Returns the symbol of the token.
Returns the decimals places of the token.
Returns the amount of tokens in existence.
Returns the amount of tokens owned by account.
_Moves amount tokens from the caller's account to recipient.
Returns a boolean value indicating whether the operation succeeded.
Emits a {Transfer} event._
See {IERC20-allowance}.
_See {IERC20-approve}.
Requirements:
spender cannot be the zero address._
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
isForceTimerStarted
ShutdownStarted
ShutdownExecuted
TransferOwnership
AcceptedOwnership
OwnershipSealed
Parameters
Owner (e.g. CVX multisig)
PoolManager (e.g. PoolManagerSecondaryProxy or 0xD20904e5916113D11414F083229e9C8C6F91D1e1)
The booster (e.g. 0xF403C135812408BFbE8713b5A23a04b3D48AAE31)
Creates stashes (e.g. 0x884da067B66677e72530df91eabb6e3CE69c2bE4)
Rescues tokens for subsequent vlCVX redistribution (e.g. 0x01140351069af98416cC08b16424b9E765436531)
transferOwnership
acceptOwnership
setBoosterOwner
queueForceShutdown
forceShutdownSystem
setRescueTokenDistribution
setRescueTokenReward
setStashExtraReward
setStashRewardHook
setStashFactoryImplementation
A lite version of the original Booster for use on sidechains
stakerIncentive
earmarkIncentive
FEE_DENOMINATOR
FeeManagerUpdated
PoolManagerUpdated
FactoriesUpdated
RewardContractsUpdated
TreasuryUpdated
Constructor doing what constructors do. It is noteworthy that a lot of basic config is set to 0 - expecting subsequent calls setFeeManager etc.
Parameters
VoterProxyLite (locks the crv and adds to all gauges)
Initialize the contract.
Parameters
CVX token, or the thing that mints it
Owner is responsible for setting initial config, updating vote delegate and shutting system
Fee Manager can update the fees (lockIncentive, stakeIncentive, earmarkIncentive, platformFee)
Pool manager is responsible for adding new pools
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)
Fee manager can set all the relevant fees
Parameters
% for cvxCrv stakers where 1% == 100
% for CVX stakers where 1% == 100
% for whoever calls the claim where 1% == 100
% for "treasury" or vlCVX where 1% == 100
Set the address of the treasury (i.e. vlCVX)
END SETTER SECTION ///
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!
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
Shuts down the WHOLE SYSTEM by withdrawing all the LP tokens to here and then allowing for subsequent withdrawal by any depositors.
Deposits an "_amount" to a given gauge (specified by _pid), mints a DepositToken and subsequently stakes that on Convex BaseRewardPool
Deposits all a senders balance to a given gauge (specified by _pid), mints a DepositToken and subsequently stakes that on Convex BaseRewardPool
Withdraw a given amount from a pool (must already been unstaked from the Convex Reward Pool - BaseRewardPool uses withdrawAndUnwrap to get around this)
Withdraw all the senders LP tokens from a given gauge
Allows the actual BaseRewardPool to withdraw and send directly to the user
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
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.
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
A lite version of the original VoterProxy for use on sidechains
Initialize the contract.
Parameters
setRewardDeposit
Allows dao to set the reward withdrawal address
Parameters
setSystemConfig
Allows dao to set the external system config, should it change in the future
Parameters
Token minter address for claiming rewards
Set the operator of the VoterProxy
Parameters
Address of the operator (Booster)
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
Gauge contract to deposit to
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 LP tokens from a gauge
Only callable by the operator
Parameters
Amount of LP token to withdraw
Withdraw all LP tokens from a gauge
Only callable by the operator
Parameters
Claim CRV from Curve
Claim CRV for LP token staking from the CRV minter contract
Claim extra rewards from gauge
Called by operator (Booster) to claim extra rewards
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.
LayerZero chain ID for this chain
gaugeController
Gauge controller address
gaugeCheckpointer
Gauge controller address
lzChainId => gauge type
AddSidechainPool
Parameters
Guage checkpointer address
Maps layer zero chain id with balancer gauge type.
Parameters
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
The root gauge addresses.
The LayerZero destination chain ID eg optimism is 111
The LayerZero ZRO payment address
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
The poolManager address
Mapping of valid gauges sent from L1
PoolManagerUpdated
Initialize the contract.
Parameters
LayerZero endpoint contract
setPoolManagerOperator
sets the poolManager operator.
Usefull to reset pool manager operator value.
Adds new pool directly on L2.
Parameters
Adds new pool directly on L2 checking for a valid gauge
Parameters
Shutdowns a given pool.
Parameters
Shutdows the system, it is not reversible.