Hot answers tagged

1 vote
Accepted

Remix - Error: cannot encode object for signature with missing names

If you have the following struct struct Airdrop { bytes32 nft; uint256 id; } Then the input should looks like this: [[bytes32-of-nft, id], [...], [...]] example: [["...
user avatar
  • 2,323
1 vote

Does a fixed size array specify the maximum size or the exact size of the array?

I guess this depends on what you mean with "holding". If you create array of type bool with static size of 5, it means you will immediately have an array of types bool with 5 entries, and ...
user avatar
1 vote

How to push elements in an array within a function?

Here is the link to a GitHub issue that has the correct explanation. https://github.com/ethereum/solidity/issues/12549 Reasoning - If you are defining a local variable inside a function even if it's a ...
user avatar
1 vote

How to convert in-memory static array to calldata static array?

Besides what Morten wrote, one can do this._setNonRecoverableTokens(nonRecoverableTokens); to call _setNonRecoverableTokens externally which will copy your memory array to calldata (see slide '57' ...
user avatar
  • 41
1 vote

Does Solidity support passing an array of strings to a contract's constructor yet?

2022 here, yes it does now. Open this in Remix and use something like ["str1", "str2"] to deploy: pragma solidity ^0.8.7; contract Strings { string[] public stringParam; ...
user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible