starknet-io / SNIPs

Starknet Improvement Proposal repository
MIT License
158 stars 99 forks source link

SNIP13: index ERC20 event fields #84

Closed ArielElp closed 5 months ago

ArielElp commented 6 months ago

Events in Starknet consist of two felt arrays, keys and data, the former is analogous to topics on Ethereum. Similarly to Ethereum, Starknet’s json-rpc allows you to filter over event keys via the starknet_getEvents method.

In this SNIP we suggest updating StarkGate's ERC20s (including ETH, STRK, USDC and others) to index more fields the Transfer and Approval events in order to allow filtration over the sender or receiver.


This change is Reviewable

natan-granit commented 6 months ago

Should be changed "to index more fields in the..."

nbundi commented 6 months ago

making ERC20 Transfer and Approval events index these fields should be part of SNIP-2 instead of creating a new snip targeted at StarkGate tokens no?

in fact, this PR fixes this in the ERC20 standard (among other things) https://github.com/starknet-io/SNIPs/pull/83

odednaor commented 6 months ago

Need to further investigate this change on fees and disk usage of full nodes.

nbundi commented 5 months ago

@ArielElp it's ok to have it discussed in a separate snip explicitly but you should align the actual change of adding the missing events to StarkGate ERC20 tokens with this PR https://github.com/starknet-io/SNIPs/pull/83

Effectively all snip-2 (erc-20) compatible token contracts should emit these events