Strat writer life improvement: make regular reverts work and return arbitrary data after success
adhusson opened this issue · 2 comments
adhusson commented
Currently, Mangrove reads the 32 first bytes of returndata (let's say d
) after makerExecute
. If no revert and d = 0
, the execution is considered a success; otherwise a failure.
We propose changing that to:
- If no revert, read the first 32 bytes of returndata. This matches the
bytes32
returned according to the... makerExecute returns (bytes32)
signature. In addition, consider the execution a success. - If revert, read the 69th to 100th bytes (included) of returndata. This matches the first 32 bytes of string
str
returned through, e.g.require(false,str)
. In addition, consider the execution a failure.