Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert reason not supplied on revert for delegated calls. #152

Open
sebasgoldberg opened this issue Aug 30, 2022 · 2 comments
Open

Revert reason not supplied on revert for delegated calls. #152

sebasgoldberg opened this issue Aug 30, 2022 · 2 comments

Comments

@sebasgoldberg
Copy link

Describe the bug
Revert reason not supplied on revert for delegated calls.

Reproduction steps

The following test fails. The revert happens but no reason it is returned:

const aMock: FakeContract<SomeContract> = await smock.fake('SomeContract');
aMock.aFunction.reverts("A REASON")
...
await expect(otherContract.aFunctionThatExecuteDelegateCall( // delegates to aMock.aFunction
    aMock,
), "Should reverts with the mock programed reason")
    .to.rejectedWith("A REASON")

If I execute the same test without using the smock library, but instead using a mock contract that reverts, compiled from solidity code, the test passes.

Expected behavior
In the above test otherContract.aFunctionThatExecuteDelegateCall should revert using reason "A REASON".

Screenshots
NA

System Specs:

  • Ubuntu Server 20.04:
  • Package Version (or commit hash): 2.2.0

Additional context
For the contract delegator solidity code I am using functionDelegateCall from Openzeppelin's Address lib:

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/4b16e887474eebb64e3f8266c68ef151a3f1b769/contracts/utils/Address.sol#L170

@sirnicolaz
Copy link

Is anyone planning to fix this or provide a workaround? The functionality is pretty much useless if the reason is not forwarded back.

@kalloc
Copy link

kalloc commented Dec 18, 2022

I see your issue may be connected with my one #152

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants