Iām making an erc1155 reciever and I get a strange error āstack too deepā, but only if I use the array.length of the ātokenIdsā argument, if I use the āamountsā argument it doesnāt happenā¦
does anyone know why?
Iām making an erc1155 reciever and I get a strange error āstack too deepā, but only if I use the array.length of the ātokenIdsā argument, if I use the āamountsā argument it doesnāt happenā¦
does anyone know why?
hey,
If you get this error it probably means you have too many function arguments, local variables or return values in your function.
you can try to split your solidity functions into two and if you are using string for some vars which are not so long, you can change them to byte32
.
@liron As fas as i can see from the syntax, lenght
in an in-built solidity keyword avoid using it.
apart from that EVM stack has 16 slots, if you try referencing a variable higher than 16 then you get the error
check this link: https://soliditydeveloper.com/stacktoodeep