-
Notifications
You must be signed in to change notification settings - Fork 38
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
attemptTransaction error has overwritten the original error message #54
Comments
Hey Lecky! Yeah, this is really tricky. Part of the challenge is that the error is lost during the call to I try to address this a bit with CALLs by doing a preflight I dunno if that answers your question, but we're working on sanitizing this as part of the next major version. |
Maybe fire How about using the new So maybe use try on the try executeCall(to, value, data, txGas){
emit SuccessEvent();
} catch {
this.web3.eth.call({
from,
to,
value,
data,
});
} |
Hey Lecky! Unfortunately, that change is not in the purview of this repo. Contract changes which allow this to happen should probably be argued for in the original issue thread here: safe-global/safe-smart-account#182 However, we are aware of the new As far as doing this with the current contracts at this layer, the preflight |
If you want to debug this on a test network, just deploy your own multisend contract (only the interface is required to be the same) and adjust it in a way that it returns the error message. The chances are very low that we will adjust our MultiSend this year. Edit: the address of your multisend can be passed into the configuration of the CPK (https://github.com/gnosis/contract-proxy-kit#networks-configuration) |
@rmeissner I don't think that will allow the error message to be recovered though, because MultiSend has to be used through a Also, emitting an event instead of reverting would work only if the transaction gets processed/mined. Currently the semantics are to reject with an error if transactions are going to fail. Basically, to get an error from a batch transaction, we would have to:
Also a feature like this would also necessitate a factory change, to facilitate getting an error that would happen when a contract that doesn't exist yet does a batch of transactions. @leckylao Long story short, I think the only time the original error message from the contract will get displayed will be for a single call (no batches, and no delegatecalls). The other scenarios will involve changes that probably won't happen. I will close this issue when this behavior is guaranteed for all major clients, though I must note that this should already work for Ganache. |
ahhh yes what you write is correct. You can also make use of a geth feature were you can overwrite the contract source atr a specific address to expose the error. It is not planned that |
Description
Function attemptTransaction on https://github.com/gnosis/contract-proxy-kit/blob/v1.1.1/src/index.js#L468 has new Error message 'transaction execution expected to fail' which will overwrite the original error message on the CALL.
For example when running setup for a module it will run setManager https://github.com/gnosis/safe-contracts/blob/v1.1.1/contracts/base/Module.sol#L23 which will return "Manager has already been set" but it will get overwritten with "transaction execution expected to fail".
require(address(manager) == address(0), "Manager has already been set");
So is there a way to pass the original error message if there's one?
The text was updated successfully, but these errors were encountered: