Cannot create encoded data
See original GitHub issueProblem
I cannot get encoded data with a struct param in the test code below.
// TEST CODE
const functionArgs = [
xxx,
yyy,
{
x: x,
y: y
}
]
// console.log(functionArgs.length) => 3
const abi = compiledJSON.abi
const iface = new ethers.utils.Interface(abi)
// console.log(iface.functions.targetFunction) =>
...
inputs:
[ { internalType: 'string', name: 'title', type: 'string' },
{ internalType: 'string', name: 'name', type: 'string' },
{ components: [Array],
internalType: 'struct Struct.Str',
name: 'str',
type: 'tuple' } ], ...
const calldata = iface.functions.targetFunction.encode(...functionArgs) // Error
Error Message
Error: missing argument in interface function targetFunction (count=2, expectedCount=3, version=4.0.47)
Version
ethers: 4.0.47 solc: 0.5.16 truffle: 5.1.9
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
cannot create a Parse.File without valid data URI's or ...
It happens when new Parse.File(fileName, { base64 }) is called. Is there something i am doing wrong, how can i work around this?...
Read more >How can I fix the UTF-8 error when bulk uploading users?
Answer. This error is created when the uploaded file is not in a UTF-8 format. UTF-8 is the dominant character encoding format on...
Read more >Choose text encoding when you open and save files
Choose an encoding standard when you open a file · In Control Panel, click Add or Remove Programs. · In the Currently installed...
Read more >Base64 encoding: What sysadmins need to know
Fundamentally, Base64 is used to encode binary data as printable text. ... the original binary cannot be divided into a 24-bit sequence.
Read more >Base64 Encode and Decode From Command Line
For encoding data, Base64 uses only alphabet, number and = symbol. For instance, c2FtcGxlCg== is a valid encoded data while b?HV3.Zh2J== is not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Oh, sorry when changing
...functionArgs
intofunctionArgs
, then it works. Thank you for your reviewing!Thank you very much for your kindness 😃