Smart Contract

Methods :

Events :

Registred

event Registred(address indexed user, uint256 price)

Emitted when an user registers a new BoostOffer

UpdateOffer

event UpdateOffer(address indexed user, uint256 newPrice)

Emitted when an user updates its BoostOffer

UpdateOfferPrice

event UpdateOfferPrice(address indexed user, uint256 newPrice)

Emitted when an user updates its BoostOffer price

Quit

event Quit(address indexed user)

Emitted when an user removes its BoostOffer

BoostPurchase

event BoostPurchase (address indexed delegator, address indexed receiver, uint256 tokenId, uint256 amount, uint256 price, uint256 paidFeeAmount, uint256 expiryTime)

Emitted when a Boost is purchased

Claim

event Claim(address indexed user, uint256 amount)

Emitted when an user claims the fees earned

NewAdvisedPrice

event NewAdvisedPrice(uint256 newPrice)

Emitted when the advised price is updated

Read-only methods :

struct BoostOffer

typenamedesc

address

user

Address of the user making the offer

uint256

pricePerVote

Price per vote per second, set by the user

uint64

maxDuration

Max duration a Boost from this offer can last

uint64

expiryTime

Timestamp of expiry of the Offer

uint16

minPerc

Minimum percent of users voting token balance to buy for a Boost (in BPS)

uint16

maxPerc

Maximum percent of users total voting token balance available to delegate (in BPS)

bool

useAdvicePrice

Use the advised price instead of the Offer one

feeToken

function feeToken() public view returns(address)

ERC20 used to pay for DelegationBoost

votingEscrow

function votingEscrow() public view returns(address)

Address of the votingEscrowToken to delegate

delegationBoost

function delegationBoost() public view returns(address)

Address of the Delegation Boost contract (veBoost)

feeReserveRatio

function feeReserveRatio() public view returns(address)

Ratio of fees to be set as Reserve (in BPS)

minPercRequired

function minPercRequired() public view returns(address)

Min Percent of delegator votes to buy required to purchase a Delegation Boost (in BPS)

minDelegationTime

function minDelegationTime() public view returns(address)

Minimum delegation time, taken from veBoost contract (currently 1 week)

advisedPrice

function advisedPrice() public view returns(uint256)

Price per vote advised by the managers for users that don't handle their pricing themselves

offers

function offers(uint256 index) public view returns(BoostOffer)

Returns the BoostOffer for a given index

userIndex

function userIndex(address user) public view returns(uint256)

Index of the user in the offers array

earnedFees

function earnedFees(address user) public view returns(uint256)

Amount of fees earned by users through Boost selling

canDelegate

function canDelegate(address delegator, uint256 amount) external view returns(bool)

Checks if the delegator has enough available balance & the Offer allows to delegate the given amount

canDelegatePercent

function canDelegatePercent(address delegator, uint256 percent) external view returns(bool)

Checks if the delegator has enough available balance & the Offer allows to delegate the given amount (for a given percent of the Offer)

offersIndex

function offersIndex() external view returns(uint256)

Total amount of BoostOffers currently in the list

estimateFees

function estimateFees( address delegator, uint256 amount, uint256 duration) external view returns (uint256)

Gives an estimate of fees to pay for a given Boost Delegation

Parameters :

name

type

desc

delegator

address

Address of the delegator for the Boost

amount

uint256

Amount to delegate

duration

uint256

Duration (in weeks) of the Boost to purchase

estimateFeesPercent

function estimateFeesPercent( address delegator, uint256 percent, uint256 duration) external view returns (uint256)

Gives an estimate of fees to pay for a given Boost Delegation

Parameters :

name

type

desc

delegator

address

Address of the delegator for the Boost

percent

uint256

Percent of the delegator balance to delegate (in BPS)

duration

uint256

Duration (in weeks) of the Boost to purchase

claimable

function claimable(address user) external view returns (uint256)

Returns the amount of fees earned by the user that can be claimed

State-changing methods :

register

function register( uint256 pricePerVote, uint16 minPerc, uint16 maxPerc ) external returns(bool)

Registers a new user wanting to sell its delegation

Parameters :

name

type

desc

pricePerVote

uint256

Price of 1 vote per second (in wei)

maxDuration

uint64

Maximum duration (in weeks) that a Boost can last when taken from this Offer

expiryTime

uint64

Timestamp when this Offer is not longer valid

minPerc

uint16

Minimum percent of users voting token balance to buy for a Boost (in BPS)

maxPerc

uint16

Maximum percent of users total voting token balance available to delegate (in BPS)

useAdvicePrice

bool

True to use the advice Price instead of the given pricePerVote

Returns : bool : success

updateOffer

function updateOffer( uint256 pricePerVote, uint64 maxDuration, uint64 expiryTime, uint16 minPerc, uint16 maxPerc, bool useAdvicePrice) external returns(bool)

Updates an user BoostOffer parameters

Parameters :

name

type

desc

pricePerVote

uint256

Price of 1 vote per second (in wei)

maxDuration

uint64

Maximum duration (in weeks) that a Boost can last when taken from this Offer

expiryTime

uint64

Timestamp when this Offer is not longer valid

minPerc

uint16

Minimum percent of users voting token balance to buy for a Boost (in BPS)

maxPerc

uint16

Maximum percent of users total voting token balance available to delegate (in BPS)

useAdvicePrice

bool

True to use the advice Price instead of the given pricePerVote

Returns : bool : success

updateOfferPrice

function updateOfferPrice( uint256 pricePerVote, bool useAdvicePrice) external returns(bool)

Updates an user BoostOffer Price parameters

Parameters :

name

type

desc

pricePerVote

uint256

Price of 1 vote per second (in wei)

useAdvicePrice

bool

True to use the advice Price instead of the given pricePerVote

quit

function quit() external returns(bool)

Remove the BoostOffer of the user, and claim any remaining fees earned

Returns : bool : success

buyDelegationBoost

function buyDelegationBoost( address delegator, address receiver, uint256 percent, uint256 duration, uint256 maxFeeAmount ) external returns(uint256)

Buy a Delegation Boost from a Delegator BoostOffer

Parameters :

name

type

desc

delegator

address

Address of the delegator for the Boost

receiver

address

Address of the receiver of the Boost

amount

uint256

Amount to delegate

duration

uint256

Duration (in weeks) of the Boost to purchase

maxFeeAmount

uint256

Maximum amount of feeToken available to pay to cover the Boost Duration (in wei)

Returns : uint256 : tokenId of the newly minted veBoost

The maxFeeAmount value must be approved in the feeToken ERC20 for Warden before this transaction

The Buyer will then need to call the user_checkpoint() method on all Curve V4 & Factory Gauges currently farming, to apply the newly received Boost

buyDelegationBoostPercent

function buyDelegationBoost( address delegator, address receiver, uint256 percent, uint256 duration, uint256 maxFeeAmount ) external returns(uint256)

Buy a Delegation Boost from a Delegator BoostOffer

Parameters :

name

type

desc

delegator

address

Address of the delegator for the Boost

receiver

address

Address of the receiver of the Boost

percent

uint256

Percent of the delegator balance to delegate (in BPS)

duration

uint256

Duration (in weeks) of the Boost to purchase

maxFeeAmount

uint256

Maximum amount of feeToken available to pay to cover the Boost Duration (in wei)

Returns : uint256 : tokenId of the newly minted veBoost

The maxFeeAmount value must be approved in the feeToken ERC20 for Warden before this transaction

The Buyer will then need to call the user_checkpoint() method on all Curve V4 & Factory Gauges currently farming, to apply the newly received Boost

claim

function claim() external returns(bool)

Claims all earned fees

Returns : bool : success

Last updated