errors reported as strings not bytes

This commit is contained in:
Tim Olson
2023-10-20 01:10:33 -04:00
parent 4cc5d54eb6
commit cb836ad2a3

View File

@@ -6,7 +6,6 @@
* `calldata` is a small read-only area for function arguments. you should rarely if ever need to use this keyword. reading from calldata takes the least gas of all.
* word size is 256 bits. int and uint types are available for every 8-bit interval from `uint8`, `uint16`, `uint24`, ..., `uint256`. do not use the bare `uint` even though it's a legal alias for 256.
* similarly to `uint?` types, there are value types `bytes1`, `bytes2`, ..., `bytes32` which is 256 bits. `bytes` by itself is an alias for the dynamic array `byte[]`
* do not use `string` type. use `bytes` instead. for reasons.
* arrays have three types: dynamic storage array, dynamic memory array, and static array.
* all arrays in storage (contract members) start as 0-length and may only be extended by `contractArray.push(item)` one at a time. remove with `pop()`. a storage array referenced inside a function as `Foo[] storage myArray = contractArray;` results in a reference to the storage area.
* dynamic memory arrays `Foo[] memory myArray = new Foo[](length);` only this c++ style allocation is available for dynamic memory arrays, and the length must be known at creation time. you must then set each member of the array separately, in a loop.