Skip to content

Commit

Permalink
Update EIP-6909: index id, not caller
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
jtriley-eth authored Sep 25, 2023
1 parent 147a056 commit b3a296e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions EIPS/eip-6909.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ SHOULD be logged with the `receiver` address as the zero address when an `amount
inputs:
- name: caller
indexed: true
indexed: false
type: address
- name: sender
indexed: true
Expand All @@ -269,7 +269,7 @@ SHOULD be logged with the `receiver` address as the zero address when an `amount
indexed: true
type: address
- name: id
indexed: false
indexed: true
type: uint256
- name: amount
indexed: false
Expand Down Expand Up @@ -482,7 +482,7 @@ contract ERC6909 {
/// @param receiver The address of the receiver.
/// @param id The id of the token.
/// @param amount The amount of the token.
event Transfer(address indexed caller, address indexed sender, address indexed receiver, uint256 id, uint256 amount);
event Transfer(address caller, address indexed sender, address indexed receiver, uint256 indexed id, uint256 amount);
/// @notice The event emitted when an operator is set.
/// @param owner The address of the owner.
Expand Down Expand Up @@ -517,7 +517,7 @@ contract ERC6909 {
if (balanceOf[msg.sender][id] < amount) revert InsufficientBalance(msg.sender, id);
balanceOf[msg.sender][id] -= amount;
balanceOf[receiver][id] += amount;
emit Transfer(msg.sender, receiver, id, amount);
emit Transfer(msg.sender, msg.sender, receiver, id, amount);
return true;
}
Expand All @@ -537,7 +537,7 @@ contract ERC6909 {
if (balanceOf[sender][id] < amount) revert InsufficientBalance(sender, id);
balanceOf[sender][id] -= amount;
balanceOf[receiver][id] += amount;
emit Transfer(sender, receiver, id, amount);
emit Transfer(msg.sender, sender, receiver, id, amount);
return true;
}
Expand Down Expand Up @@ -572,14 +572,14 @@ contract ERC6909 {
// WARNING: important safety checks should precede calls to this method.
balanceOf[receiver][id] += amount;
totalSupply[id] += amount;
emit Transfer(address(0), receiver, 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(sender, address(0), id, amount);
emit Transfer(msg.sender, sender, address(0), id, amount);
}
}
```
Expand Down

0 comments on commit b3a296e

Please sign in to comment.