I am trying to encode a struct as bytes with brownie and then pass the bytes as an argument to a smart contract.
contract C {
struct S {
uint256 a;
uint256 b;
}
function f(bytes memory d) external returns (uint256, uint256) {
S memory s = abi.decode(d, (S));
return (s.a, s.b);
}
}
With the contract above, how can I construct d
with brownie such that it can be decoded into a struct in solidity? I see that brownie has ContractTx.encode_input(), but this requires a function signature. Thanks!