Skip to content

How to burn liquidswap lp tokens using their smart contract?? #527

Discussion options

You must be logged in to vote

How to burn a Coin in three ways

1. I have access to the BurnCapability

  • I can burn them with 0x1::coin::burn if I have access to this. Likely you don't unless you created the LP token.

2. I'm a programmer and I want to lock it in a vault and throw away the key

  • I can write a simple immutable contract that works as a vault
module addr::vault {
  use aptos_framework::coin;
  struct Vault<MyCoin> {
      coins: Coin<MyCoin>
  }

  entry fun lock_forever<MyCoin>(caller: &signer, amount: u64) {
     let coins = coin::withdraw<MyCoin>(caller, amount);
     move_to(caller, Vault<MyCoin>{
         coins
     });
  }
}

3. Transfer them to an address that no one can access

This is most used in t…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ajaythxkur
Comment options

Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants