Skip to content

Commit

Permalink
docs: explain the key schema is restricted to static types (#1562)
Browse files Browse the repository at this point in the history
  • Loading branch information
qbzzt committed Sep 21, 2023
1 parent b3cf4f7 commit b18d491
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/pages/tutorials/minimal/add-table.mdx
Expand Up @@ -48,6 +48,8 @@ A MUD table has two schemas:
- `valueSchema`, the value in the entry

Each schema is represented as a structure with field names as keys, and the appropriate [Solidity data types](https://docs.soliditylang.org/en/latest/types.html) as their values.
Note that the data types in the key schema are limited to those that are fixed length such at `bytes<n>`.
You cannot use strings, arrays, etc.

In this case, the counter value is represented as a 32 bit unsigned integer, because that is what `Counter` uses.
Block numbers and timestamps can be values up to `uint256`, so we'll use this type for these fields.
Expand Down

0 comments on commit b18d491

Please sign in to comment.