From fd22a1280497f250719b109b90deb5f4c3b0d738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Fri, 25 Feb 2022 09:24:03 -0500 Subject: [PATCH] chore: rename FastX -> Sui Fixes #502. --- doc/move.md | 6 +++--- doc/wallet.md | 2 +- sui/src/wallet.rs | 4 ++-- sui/src/wallet_commands.rs | 2 +- sui_core/src/client.rs | 2 +- sui_core/src/unit_tests/authority_tests.rs | 2 +- sui_programmability/adapter/Cargo.toml | 2 +- sui_programmability/adapter/src/adapter.rs | 14 +++++++------- .../adapter/src/bytecode_rewriter.rs | 2 +- sui_programmability/adapter/src/genesis.rs | 2 +- .../adapter/src/unit_tests/adapter_tests.rs | 2 +- .../src/unit_tests/data/publish_init/Move.toml | 2 +- .../unit_tests/data/publish_init/sources/M1.move | 6 +++--- .../unit_tests/data/publish_init_param/Move.toml | 2 +- .../data/publish_init_param/sources/M1.move | 6 +++--- .../data/publish_init_public/Move.toml | 2 +- .../data/publish_init_public/sources/M1.move | 6 +++--- .../unit_tests/data/publish_init_ret/Move.toml | 2 +- .../data/publish_init_ret/sources/M1.move | 6 +++--- .../src/unit_tests/data/simple_call/Move.toml | 2 +- .../unit_tests/data/simple_call/sources/M1.move | 8 ++++---- sui_programmability/examples/Move.toml | 2 +- .../examples/sources/CombinableObjects.move | 8 ++++---- .../examples/sources/CustomObjectTemplate.move | 16 ++++++++-------- .../examples/sources/EconMod.move | 8 ++++---- sui_programmability/examples/sources/Hero.move | 16 ++++++++-------- .../examples/sources/HeroMod.move | 8 ++++---- .../examples/sources/TicTacToe.move | 8 ++++---- .../examples/sources/TrustedCoin.move | 6 +++--- .../examples/tests/TicTacToeTests.move | 2 +- sui_programmability/framework/Cargo.toml | 2 +- sui_programmability/framework/Move.toml | 6 +++--- sui_programmability/framework/README.md | 4 ++-- sui_programmability/framework/sources/Coin.move | 8 ++++---- .../framework/sources/Collection.move | 8 ++++---- .../framework/sources/Escrow.move | 8 ++++---- sui_programmability/framework/sources/Event.move | 2 +- sui_programmability/framework/sources/GAS.move | 10 +++++----- .../framework/sources/Geniteam.move | 8 ++++---- sui_programmability/framework/sources/ID.move | 8 ++++---- sui_programmability/framework/sources/Math.move | 2 +- .../framework/sources/ObjectBasics.move | 10 +++++----- .../framework/sources/TestScenario.move | 8 ++++---- .../framework/sources/Transfer.move | 6 +++--- .../framework/sources/TxContext.move | 4 ++-- sui_programmability/framework/src/lib.rs | 4 ++-- .../framework/src/natives/transfer.rs | 2 +- .../framework/tests/CollectionTests.move | 10 +++++----- sui_programmability/framework/tests/IDTests.move | 6 +++--- .../framework/tests/TestScenarioTests.move | 8 ++++---- .../framework/tests/TxContextTests.move | 6 +++--- .../verifier/src/id_leak_verifier.rs | 2 +- sui_types/src/coin.rs | 2 +- sui_types/src/gas_coin.rs | 2 +- sui_types/src/id.rs | 4 ++-- sui_types/src/lib.rs | 2 +- sui_types/src/object.rs | 4 ++-- 57 files changed, 151 insertions(+), 151 deletions(-) diff --git a/doc/move.md b/doc/move.md index dab67a347a979..99f77c59a31ce 100644 --- a/doc/move.md +++ b/doc/move.md @@ -85,14 +85,14 @@ more about them in the Move if immediately interested): ```rust -module FastX::GAS { +module Sui::GAS { ... } ``` As we can see, when defining a module we specify the module name (`GAS`), preceded by the name of the package where this module resides -(`FastX`). The combination of the package name and the module name +(`Sui`). The combination of the package name and the module name is used to uniquely identify a module in Move source code (e.g., to be able to use if from other modules) - the package name is globally unique, but different packages can contain modules with the same name. @@ -106,7 +106,7 @@ framework packages this address is assigned in the manifest file: ``` [addresses] -FastX = "0x2" +Sui = "0x2" ``` ### First look at Move function definition diff --git a/doc/wallet.md b/doc/wallet.md index 7bd60f5898510..8d99a00de9f31 100644 --- a/doc/wallet.md +++ b/doc/wallet.md @@ -185,7 +185,7 @@ one-by-one: - `--package` - ID of the package object where the module containing the function is located (please [remember](#a-quick-look-at-the-gas-module) that the ID of the - genesis FastX package containing the GAS module is defined in its + genesis Sui package containing the GAS module is defined in its manifest file, and is equal to 0x2) - `object-args` - a list of arguments of Sui object type (in this case there is only one representing the `c` parameter of the `transfer` diff --git a/sui/src/wallet.rs b/sui/src/wallet.rs index 9796dda213f28..80d96757bf114 100644 --- a/sui/src/wallet.rs +++ b/sui/src/wallet.rs @@ -11,7 +11,7 @@ use sui::shell::{AsyncHandler, CommandStructure, Shell}; use sui::wallet_commands::*; use tracing::error; -const FAST_X: &str = " _____ _ _ __ ____ __ +const SUI: &str = " _____ _ _ __ ____ __ / ___/__ __(_) | | / /___ _/ / /__ / /_ \\__ \\/ / / / / | | /| / / __ `/ / / _ \\/ __/ ___/ / /_/ / / | |/ |/ / /_/ / / / __/ /_ @@ -70,7 +70,7 @@ async fn main() -> Result<(), anyhow::Error> { if !options.no_shell { let app: App = WalletCommands::clap(); - println!("{}", FAST_X.cyan().bold()); + println!("{}", SUI.cyan().bold()); print!("--- Sui"); app.write_long_version(&mut io::stdout())?; println!(" ---"); diff --git a/sui/src/wallet_commands.rs b/sui/src/wallet_commands.rs index 23ed5880ac532..37ecd90b0ae27 100644 --- a/sui/src/wallet_commands.rs +++ b/sui/src/wallet_commands.rs @@ -87,7 +87,7 @@ pub enum WalletCommands { /// Pure arguments to the functions, which conform to move_core_types::transaction_argument /// Special case formatting rules: /// Use one string with CSV token embedded, for example "54u8,0x43" - /// When specifying FastX addresses, specify as vector. Example x\"01FE4E6F9F57935C5150A486B5B78AC2B94E2C5CD9352C132691D99B3E8E095C\" + /// When specifying Sui addresses, specify as vector. Example x\"01FE4E6F9F57935C5150A486B5B78AC2B94E2C5CD9352C132691D99B3E8E095C\" #[structopt(long, parse(try_from_str = parse_transaction_argument))] pure_args: Vec, /// ID of the gas object for gas payment, in 20 bytes Hex string diff --git a/sui_core/src/client.rs b/sui_core/src/client.rs index 606ae379742e8..8fa4549cbb2e8 100644 --- a/sui_core/src/client.rs +++ b/sui_core/src/client.rs @@ -131,7 +131,7 @@ pub struct ClientState { // Operations are considered successful when they successfully reach a quorum of authorities. #[async_trait] pub trait Client { - /// Send object to a FastX account. + /// Send object to a Sui account. async fn transfer_object( &mut self, object_id: ObjectID, diff --git a/sui_core/src/unit_tests/authority_tests.rs b/sui_core/src/unit_tests/authority_tests.rs index 932df15d0bf2e..513dbecbe4df2 100644 --- a/sui_core/src/unit_tests/authority_tests.rs +++ b/sui_core/src/unit_tests/authority_tests.rs @@ -1395,7 +1395,7 @@ async fn test_hero() { let player_gas_object_ref = player_gas_object.to_object_reference(); let authority = init_state_with_objects(vec![admin_gas_object, player_gas_object]).await; - // 3. Publish the Hero modules to FastX. + // 3. Publish the Hero modules to Sui. let all_module_bytes = modules .iter() .map(|m| { diff --git a/sui_programmability/adapter/Cargo.toml b/sui_programmability/adapter/Cargo.toml index c2f34c3a0f31b..58993709ca0f7 100644 --- a/sui_programmability/adapter/Cargo.toml +++ b/sui_programmability/adapter/Cargo.toml @@ -2,7 +2,7 @@ name = "sui-adapter" version = "0.1.0" authors = ["Mysten Labs "] -description = "Adapter and accompanying CLI for local fastX development" +description = "Adapter and accompanying CLI for local sui development" license = "Apache-2.0" publish = false edition = "2021" diff --git a/sui_programmability/adapter/src/adapter.rs b/sui_programmability/adapter/src/adapter.rs index b3e7a1f2520a2..d2d17a2b08760 100644 --- a/sui_programmability/adapter/src/adapter.rs +++ b/sui_programmability/adapter/src/adapter.rs @@ -185,7 +185,7 @@ fn execute_internal< // we already checked that the function had no return types in resolve_and_type_check--it should // also not return any values at runtime debug_assert!(return_values.is_empty()); - // FastX Move programs should never touch global state, so ChangeSet should be empty + // Sui Move programs should never touch global state, so ChangeSet should be empty debug_assert!(change_set.accounts().is_empty()); // Input ref parameters we put in should be the same number we get out, plus one for the &mut TxContext debug_assert!(mutable_ref_objects.len() + 1 == mutable_ref_values.len()); @@ -366,7 +366,7 @@ pub fn publish + ModuleResolver + ModuleResolver + Storage, @@ -377,7 +377,7 @@ pub fn verify_and_link< natives: NativeFunctionTable, ) -> Result { // Run the Move bytecode verifier and linker. - // It is important to do this before running the FastX verifier, since the fastX + // It is important to do this before running the Sui verifier, since the sui // verifier may assume well-formedness conditions enforced by the Move verifier hold let vm = MoveVM::new(natives) .expect("VM creation only fails if natives are invalid, and we created the natives"); @@ -405,9 +405,9 @@ pub fn verify_and_link< error: e.to_string(), })?; - // run the FastX verifier + // run the Sui verifier for module in modules.iter() { - // Run FastX bytecode verifier, which runs some additional checks that assume the Move bytecode verifier has passed. + // Run Sui bytecode verifier, which runs some additional checks that assume the Move bytecode verifier has passed. verifier::verify_module(module)?; } Ok(vm) @@ -541,8 +541,8 @@ fn process_successful_execution< } // any object left in `by_value_objects` is an input passed by value that was not transferred or frozen. - // this means that either the object was (1) deleted from the FastX system altogether, or - // (2) wrapped inside another object that is in the FastX object pool + // this means that either the object was (1) deleted from the Sui system altogether, or + // (2) wrapped inside another object that is in the Sui object pool // in either case, we want to delete it let mut gas_refund: u64 = 0; for (id, object) in by_value_objects.iter() { diff --git a/sui_programmability/adapter/src/bytecode_rewriter.rs b/sui_programmability/adapter/src/bytecode_rewriter.rs index 5e6565fabc114..9798b4532ea23 100644 --- a/sui_programmability/adapter/src/bytecode_rewriter.rs +++ b/sui_programmability/adapter/src/bytecode_rewriter.rs @@ -111,7 +111,7 @@ impl ModuleHandleRewriter { // also check this later, but it's easier to understand what's going on if we raise the alarm // here. // TODO: if we wanted to, we could support rewriting the tables to eliminate duplicates, - // but this is more involved + will never happen in FastX's usage of the rewriter + // but this is more involved + will never happen in Sui's usage of the rewriter // (modulo hash collisions in ID generation). #[cfg(debug_assertions)] { diff --git a/sui_programmability/adapter/src/genesis.rs b/sui_programmability/adapter/src/genesis.rs index 5829080eeb39b..41b75666f95b4 100644 --- a/sui_programmability/adapter/src/genesis.rs +++ b/sui_programmability/adapter/src/genesis.rs @@ -21,7 +21,7 @@ pub fn clone_genesis_modules() -> Vec { genesis.objects.clone() } -/// Create and return objects wrapping the genesis modules for fastX +/// Create and return objects wrapping the genesis modules for sui fn create_genesis_module_objects(lib_dir: &Path) -> SuiResult { let sui_modules = sui_framework::get_sui_framework_modules(lib_dir)?; let std_modules = diff --git a/sui_programmability/adapter/src/unit_tests/adapter_tests.rs b/sui_programmability/adapter/src/unit_tests/adapter_tests.rs index 95a093fe7a3d3..a4f3e4b78991d 100644 --- a/sui_programmability/adapter/src/unit_tests/adapter_tests.rs +++ b/sui_programmability/adapter/src/unit_tests/adapter_tests.rs @@ -164,7 +164,7 @@ impl ResourceResolver for InMemoryStorage { _address: &AccountAddress, _struct_tag: &StructTag, ) -> Result>, Self::Error> { - unreachable!("Should never be called in FastX") + unreachable!("Should never be called in Sui") } } diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml index 865eda5920023..2a816dcd5183e 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init/Move.toml @@ -7,4 +7,4 @@ Test = "0x0" [dependencies] MoveStdlib = { local = "../../../../../framework/deps/move-stdlib/" } -FastX = { local = "../../../../../framework" } +Sui = { local = "../../../../../framework" } diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move index 397ef812bb72c..8d46c64673301 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init/sources/M1.move @@ -1,7 +1,7 @@ module Test::M1 { - use FastX::ID::VersionedID; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; + use Sui::ID::VersionedID; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml index 21c81a767ae32..8e5eebfdba1c7 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/Move.toml @@ -7,4 +7,4 @@ Test = "0x0" [dependencies] MoveStdlib = { local = "../../../../../framework/deps/move-stdlib/" } -FastX = { local = "../../../../../framework" } +Sui = { local = "../../../../../framework" } diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move index 4d2d26b4439e4..71800acb96b9d 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_param/sources/M1.move @@ -1,7 +1,7 @@ module Test::M1 { - use FastX::ID::VersionedID; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; + use Sui::ID::VersionedID; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml index a998f94340952..7420726e7bd33 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/Move.toml @@ -7,4 +7,4 @@ Test = "0x0" [dependencies] MoveStdlib = { local = "../../../../../framework/deps/move-stdlib/" } -FastX = { local = "../../../../../framework" } +Sui = { local = "../../../../../framework" } diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move index fdb0f9bf1051f..6c839412e2a37 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_public/sources/M1.move @@ -1,7 +1,7 @@ module Test::M1 { - use FastX::ID::VersionedID; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; + use Sui::ID::VersionedID; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml index a59ff2274b62d..dfb97cd723f51 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/Move.toml @@ -7,4 +7,4 @@ Test = "0x0" [dependencies] MoveStdlib = { local = "../../../../../framework/deps/move-stdlib/" } -FastX = { local = "../../../../../framework" } +Sui = { local = "../../../../../framework" } diff --git a/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move index c19d288723fe0..9d330f72def49 100644 --- a/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move +++ b/sui_programmability/adapter/src/unit_tests/data/publish_init_ret/sources/M1.move @@ -1,7 +1,7 @@ module Test::M1 { - use FastX::ID::VersionedID; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; + use Sui::ID::VersionedID; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml b/sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml index b0b762400df26..7e0f77b4e2b7c 100644 --- a/sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml +++ b/sui_programmability/adapter/src/unit_tests/data/simple_call/Move.toml @@ -7,7 +7,7 @@ Test = "0x0" [dependencies] MoveStdlib = { local = "../../../../../framework/deps/move-stdlib/" } -FastX = { local = "../../../../../framework" } +Sui = { local = "../../../../../framework" } diff --git a/sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move b/sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move index ab7c01f6b083f..a30afbb7b0b38 100644 --- a/sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move +++ b/sui_programmability/adapter/src/unit_tests/data/simple_call/sources/M1.move @@ -1,8 +1,8 @@ module Test::M1 { - use FastX::ID::VersionedID; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; - use FastX::Coin::Coin; + use Sui::ID::VersionedID; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; + use Sui::Coin::Coin; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/examples/Move.toml b/sui_programmability/examples/Move.toml index 833a7f2bd1bf9..ca50452855798 100644 --- a/sui_programmability/examples/Move.toml +++ b/sui_programmability/examples/Move.toml @@ -3,7 +3,7 @@ name = "Examples" version = "0.0.1" [dependencies] -FastX = { local = "../framework" } +Sui = { local = "../framework" } [addresses] Examples = "0x0" diff --git a/sui_programmability/examples/sources/CombinableObjects.move b/sui_programmability/examples/sources/CombinableObjects.move index 4ebe58b6979fe..225c69536e978 100644 --- a/sui_programmability/examples/sources/CombinableObjects.move +++ b/sui_programmability/examples/sources/CombinableObjects.move @@ -2,10 +2,10 @@ /// new objects module Examples::CombinableObjects { use Examples::TrustedCoin::EXAMPLE; - use FastX::Coin::{Self, Coin}; - use FastX::ID::{Self, VersionedID}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::Coin::{Self, Coin}; + use Sui::ID::{Self, VersionedID}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; struct Ham has key { id: VersionedID diff --git a/sui_programmability/examples/sources/CustomObjectTemplate.move b/sui_programmability/examples/sources/CustomObjectTemplate.move index a040371581bf2..8e15d3a608520 100644 --- a/sui_programmability/examples/sources/CustomObjectTemplate.move +++ b/sui_programmability/examples/sources/CustomObjectTemplate.move @@ -1,12 +1,12 @@ /// An example of a custom object with comments explaining the relevant bits module Examples::CustomObjectTemplate { - use FastX::ID::VersionedID; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::ID::VersionedID; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; - /// A custom fastX object. Every object must have the `key` attribute - /// (indicating that it is allowed to be a key in the fastX global object - /// pool), and must have a field `id: ID` corresponding to its fastX ObjId. + /// A custom sui object. Every object must have the `key` attribute + /// (indicating that it is allowed to be a key in the sui global object + /// pool), and must have a field `id: ID` corresponding to its sui ObjId. /// Other object attributes present at the protocol level (authenticator, /// sequence number, TxDigest, ...) are intentionally not exposed here. struct Object has key { @@ -65,14 +65,14 @@ module Examples::CustomObjectTemplate { } } - /// Example of an entrypoint function to be embedded in a FastX + /// Example of an entrypoint function to be embedded in a Sui /// transaction. The first argument of an entrypoint is always a /// special `TxContext` created by the runtime that is useful for deriving /// new id's or determining the sender of the transaction. /// After the `TxContext`, entrypoints can take struct types with the `key` /// attribute as input, as well as primitive types like ints, bools, ... /// - /// A FastX transaction must declare the ID's of each object it will + /// A Sui transaction must declare the ID's of each object it will /// access + any primitive inputs. The runtime that processes the /// transaction fetches the values associated with the ID's, type-checks /// the values + primitive inputs against the function signature of the diff --git a/sui_programmability/examples/sources/EconMod.move b/sui_programmability/examples/sources/EconMod.move index 3e9407229bc94..2c0007803ddee 100644 --- a/sui_programmability/examples/sources/EconMod.move +++ b/sui_programmability/examples/sources/EconMod.move @@ -5,10 +5,10 @@ module Examples::EconMod { use Examples::HeroMod::{Self, SeaMonster, RUM}; use Examples::Hero::Hero; - use FastX::Coin::{Self, Coin}; - use FastX::ID::{Self, VersionedID}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::Coin::{Self, Coin}; + use Sui::ID::{Self, VersionedID}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; /// Created by `monster_owner`, a player with a monster that's too strong /// for them to slay + transferred to a player who can slay the monster. diff --git a/sui_programmability/examples/sources/Hero.move b/sui_programmability/examples/sources/Hero.move index 7ad1e2955e87e..633b411ede903 100644 --- a/sui_programmability/examples/sources/Hero.move +++ b/sui_programmability/examples/sources/Hero.move @@ -2,12 +2,12 @@ /// associated logic. module Examples::Hero { use Examples::TrustedCoin::EXAMPLE; - use FastX::Coin::{Self, Coin}; - use FastX::Event; - use FastX::ID::{Self, VersionedID, IDBytes}; - use FastX::Math; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::Coin::{Self, Coin}; + use Sui::Event; + use Sui::ID::{Self, VersionedID, IDBytes}; + use Sui::Math; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; use Std::Option::{Self, Option}; /// Our hero! @@ -294,8 +294,8 @@ module Examples::Hero { #[test] public fun slay_boar_test() { use Examples::TrustedCoin::{Self, EXAMPLE}; - use FastX::Coin::{Self, TreasuryCap}; - use FastX::TestScenario; + use Sui::Coin::{Self, TreasuryCap}; + use Sui::TestScenario; let admin = ADMIN; let player = @0x0; diff --git a/sui_programmability/examples/sources/HeroMod.move b/sui_programmability/examples/sources/HeroMod.move index aadd31f8fe121..aff4b4883ebe6 100644 --- a/sui_programmability/examples/sources/HeroMod.move +++ b/sui_programmability/examples/sources/HeroMod.move @@ -7,10 +7,10 @@ /// anyone is free to create a mod like this. module Examples::HeroMod { use Examples::Hero::{Self, Hero}; - use FastX::ID::{Self, VersionedID}; - use FastX::Coin::{Self, Coin, TreasuryCap }; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::ID::{Self, VersionedID}; + use Sui::Coin::{Self, Coin, TreasuryCap }; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; /// A new kind of monster for the hero to fight struct SeaMonster has key, store { diff --git a/sui_programmability/examples/sources/TicTacToe.move b/sui_programmability/examples/sources/TicTacToe.move index 3fdb330e895bf..d1e9eb69a1e62 100644 --- a/sui_programmability/examples/sources/TicTacToe.move +++ b/sui_programmability/examples/sources/TicTacToe.move @@ -2,10 +2,10 @@ module Examples::TicTacToe { use Std::Option::{Self, Option}; use Std::Vector; - use FastX::ID::{Self, VersionedID, IDBytes}; - use FastX::Event; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::ID::{Self, VersionedID, IDBytes}; + use Sui::Event; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; // Game status const IN_PROGRESS: u8 = 0; diff --git a/sui_programmability/examples/sources/TrustedCoin.move b/sui_programmability/examples/sources/TrustedCoin.move index 19d28ee82bc68..3fb7defe7e489 100644 --- a/sui_programmability/examples/sources/TrustedCoin.move +++ b/sui_programmability/examples/sources/TrustedCoin.move @@ -1,8 +1,8 @@ /// Example coin with a trusted owner responsible for minting/burning (e.g., a stablecoin) module Examples::TrustedCoin { - use FastX::Coin::{Self, TreasuryCap}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::Coin::{Self, TreasuryCap}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; /// Name of the coin struct EXAMPLE has drop {} diff --git a/sui_programmability/examples/tests/TicTacToeTests.move b/sui_programmability/examples/tests/TicTacToeTests.move index 47e643a56a799..a7aff96fa9bfd 100644 --- a/sui_programmability/examples/tests/TicTacToeTests.move +++ b/sui_programmability/examples/tests/TicTacToeTests.move @@ -1,6 +1,6 @@ #[test_only] module Examples::TicTacToeTests { - use FastX::TestScenario::{Self, Scenario}; + use Sui::TestScenario::{Self, Scenario}; use Examples::TicTacToe::{Self, Mark, MarkMintCap, TicTacToe, Trophy}; const SEND_MARK_FAILED: u64 = 0; diff --git a/sui_programmability/framework/Cargo.toml b/sui_programmability/framework/Cargo.toml index 360c23f5ec8cb..eaa55b2f7f0f8 100644 --- a/sui_programmability/framework/Cargo.toml +++ b/sui_programmability/framework/Cargo.toml @@ -3,7 +3,7 @@ name = "sui-framework" version = "0.1.0" edition = "2021" authors = ["Mysten Labs "] -description = "Move framework for fastX platform" +description = "Move framework for sui platform" license = "Apache-2.0" publish = false diff --git a/sui_programmability/framework/Move.toml b/sui_programmability/framework/Move.toml index c106ce6404e7c..2bad3ad0ee92f 100644 --- a/sui_programmability/framework/Move.toml +++ b/sui_programmability/framework/Move.toml @@ -1,5 +1,5 @@ [package] -name = "FastX" +name = "Sui" version = "0.0.1" [dependencies] @@ -9,7 +9,7 @@ MoveStdlib = { local = "deps/move-stdlib" } #MoveStdlib = { git = "https://github.com/diem/diem.git", subdir="language/move-stdlib", rev = "346301f33b3489bb4e486ae6c0aa5e030223b492" } [addresses] -FastX = "0x2" +Sui = "0x2" [dev-addresses] -FastX = "0x2" +Sui = "0x2" diff --git a/sui_programmability/framework/README.md b/sui_programmability/framework/README.md index 66c147ca12c35..878c0ea273abe 100644 --- a/sui_programmability/framework/README.md +++ b/sui_programmability/framework/README.md @@ -1,6 +1,6 @@ -# FastX Programmability with Move +# Sui Programmability with Move -This is a proof-of-concept Move standard library for FastX (`sources/`), along with several examples of programs that FastX users might want to write (`examples`). `CustomObjectTemplate.move` is a good starting point for understanding the proposed model. +This is a proof-of-concept Move standard library for Sui (`sources/`), along with several examples of programs that Sui users might want to write (`examples`). `CustomObjectTemplate.move` is a good starting point for understanding the proposed model. ### Setup diff --git a/sui_programmability/framework/sources/Coin.move b/sui_programmability/framework/sources/Coin.move index 4eac9dd751a7a..a95dda9f1b048 100644 --- a/sui_programmability/framework/sources/Coin.move +++ b/sui_programmability/framework/sources/Coin.move @@ -1,7 +1,7 @@ -module FastX::Coin { - use FastX::ID::{Self, VersionedID}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; +module Sui::Coin { + use Sui::ID::{Self, VersionedID}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; use Std::Errors; use Std::Vector; diff --git a/sui_programmability/framework/sources/Collection.move b/sui_programmability/framework/sources/Collection.move index 8a5f68e227f5f..d95b05ca768a9 100644 --- a/sui_programmability/framework/sources/Collection.move +++ b/sui_programmability/framework/sources/Collection.move @@ -1,10 +1,10 @@ -module FastX::Collection { +module Sui::Collection { use Std::Errors; use Std::Option::{Self, Option}; use Std::Vector::Self; - use FastX::ID::{Self, VersionedID, IDBytes}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; + use Sui::ID::{Self, VersionedID, IDBytes}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; // Error codes const EOBJECT_NOT_FOUND: u64 = 0; diff --git a/sui_programmability/framework/sources/Escrow.move b/sui_programmability/framework/sources/Escrow.move index c248476d78c5f..d8f9c6233d2ab 100644 --- a/sui_programmability/framework/sources/Escrow.move +++ b/sui_programmability/framework/sources/Escrow.move @@ -1,10 +1,10 @@ /// An escrow for atomic swap of objects that /// trusts a third party for liveness, but not /// safety. -module FastX::Escrow { - use FastX::ID::{Self, IDBytes, VersionedID}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; +module Sui::Escrow { + use Sui::ID::{Self, IDBytes, VersionedID}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; /// An object held in escrow struct EscrowedObj has key, store { diff --git a/sui_programmability/framework/sources/Event.move b/sui_programmability/framework/sources/Event.move index 95999d1bc2564..a7542a6550bd9 100644 --- a/sui_programmability/framework/sources/Event.move +++ b/sui_programmability/framework/sources/Event.move @@ -1,4 +1,4 @@ -module FastX::Event { +module Sui::Event { /// Add `t` to the event log of this transaction // TODO(https://github.com/MystenLabs/fastnft/issues/19): diff --git a/sui_programmability/framework/sources/GAS.move b/sui_programmability/framework/sources/GAS.move index 36c286df5f407..ffde418fe79b6 100644 --- a/sui_programmability/framework/sources/GAS.move +++ b/sui_programmability/framework/sources/GAS.move @@ -1,8 +1,8 @@ -/// Coin is the token used to pay for gas in FastX -module FastX::GAS { - use FastX::Coin; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; +/// Coin is the token used to pay for gas in Sui +module Sui::GAS { + use Sui::Coin; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; /// Name of the coin struct GAS has drop {} diff --git a/sui_programmability/framework/sources/Geniteam.move b/sui_programmability/framework/sources/Geniteam.move index 7a9427803399c..43dc30bf68ced 100644 --- a/sui_programmability/framework/sources/Geniteam.move +++ b/sui_programmability/framework/sources/Geniteam.move @@ -1,7 +1,7 @@ -module FastX::Geniteam { - use FastX::ID::{Self, VersionedID, IDBytes}; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; +module Sui::Geniteam { + use Sui::ID::{Self, VersionedID, IDBytes}; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; use Std::ASCII::{Self, String}; use Std::Option::{Self, Option}; use Std::Vector::Self; diff --git a/sui_programmability/framework/sources/ID.move b/sui_programmability/framework/sources/ID.move index bbca6a27f7003..cd3124235e9b8 100644 --- a/sui_programmability/framework/sources/ID.move +++ b/sui_programmability/framework/sources/ID.move @@ -1,8 +1,8 @@ -/// FastX object identifiers -module FastX::ID { +/// Sui object identifiers +module Sui::ID { use Std::BCS; // TODO(): bring this back - //friend FastX::TxContext; + //friend Sui::TxContext; /// Version of a ID created by the current transaction. const INITIAL_VERSION: u64 = 0; @@ -71,7 +71,7 @@ module FastX::ID { BCS::to_bytes(get_bytes(i)) } - /// Get the VersionedID for `obj`. Safe because fastX has an extra + /// Get the VersionedID for `obj`. Safe because sui has an extra /// bytecode verifier pass that forces every struct with /// the `key` ability to have a distinguished `VersionedID` field. public native fun get_id(obj: &T): &VersionedID; diff --git a/sui_programmability/framework/sources/Math.move b/sui_programmability/framework/sources/Math.move index 7a19a22d353e5..fd69fd4dd1342 100644 --- a/sui_programmability/framework/sources/Math.move +++ b/sui_programmability/framework/sources/Math.move @@ -1,5 +1,5 @@ /// Basic math for nicer programmability -module FastX::Math { +module Sui::Math { /// Return the larger of `x` and `y` public fun max(x: u64, y: u64): u64 { diff --git a/sui_programmability/framework/sources/ObjectBasics.move b/sui_programmability/framework/sources/ObjectBasics.move index 7e1f677f2cc89..be6134a84f782 100644 --- a/sui_programmability/framework/sources/ObjectBasics.move +++ b/sui_programmability/framework/sources/ObjectBasics.move @@ -1,9 +1,9 @@ /// Test CTURD object basics (create, transfer, update, read, delete) -module FastX::ObjectBasics { - use FastX::Event; - use FastX::ID::{Self, VersionedID}; - use FastX::TxContext::{Self, TxContext}; - use FastX::Transfer; +module Sui::ObjectBasics { + use Sui::Event; + use Sui::ID::{Self, VersionedID}; + use Sui::TxContext::{Self, TxContext}; + use Sui::Transfer; struct Object has key, store { id: VersionedID, diff --git a/sui_programmability/framework/sources/TestScenario.move b/sui_programmability/framework/sources/TestScenario.move index 8dbd8437eafba..65ead91b9524d 100644 --- a/sui_programmability/framework/sources/TestScenario.move +++ b/sui_programmability/framework/sources/TestScenario.move @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 #[test_only] -module FastX::TestScenario { - use FastX::ID::{Self, VersionedID, IDBytes}; - use FastX::Transfer; - use FastX::TxContext::{Self, TxContext}; +module Sui::TestScenario { + use Sui::ID::{Self, VersionedID, IDBytes}; + use Sui::Transfer; + use Sui::TxContext::{Self, TxContext}; use Std::Vector; /// Attempted an operation that required a concluded transaction, but there are none diff --git a/sui_programmability/framework/sources/Transfer.move b/sui_programmability/framework/sources/Transfer.move index 794a7c10de4e4..90a2ea4edfa0a 100644 --- a/sui_programmability/framework/sources/Transfer.move +++ b/sui_programmability/framework/sources/Transfer.move @@ -1,8 +1,8 @@ -module FastX::Transfer { - use FastX::ID; +module Sui::Transfer { + use Sui::ID; /// Transfers are implemented by emitting a - /// special `TransferEvent` that the fastX adapter + /// special `TransferEvent` that the sui adapter /// interprets differently than user events. struct TransferEvent { /// The object to be transferred diff --git a/sui_programmability/framework/sources/TxContext.move b/sui_programmability/framework/sources/TxContext.move index e0428c33f3e38..cbb9a5ff6fe95 100644 --- a/sui_programmability/framework/sources/TxContext.move +++ b/sui_programmability/framework/sources/TxContext.move @@ -1,4 +1,4 @@ -module FastX::TxContext { +module Sui::TxContext { #[test_only] use Std::Errors; #[test_only] @@ -6,7 +6,7 @@ module FastX::TxContext { use Std::Signer; - use FastX::ID::{Self, VersionedID}; + use Sui::ID::{Self, VersionedID}; /// Number of bytes in an inputs_hash (which will be the transaction digest) const INPUTS_HASH_LENGTH: u64 = 32; diff --git a/sui_programmability/framework/src/lib.rs b/sui_programmability/framework/src/lib.rs index a49e41a283e7e..62eb8625d9bea 100644 --- a/sui_programmability/framework/src/lib.rs +++ b/sui_programmability/framework/src/lib.rs @@ -60,7 +60,7 @@ pub fn get_move_stdlib_modules(lib_dir: &Path) -> SuiResult> /// Given a `path` and a `build_config`, build the package in that path and return the compiled modules as Vec>. /// This is useful for when publishing -/// If we are building the FastX framework, `is_framework` will be true; +/// If we are building the Sui framework, `is_framework` will be true; /// Otherwise `is_framework` should be false (e.g. calling from client). pub fn build_move_package_to_bytes(path: &Path) -> Result>, SuiError> { build_move_package( @@ -82,7 +82,7 @@ pub fn build_move_package_to_bytes(path: &Path) -> Result>, SuiError } /// Given a `path` and a `build_config`, build the package in that path. -/// If we are building the FastX framework, `is_framework` will be true; +/// If we are building the Sui framework, `is_framework` will be true; /// Otherwise `is_framework` should be false (e.g. calling from client). pub fn build_move_package( path: &Path, diff --git a/sui_programmability/framework/src/natives/transfer.rs b/sui_programmability/framework/src/natives/transfer.rs index bc9df162ae1d5..2866754abb3cb 100644 --- a/sui_programmability/framework/src/natives/transfer.rs +++ b/sui_programmability/framework/src/natives/transfer.rs @@ -17,7 +17,7 @@ use std::collections::VecDeque; /// Implementation of Move native function /// `transfer_internal(obj: T, recipient: vector, should_freeze: bool)` -/// Here, we simply emit this event. The fastX adapter +/// Here, we simply emit this event. The sui adapter /// treats this as a special event that is handled /// differently from user events: /// the adapter will change the owner of the object diff --git a/sui_programmability/framework/tests/CollectionTests.move b/sui_programmability/framework/tests/CollectionTests.move index 56d78c05883fc..9609cdc5cbbc5 100644 --- a/sui_programmability/framework/tests/CollectionTests.move +++ b/sui_programmability/framework/tests/CollectionTests.move @@ -1,8 +1,8 @@ #[test_only] -module FastX::CollectionTests { - use FastX::Collection; - use FastX::ID::{Self, VersionedID}; - use FastX::TxContext; +module Sui::CollectionTests { + use Sui::Collection; + use Sui::ID::{Self, VersionedID}; + use Sui::TxContext; const ECOLLECTION_SIZE_MISMATCH: u64 = 0; const EOBJECT_NOT_FOUND: u64 = 1; @@ -36,7 +36,7 @@ module FastX::CollectionTests { #[expected_failure(abort_code = 520)] fun test_init_with_invalid_max_capacity() { let ctx = TxContext::dummy(); - // FastX::Collection::DEFAULT_MAX_CAPACITY is not readable outside the module + // Sui::Collection::DEFAULT_MAX_CAPACITY is not readable outside the module let max_capacity = 65536; let collection = Collection::new_with_max_capacity(&mut ctx, max_capacity + 1); Collection::transfer(collection, TxContext::get_signer_address(&ctx)); diff --git a/sui_programmability/framework/tests/IDTests.move b/sui_programmability/framework/tests/IDTests.move index 1ff26ec430b73..6a5498ddbe2a4 100644 --- a/sui_programmability/framework/tests/IDTests.move +++ b/sui_programmability/framework/tests/IDTests.move @@ -1,7 +1,7 @@ #[test_only] -module FastX::IDTests { - use FastX::ID; - use FastX::TxContext; +module Sui::IDTests { + use Sui::ID; + use Sui::TxContext; const ID_BYTES_MISMATCH: u64 = 0; diff --git a/sui_programmability/framework/tests/TestScenarioTests.move b/sui_programmability/framework/tests/TestScenarioTests.move index 9663a18b70a5e..5269c54026520 100644 --- a/sui_programmability/framework/tests/TestScenarioTests.move +++ b/sui_programmability/framework/tests/TestScenarioTests.move @@ -2,10 +2,10 @@ // SPDX-License-Identifier: Apache-2.0 #[test_only] -module FastX::TestScenarioTests { - use FastX::ID; - use FastX::TestScenario; - use FastX::Transfer; +module Sui::TestScenarioTests { + use Sui::ID; + use Sui::TestScenario; + use Sui::Transfer; const ID_BYTES_MISMATCH: u64 = 0; const VALUE_MISMATCH: u64 = 1; diff --git a/sui_programmability/framework/tests/TxContextTests.move b/sui_programmability/framework/tests/TxContextTests.move index 2bb22adef25ee..0270652e1300d 100644 --- a/sui_programmability/framework/tests/TxContextTests.move +++ b/sui_programmability/framework/tests/TxContextTests.move @@ -1,7 +1,7 @@ #[test_only] -module FastX::TxContextTests { - use FastX::ID; - use FastX::TxContext; +module Sui::TxContextTests { + use Sui::ID; + use Sui::TxContext; #[test] fun test_id_generation() { diff --git a/sui_programmability/verifier/src/id_leak_verifier.rs b/sui_programmability/verifier/src/id_leak_verifier.rs index ab54affe8892f..36bf4a185cb56 100644 --- a/sui_programmability/verifier/src/id_leak_verifier.rs +++ b/sui_programmability/verifier/src/id_leak_verifier.rs @@ -163,7 +163,7 @@ impl<'a> TransferFunctions for IDLeakAnalysis<'a> { impl<'a> AbstractInterpreter for IDLeakAnalysis<'a> {} -/// FastX::ID::delete function is allowed to take an ID by value. +/// Sui::ID::delete function is allowed to take an ID by value. fn is_call_safe_to_leak(verifier: &IDLeakAnalysis, function_handle: &FunctionHandle) -> bool { let m = verifier .binary_view diff --git a/sui_types/src/coin.rs b/sui_types/src/coin.rs index 1480de65ea67b..d40290be27d12 100644 --- a/sui_types/src/coin.rs +++ b/sui_types/src/coin.rs @@ -20,7 +20,7 @@ pub const COIN_STRUCT_NAME: &IdentStr = COIN_MODULE_NAME; pub const COIN_JOIN_FUNC_NAME: &IdentStr = ident_str!("join"); pub const COIN_SPLIT_VEC_FUNC_NAME: &IdentStr = ident_str!("split_vec"); -// Rust version of the Move FastX::Coin::Coin type +// Rust version of the Move Sui::Coin::Coin type #[derive(Debug, Serialize, Deserialize)] pub struct Coin { id: VersionedID, diff --git a/sui_types/src/gas_coin.rs b/sui_types/src/gas_coin.rs index 2d847d5f61585..dbf53f4eedea8 100644 --- a/sui_types/src/gas_coin.rs +++ b/sui_types/src/gas_coin.rs @@ -38,7 +38,7 @@ impl GAS { } } -/// Rust version of the Move FastX::Coin::Coin type +/// Rust version of the Move Sui::Coin::Coin type #[derive(Debug, Serialize, Deserialize)] pub struct GasCoin(Coin); diff --git a/sui_types/src/id.rs b/sui_types/src/id.rs index a888d57509c40..9c58b1f228c66 100644 --- a/sui_types/src/id.rs +++ b/sui_types/src/id.rs @@ -18,14 +18,14 @@ pub const ID_MODULE_NAME: &IdentStr = ident_str!("ID"); pub const ID_STRUCT_NAME: &IdentStr = ID_MODULE_NAME; pub const ID_BYTES_STRUCT_NAME: &IdentStr = ident_str!("IDBytes"); -/// Rust version of the Move FastX::ID::VersionedID type +/// Rust version of the Move Sui::ID::VersionedID type #[derive(Debug, Serialize, Deserialize)] pub struct VersionedID { id: IDBytes, version: u64, } -/// Rust version of the Move FastX::ID::IDBytes type +/// Rust version of the Move Sui::ID::IDBytes type #[derive(Debug, Serialize, Deserialize)] struct IDBytes { bytes: ObjectID, diff --git a/sui_types/src/lib.rs b/sui_types/src/lib.rs index e52a690e92f43..caf6c71ad50af 100644 --- a/sui_types/src/lib.rs +++ b/sui_types/src/lib.rs @@ -31,7 +31,7 @@ pub mod storage; /// Same as the ObjectID pub const MOVE_STDLIB_ADDRESS: AccountAddress = AccountAddress::ONE; -/// 0x2-- account address where fastX framework modules are stored +/// 0x2-- account address where sui framework modules are stored /// Same as the ObjectID pub const SUI_FRAMEWORK_ADDRESS: AccountAddress = get_hex_address_two(); diff --git a/sui_types/src/object.rs b/sui_types/src/object.rs index be19bf52ba84f..970740c0e6add 100644 --- a/sui_types/src/object.rs +++ b/sui_types/src/object.rs @@ -209,7 +209,7 @@ impl MovePackage { module_name: module.to_string(), })?; let m = CompiledModule::deserialize(bytes) - .expect("Unwrap safe because FastX serializes/verifies modules before publishing them"); + .expect("Unwrap safe because Sui serializes/verifies modules before publishing them"); Function::new_from_name(&m, function).ok_or(SuiError::FunctionNotFound { error: format!( @@ -243,7 +243,7 @@ pub enum Data { Move(MoveObject), /// Map from each module name to raw serialized Move module bytes Package(MovePackage), - // ... FastX "native" types go here + // ... Sui "native" types go here } impl Data {