foundry-rs / forge-std

Forge Standard Library is a collection of helpful contracts for use with forge and foundry. It leverages forge's cheatcodes to make writing tests easier and faster, while improving the UX of cheatcodes. For more in-depth usage examples checkout the tests.
Apache License 2.0
815 stars 319 forks source link

support deal on optimism sUSD #293

Open sakulstra opened 1 year ago

sakulstra commented 1 year ago

When i try to deal sUSD via deal(0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9, user, 1 ether); on optimism foundry crashes with

[FAIL. Reason: stdStorage find(StdStorage): Packed slot. This would cause dangerous overwriting and currently isn't supported.]

Seems a bit similar, but probably different:

adamxyzxyz commented 1 year ago

Getting the same error when SNX, guessing this is a problem with any of their tokens. Any solution found for this?

sakulstra commented 1 year ago

For now we overwrite deal and for selected tokens, mock a whale and transfer instead of deal :sweat_smile:

ChiTimesChi commented 9 months ago

@adamxyzxyz @sakulstra

Here's the solution we are using for minting sUSD in tests:

https://github.com/synapsecns/synapse-contracts/blob/4b2858a5f7aa3bed6c5c184ae1fe59c2730274ef/test/interfaces/ISynth.sol#L1-L13