Open anajuliabit opened 1 month ago
I think this is a reasonable feature
+1 on this but would prefer it not be called deal
This would be very helpful to use anvil
as a backend for tests where you need to handle ERC20 tokens
@roninjin10 had the idea to request an access list for a call to erc20.balanceOf(account)
which would return the storage slot most probably as the last element of the access list returned
That should speed things up right?
can I work on this, please?
Assigned @maxslimb
@roninjin10 had the idea to request an access list for a call to
erc20.balanceOf(account)
which would return the storage slot most probably as the last element of the access list returnedThat should speed things up right?
For reference, I implemented this using viem in TypeScript here
Results are much much faster, which avoid having to rely on some external cache because only a few RPC queries are made and no brute-force is required anymore
Also, it adds support for non-trivial tokens such as stETH and USD0. I highly recommend doing something similar at anvil's level: request the access list and try each slot of the access list instead of brute-forcing the balanceOf
slot
@yash-atreya do you have any guidelines to contribute and for creating a pr?
Component
Anvil
Describe the feature you would like
I'd like to request the creation of an RPC method similar to the ERC20
deal
cheatcode for the following use case:I need to gather enough votes in a governor to approve a proposal. If a
deal
equivalent RPC method exists, I could simplydeal
the quorum amount to any wallet, rather than having to impersonate multiple whale wallets to meet the quorum.Thank you!
Additional context
No response