In a deployed contract (in sepolia) there is a method readTimelock(address,uint256)
that returns a TimeLock
, which is a struct like the following:
struct TimeLock{
uint160 amount,
uint64 time,
bool withdrawn
}
I would like to make a call to the contract and get that timelock using foundry cast call
. I'm trying with something like:
cast call 0x243B56EDb7BD8B0Aa6fE554A4860405717b8CC4a "readTimeLock(address,uint256)(uint160,uint64,bool)" 0x37aFaa6c1B0cD3c92DE24C09451FD046fA7CbfC3 0 --rpc-url $SEPOLIA_URL
The error I get is the following:
(code: -32000, message: execution reverted, data: None)
Unfortunately, in the documentation nothing is said about function returning structs. Thanks. https://book.getfoundry.sh/reference/cast/cast-call
Other errors I get trying different compositions is simply "Invalid data"