diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-11-uint8[]-uint128[]-uint256[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-11-uint8[]-uint128[]-uint256[].md index a524bc0..ef6e190 100644 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-11-uint8[]-uint128[]-uint256[].md +++ b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-11-uint8[]-uint128[]-uint256[].md @@ -62,11 +62,8 @@ more than enough to fit into the next slot, then, we can load the next storage l ## General `[]` Deduction. -Once the concept of type storages is understood, you can use that to figure out how the array versions of that type -will be stored. +Once the concept of type storages is understood, you can use that to figure out how the array versions of that type will be stored. -You can use the knowledge of arrays to write to any array index, or read from an array index. +To retrieve an element from a packed array is quite tricky and is not readily advised. -To retrieve an element from a packed array is quite trick and is not readily advised. - -> 🚨 The use of Yul to read and write arrays is not advised. It is a very tricky business. \ No newline at end of file +> 🚨 The use of Yul to read and write arrays is not advised. It is a very tricky business, considering the fact that small types are packed and large types occupy one slot, it is a whole new level of stress to take in packing, and other considerations while storing values into an array from Yul. Allow Solidity to handle the intricacies for you. \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-12-int8[]-int128[]-int256[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-12-int8[]-int128[]-int256[].md deleted file mode 100644 index 85f3776..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-12-int8[]-int128[]-int256[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `int8[]`, `int128[]`, `int256[]` - -Combine the knowledge of [int8, int128 and int256](4-2-2-int8-int128-int256.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-13-bytes1[]-bytes16[]-bytes32[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-13-bytes1[]-bytes16[]-bytes32[].md deleted file mode 100644 index b8bf212..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-13-bytes1[]-bytes16[]-bytes32[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `bytes1[]`, `bytes16[]`, `bytes32[]` - -Combine the knowledge of [bytes1, bytes16, bytes32](4-2-3-bytes1-bytes16-bytes32.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-14-bytes[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-14-bytes[].md deleted file mode 100644 index c58a992..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-14-bytes[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `bytes[]` - -Combine the knowledge of [bytes](4-2-4-bytes.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-15-string[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-15-string[].md deleted file mode 100644 index accd1ab..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-15-string[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `string[]` - -Combine the knowledge of [string](4-2-5-string.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-16-address[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-16-address[].md deleted file mode 100644 index 4c57760..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-16-address[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `address[]` - -Combine the knowledge of [address](4-2-6-address.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-17-custom-types[].md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-17-custom-types[].md deleted file mode 100644 index e89af18..0000000 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-17-custom-types[].md +++ /dev/null @@ -1,3 +0,0 @@ -# `Custom Types[]` - -Combine the knowledge of [Custom Types](4-2-10-custom-types.md) with [arrays](4-2-11-uint8%5B%5D-uint128%5B%5D-uint256%5B%5D.md). \ No newline at end of file diff --git a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-2-int8-int128-int256.md b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-2-int8-int128-int256.md index b63a918..927ad7d 100644 --- a/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-2-int8-int128-int256.md +++ b/book/src/4-yul-implementations/4-2-variable-storage-in-storage/4-2-2-int8-int128-int256.md @@ -38,4 +38,6 @@ contract Yul { } ``` -> 🚨 Due to the tricky nature of the storage of `int[n]` types, apply more care when storing and manipulating values from storage. \ No newline at end of file +> 🚨 Due to the tricky nature of the storage of `int[n]` types, apply more care when storing and manipulating values from storage. + +> 🚨 Do not store negative `int[n]` values directly from your Yul block of code, Yul treats it as a `uint[n]` type overflow, meaning that `-1` will be converted to `(2^256) - 1`. This can lead to security breaches. \ No newline at end of file