-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update EIP-3475: Changing comments #5789
Changes from 20 commits
f3d39dc
6fd0a6b
70b7d1c
18b3a81
6c99965
32320d7
d958901
9727fde
dae0849
b6b5e8d
a42e07f
600ae6b
cc86cef
18437ab
4ff1ba8
adacdf2
85a25dc
3ed1c0e
48f420b
c28b03d
ae72fd3
4eba8c2
2c681d1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -260,47 +260,59 @@ function isApprovedFor(address _owner, address _operator) external view returns | |||||
* @notice Issue MUST trigger when Bonds are issued. This SHOULD not include zero value Issuing. | ||||||
* @dev This SHOULD not include zero value issuing. | ||||||
* @dev Issue MUST be triggered when the operator (i.e Bank address) contract issues bonds to the given entity. | ||||||
* eg: emit Issue(_operator, 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,[IERC3475.Transaction(1,14,500)]); | ||||||
* issue by address(operator) 500 DBIT-USD Bond(nonce14,class 1) to address 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
*/ | ||||||
event Issue(address indexed _operator, address indexed _to, Transaction[] _transactions); | ||||||
// eg: | ||||||
|
||||||
emit Issue(_operator, 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,[IERC3475.Transaction(1,14,500)]); | ||||||
// issue by address(operator) 500 DBIT-USD Bond(nonce14,class 0) to address 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
|
||||||
/** | ||||||
* Redeem | ||||||
* @notice Redeem MUST trigger when Bonds are redeemed. This SHOULD not include zero value redemption. | ||||||
*e.g: emit Redeem(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
* emit event when 5000 bonds of class 1, nonce 14 owned by address 0x492Af743654549b12b1B807a9E0e8F397E44236E are being redeemed by 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
*/ | ||||||
event Redeem(address indexed _operator, address indexed _from, uint256 classId, uint256 nonceId, uint256 _amount); | ||||||
//e.g: | ||||||
emit Redeem(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
|
||||||
//e.g: emit Redeem(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
//emit event when 5000 bonds of class 1, nonce 14 owned by address 0x492Af743654549b12b1B807a9E0e8F397E44236E are being redeemed by 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
|
||||||
/** | ||||||
* Burn. | ||||||
* @dev `Burn` MUST trigger when the bonds are being redeemed via staking (or being invalidated) by the bank contract. | ||||||
* @dev `Burn` MUST trigger when Bonds are burned. This SHOULD not include zero value burning. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also explain what "zero value burning" means in this contex? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it means when the amount corresponding to the given class and nonce of the bonds is Zero. meaning we should not call functions with null value. |
||||||
* e.g : emit Burn(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
* emits event when 5000 bonds of owner 0x492Af743654549b12b1B807a9E0e8F397E44236E of type (class 1, nonce 14) are burned by operator 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
*/ | ||||||
emit Burn(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
|
||||||
event burn(address _operator, address _owner, Transaction[] _transactions); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this is correcting a mistake where
Suggested change
To match the example in the currently Final version of this EIP. |
||||||
|
||||||
//emit Burn(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef,0x492Af743654549b12b1B807a9E0e8F397E44236E,[IERC3475.Transaction(1,14,500)]); | ||||||
//emits event when 5000 bonds of owner 0x492Af743654549b12b1B807a9E0e8F397E44236E of type (class 1, nonce 14) are burned by operator 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef. | ||||||
|
||||||
/** | ||||||
* Transfer | ||||||
* @dev its emitted when the bond is transferred by address(operator) from owner address(_from) to address(_to) with the bonds transferred, whose params are defined by _transactions struct array. | ||||||
* @dev Transfer MUST trigger when Bonds are transferred. This SHOULD not include zero value transfers. | ||||||
* @dev Transfer event with the _from `0x0` MUST not create this event(use `event Issued` instead). | ||||||
* e.g emit Transfer(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, 0x492Af743654549b12b1B807a9E0e8F397E44236E, _to, [IERC3475.Transaction(1,14,500)]); | ||||||
* transfer by address(_operator) amount 500 DBIT-USD bonds with (Class 1 and Nonce 14) from 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, to address(_to). | ||||||
*/ | ||||||
emit Transfer(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, 0x492Af743654549b12b1B807a9E0e8F397E44236E, _to, [IERC3475.Transaction(1,14,500)]); | ||||||
|
||||||
// e.g emit Transfer(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, 0x492Af743654549b12b1B807a9E0e8F397E44236E, _to, [IERC3475.Transaction(1,14,500)]); | ||||||
// transfer by address(_operator) amount 500 DBIT-USD bonds with (Class 1 and Nonce 14) from 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, to address(_to). | ||||||
event Transfer(address indexed _operator, address indexed _from, address indexed _to, Transaction[] _transactions); | ||||||
|
||||||
/** | ||||||
* ApprovalFor | ||||||
* @dev its emitted when address(_owner) approves the address(_operator) to transfer his bonds. | ||||||
* @notice Approval MUST trigger when bond holders are approving an _operator. This SHOULD not include zero value approval. | ||||||
* eg: emit ApprovalFor(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, 0x492Af743654549b12b1B807a9E0e8F397E44236E); | ||||||
* this means 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef gives 0x492Af743654549b12b1B807a9E0e8F397E44236E access permission for transfer of its bonds. | ||||||
*/ | ||||||
emit ApprovalFor(0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef, 0x492Af743654549b12b1B807a9E0e8F397E44236E); | ||||||
// this means 0x2d03B6C79B75eE7aB35298878D05fe36DC1fE8Ef gives 0x492Af743654549b12b1B807a9E0e8F397E44236E access permission for transfer of its bonds. | ||||||
|
||||||
event ApprovalFor(address indexed _owner, address indexed _operator, bool _approved); | ||||||
``` | ||||||
|
||||||
|
@@ -385,7 +397,10 @@ The `nonceId` is the nonce id of the given bond class. This param is for distinc | |||||
The `_amount` is the amount of the bond for which the spender is approved. | ||||||
|
||||||
|
||||||
**AMM optimization**: One of the most obvious use cases of this EIP is the multilayered pool. The early version of AMM uses a separate smart contract and an [EIP-20](./eip-20.md) LP token to manage a pair. By doing so, the overall liquidity inside of one pool is significantly reduced and thus generates unnecessary gas spent and slippage. Using this EIP standard, one can build a big liquidity pool with all the pairs inside (thanks to the presence of the data structures consisting of the liquidity corresponding to the given class and nonce of bonds). Thus by knowing the class and nonce of the bonds, the liquidity can be represented as the percentage of a given token pair for the owner of the bond in the given pool. Effectively, the [EIP-20](./eip-20.md) LP token (defined by a unique smart contract in the pool factory contract) is aggregated into a single bond and consolidated into a single pool. | ||||||
|
||||||
**AMM optimization**: | ||||||
|
||||||
One of the most obvious use cases of this EIP is the multilayered pool. The early version of AMM uses a separate smart contract and an [EIP-20](./eip-20.md) LP token to manage a pair. By doing so, the overall liquidity inside of one pool is significantly reduced and thus generates unnecessary gas spent and slippage. Using this EIP standard, one can build a big liquidity pool with all the pairs inside (thanks to the presence of the data structures consisting of the liquidity corresponding to the given class and nonce of bonds). Thus by knowing the class and nonce of the bonds, the liquidity can be represented as the percentage of a given token pair for the owner of the bond in the given pool. Effectively, the [EIP-20](./eip-20.md) LP token (defined by a unique smart contract in the pool factory contract) is aggregated into a single bond and consolidated into a single pool. | ||||||
|
||||||
- The reason behind the standard's name (abstract storage bond) is its ability to store all the specifications (metadata/values and transaction as defined in the following sections) without needing external storage on-chain/off-chain. | ||||||
|
||||||
|
@@ -412,7 +427,7 @@ Test-case for the minimal reference implementation is [here](../assets/eip-3475/ | |||||
- [Interface](../assets/eip-3475/interfaces/IERC3475.sol). | ||||||
|
||||||
- [Basic Example](../assets/eip-3475/ERC3475.sol). | ||||||
- This demonstration shows only minimalist implementation. | ||||||
- This demonstration shows only minimalist implementation. | ||||||
|
||||||
## Security Considerations | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double checking that you're intentionally changing a zero to a one here.