LP Tokens — Curve 1.0.0 documentation (2024)

In exchange for depositing coins into a Curve pool (see Curve Pools), liquidity providers receive pool LP tokens. A Curve pool LP token is an ERC20 contract specific to the Curve pool. Hence, LP tokens are transferrable. Holders of pool LP tokens may stake the token into a pool’s liquidity gauge in order to receive CRV token rewards. Alternatively, if the LP token is supported by a metapool, the token may be deposited into the respective metapool in exchange for the metapool’s LP token (see here).

The following versions of Curve pool LP tokens exist:

The version of each pool’s LP token can be found in the Deployment Addresses.

Note

For older Curve pools the token attribute is not always public and a getter has not been explicitly implemented.

Curve Token V1

The implementation for a Curve Token V1 may be viewed on GitHub.

CurveToken.name() string[64]: view

Get the name of the token.

>>> lp_token.name()'Curve.fi yDAI/yUSDC/yUSDT/yBUSD'
CurveToken.symbol() string[32]: view

Get the token symbol.

>>> lp_token.symbol()'yDAI+yUSDC+yUSDT+yBUSD'
CurveToken.decimals() uint256: view

Get the number of decimals for the token.

>>> lp_token.decimals()18
CurveToken.balanceOf(account: address) uint256: view

Get the token balance for an account.

  • account: Address to get the token balance for

CurveToken.totalSupply() uint256: view

Get the total token supply.

>>> lp_token.totalSupply()73112516629065063732935484
CurveToken.allowance(_owner: address, _spender: address) uint256: view

Get the allowance of an account to spend on behalf of some other account.

  • _owner: Account that is paying when _spender spends the allowance

  • _spender: Account that can spend up to the allowance

Returns the allowance of _spender for _owner.

CurveToken.transfer(_to: address, _value: uint256) bool

Transfer tokens to a specified address.

  • _to: Receiver of the tokens

  • _value: Amount of tokens to transfer

Returns True if the transfer succeeded.

CurveToken.transferFrom(_from: address, _to: address, _value: uint256) bool

Transfer tokens from one address to another. Note that while this function emits a Transfer event, this is not required as per the specification, and other compliant implementations may not emit the event.

  • _from: Address which you want to send tokens from

  • _to: Address which you want to transfer to

  • _value: Amount of tokens to be transferred

Returns True if transfer succeeded.

CurveToken.approve(_spender: address, _value: uint256) bool

Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.

Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender’s allowance to 0 and set the desired value afterwards (see this GitHub issue).

  • _spender: Address which will spend the funds.

  • _value: Amount of tokens to be spent.

Returns True if approval succeeded.

Warning

For Curve LP Tokens V1 and V2, non-zero to non-zero approvals are prohibited. Instead, after every non-zero approval, the allowance for the spender must be reset to 0.

Minter Methods

The following methods are only callable by the minter (private attribute).

Note

For Curve Token V1, the minter attribute is not public.

CurveToken.mint(_to: address, _value: uint256)

Mint an amount of the token and assign it to an account. This encapsulates the modification of balances such that the proper events are emitted.

  • _to: Address that will receive the created tokens

  • _value: Amount that will be created

CurveToken.burn(_value: uint256)

Burn an amount of the token of msg.sender.

  • _value: Token amount that will be burned

CurveToken.burnFrom(_to: address, _value: uint256)

Burn an amount of the token from a given account.

  • _to: Account whose tokens will be burned

  • _value: Amount that will be burned

CurveToken.set_minter(_minter: address)

Set a new minter for the token.

  • _minter: Address of the new minter

Curve Token V2

The implementation for a Curve Token V2 may be viewed on GitHub.

Note

Compared to Curve Token v1, the following changes have been made to the API:

  • minter attribute is public and therefore a minter getter has been generated

  • name and symbol attributes can be set via set_name

  • mint method returns bool

  • burnFrom method returns bool

  • burn method has been removed

Warning

For Curve LP Tokens V1 and V2, non-zero to non-zero approvals are prohibited. Instead, after every non-zero approval, the allowance for the spender must be reset to 0.

CurveToken.minter() address: view

Getter for the address of the minter of the token.

CurveToken.set_name(_name: String[64], _symbol: String[32])

Set the name and symbol of the token.

  • _name: New name of token

  • _symbol: New symbol of token

This method can only be called by minter.

CurveToken.mint(_to: address, _value: uint256) bool

Mint an amount of the token and assign it to an account. This encapsulates the modification of balances such that the proper events are emitted.

Returns True if not reverted.

CurveToken.burnFrom(_to: address, _value: uint256) bool

Burn an amount of the token from a given account.

  • _to: Account whose tokens will be burned

  • _value: Amount that will be burned

Returns True if not reverted.

Curve Token V3

The Curve Token V3 is more gas efficient than versions 1 and 2.

Note

Compared to the Curve Token V2 API, there have been the following changes:

  • increaseAllowance and decreaseAllowance methods added to mitigate race conditions

The implementation for a Curve Token V3 may be viewed on GitHub.

CurveToken.increaseAllowance(_spender: address, _added_value: uint256) bool

Increase the allowance granted to _spender by the msg.sender.

This is alternative to approve that can be used as a mitigation for the potential race condition.

  • _spender: Address which will transfer the funds

  • _added_value: Amount of to increase the allowance

Returns True if success.

CurveToken.decreaseAllowance(_spender: address, _subtracted_value: uint256) bool

Decrease the allowance granted to _spender by the msg.sender.

This is alternative to {approve} that can be used as a mitigation for the potential race condition.

  • _spender: Address which will transfer the funds

  • _subtracted_value: Amount of to decrease the allowance

Returns True if success.

LP Tokens — Curve 1.0.0 documentation (2024)
Top Articles
ITS Data Access Policy
Best Credit Cards for Bad Credit of 2024
Fiskars X27 Kloofbijl - 92 cm | bol
Pollen Count Centreville Va
Warren Ohio Craigslist
Places 5 Hours Away From Me
Odawa Hypixel
Kansas City Kansas Public Schools Educational Audiology Externship in Kansas City, KS for KCK public Schools
Lifebridge Healthstream
Recent Obituaries Patriot Ledger
Craigslist Nj North Cars By Owner
Draconic Treatise On Mining
[2024] How to watch Sound of Freedom on Hulu
How do you like playing as an antagonist? - Goonstation Forums
Otterbrook Goldens
Baywatch 2017 123Movies
Mzinchaleft
Imagetrend Inc, 20855 Kensington Blvd, Lakeville, MN 55044, US - MapQuest
Weather Rotterdam - Detailed bulletin - Free 15-day Marine forecasts - METEO CONSULT MARINE
Craigslist Red Wing Mn
Roof Top Snipers Unblocked
Indystar Obits
Euro Style Scrub Caps
Wkow Weather Radar
Valic Eremit
Asteroid City Showtimes Near Violet Crown Charlottesville
14 Top-Rated Attractions & Things to Do in Medford, OR
Best Middle Schools In Queens Ny
Kitchen Exhaust Cleaning Companies Clearwater
Himekishi Ga Classmate Raw
Taylored Services Hardeeville Sc
Ts Modesto
Marlene2295
Sony Wf-1000Xm4 Controls
Kelsey Mcewen Photos
Shoreone Insurance A.m. Best Rating
Sams La Habra Gas Price
Dee Dee Blanchard Crime Scene Photos
Low Tide In Twilight Manga Chapter 53
Is Ameriprise A Pyramid Scheme
Ghareeb Nawaz Texas Menu
Craigslist Rooms For Rent In San Fernando Valley
Unlock The Secrets Of "Skip The Game" Greensboro North Carolina
Ehc Workspace Login
Hawkview Retreat Pa Cost
300+ Unique Hair Salon Names 2024
Great Clips Virginia Center Commons
Wild Fork Foods Login
Deshuesadero El Pulpo
Gelato 47 Allbud
Escape From Tarkov Supply Plans Therapist Quest Guide
Qvc Com Blogs
Latest Posts
Article information

Author: Merrill Bechtelar CPA

Last Updated:

Views: 5905

Rating: 5 / 5 (70 voted)

Reviews: 85% of readers found this page helpful

Author information

Name: Merrill Bechtelar CPA

Birthday: 1996-05-19

Address: Apt. 114 873 White Lodge, Libbyfurt, CA 93006

Phone: +5983010455207

Job: Legacy Representative

Hobby: Blacksmithing, Urban exploration, Sudoku, Slacklining, Creative writing, Community, Letterboxing

Introduction: My name is Merrill Bechtelar CPA, I am a clean, agreeable, glorious, magnificent, witty, enchanting, comfortable person who loves writing and wants to share my knowledge and understanding with you.