Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing fixed-size array as an argument for a smart contract function with "cast send" #6480

Closed
2 tasks done
kaseen opened this issue Dec 1, 2023 · 0 comments · Fixed by #6484
Closed
2 tasks done
Labels
T-bug Type: bug

Comments

@kaseen
Copy link

kaseen commented Dec 1, 2023

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

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.

@kaseen kaseen added the T-bug Type: bug label Dec 1, 2023
@gakonst gakonst added this to Foundry Dec 1, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 1, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant