foundry icon indicating copy to clipboard operation
foundry copied to clipboard

"deal" does not works with Circle USDC

Open maguroid opened this issue 1 year ago • 1 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (3cdee82 2024-02-15T00:19:38.655803000Z)

What command(s) is the bug in?

ARB_RPC_URL=<your_rpc_url> forge test -vvv

Operating System

macOS (Apple Silicon)

Describe the bug

When using 'deal' with Circle USDC, it will fail with the following error:

[FAIL. Reason: revert: stdStorage find(StdStorage): Slot(s) not found.] test_dealUsdc() (gas: 150179)

minimul repro

I believe the reason is the implementation of 'balanceOf' in Circle USDC. It has a little trick to handle the blacklist, where the last bit is used as a flag.

Circle USDC implementation

maguroid avatar Feb 15 '24 07:02 maguroid

cc @klkvr

mattsse avatar Feb 15 '24 12:02 mattsse

circle usd packs blacklist and balance, like aave token does with delegation. We maintain a list of aave-listed assets that don't currently work with deal here if that is of any help.

Not sure if relevant, but the people behind evm.storage open sourced their rust based storage layout extractor: https://github.com/smlxl/storage-layout-extractor which seems to work quite well with structs - which i think will not help in case of USDC, but perhaps in others 😅 .

sakulstra avatar Feb 18 '24 21:02 sakulstra

Fixed in forge-std 1.8.0

klkvr avatar Mar 14 '24 18:03 klkvr

deal still doesn't work for USDC. I get this error when trying to deal USDC [FAIL. Reason: revert: stdStorage find(StdStorage): Slot(s) not found.]

Tried dealing USDT and it works perfectly but USDC fails This is on the latest version of foundry

lelerukjaymoh avatar Apr 11 '24 15:04 lelerukjaymoh

You may need update forge-std by running forge update lib/forge-std.

maguroid avatar Apr 11 '24 15:04 maguroid