Skip to content

Commit 24e96a3

Browse files
committed
add comment for Approval change
1 parent 61392d4 commit 24e96a3

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

packages/ethereum-contracts/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
1616
- bump solc to "0.8.30".
1717
- Changed EVM target from `paris` to `shanghai` because now all networks with supported Superfluid deployment support it.
1818
- Emit ERC20 `Transfer` events (with amount 0) on CFA and GDA actions potentially leading to account balance changes. This shall help indexers to keep track of SuperToken holders and account balances.
19+
- Don't emit ERC20 `Approval` events on `transferFrom` operations. This is consistent with the OpenZeppelin ERC20 implementation from v5 onwards. Change effective only for SuperTokens using the latest logic.
1920

2021
### Fixed
2122
- `ISuperfluidPool`: `getClaimable` and `getClaimableNow` could previously return non-zero values for connected pools, which was inconsistent with what `claimAll` would actually do in this situation (claim nothing).

packages/ethereum-contracts/contracts/superfluid/SuperToken.sol

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,10 @@ contract SuperToken is
513513
*
514514
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made
515515
* during the `transferFrom` operation set the flag to false.
516+
*
517+
* Note: In the OpenZeppelin implementation, from v5 onwards, {transferFrom} doesn't emit an {Approval} event.
518+
* By adding this overloaded function and using it for {transferFrom}, we replicate that change,
519+
* because it seems semantically more correct.
516520
*/
517521
function _approve(address account, address spender, uint256 amount, bool emitEvent)
518522
internal

0 commit comments

Comments
 (0)