wormhole/sui/wormhole
Csongor Kiss a46bccaa9b
Upgrade sui packages and compiler to 1.19.1-mainnet (#3803)
* sui: upgrade to mainnet-1.19.1

* sui: update Dockerfile.base

* sui: update tilt deployment to support new sui binary

* sui: remove faucet and simplify tilt deploy script

* sui: add script for switching Move.toml files between networks

* devnet: update sui addresses, regen config

---------

Co-authored-by: Evan Gray <battledingo@gmail.com>
2024-04-15 17:16:07 +01:00
..
sources Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
.gitignore sui: redesign Wormhole and Token Bridge contracts 2023-05-02 12:34:41 -04:00
Makefile sui: redesign Wormhole and Token Bridge contracts 2023-05-02 12:34:41 -04:00
Move.devnet.toml Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
Move.lock Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
Move.mainnet.toml Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
Move.testnet.toml Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
Move.toml Upgrade sui packages and compiler to 1.19.1-mainnet (#3803) 2024-04-15 17:16:07 +01:00
README.md sui: redesign Wormhole and Token Bridge contracts 2023-05-02 12:34:41 -04:00

README.md

Sui Wormhole Core Bridge Design

State

The State object is created exactly once during the initialisation of the contract. Normally, run-once functionality is implemented in the special init function of a module (this code runs once, when the module is first deployed), but this function takes no arguments, while our initialisation code does (to ease deployment to different environments without recompiling the contract).

To allow configuring the state with arguments, it's initialised in the init_and_share_state function, which also shares the state object. To ensure this function can only be called once, it consumes a DeployerCap object which in turn is created and transferred to the deployer in the init function. Since init_and_share_state consumes this object, it won't be possible to call it again.

Dynamic fields

TODO: up to date notes on where and how we use dynamic fields.

Epoch Timestamp

Sui currently does not have fine-grained timestamps, so we use tx_context::epoch(ctx) in place of on-chain time in seconds.