mirror of
https://github.com/autistic-symposium/web3-starter-sol.git
synced 2025-07-12 17:59:36 -04:00
Update solidity_tldr.md
This commit is contained in:
parent
d15a60ca34
commit
6fafd48d77
1 changed files with 6 additions and 1 deletions
|
@ -310,9 +310,14 @@ assembly {
|
|||
}
|
||||
```
|
||||
|
||||
* **memory**: volatile read-write byte-addressable space (store data during execution) initiallized as zero. the evm opcodes are `MLOAD` (loads a word into the stack), `MSTORE` (saves a word to memory), `MSTORE8` (saves a byte to memory).
|
||||
* **memory**: volatile read-write byte-addressable space (store data during execution) initiallized as zero. the evm opcodes are `MLOAD` (loads a word into the stack), `MSTORE` (saves a word to memory), `MSTORE8` (saves a byte to memory). gas costs since memory loads (MLOADs) are significantly cheaper in gas than SLOADs.
|
||||
|
||||
* **storage**: persistant read-write word-addressable space for contracts, addressed by words. it's a key-value mapping of 2**256 slots of 32 bytes each. gas to save data into storage is one of the highest operations. the evm opcodes are: `SLOAD` (loads a word from storage to stack), `SSTORE` (saves a word to storage).
|
||||
* bitpack loading: storing multiple variables in a single 32-byts slot by ordering the byte size
|
||||
* fixed-length arrays: takes a predetermined amount of slots.
|
||||
* dynamic-length arrays: new elements assign slots after deployment (handled by the evm with keccak256 hashing)
|
||||
* mappings: dynamic type with key hashes
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue