Skip to content

Commit

Permalink
Update ERC-6909: Remove totalSupply, add authors
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
jtriley-eth authored Nov 21, 2023
1 parent fac498b commit f76969b
Showing 1 changed file with 3 additions and 28 deletions.
31 changes: 3 additions & 28 deletions ERCS/erc-6909.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
eip: 6909
title: Minimal Multi-Token Interface
description: A minimal specification for managing multiple tokens by their id in a single contract.
author: Joshua Trujillo (@jtriley-eth)
author: JT Riley (@jtriley-eth), Dillon (@d1ll0n), Sara (@snreynolds), Vectorized (@Vectorized)
discussions-to: https://ethereum-magicians.org/t/eip-6909-multi-token-standard/13891
status: Draft
type: Standards Track
Expand Down Expand Up @@ -40,26 +40,6 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S

### Methods

#### `totalSupply`

The total `amount` of a token `id` that exists.

MUST be equal to the sum of the `balanceOf` of all accounts of the token `id`.

```yaml
- name: totalSupply
type: function
stateMutability: view

inputs:
- name: id
type: uint256

outputs:
- name: amount
type: uint256
```
#### `balanceOf`

The total `amount` of a token `id` that an `owner` owns.
Expand Down Expand Up @@ -250,9 +230,9 @@ The `caller` initiates a transfer of an `amount` of a token `id` from a `sender`

MUST be logged when an `amount` of a token `id` is transferred from one account to another.

SHOULD be logged with the `sender` address as the zero address when an `amount` of a token `id` is minted.
MUST be logged with the `sender` address as the zero address when an `amount` of a token `id` is minted.

SHOULD be logged with the `receiver` address as the zero address when an `amount` of a token `id` is burned.
MUST be logged with the `receiver` address as the zero address when an `amount` of a token `id` is burned.

```yaml
- name: Transfer
Expand Down Expand Up @@ -497,9 +477,6 @@ contract ERC6909 {
/// @param amount The amount of the token.
event Approval(address indexed owner, address indexed spender, uint256 indexed id, uint256 amount);
/// @notice The total supply of each id.
mapping(uint256 id => uint256 amount) public totalSupply;
/// @notice Owner balance of an id.
mapping(address owner => mapping(uint256 id => uint256 amount)) public balanceOf;
Expand Down Expand Up @@ -571,14 +548,12 @@ contract ERC6909 {
function _mint(address receiver, uint256 id, uint256 amount) internal {
// WARNING: important safety checks should precede calls to this method.
balanceOf[receiver][id] += amount;
totalSupply[id] += amount;
emit Transfer(msg.sender, address(0), receiver, id, amount);
}

function _burn(address sender, uint256 id, uint256 amount) internal {
// WARNING: important safety checks should precede calls to this method.
balanceOf[sender][id] -= amount;
totalSupply[id] -= amount;
emit Transfer(msg.sender, sender, address(0), id, amount);
}
}
Expand Down

0 comments on commit f76969b

Please sign in to comment.