TrueFiEng / Waffle

Library for writing and testing smart contracts.
https://getwaffle.io
MIT License
962 stars 162 forks source link

Mocking contract at specific address #729

Closed lukehutch closed 1 year ago

lukehutch commented 2 years ago

Some EIPs define that contracts must be deployed at specific addresses. How can I call deployMockContract while specifying the address to deploy the mocked contract at? (I can't find a way using the current API.)

Relatedly, how can I determine if there is already a contract deployed at a given address (to avoid re-deployment)?

(Related, for another mocking framework: https://github.com/defi-wonderland/smock/issues/47)

rzadp commented 2 years ago

Interesting, we'll look into it and see if we can implement it. External contributions are welcome as well.

joelamouche commented 1 year ago

I need that too to simulate an Optimism bridge. I would settle for a way to impersonate an account on ganache too.

External contributions are welcome as well.

happy to help if you point me in the right direction