SNIPs icon indicating copy to clipboard operation
SNIPs copied to clipboard

SNIP13: index ERC20 event fields

Open ArielElp opened this issue 1 year ago • 3 comments

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.

ArielElp avatar May 05 '24 15:05 ArielElp

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

natan-granit avatar May 06 '24 06:05 natan-granit

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

nbundi avatar May 06 '24 10:05 nbundi

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

odednaor avatar May 08 '24 12:05 odednaor

@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

nbundi avatar May 29 '24 10:05 nbundi