Claim Refund

If a token doesn't graduate within 3 days, holders can initiate refund mode and claim pro-rata ETH refunds.

Check Eligibility

const curve = new ethers.Contract(CURVE_ADDRESS, CURVE_ABI, provider);

const isRefund = await curve.is_refund_mode();
const isGrad = await curve.is_graduated();
const myLots = await curve.get_user_token_balance(myAddress);

Initiate Refund Mode

// Anyone can call this after 3 days if not graduated
if (!isRefund && !isGrad) {
    await (await curve.connect(signer).initiate_refund()).wait();
}

const refundPerLot = await curve.refund_per_lot();
console.log("Refund per lot:", ethers.utils.formatEther(refundPerLot));

Claim Your Refund

// Approve tokens for burning
const token = new ethers.Contract(TOKEN_ADDRESS, ERC20_ABI, signer);
const burnAmount = myLots.mul(1000).mul(ethers.BigNumber.from(10).pow(9));
await (await token.approve(CURVE_ADDRESS, burnAmount)).wait();

// Claim refund — tokens are burned, ETH returned
await (await curve.connect(signer).refund_claim(myLots)).wait();