carbonable-labs / carbon-protocol-v3

Apache License 2.0
3 stars 9 forks source link

CPv3 - Rebase function - change Tokenized Carbon Credit status and supply #38

Closed cloudvenger closed 1 week ago

cloudvenger commented 3 weeks ago

Description

Implement rebase function for Tokenized Carbon Credit Smart Contract. When changing the status of one Vintage and if needed to update the total supply of this Vintage, be able to modify proportionally the supply of this Vintage in the wallet of users.

Additional context

Rebase tokens are a type of cryptocurrency that adjusts their supply.

Rebase tokens achieve price stability through a process known as a "rebase," which is triggered at regular intervals (e.g., every 24 hours). During a rebase, the supply of the token is adjusted based on a predetermined formula.

**AMPL**: The unit of account ERC-20 token. AMPL's price targets the CPI adjusted 2019 USD, but the number of AMPL tokens in user wallets automatically increases or decreases based on demand.

The Ampleforth Protocol automatically expands or contracts the quantity of tokens in user wallets based on price. Except the number of AMPL tokens in your wallet increases when there's more demand and decreases when there's less demand.

Elastic Supply Policy

Rebase function : To execute this process efficiently, we avoid generating a transaction for each wallet. Instead, Ampleforth
balances are internally represented by a hidden internal denomination. All external interfaces to the system
reference the external denomination, while all internal operations reference the hidden internal denomination.The conversion rate between the hidden internal denomination and the external denomination is controlled
by an exchange rate that equals hiddenSupply/uFragmentSupply. This coefficient of expansion,
sometimes referred to as the splitRatio, is represented rationally as the quotient of two numbers in the codebase.

About the Ampleforth Protocol

Webographie

https://cryptonews.com/exclusives/rebase-tokens.htm#:~:text=What%20Are%20Rebase%2FElastic%20Tokens,the%20time%20of%20their%20creation.

https://www.ampleforth.org/

Ampleforth Whitpaper

https://github.com/ampleforth/ampleforth-contracts

https://github.com/ampleforth/ampleforth-contracts/blob/master/contracts/WAMPL.sol