2
votes
What is the problem with structs having just arrays as its members?
See the docs
When set A public a, it auto generate a defaut getter for a. And follow the docs, nothing is return in that default getter, so it raised the issue. But when you put 1 non-array member in ...
- 123
1
vote
Accepted
Why am I getting `undefined` when trying to access array elements in Truffle Console?
Truffle functions return a Future so you need to await for the result:
> myArray = await myContract.getMyArray()
[
BN {
negative: 0,
words: [ 0, <1 empty item> ],
length: 1,
...
- 30.2k
1
vote
Best practices for working around the lack of dynamically sized memory arrays in solidity
I think the most gas-efficient way is moving the check condition into someOtherFunction() and processing the whole array.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
arrays × 598solidity × 450
struct × 130
mapping × 107
contract-development × 83
remix × 60
storage × 60
contract-design × 49
memory × 44
web3js × 27
gas × 26
addresses × 24
string × 18
contract-debugging × 16
truffle × 15
bytes × 15
blockchain × 14
data-types × 12
solidity-0.8.x × 11
go-ethereum × 10
evm × 9
out-of-gas × 9
bytes32 × 7
optimization × 7
contract-deployment × 6