Skip to content

feat(src20): emit Approval event to both owner and spender#131

Merged
ameya-deshmukh merged 2 commits intomainfrom
ameya/emit-approvals-to-both-parties-src20
Mar 25, 2026
Merged

feat(src20): emit Approval event to both owner and spender#131
ameya-deshmukh merged 2 commits intomainfrom
ameya/emit-approvals-to-both-parties-src20

Conversation

@ameya-deshmukh
Copy link
Copy Markdown
Contributor

@ameya-deshmukh ameya-deshmukh commented Mar 25, 2026

Summary

  • Symmetric event emission: emitApprovalEncrypted now emits the Approval event to both the owner and spender, matching the existing emitTransferEncrypted pattern.
  • Each party gets an encrypted event if they have a registered AES key, or a zero-hash/empty-data event if they don't.
  • Adds 4 tests covering all key-registration combinations: both have keys, only owner, only spender, neither.

Test plan

  • All 4 new Approval event tests pass via sforge test --match-contract SRC20EventsTest --match-test test_Approve
  • All 12 existing Transfer event tests still pass
  • CI passes

🤖 Generated with Claude Code

Symmetric with Transfer events — emitApprovalEncrypted now emits the
Approval event to both the owner and spender independently, each
encrypted with their own AES key if registered.
Add 4 permit tests covering all key-registration combinations (both
have keys, only owner, only spender, neither) to match the transferFrom
coverage pattern for Transfer events.
@ameya-deshmukh ameya-deshmukh merged commit 0d9a29e into main Mar 25, 2026
2 checks passed
@ameya-deshmukh ameya-deshmukh deleted the ameya/emit-approvals-to-both-parties-src20 branch March 25, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant