carbonable-labs / carbon-protocol-v3

Apache License 2.0
12 stars 24 forks source link

feat: cancel public sale #138

Closed julienbrs closed 1 week ago

julienbrs commented 1 week ago

Description

During the funding phase, admin can call cancel_mint for an emergency case. The mint is then cancelled and each user can call redeem_investment to get their money back by burning their unused SFT for USDC invested

Acceptance Criteria

Additional context

One issue might be if users invest with multiple currencies (i.e STARK, USDC, ETH). Option 1: We keep track of how people invested (which currency for which amount) in a mapping. Option 2: We refund everyone in stablecoin (USDC) thanks to the minting price which is constant. However, Carbonable should beforehand swap all the ETH, STARK, etc..

Volatility might be an issue: Bob invest 1ETH worth $2k, mint is cancelled but ETH dumped by 50%. Now Bob got $1k back, like if he was holding ETH (but if he used his ETH to pay that means he probably didn't want to hold it).

tekkac commented 1 week ago

+1 We had something like this in mind, your version being more simple and elegant to me. I don't think swapping is needed since public_buy is only possible in USDC. Using other tokens is possible yet only as a Carbonable service.