WCurveGauge
This is the technical documentation for the WCurveGauge Solidity contract. The WCurveGauge contract is a wrapped Curve Gauge position that leverages LP tokens to be held in the BlueberryBank and does not generate yields. LP tokens are identified by tokenIds encoded from the LP token address.
Imports
The contract imports several OpenZeppelin contracts and other utility contracts and interfaces.
Contract Inheritance
The WCurveGauge contract inherits from the following contracts:
ERC1155Upgradeable
ReentrancyGuardUpgradeable
OwnableUpgradeable
EnsureApprove
IERC20Wrapper
IWCurveGauge
State Variables
The contract maintains the following state variables:
registry
: Address of Curve RegistrygaugeController
: Address of Curve Gauge ControllerCRV
: Address of CRV tokenaccCrvPerShares
: Mapping from gauge id to accCrvPerShare
Functions
initialize
This function initializes the contract with the addresses of the CRV token, Curve Registry, and Curve Gauge Controller.
encodeId
This function encodes the given pool id and CRV amount per share to an ERC1155 token id.
decodeId
This function decodes the given ERC1155 token id to a pool id and CRV amount per share.
getUnderlyingToken
This function returns the underlying ERC20 token of the given ERC1155 token id.
getLpFromGaugeId
This function returns the LP token address from the given gauge id.
pendingRewards
This function returns the pending rewards from the farming pool.
mint
This function mints an ERC1155 token for the given LP token.
_mintCrv
This internal function mints CRV rewards for the Curve gauge.
Last updated