From af17dcb503e6c8ea6df7a76aeff92e5bff5d5f47 Mon Sep 17 00:00:00 2001 From: Foivos Date: Wed, 27 Nov 2024 16:32:10 +0100 Subject: [PATCH] feat: change version to sui testnet 1.38.2 (#217) --- .changeset/curly-suns-explain.md | 5 + move/abi/Move.lock | 10 +- move/abi/Move.toml | 4 +- move/abi/sources/abi.move | 3 +- move/axelar_gateway/Move.lock | 10 +- move/axelar_gateway/Move.toml | 6 +- move/axelar_gateway/sources/gateway.move | 20 ++- move/axelar_gateway/sources/types/proof.move | 2 +- move/example/Move.lock | 11 +- move/example/Move.toml | 4 +- move/example/sources/gmp/gmp.move | 16 +-- move/example/sources/its/its.move | 2 +- move/gas_service/Move.lock | 10 +- move/gas_service/Move.toml | 4 +- move/governance/Move.lock | 10 +- move/governance/Move.toml | 4 +- .../sources/governance/governance.move | 6 +- move/interchain_token/Move.lock | 10 +- move/interchain_token/Move.toml | 4 +- move/its/Move.lock | 10 +- move/its/Move.toml | 4 +- move/its/sources/events.move | 20 +-- move/its/sources/its.move | 33 +++-- move/its/sources/types/trusted_addresses.move | 4 +- move/its/sources/versioned/its_v0.move | 12 +- move/its/tests/coin.move | 125 +++++++++++------- move/its/tests/coin_init_test.move | 46 +++---- move/operators/Move.lock | 10 +- move/operators/Move.toml | 4 +- move/operators/sources/operators.move | 9 +- move/relayer_discovery/Move.lock | 10 +- move/relayer_discovery/Move.toml | 4 +- .../sources/types/transaction.move | 36 +++-- move/squid/Move.lock | 14 +- move/squid/Move.toml | 8 +- move/squid/sources/squid/deepbook_v3.move | 3 +- move/squid/sources/squid/discovery.move | 2 +- move/squid/sources/squid/squid.move | 13 +- move/squid/sources/squid/swap_info.move | 31 ++--- move/squid/sources/squid/transfers.move | 3 +- move/utils/Move.lock | 10 +- move/utils/Move.toml | 4 +- move/utils/sources/utils/utils.move | 6 +- move/version_control/Move.lock | 10 +- move/version_control/Move.toml | 4 +- package-lock.json | 4 +- package.json | 2 +- version.json | 2 +- 48 files changed, 334 insertions(+), 250 deletions(-) create mode 100644 .changeset/curly-suns-explain.md diff --git a/.changeset/curly-suns-explain.md b/.changeset/curly-suns-explain.md new file mode 100644 index 00000000..85b6e2d1 --- /dev/null +++ b/.changeset/curly-suns-explain.md @@ -0,0 +1,5 @@ +--- +'@axelar-network/axelar-cgp-sui': major +--- + +Change to sui testnet-v1.38.2 diff --git a/move/abi/Move.lock b/move/abi/Move.lock index 029dbb21..e14ee6ba 100644 --- a/move/abi/Move.lock +++ b/move/abi/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "08E67C09D06D1A67017ACC0FC428650D442948374ABD478D0094C61624BB33F2" +manifest_digest = "A231B175183FA2CD5B9C408C16D741D3FA902F681B81144792A483FF5FAD2D4D" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, @@ -10,17 +10,17 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/abi/Move.toml b/move/abi/Move.toml index 0675a673..ac752e3f 100644 --- a/move/abi/Move.toml +++ b/move/abi/Move.toml @@ -1,10 +1,10 @@ [package] name = "Abi" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } [addresses] abi = "0xa0" diff --git a/move/abi/sources/abi.move b/move/abi/sources/abi.move index 270a8355..09e08a66 100644 --- a/move/abi/sources/abi.move +++ b/move/abi/sources/abi.move @@ -1,4 +1,5 @@ -/// This module implements ABI encoding/decoding methods for interoperability with EVM message format. +/// This module implements ABI encoding/decoding methods for interoperability +/// with EVM message format. /// /// ABI Specification: https://docs.soliditylang.org/en/v0.8.26/abi-spec.html module abi::abi; diff --git a/move/axelar_gateway/Move.lock b/move/axelar_gateway/Move.lock index 722cda48..212c2847 100644 --- a/move/axelar_gateway/Move.lock +++ b/move/axelar_gateway/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "E9A0CD1400D2AFF354F91244ACA6D96CD91319A47BFBF47CDCC0347338FD41D2" +manifest_digest = "D73C467DE21B1D00575486851AEC7086768E5D6D0E4DDCBECB0977101BE53CA3" deps_digest = "F9B494B64F0615AED0E98FC12A85B85ECD2BC5185C22D30E7F67786BB52E507C" dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -13,11 +13,11 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -40,6 +40,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/axelar_gateway/Move.toml b/move/axelar_gateway/Move.toml index 86029da2..73002bec 100644 --- a/move/axelar_gateway/Move.toml +++ b/move/axelar_gateway/Move.toml @@ -1,11 +1,11 @@ [package] name = "AxelarGateway" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } -MoveStdlib = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/move-stdlib", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } +MoveStdlib = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/move-stdlib", rev = "testnet-v1.38.2" } VersionControl = { local = "../version_control" } Utils = { local = "../utils" } diff --git a/move/axelar_gateway/sources/gateway.move b/move/axelar_gateway/sources/gateway.move index 3b0272c5..008ffcfd 100644 --- a/move/axelar_gateway/sources/gateway.move +++ b/move/axelar_gateway/sources/gateway.move @@ -174,12 +174,24 @@ entry fun rotate_signers( ) } -entry fun allow_function(self: &mut Gateway, _: &OwnerCap, version: u64, function_name: String) { +entry fun allow_function( + self: &mut Gateway, + _: &OwnerCap, + version: u64, + function_name: String, +) { self.value_mut!(b"allow_function").allow_function(version, function_name); } -entry fun disallow_function(self: &mut Gateway, _: &OwnerCap, version: u64, function_name: String) { - self.value_mut!(b"disallow_function").disallow_function(version, function_name); +entry fun disallow_function( + self: &mut Gateway, + _: &OwnerCap, + version: u64, + function_name: String, +) { + self + .value_mut!(b"disallow_function") + .disallow_function(version, function_name); } // ---------------- @@ -1081,7 +1093,7 @@ fun test_disallow_function() { let function_name = b"approve_messages".to_ascii_string(); self.disallow_function(&owner_cap, version, function_name); - + sui::test_utils::destroy(self); owner_cap.destroy_for_testing(); } diff --git a/move/axelar_gateway/sources/types/proof.move b/move/axelar_gateway/sources/types/proof.move index e88d4570..0057eaf0 100644 --- a/move/axelar_gateway/sources/types/proof.move +++ b/move/axelar_gateway/sources/types/proof.move @@ -40,7 +40,7 @@ const ESignerNotFound: vector = #[error] const ERedundantSignaturesProvided: vector = b"redundant signatures provided"; - + // ----------------- // Package Functions // ----------------- diff --git a/move/example/Move.lock b/move/example/Move.lock index 52246010..b1df2bf6 100644 --- a/move/example/Move.lock +++ b/move/example/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "2BF8E393A6BC926689C2EF8893266EC21B1C76E0FE59A375A46CB3E88D4C2593" +manifest_digest = "9000A958E0D3E6CFF585787FB438BFFC534547BC22A28DB5816B23C2F29EC7DC" deps_digest = "CAFAD8A7CF51067FB4358215BECB86BD100DD64E57C2AC8A7AE7D74B688F5965" dependencies = [ { id = "AxelarGateway", name = "AxelarGateway" }, @@ -38,6 +38,7 @@ id = "GasService" source = { local = "../gas_service" } dependencies = [ + { id = "AxelarGateway", name = "AxelarGateway" }, { id = "Sui", name = "Sui" }, { id = "VersionControl", name = "VersionControl" }, ] @@ -57,7 +58,7 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "RelayerDiscovery" @@ -71,7 +72,7 @@ dependencies = [ [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -94,6 +95,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/example/Move.toml b/move/example/Move.toml index 71a64333..3af5e113 100644 --- a/move/example/Move.toml +++ b/move/example/Move.toml @@ -1,10 +1,10 @@ [package] name = "Example" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } GasService = { local = "../gas_service" } AxelarGateway = { local = "../axelar_gateway" } Utils = { local = "../utils" } diff --git a/move/example/sources/gmp/gmp.move b/move/example/sources/gmp/gmp.move index c95cce56..c23426a8 100644 --- a/move/example/sources/gmp/gmp.move +++ b/move/example/sources/gmp/gmp.move @@ -2,8 +2,8 @@ module example::gmp; use axelar_gateway::channel::{Self, Channel, ApprovedMessage}; use axelar_gateway::gateway::{Self, Gateway}; -use gas_service::gas_service::GasService; use example::utils::concat; +use gas_service::gas_service::GasService; use relayer_discovery::discovery::RelayerDiscovery; use relayer_discovery::transaction; use std::ascii::{Self, String}; @@ -36,10 +36,11 @@ public fun register_transaction( discovery: &mut RelayerDiscovery, singleton: &Singleton, ) { - let arguments = vector [ - vector[2u8], - concat(vector[0u8], object::id_address(singleton).to_bytes()) - ]; + let arguments = + vector[ + vector[2u8], + concat(vector[0u8], object::id_address(singleton).to_bytes()), + ]; let transaction = transaction::new_transaction( true, @@ -77,14 +78,13 @@ public fun send_call( coin: Coin, params: vector, ) { - let message_ticket = gateway::prepare_message( &singleton.channel, destination_chain, destination_address, payload, - ); - + ); + gas_service.pay_gas( &message_ticket, coin, diff --git a/move/example/sources/its/its.move b/move/example/sources/its/its.move index ca1b2806..8e75ab44 100644 --- a/move/example/sources/its/its.move +++ b/move/example/sources/its/its.move @@ -7,9 +7,9 @@ use example::utils::concat; use gas_service::gas_service::GasService; use its::coin_info; use its::coin_management; +use its::discovery as its_discovery; use its::its::{Self, ITS}; use its::token_id::TokenId; -use its::discovery as its_discovery; use relayer_discovery::discovery::RelayerDiscovery; use relayer_discovery::transaction::{Self, Transaction}; use std::ascii::{Self, String}; diff --git a/move/gas_service/Move.lock b/move/gas_service/Move.lock index 16161b14..1835882e 100644 --- a/move/gas_service/Move.lock +++ b/move/gas_service/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "C04CC08DC1212FBCB4F5A869F32A9607A3C3E3586BC3BEFC0C0F1DBD3CE563CE" +manifest_digest = "B42F61019F82CD818F2BA9772475684AF7EC56ED0D88B4441EE2A8552F9DC1F6" deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" dependencies = [ { id = "AxelarGateway", name = "AxelarGateway" }, @@ -23,11 +23,11 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -50,6 +50,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/gas_service/Move.toml b/move/gas_service/Move.toml index c83e94eb..66957f3e 100644 --- a/move/gas_service/Move.toml +++ b/move/gas_service/Move.toml @@ -1,10 +1,10 @@ [package] name = "GasService" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } VersionControl = { local = "../version_control" } AxelarGateway = { local = "../axelar_gateway" } diff --git a/move/governance/Move.lock b/move/governance/Move.lock index d09297b3..b49c3d1e 100644 --- a/move/governance/Move.lock +++ b/move/governance/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "B4EA324317AA32AD7EFF65A13D328A551EE7260B59DADB9285251131A0AC0230" +manifest_digest = "CB2A981ECA1F36FE40AF09B3D67DCBF7027A21D1253B06D5F232FA31DB0C6B30" deps_digest = "397E6A9F7A624706DBDFEE056CE88391A15876868FD18A88504DA74EB458D697" dependencies = [ { id = "Abi", name = "Abi" }, @@ -33,11 +33,11 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -60,6 +60,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/governance/Move.toml b/move/governance/Move.toml index 0613756c..c3d1a624 100644 --- a/move/governance/Move.toml +++ b/move/governance/Move.toml @@ -1,10 +1,10 @@ [package] name = "Governance" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } AxelarGateway = { local = "../axelar_gateway" } Abi = { local = "../abi" } Utils = { local = "../utils" } diff --git a/move/governance/sources/governance/governance.move b/move/governance/sources/governance/governance.move index 5d5fc71a..2933ab1c 100644 --- a/move/governance/sources/governance/governance.move +++ b/move/governance/sources/governance/governance.move @@ -33,7 +33,8 @@ public struct Governance has key, store { caps: Table, } -// This can only be called once since it needs its own upgrade cap which it deletes. +// This can only be called once since it needs its own upgrade cap which it +// deletes. entry fun new( trusted_source_chain: String, trusted_source_address: String, @@ -68,7 +69,8 @@ public fun is_governance( &addr == &self.trusted_source_address } -// TODO maybe check that the polcy for the upgrade cap has not been tampered with. +// TODO maybe check that the polcy for the upgrade cap has not been tampered +// with. entry fun take_upgrade_cap(self: &mut Governance, upgrade_cap: UpgradeCap) { is_cap_new(&upgrade_cap); diff --git a/move/interchain_token/Move.lock b/move/interchain_token/Move.lock index 5a58ad69..03534d07 100644 --- a/move/interchain_token/Move.lock +++ b/move/interchain_token/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "5401450A06E6E41BED35853A7B402D7A02DFE2B0B1AD9B31E9AA2C2CABF1326D" +manifest_digest = "64A2F7ED9D02E9B6162B36D6003ADED9D19462DE6CDDEF86E83D3116B21DC6E0" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, @@ -10,17 +10,17 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/interchain_token/Move.toml b/move/interchain_token/Move.toml index e4e54a52..1cbc1045 100644 --- a/move/interchain_token/Move.toml +++ b/move/interchain_token/Move.toml @@ -1,10 +1,10 @@ [package] name = "InterchainToken" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } [addresses] interchain_token = "0xa8" diff --git a/move/its/Move.lock b/move/its/Move.lock index 21594136..d93fb85b 100644 --- a/move/its/Move.lock +++ b/move/its/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "24983239A0E064F9E41A580A433B338164892CD463BF38F6A42B88C6029D8A16" +manifest_digest = "2429DB0FDE0EAD1C15A96EA75C44454B3279EB93A32FF56518FFFDAFEF50695A" deps_digest = "52B406A7A21811BEF51751CF88DA0E76DAEFFEAC888D4F4060B1A72BBE7D8D35" dependencies = [ { id = "Abi", name = "Abi" }, @@ -34,7 +34,7 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "RelayerDiscovery" @@ -48,7 +48,7 @@ dependencies = [ [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -71,6 +71,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/its/Move.toml b/move/its/Move.toml index 929fa9b3..d5b03748 100644 --- a/move/its/Move.toml +++ b/move/its/Move.toml @@ -1,10 +1,10 @@ [package] name = "ITS" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } AxelarGateway = { local = "../axelar_gateway" } Abi = { local = "../abi" } Utils = { local = "../utils" } diff --git a/move/its/sources/events.move b/move/its/sources/events.move index 2569da19..09d1b1b4 100644 --- a/move/its/sources/events.move +++ b/move/its/sources/events.move @@ -148,31 +148,26 @@ public(package) fun trusted_address_set( trusted_address: String, ) { event::emit(TrustedAddressSet { - chain_name, - trusted_address, + chain_name, + trusted_address, }); } -public(package) fun trusted_address_removed( - chain_name: String, -) { +public(package) fun trusted_address_removed(chain_name: String) { event::emit(TrustedAddressRemoved { chain_name, }); } -public(package) fun flow_limit_set( - token_id: TokenId, - flow_limit: u64, -) { +public(package) fun flow_limit_set(token_id: TokenId, flow_limit: u64) { event::emit(FlowLimitSet { token_id, - flow_limit + flow_limit, }); } - + // --------- -// Test Only +// Test Only // --------- #[test_only] use its::coin::COIN; @@ -211,7 +206,6 @@ fun test_interchain_transfer_empty_data() { assert!(event.amount == amount); } - #[test] fun test_interchain_transfer_nonempty_data() { let token_id = token_id::from_address(@0x1); diff --git a/move/its/sources/its.move b/move/its/sources/its.move index 054fd948..0f81905e 100644 --- a/move/its/sources/its.move +++ b/move/its/sources/its.move @@ -79,12 +79,24 @@ macro fun value_mut($self: &mut ITS, $function_name: vector): &mut ITS_v0 { // --------------- // Entry Functions // --------------- -entry fun allow_function(self: &mut ITS, _: &OwnerCap, version: u64, function_name: String) { +entry fun allow_function( + self: &mut ITS, + _: &OwnerCap, + version: u64, + function_name: String, +) { self.value_mut!(b"allow_function").allow_function(version, function_name); } -entry fun disallow_function(self: &mut ITS, _: &OwnerCap, version: u64, function_name: String) { - self.value_mut!(b"disallow_function").disallow_function(version, function_name); +entry fun disallow_function( + self: &mut ITS, + _: &OwnerCap, + version: u64, + function_name: String, +) { + self + .value_mut!(b"disallow_function") + .disallow_function(version, function_name); } // ---------------- @@ -722,9 +734,9 @@ fun test_receive_deploy_interchain_token() { ); receive_deploy_interchain_token(&mut its, approved_message); - + utils::assert_event>(); - + clock.destroy_for_testing(); sui::test_utils::destroy(its); } @@ -884,10 +896,11 @@ fun test_set_flow_limit() { let decimals = 9; let limit = 1234; - let ( - treasury_cap, - coin_metadata, - ) = its::coin::create_treasury_and_metadata(symbol, decimals, ctx); + let (treasury_cap, coin_metadata) = its::coin::create_treasury_and_metadata( + symbol, + decimals, + ctx, + ); let coin_info = its::coin_info::from_metadata( coin_metadata, ); @@ -964,7 +977,7 @@ fun test_disallow_function() { let function_name = b"send_interchain_transfer".to_ascii_string(); self.disallow_function(&owner_cap, version, function_name); - + sui::test_utils::destroy(self); sui::test_utils::destroy(owner_cap); } diff --git a/move/its/sources/types/trusted_addresses.move b/move/its/sources/types/trusted_addresses.move index 0e72745b..39dd60b9 100644 --- a/move/its/sources/types/trusted_addresses.move +++ b/move/its/sources/types/trusted_addresses.move @@ -37,7 +37,9 @@ public fun new( /// ----------------- /// Package Functions /// ----------------- -public(package) fun destroy(self: TrustedAddresses): (vector, vector) { +public(package) fun destroy( + self: TrustedAddresses, +): (vector, vector) { let TrustedAddresses { trusted_chains, trusted_addresses } = self; (trusted_chains, trusted_addresses) } diff --git a/move/its/sources/versioned/its_v0.move b/move/its/sources/versioned/its_v0.move index 0213365b..134d166b 100644 --- a/move/its/sources/versioned/its_v0.move +++ b/move/its/sources/versioned/its_v0.move @@ -488,11 +488,19 @@ public(package) fun set_flow_limit( events::flow_limit_set(token_id, limit); } -public(package) fun allow_function(self: &mut ITS_v0, version: u64, function_name: String) { +public(package) fun allow_function( + self: &mut ITS_v0, + version: u64, + function_name: String, +) { self.version_control.allow_function(version, function_name); } -public(package) fun disallow_function(self: &mut ITS_v0, version: u64, function_name: String) { +public(package) fun disallow_function( + self: &mut ITS_v0, + version: u64, + function_name: String, +) { self.version_control.disallow_function(version, function_name); } diff --git a/move/its/tests/coin.move b/move/its/tests/coin.move index f6c3bfcf..e924f74d 100644 --- a/move/its/tests/coin.move +++ b/move/its/tests/coin.move @@ -1,52 +1,77 @@ #[test_only] -module its::coin { - use sui::url::{Url}; - use sui::coin::{Self, CoinMetadata, TreasuryCap}; - - public struct COIN has drop {} - - - // ----- - // Coin creation functions. - // ----- - - public fun create_treasury_and_metadata(symbol: vector, decimals: u8, ctx: &mut TxContext): (TreasuryCap, CoinMetadata) { - coin::create_currency( - COIN {}, - decimals, - symbol, - b"Name", - b"", - option::none(), - ctx - ) - } - - public fun create_treasury_and_metadata_custom(name: vector, symbol: vector, decimals: u8, url: Option, ctx: &mut TxContext): (TreasuryCap, CoinMetadata) { - coin::create_currency( - COIN {}, - decimals, - symbol, - name, - b"", - url, - ctx - ) - } - - public fun create_treasury(symbol: vector, decimals: u8, ctx: &mut TxContext): TreasuryCap { - let (treasury, metadata) = create_treasury_and_metadata(symbol, decimals, ctx); - - sui::test_utils::destroy(metadata); - - treasury - } - - public fun create_metadata(symbol: vector, decimals: u8, ctx: &mut TxContext): CoinMetadata { - let (treasury, metadata) = create_treasury_and_metadata(symbol, decimals, ctx); - - sui::test_utils::destroy(treasury); - - metadata - } +module its::coin; + +use sui::coin::{Self, CoinMetadata, TreasuryCap}; +use sui::url::Url; + +public struct COIN has drop {} + +// ----- +// Coin creation functions. +// ----- + +public fun create_treasury_and_metadata( + symbol: vector, + decimals: u8, + ctx: &mut TxContext, +): (TreasuryCap, CoinMetadata) { + coin::create_currency( + COIN {}, + decimals, + symbol, + b"Name", + b"", + option::none(), + ctx, + ) +} + +public fun create_treasury_and_metadata_custom( + name: vector, + symbol: vector, + decimals: u8, + url: Option, + ctx: &mut TxContext, +): (TreasuryCap, CoinMetadata) { + coin::create_currency( + COIN {}, + decimals, + symbol, + name, + b"", + url, + ctx, + ) +} + +public fun create_treasury( + symbol: vector, + decimals: u8, + ctx: &mut TxContext, +): TreasuryCap { + let (treasury, metadata) = create_treasury_and_metadata( + symbol, + decimals, + ctx, + ); + + sui::test_utils::destroy(metadata); + + treasury +} + +public fun create_metadata( + symbol: vector, + decimals: u8, + ctx: &mut TxContext, +): CoinMetadata { + let (treasury, metadata) = create_treasury_and_metadata( + symbol, + decimals, + ctx, + ); + + sui::test_utils::destroy(treasury); + + metadata } diff --git a/move/its/tests/coin_init_test.move b/move/its/tests/coin_init_test.move index 306648d1..9f0c069d 100644 --- a/move/its/tests/coin_init_test.move +++ b/move/its/tests/coin_init_test.move @@ -1,31 +1,29 @@ #[test_only] -module its::thecool1234coin___ { - use sui::coin; - use sui::url::{Url}; +module its::thecool1234coin___; - public struct THECOOL1234COIN___ has drop{ +use sui::coin; +use sui::url::Url; - } +public struct THECOOL1234COIN___ has drop {} - fun init(witness: THECOOL1234COIN___, ctx: &mut TxContext) { - let (treasury, metadata) = coin::create_currency( - witness, - 6, - b"THECOOL1234COIN___", - b"", - b"", - option::none(), - ctx - ); - transfer::public_transfer(treasury, tx_context::sender(ctx)); - transfer::public_transfer(metadata, tx_context::sender(ctx)); - } +fun init(witness: THECOOL1234COIN___, ctx: &mut TxContext) { + let (treasury, metadata) = coin::create_currency( + witness, + 6, + b"THECOOL1234COIN___", + b"", + b"", + option::none(), + ctx, + ); + transfer::public_transfer(treasury, tx_context::sender(ctx)); + transfer::public_transfer(metadata, tx_context::sender(ctx)); +} - #[test] - fun test_init() { - // use sui::test_scenario::{Self as ts, ctx}; - use sui::tx_context::dummy; +#[test] +fun test_init() { + // use sui::test_scenario::{Self as ts, ctx}; + use sui::tx_context::dummy; - init(THECOOL1234COIN___{}, &mut dummy()); - } + init(THECOOL1234COIN___ {}, &mut dummy()); } diff --git a/move/operators/Move.lock b/move/operators/Move.lock index ed545291..d135f7e1 100644 --- a/move/operators/Move.lock +++ b/move/operators/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "CD7A7B52801624038762B544C7FBA2984AB5E0D020B31789CF872E338052201E" +manifest_digest = "418BDFBACD391D45ECD26870AEC79D78230DD6AC29C18D418856426AE314396B" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, @@ -10,17 +10,17 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/operators/Move.toml b/move/operators/Move.toml index 1541d8ee..64fe490d 100644 --- a/move/operators/Move.toml +++ b/move/operators/Move.toml @@ -1,10 +1,10 @@ [package] name = "Operators" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } [addresses] operators = "0xa4" diff --git a/move/operators/sources/operators.move b/move/operators/sources/operators.move index ed405d77..482303f8 100644 --- a/move/operators/sources/operators.move +++ b/move/operators/sources/operators.move @@ -23,7 +23,8 @@ public struct OperatorCap has key, store { /// The main `Operators` struct storing the capabilities and operator IDs. public struct Operators has key { id: UID, - // The number of operators are small in practice, and under the Sui object size limit, so a dynamic collection doesn't need to be used + // The number of operators are small in practice, and under the Sui object + // size limit, so a dynamic collection doesn't need to be used operators: VecSet
, // map-like collection of capabilities stored as Sui objects caps: Bag, @@ -165,12 +166,14 @@ public fun loan_cap( id: object::id(&cap), }; - // Return a tuple of the borrowed capability and the Borrow hot potato object + // Return a tuple of the borrowed capability and the Borrow hot potato + // object (cap, borrow_obj) } /// Restores a previously loaned capability back to the `Operators` struct. -/// This function must be called before the end of the transaction to return the loaned capability. +/// This function must be called before the end of the transaction to return the +/// loaned capability. public fun restore_cap( self: &mut Operators, _operator_cap: &OperatorCap, diff --git a/move/relayer_discovery/Move.lock b/move/relayer_discovery/Move.lock index aaa372fd..f39fead8 100644 --- a/move/relayer_discovery/Move.lock +++ b/move/relayer_discovery/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "6A753682B9B5695DD336E61630335B800C2B32CB92CA5F4C5EC1284BED743720" +manifest_digest = "4E33D934429D8D0336B3711511BF888946104633CBCEA3AFDF5E02497784F1D2" deps_digest = "060AD7E57DFB13104F21BE5F5C3759D03F0553FC3229247D9A7A6B45F50D03A3" dependencies = [ { id = "AxelarGateway", name = "AxelarGateway" }, @@ -23,11 +23,11 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -50,6 +50,6 @@ dependencies = [ ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/relayer_discovery/Move.toml b/move/relayer_discovery/Move.toml index 45038bd6..f05753c6 100644 --- a/move/relayer_discovery/Move.toml +++ b/move/relayer_discovery/Move.toml @@ -1,10 +1,10 @@ [package] name = "RelayerDiscovery" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } VersionControl = { local = "../version_control" } AxelarGateway = { local = "../axelar_gateway" } diff --git a/move/relayer_discovery/sources/types/transaction.move b/move/relayer_discovery/sources/types/transaction.move index c10bcca7..cdef88f8 100644 --- a/move/relayer_discovery/sources/types/transaction.move +++ b/move/relayer_discovery/sources/types/transaction.move @@ -24,18 +24,26 @@ public struct Function has store, copy, drop { /// Arguments are prefixed with: /// - 0 for objects followed by exactly 32 bytes that contain the object id /// - 1 for pure types followed by the bcs encoded form of the pure value -/// - 2 for the ApprovedMessage object, followed by nothing (to be passed into the target function) -/// - 3 for the payload of the contract call (to be passed into the intermediate function) -/// - 4 for an argument returned from a previous move call, followed by a u8 specified which call to get the return of (0 for the first transaction AFTER the one that gets ApprovedMessage out), and then another u8 specifying which argument to input. +/// - 2 for the ApprovedMessage object, followed by nothing (to be passed into +/// the target function) +/// - 3 for the payload of the contract call (to be passed into the intermediate +/// function) +/// - 4 for an argument returned from a previous move call, followed by a u8 +/// specified which call to get the return of (0 for the first transaction AFTER +/// the one that gets ApprovedMessage out), and then another u8 specifying which +/// argument to input. /// Following are some example arguments: /// ``` /// 0x06: &mut Clock = 0x0006, -/// 0x810a8b960cf54ceb7ce5b796d25fc2207017785bbc952562d1e4d10f2a4b8836: &mut Singleton = 0x00810a8b960cf54ceb7ce5b796d25fc2207017785bbc952562d1e4d10f2a4b8836, +/// 0x810a8b960cf54ceb7ce5b796d25fc2207017785bbc952562d1e4d10f2a4b8836: &mut +/// Singleton = +/// 0x00810a8b960cf54ceb7ce5b796d25fc2207017785bbc952562d1e4d10f2a4b8836, /// 30: u64 = 0x011e00000000000000, /// "Name": ascii::String = 0x01044e616d65, /// approved_call: ApprovedMessage = 0x02, /// payload: vector = 0x03 -/// previous_return: Return (returned as the second argument of the first call) = 0x40001, +/// previous_return: Return (returned as the second argument of the first call) +/// = 0x40001, /// ``` public struct MoveCall has store, copy, drop { function: Function, @@ -217,15 +225,17 @@ fun test_new_move_call_from_bcs() { ascii::string(b"type1"), ascii::string(b"type2"), ]; - let input = bcs::to_bytes(&MoveCall{ - function: Function { - package_id, - module_name, - name, + let input = bcs::to_bytes( + &MoveCall { + function: Function { + package_id, + module_name, + name, + }, + arguments, + type_arguments, }, - arguments, - type_arguments, - }); + ); let move_call = new_move_call_from_bcs(&mut bcs::new(input)); assert!(move_call.function.package_id == package_id); diff --git a/move/squid/Move.lock b/move/squid/Move.lock index 361e7c8c..000cd67b 100644 --- a/move/squid/Move.lock +++ b/move/squid/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "5552A45BAFD1BC7672B9E8D451BC32F142AD5A0EFBF7D89035E84EF9D56CDB11" +manifest_digest = "2DB6D2C862CE139572342A8CF12D41839A4CF29EE80459E7BBA8F26C12F6C145" deps_digest = "04732BFEF428F74DE262001DC455D76B909EBC394B034A9A15CC095E4BDD9CEF" dependencies = [ { id = "AxelarGateway", name = "AxelarGateway" }, @@ -49,7 +49,7 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "RelayerDiscovery" @@ -63,7 +63,7 @@ dependencies = [ [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, @@ -87,7 +87,7 @@ dependencies = [ [[move.package]] id = "deepbook" -source = { git = "https://github.com/axelarnetwork/deepbookv3.git", rev = "mainnet-v1.35.2", subdir = "packages/deepbook" } +source = { git = "https://github.com/axelarnetwork/deepbookv3.git", rev = "testnet-v1.38.2", subdir = "packages/deepbook" } dependencies = [ { id = "Sui", name = "Sui" }, @@ -96,13 +96,13 @@ dependencies = [ [[move.package]] id = "token" -source = { git = "https://github.com/axelarnetwork/deepbookv3.git", rev = "mainnet-v1.35.2", subdir = "packages/token" } +source = { git = "https://github.com/axelarnetwork/deepbookv3.git", rev = "testnet-v1.38.2", subdir = "packages/token" } dependencies = [ { id = "Sui", name = "Sui" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/squid/Move.toml b/move/squid/Move.toml index b3b07e52..825eb127 100644 --- a/move/squid/Move.toml +++ b/move/squid/Move.toml @@ -1,12 +1,12 @@ [package] name = "Squid" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } -deepbook = { git = "https://github.com/axelarnetwork/deepbookv3.git", subdir = "packages/deepbook", rev = "mainnet-v1.35.2" } -token = { git = "https://github.com/axelarnetwork/deepbookv3.git", subdir = "packages/token", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } +deepbook = { git = "https://github.com/axelarnetwork/deepbookv3.git", subdir = "packages/deepbook", rev = "testnet-v1.38.2" } +token = { git = "https://github.com/axelarnetwork/deepbookv3.git", subdir = "packages/token", rev = "testnet-v1.38.2" } Utils = { local = "../utils" } AxelarGateway = { local = "../axelar_gateway" } ITS = { local = "../its" } diff --git a/move/squid/sources/squid/deepbook_v3.move b/move/squid/sources/squid/deepbook_v3.move index 61129209..acfe46f8 100644 --- a/move/squid/sources/squid/deepbook_v3.move +++ b/move/squid/sources/squid/deepbook_v3.move @@ -17,7 +17,8 @@ const EWrongSwapType: vector = b"wrong swap type"; #[error] const EWrongPool: vector = b"pool argument does not match required pool"; #[error] -const EWrongCoinType: vector = b"coin type expected does not match type argument"; +const EWrongCoinType: vector = + b"coin type expected does not match type argument"; const FLOAT_SCALING: u128 = 1_000_000_000; diff --git a/move/squid/sources/squid/discovery.move b/move/squid/sources/squid/discovery.move index 13a8f091..3f04de07 100644 --- a/move/squid/sources/squid/discovery.move +++ b/move/squid/sources/squid/discovery.move @@ -6,7 +6,7 @@ use relayer_discovery::discovery::RelayerDiscovery; use relayer_discovery::transaction::{Self, MoveCall, Transaction}; use squid::deepbook_v3; use squid::squid::Squid; -use squid::swap_type::{Self}; +use squid::swap_type; use squid::transfers; use std::ascii::{Self, String}; use sui::bcs; diff --git a/move/squid/sources/squid/squid.move b/move/squid/sources/squid/squid.move index 42a81e18..37540e0e 100644 --- a/move/squid/sources/squid/squid.move +++ b/move/squid/sources/squid/squid.move @@ -89,9 +89,15 @@ entry fun disallow_function( .disallow_function(version, function_name); } -entry fun withdraw(self: &mut Squid, _: &OwnerCap, amount: u64, ctx: &mut TxContext) { +entry fun withdraw( + self: &mut Squid, + _: &OwnerCap, + amount: u64, + ctx: &mut TxContext, +) { self.value_mut!(b"withdraw").withdraw(amount, ctx); } + // ---------------- // Public Functions // ---------------- @@ -247,7 +253,6 @@ fun test_init() { init(ctx); } - #[test] fun test_allow_function() { let ctx = &mut sui::tx_context::dummy(); @@ -271,7 +276,7 @@ fun test_disallow_function() { let function_name = b"start_swap".to_ascii_string(); self.disallow_function(&owner_cap, version, function_name); - + sui::test_utils::destroy(self); owner_cap.destroy_for_testing(); } @@ -286,7 +291,7 @@ fun test_withdraw() { let balance = sui::balance::create_for_testing(amount); self.value_mut!(b"").coin_bag_mut().store_balance(balance); self.withdraw(&owner_cap, amount, ctx); - + sui::test_utils::destroy(self); owner_cap.destroy_for_testing(); } diff --git a/move/squid/sources/squid/swap_info.move b/move/squid/sources/squid/swap_info.move index f5ec84e3..21d5b4bf 100644 --- a/move/squid/sources/squid/swap_info.move +++ b/move/squid/sources/squid/swap_info.move @@ -6,17 +6,19 @@ use sui::bcs; // ----- // Enums // ----- -/// Swapping: Curently performing swaps, should happen only after all estimation is finished. -/// Estimating: Currently performing estimates. Once all estimates are done and the output is satisfactory then we can swap. +/// Swapping: Curently performing swaps, should happen only after all estimation +/// is finished. +/// Estimating: Currently performing estimates. Once all estimates are done and +/// the output is satisfactory then we can swap. /// Done: Done swapping and can be destroyed. public enum SwapStatus has copy, drop, store { - Swapping { - index: u64, - fallback: bool + Swapping { + index: u64, + fallback: bool, }, - Estimating { - index: u64, - fallback: bool + Estimating { + index: u64, + fallback: bool, }, Done, } @@ -71,9 +73,7 @@ public(package) fun new(data: vector, ctx: &mut TxContext): SwapInfo { public(package) fun data_swapping(self: &mut SwapInfo): (vector, bool) { let (index, fallback) = match (self.status) { SwapStatus::Swapping { index, fallback } => (index, fallback), - SwapStatus::Estimating { .. } => abort ( - ENotDoneEstimating, - ), + SwapStatus::Estimating { .. } => abort (ENotDoneEstimating), SwapStatus::Done => abort (EDoneSwapping), }; @@ -88,9 +88,7 @@ public(package) fun data_swapping(self: &mut SwapInfo): (vector, bool) { (self.swap_data[index], fallback) } -public(package) fun data_estimating( - self: &mut SwapInfo, -): (vector, bool) { +public(package) fun data_estimating(self: &mut SwapInfo): (vector, bool) { let (index, fallback) = match (self.status) { SwapStatus::Estimating { index, fallback } => (index, fallback), _ => abort (EDoneEstimating), @@ -114,7 +112,10 @@ public(package) fun coin_bag(self: &mut SwapInfo): &mut CoinBag { public(package) fun skip_swap(self: &mut SwapInfo) { self.status = match (self.status) { - SwapStatus::Estimating { index, fallback: false } => SwapStatus::Estimating { index, fallback: true }, + SwapStatus::Estimating { + index, + fallback: false, + } => SwapStatus::Estimating { index, fallback: true }, SwapStatus::Estimating { .. } => abort (EAlreadySkippingSwaps), _ => abort (ENotEstimating), }; diff --git a/move/squid/sources/squid/transfers.move b/move/squid/sources/squid/transfers.move index ba52a209..712c01a7 100644 --- a/move/squid/sources/squid/transfers.move +++ b/move/squid/sources/squid/transfers.move @@ -17,7 +17,8 @@ use utils::utils::peel; #[error] const EWrongSwapType: vector = b"wrong swap type"; #[error] -const EWrongCoinType: vector = b"expected coin type does not match type argument"; +const EWrongCoinType: vector = + b"expected coin type does not match type argument"; /// fallback states whether this transfer happens normally or only on fallback /// mode. diff --git a/move/utils/Move.lock b/move/utils/Move.lock index 78062543..8250a011 100644 --- a/move/utils/Move.lock +++ b/move/utils/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "3BAA9FE6DB42BDED9C75491E48F362189C85ECED886417358F57518FCCF16C09" +manifest_digest = "31B2B08211C3D084CCBB34DBFCA97A1607BF504E25438B09066F0DCC5C25699A" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, @@ -10,17 +10,17 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/utils/Move.toml b/move/utils/Move.toml index ea17fa31..9038a366 100644 --- a/move/utils/Move.toml +++ b/move/utils/Move.toml @@ -1,10 +1,10 @@ [package] name = "Utils" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } [addresses] utils = "0xa7" diff --git a/move/utils/sources/utils/utils.move b/move/utils/sources/utils/utils.move index e5b57ac8..a5eb3808 100644 --- a/move/utils/sources/utils/utils.move +++ b/move/utils/sources/utils/utils.move @@ -9,11 +9,13 @@ use sui::bcs::{Self, BCS}; /// Peel data from a BCS encoded vector /// This macro is used to peel data from a BCS encoded vector -/// The macro will assert that there is no remaining data in the BCS after peeling. If there is +/// The macro will assert that there is no remaining data in the BCS after +/// peeling. If there is /// remaining data, the macro will panic. /// $data: The BCS encoded vector /// $peel_fn: The function to peel the data -/// Returns: The peeled data or an error if there is any remaining data in the BCS +/// Returns: The peeled data or an error if there is any remaining data in the +/// BCS /// /// Example Usage: /// ``` diff --git a/move/version_control/Move.lock b/move/version_control/Move.lock index 26822ed9..fb17fae0 100644 --- a/move/version_control/Move.lock +++ b/move/version_control/Move.lock @@ -2,7 +2,7 @@ [move] version = 3 -manifest_digest = "8FDB179F177742FB24511BB8033C151AD480A3F5C0B005E15E43C608ABB72046" +manifest_digest = "90E168D49C8BC4751181151BABEA6E291270C8E7FCC77708DA6EE9F0F6A199E3" deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" dependencies = [ { id = "Sui", name = "Sui" }, @@ -10,17 +10,17 @@ dependencies = [ [[move.package]] id = "MoveStdlib" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/move-stdlib" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/move-stdlib" } [[move.package]] id = "Sui" -source = { git = "https://github.com/MystenLabs/sui.git", rev = "mainnet-v1.35.2", subdir = "crates/sui-framework/packages/sui-framework" } +source = { git = "https://github.com/MystenLabs/sui.git", rev = "testnet-v1.38.2", subdir = "crates/sui-framework/packages/sui-framework" } dependencies = [ { id = "MoveStdlib", name = "MoveStdlib" }, ] [move.toolchain-version] -compiler-version = "1.35.2" -edition = "2024.beta" +compiler-version = "1.38.2" +edition = "2024" flavor = "sui" diff --git a/move/version_control/Move.toml b/move/version_control/Move.toml index 282050c7..4bbae75e 100644 --- a/move/version_control/Move.toml +++ b/move/version_control/Move.toml @@ -1,10 +1,10 @@ [package] name = "VersionControl" version = "0.1.0" -edition = "2024.beta" +edition = "2024" [dependencies] -Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "mainnet-v1.35.2" } +Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "testnet-v1.38.2" } [addresses] version_control = "0xb0" diff --git a/package-lock.json b/package-lock.json index 0fda6468..c99b7ff3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.2", "@mysten/sui": "^1.3.0", - "deepbookv3": "github:axelarnetwork/deepbookv3#mainnet-v1.35.2", + "deepbookv3": "github:axelarnetwork/deepbookv3#testnet-v1.38.2", "ethers": "^5.0.0", "secp256k1": "^5.0.0", "smol-toml": "^1.3.0", @@ -2899,7 +2899,7 @@ }, "node_modules/deepbookv3": { "version": "1.0.0", - "resolved": "git+ssh://git@github.com/axelarnetwork/deepbookv3.git#08655d306ee4ee46e561c12536e6b4d8f75300bd", + "resolved": "git+ssh://git@github.com/axelarnetwork/deepbookv3.git#16667dd1d40199438adc2ed42e9d3c8ff645a9f4", "license": "Apache-2.0" }, "node_modules/define-data-property": { diff --git a/package.json b/package.json index 9d98ac6b..2d940a52 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.32.2", "@mysten/sui": "^1.3.0", - "deepbookv3": "github:axelarnetwork/deepbookv3#mainnet-v1.35.2", + "deepbookv3": "github:axelarnetwork/deepbookv3#testnet-v1.38.2", "ethers": "^5.0.0", "secp256k1": "^5.0.0", "smol-toml": "^1.3.0", diff --git a/version.json b/version.json index 971e496d..b6ae2079 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "SUI_VERSION": "mainnet-v1.35.2" + "SUI_VERSION": "testnet-v1.38.2" }