Skip to content

Conversation

seanyoung
Copy link

In a wasm context not all types are 256 bit like in evm. This would make
easier to store smaller primitives (e.g. i32), since they would not
require padding.

The bigger win is when storing/retrieving dynamically sized arrays. Strings
can be stored under a single key and do not require splitting up into
smaller 32 byte chunks, and arrays do not need to store a size parameter.

Signed-off-by: Sean Young [email protected]

Note this is how I've started implementing storage in solang: https://github.com/hyperledger-labs/solang and this works much better than the U256 values.

In a wasm context not all types are 256 bit like in evm. This would make
easier to store smaller primitives (e.g. i32), since they would not
require padding.

The bigger win is when storing/retrieving dynamically sized arrays. Strings
can be stored under a single key and do not require splitting up into
smaller 32 byte chunks, and arrays do not need to store a size parameter.

Signed-off-by: Sean Young <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant