Burning Tokens
1
const amount = hre.ethers.parseUnits("100", 18);
const tx = await token.connect(holderSigner)["burn(uint256)"](amount, { gasLimit: 5000000 });
await tx.wait();2
const BURN_SELECTOR = ethers.id("burn(((uint256,uint256),bytes))").slice(0, 10);
const it = prepareIT256(
BigInt(hre.ethers.parseUnits("100", 18)),
{ wallet, userKey: process.env.PRIVATE_AES_KEY_TESTNET },
tokenAddress,
BURN_SELECTOR
);
const tx = await token.connect(holderSigner)["burn(((uint256,uint256),bytes))"](
[[it.ciphertext.ciphertextHigh, it.ciphertext.ciphertextLow], it.signature],
{ gasLimit: 5000000 }
);
await tx.wait();3
// Inside a Solidity contract
gtUint256 gtAmount = MpcCore.setPublic256(withdrawAmount);
gtBool success = token.burnGt(gtAmount);
require(MpcCore.decrypt(success), "Burn failed");Last updated
Was this helpful?