From f537a6b289fa3cac0bb693a3e937cdecb4a3d230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E8=8B=B1?= Date: Fri, 28 Mar 2025 14:07:45 +0800 Subject: [PATCH 1/6] add new eip --- ERCS/stablecoin_max_supply.md | 148 ++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 ERCS/stablecoin_max_supply.md diff --git a/ERCS/stablecoin_max_supply.md b/ERCS/stablecoin_max_supply.md new file mode 100644 index 00000000000..8d6f080b8be --- /dev/null +++ b/ERCS/stablecoin_max_supply.md @@ -0,0 +1,148 @@ +--- +title: ERC-20 totalSupply Extension +description: A Simple Mechanism to Manage the Maximum Supply of Stablecoin Compliant with ERC-20. +author: YuehuaZhang (@astroyhzcc) , Yuxiang Fu (@tmac4096) , Yanyi Liang , Hao Zou (@BruceZH0915) , Siyuan Zheng (@andrewcoder666) +discussions-to: https://ethereum-magicians.org/t/a-simple-mechanism-to-manage-the-maximum-supply-of-stable-coin-compliant-with-erc-20/23244 +category: ERC +created: 2025-03-07 +--- + +## Abstract + +This proposal defines a validator role for ERC20-compliant stablecoins and introduces the concept of maximum supply. Validators manage stablecoin collateral and calculate the maximum token supply based on collateral value. The maxSupply method is provided to query the current supply cap, ensuring totalSupply never exceeds maxSupply. + +## Motivation + +Most stablecoin issuers are required to hold reserve funds or collateralized assets to back the stablecoin's value. However, existing models lack a mechanism to enforce a supply cap aligned with reserve assets. This EIP aims to: +1. Create a new role to regulate totalSupply. +2. Allow validators to update the maximum supply based on collateral value. +3. Enable transparent supply governance, , ensuring compliance with regulatory or protocol-specific requirements. + +## Definitions + +* `Issuer`: the issuer of the stable coin + +* `Validator`: the reserve fund custodians or collateral managers + + +## Specification + +### Rule + +1. Validator Management ++ Validator address must be publicly verifiable ++ The maximum token supply update operations should contain the statement or receipt from the Validator, such as CAMT052 statement. ++ Validator changes require governance approval +2. Supply Enforcement ++ all mint operations must check:totalSupply() + mintAmount ≤ maxSupply() ++ Burn operations unaffected by supply cap +3. Privilege Separation ++ Issuer manages daily mint/burn operations ++ Validator controls collateral verification + +### Interface + +```solidity +interface StablecoinMaxSupply { + // @notice The event emitted when the maximum supply of token is updated successfully. + // @param _validator the address of validator who updates the maximum supply of token. + // @param _maxSupply the maximum token supply. + // + event MaxSupplyConfigured(address indexed _validator, uint256 _maxSupply); + + // @notice This function MUST return the number of maximum suppply of the token. + // @return The maximum supply of the token + function maxSupply() external view returns (uint256); + + + // @notice This function MUST return the address of validator. + // @return The validator address of the token + function validator() external view returns (address); + + // @notice This function MUST set the maximum suppply of the token. + // @param _maxSupply the maximum token supply. + // @param data the bank statement file. for example the CAMT052 or CAMT053. + function setMaxSupply(uint256 _maxSupply, bytes calldata data) external; +} +``` + +## Rationale + +1. Validator Role: Reserve custodians or collateral managers act as validators to ensure supply aligns with asset value. +2. Maximum supply updates: Validators must update maxSupply promptly when collateral or reserve value changes. + +## Backwards Compatibility + +This standard is fully compatible with ERC-20. + + +## Reference Implementation + +```solidity +contract MyStabelecoin is ERC20, StablecoinMaxSupply{ + // the address of validator + address private _validator; + + // the address of issuer + address private _issuer; + + // the maximum supply of the token + uint256 private _maxSupply; + + constructor(address validatorAddress, address issuerAddress) ERC20("TEST", "TST") { + _validator = validatorAddress; + _issuer = issuerAddress; + } + + modifier onlyIssuer() { + require(msg.sender == _issuer, "caller is not a issuer"); + _; + } + + modifier onlyValidatorOrIssuer() { + require(msg.sender == _issuer || msg.sender == validator, "caller is not a issuer or a validator"); + _; + } + + modifier validateSupply(uint256 mintAmount) { + require( + (totalSupply() <= _maxSupply) && (_maxSupply-totalSupply()>=mintAmount), + "Exceeds maximum allowable supply"); + _; + } + + + function setMaxSupply(uint256 supply, uint256 statement053) public override + onlyValidatorOrIssuer + { + _maxSupply = supply; + emit MaxSupplyConfigured(msg.sender, _maxSupply, statement053); + } + + function maxSupply() external override view returns (uint256) { + return _maxSupply; + } + + function mint(address _holder, uint256 _value) public + onlyIssuer + validateSupply(_value) + returns (bool) { + _mint(_holder, _value); + return true; + } + + function validator() external override view returns(address) { + return _validator; + } + +} +``` + +## Security Considerations + +1. Overflow Protection: Uses Solidity 0.8+ built-in checks for arithmetic operations +2. Access Control: Restricts mint to authorized roles (e.g., onlyIssuer) to prevent unauthorized issuance. + +## Copyright + +Copyright and related rights waived via [CC0](../LICENSE.md). \ No newline at end of file From 2740e8c9cbd5e3dfb65e1ed0ef4395c2a7292884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=A5=E8=8B=B1?= Date: Fri, 28 Mar 2025 14:08:23 +0800 Subject: [PATCH 2/6] add new eip --- ERCS/stablecoin_max_supply.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ERCS/stablecoin_max_supply.md b/ERCS/stablecoin_max_supply.md index 8d6f080b8be..2d1906351af 100644 --- a/ERCS/stablecoin_max_supply.md +++ b/ERCS/stablecoin_max_supply.md @@ -4,7 +4,7 @@ description: A Simple Mechanism to Manage the Maximum Supply of Stablecoin Compl author: YuehuaZhang (@astroyhzcc) , Yuxiang Fu (@tmac4096) , Yanyi Liang , Hao Zou (@BruceZH0915) , Siyuan Zheng (@andrewcoder666) discussions-to: https://ethereum-magicians.org/t/a-simple-mechanism-to-manage-the-maximum-supply-of-stable-coin-compliant-with-erc-20/23244 category: ERC -created: 2025-03-07 +created: 2025-03-21 --- ## Abstract From c57c2b9580bdd022c7728c0caf9523cd3377a3be Mon Sep 17 00:00:00 2001 From: Sam Wilson <57262657+SamWilsn@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:28:06 -0400 Subject: [PATCH 3/6] Update and rename stablecoin_max_supply.md to erc-7924.md --- ERCS/{stablecoin_max_supply.md => erc-7924.md} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename ERCS/{stablecoin_max_supply.md => erc-7924.md} (98%) diff --git a/ERCS/stablecoin_max_supply.md b/ERCS/erc-7924.md similarity index 98% rename from ERCS/stablecoin_max_supply.md rename to ERCS/erc-7924.md index 2d1906351af..f7e6ba6ae75 100644 --- a/ERCS/stablecoin_max_supply.md +++ b/ERCS/erc-7924.md @@ -1,4 +1,5 @@ --- +eip: 7924 title: ERC-20 totalSupply Extension description: A Simple Mechanism to Manage the Maximum Supply of Stablecoin Compliant with ERC-20. author: YuehuaZhang (@astroyhzcc) , Yuxiang Fu (@tmac4096) , Yanyi Liang , Hao Zou (@BruceZH0915) , Siyuan Zheng (@andrewcoder666) @@ -145,4 +146,4 @@ contract MyStabelecoin is ERC20, StablecoinMaxSupply{ ## Copyright -Copyright and related rights waived via [CC0](../LICENSE.md). \ No newline at end of file +Copyright and related rights waived via [CC0](../LICENSE.md). From 0082434fa3ee3ff9117b51df8f46c68739e7dd33 Mon Sep 17 00:00:00 2001 From: Zyh Date: Wed, 25 Jun 2025 15:37:29 +0800 Subject: [PATCH 4/6] Merge branch 'master' into astroyhzcc_stablecoin_max_supply --- ERCS/erc-7924.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ERCS/erc-7924.md b/ERCS/erc-7924.md index f7e6ba6ae75..c6073a479c5 100644 --- a/ERCS/erc-7924.md +++ b/ERCS/erc-7924.md @@ -1,7 +1,7 @@ --- eip: 7924 title: ERC-20 totalSupply Extension -description: A Simple Mechanism to Manage the Maximum Supply of Stablecoin Compliant with ERC-20. +description: Manage the maximum supply of ERC-20 stablecoins. author: YuehuaZhang (@astroyhzcc) , Yuxiang Fu (@tmac4096) , Yanyi Liang , Hao Zou (@BruceZH0915) , Siyuan Zheng (@andrewcoder666) discussions-to: https://ethereum-magicians.org/t/a-simple-mechanism-to-manage-the-maximum-supply-of-stable-coin-compliant-with-erc-20/23244 category: ERC @@ -10,20 +10,20 @@ created: 2025-03-21 ## Abstract -This proposal defines a validator role for ERC20-compliant stablecoins and introduces the concept of maximum supply. Validators manage stablecoin collateral and calculate the maximum token supply based on collateral value. The maxSupply method is provided to query the current supply cap, ensuring totalSupply never exceeds maxSupply. +This proposal defines a validator role for [ERC-20](./eip-20.md) compliant stablecoins and introduces the concept of maximum supply. Validators manage stablecoin collateral and calculate the maximum token supply based on collateral value. The `maxSupply` method is provided to query the current supply cap, ensuring `totalSupply` never exceeds `maxSupply`. ## Motivation Most stablecoin issuers are required to hold reserve funds or collateralized assets to back the stablecoin's value. However, existing models lack a mechanism to enforce a supply cap aligned with reserve assets. This EIP aims to: -1. Create a new role to regulate totalSupply. +1. Create a new role to regulate `totalSupply`. 2. Allow validators to update the maximum supply based on collateral value. 3. Enable transparent supply governance, , ensuring compliance with regulatory or protocol-specific requirements. ## Definitions -* `Issuer`: the issuer of the stable coin +* `_Issuer_`: the issuer of the stable coin -* `Validator`: the reserve fund custodians or collateral managers +* `_Validator_`: the reserve fund custodians or collateral managers ## Specification @@ -32,7 +32,7 @@ Most stablecoin issuers are required to hold reserve funds or collateralized ass 1. Validator Management + Validator address must be publicly verifiable -+ The maximum token supply update operations should contain the statement or receipt from the Validator, such as CAMT052 statement. ++ The maximum token supply update operations should contain the statement or receipt from the Validator, for example ISO 20022 message format used for bank-to-customer intraday account reporting such as CAMT052 statement. + Validator changes require governance approval 2. Supply Enforcement + all mint operations must check:totalSupply() + mintAmount ≤ maxSupply() From 5474069e8971d9368bbbd894cc1fecc3e286844e Mon Sep 17 00:00:00 2001 From: Zyh Date: Wed, 25 Jun 2025 16:09:22 +0800 Subject: [PATCH 5/6] update the description --- ERCS/erc-7924.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ERCS/erc-7924.md b/ERCS/erc-7924.md index c6073a479c5..e0aa69bd70b 100644 --- a/ERCS/erc-7924.md +++ b/ERCS/erc-7924.md @@ -3,9 +3,12 @@ eip: 7924 title: ERC-20 totalSupply Extension description: Manage the maximum supply of ERC-20 stablecoins. author: YuehuaZhang (@astroyhzcc) , Yuxiang Fu (@tmac4096) , Yanyi Liang , Hao Zou (@BruceZH0915) , Siyuan Zheng (@andrewcoder666) -discussions-to: https://ethereum-magicians.org/t/a-simple-mechanism-to-manage-the-maximum-supply-of-stable-coin-compliant-with-erc-20/23244 +discussions-to: https://ethereum-magicians.org/t/a-simple-mechanism-to-manage-the-maximum-supply-of-stable-coin-compliant-with-erc-20/23244 +status: Draft +type: Standards Track category: ERC created: 2025-03-21 +requires: 20 --- ## Abstract @@ -32,7 +35,7 @@ Most stablecoin issuers are required to hold reserve funds or collateralized ass 1. Validator Management + Validator address must be publicly verifiable -+ The maximum token supply update operations should contain the statement or receipt from the Validator, for example ISO 20022 message format used for bank-to-customer intraday account reporting such as CAMT052 statement. ++ The maximum token supply update operations should contain the statement or receipt from the Validator, for example ISO 20022 message format used for bank-to-customer intraday account reporting such as CAMT.052 statement. + Validator changes require governance approval 2. Supply Enforcement + all mint operations must check:totalSupply() + mintAmount ≤ maxSupply() From 55e9f3a0616c13f5bd0dd155f0eaffd1f21e4185 Mon Sep 17 00:00:00 2001 From: Zyh Date: Wed, 25 Jun 2025 16:15:41 +0800 Subject: [PATCH 6/6] move definition to specification --- ERCS/erc-7924.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ERCS/erc-7924.md b/ERCS/erc-7924.md index e0aa69bd70b..7d57fac87f6 100644 --- a/ERCS/erc-7924.md +++ b/ERCS/erc-7924.md @@ -22,14 +22,17 @@ Most stablecoin issuers are required to hold reserve funds or collateralized ass 2. Allow validators to update the maximum supply based on collateral value. 3. Enable transparent supply governance, , ensuring compliance with regulatory or protocol-specific requirements. -## Definitions +## Specification -* `_Issuer_`: the issuer of the stable coin +The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. -* `_Validator_`: the reserve fund custodians or collateral managers +### Definitions +The existing definitions from [ERC-7540](./eip-7540.md) apply. -## Specification +* `_Issuer_`: the issuer of the stable coin + +* `_Validator_`: the reserve fund custodians or collateral managers ### Rule