complete checkin for juan; config tweaks & mock tweaks

This commit is contained in:
Tim Olson
2023-10-19 17:33:15 -04:00
parent 2047842c29
commit 718e3f3a36
7 changed files with 9 additions and 13 deletions

View File

@@ -8,9 +8,9 @@
* 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 or struct 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.
* 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.
* static memory arrays `Foo[4] memory myArray = [foo1, foo2, foo3, foo4];` the length of the array is part of the type information, and it is not possible to cast a dynamic array to a static one or vice-versa.
* static arrays `Foo[4] memory myArray = [foo1, foo2, foo3, foo4];` the length of the array is part of the type information, and it is not possible to cast a dynamic array to a static one or vice-versa.
* functions have two different types: views and transactions.
* a view is read-only and may be completed instantly off-chain. its return values are immediately available to whatever client invoked the call.
* transactions make changes to chain data. the return values from a transaction function are not written to chain, but they are immediately useable by other code that calls into that function from the same transaction.