Passing fixed-size array as an argument for a smart contract function with "cast send" #6480
Closed
2 tasks done
Labels
T-bug
Type: bug
Component
Cast
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (f5c9199 2023-12-01T00:19:29.279040779Z)
What command(s) is the bug in?
cast send ${CONTRACT} "playTicket(uint8[6])" "[1,2,3,4,5,6]" --rpc-url ${RPC} --private-key ${PRIVATE} --value 0.02ether
Operating System
Linux
Describe the bug
In my smart contract, there's a function defined as follows:
function playTicket(uint8[6] memory) external payable;
I'm attempting to invoke this function by sending a fixed-sized array of uint8 numbers (1 to 6) using the following cast send command:
cast send ${CONTRACT} "playTicket(uint8[6])" "[1,2,3,4,5,6]" --rpc-url ${RPC} --private-key ${PRIVATE} --value 0.02ether
However, I'm encountering a type mismatch issue with the error message:
type mismatch: expected type "uint8[6]", got value with type "uint8[]"
Despite searching the documentation, I'm unable to resolve this problem. Any guidance on how to address this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: