World
Tables

Tables

World uses the store tables, but adds access control. For onchain tables, the data is stored by the World contract, which is also a StoreData (opens in a new tab).

When a System reads or writes storage via table libraries, the request goes into StoreSwitch (opens in a new tab). This library decides which approach to use:

Interaction between the World, a System, and a table

  1. An account calls a function called namespace_system_function via the World. This function was registered by the owner of the namespace namespace and points to the function function in the system system in the namespace namespace.

  2. The World verifies that access is permitted (for example, because namespace:system is publicly accessible) and if so calls function on the namespace:system contract with the provided parameters.

  3. At some point in its execution function decides to update the data in the table namespace:table. As with all other tables, this table is stored in the World's storage. To modify it, function calls a function on the World contract.

  4. The World verifies that access is permitted (by default it would be, because namespace:system has access to the namespace namespace). If so, it modifies the data in the namespace:table table.