Hey all, trying to call a function in bscscan that has a parameter of bool[2]. I was expecting that a call to this should take the form [false,false] however I'm getting an error saying Invalid number of parameters for "yourFunction". Got 2 expected 1! What am I doing wrong?

Feb 14, 2022, 12:13 AM
Hmm that’s an interesting one, are you sure you are passing the parameter correctly to the function?
Can you paste the function signature
I don’t believe so. The only way I know of tiis would be to read logs and you can’t do that on chain. You could try reading balance of LP once each block in your contract and computing deltas but thay would be imperfect since it wouldn’t account for sells
Sure, paste code and error here (make sure code doesn’t include any personal data like private key, api key, wallet addresses, etc)
Feb 14, 2022, 12:41 AM
Thanks for the response. The function accepts bool[2] memory and is external. All it does is use the bools to assign some state variables, so nothing complex. No reason for it to throw an error as far as I can see
What's confusing me is the error message - what I posted is definitely an array as expected by bscscan, so why claim it's 2 parameters?
Feb 14, 2022, 12:46 AM
It sounds like your array is being interpreted as multiple arguments instead of a single argument.
Maybe pass as “false,false”?
Feb 14, 2022, 12:47 AM
I've tried quite a few things, most things don't return errors at all, just do nothing
Feb 14, 2022, 12:51 AM

© 2024 Draquery.com All rights reserved.