You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, an arbitrary external call can be made using a low-level call, e.g.,
data = svm.createBytes(1024, "data");
address(target).call(data);
However, if the target contract contains an external function that takes dynamic arrays as input, then the above will fail due to the symbolic calldataload offset error.
The current solution requires explicitly constructing calldata for functions that take dynamic arrays, which is cumbersome.
Proposal
Introduce a new cheatcode, say callAny(target, abi), that takes a target contract and the contract's ABI information. It will invoke all the external functions of the target, automatically constructing calldata based on the ABI.
The sizes of dynamic arrays can be specified as arguments within the cheatcode, or they will be implicitly set to a default value.
The text was updated successfully, but these errors were encountered:
Problem
Currently, an arbitrary external call can be made using a low-level call, e.g.,
However, if the
target
contract contains an external function that takes dynamic arrays as input, then the above will fail due to the symbolic calldataload offset error.The current solution requires explicitly constructing calldata for functions that take dynamic arrays, which is cumbersome.
Proposal
Introduce a new cheatcode, say
callAny(target, abi)
, that takes a target contract and the contract's ABI information. It will invoke all the external functions of the target, automatically constructing calldata based on the ABI.The sizes of dynamic arrays can be specified as arguments within the cheatcode, or they will be implicitly set to a default value.
The text was updated successfully, but these errors were encountered: