From 070e1203025e290842d2bb8bdd4011efe00f855c Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 11 Jul 2023 14:10:44 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20added=20forc=20v0.43?= =?UTF-8?q?=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contract/Forc.lock | 14 +++----------- contract/Forc.toml | 2 +- contract/out/debug/FRC20-abi.json | 8 ++++---- contract/src/main.sw | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/contract/Forc.lock b/contract/Forc.lock index cdcfca1..b5ee27c 100644 --- a/contract/Forc.lock +++ b/contract/Forc.lock @@ -1,21 +1,13 @@ [[package]] name = 'FRC20' source = 'member' -dependencies = [ - 'std', - 'string', -] +dependencies = ['std'] [[package]] name = 'core' -source = 'path+from-root-A45E318ED12CBB09' +source = 'path+from-root-9BFE6D5D0CBDF740' [[package]] name = 'std' -source = 'git+https://github.com/fuellabs/sway?tag=v0.39.0#7a095280e7e1c0bfbbfc201867896e720aab7209' +source = 'git+https://github.com/fuellabs/sway?tag=v0.42.1#3b66f8e424bd21e3ba467783b10b36e808cfa6ee' dependencies = ['core'] - -[[package]] -name = 'string' -source = 'git+https://github.com/FuelLabs/sway-libs?default-branch#719a86874b81b500b630a349ac0dd5da625b2fe9' -dependencies = ['std'] diff --git a/contract/Forc.toml b/contract/Forc.toml index 1acd9ad..ea0115f 100644 --- a/contract/Forc.toml +++ b/contract/Forc.toml @@ -5,4 +5,4 @@ license = "Apache-2.0" name = "FRC20" [dependencies] -string = { git = "https://github.com/FuelLabs/sway-libs"} \ No newline at end of file +# string = { git = "https://github.com/FuelLabs/sway-libs"} \ No newline at end of file diff --git a/contract/out/debug/FRC20-abi.json b/contract/out/debug/FRC20-abi.json index 12a1ba5..d16166b 100644 --- a/contract/out/debug/FRC20-abi.json +++ b/contract/out/debug/FRC20-abi.json @@ -137,7 +137,7 @@ "type": 6, "typeArguments": null }, - "offset": 3480 + "offset": 3512 }, { "name": "NAME", @@ -146,7 +146,7 @@ "type": 2, "typeArguments": null }, - "offset": 3488 + "offset": 3520 }, { "name": "SYMBOL", @@ -155,7 +155,7 @@ "type": 3, "typeArguments": null }, - "offset": 3520 + "offset": 3552 }, { "name": "OWNER", @@ -164,7 +164,7 @@ "type": 4, "typeArguments": [] }, - "offset": 3384 + "offset": 3416 } ] } \ No newline at end of file diff --git a/contract/src/main.sw b/contract/src/main.sw index 6f493f5..58a57de 100644 --- a/contract/src/main.sw +++ b/contract/src/main.sw @@ -1,5 +1,5 @@ contract; -use string::String; +// use string::String; use std::address::Address; use std::constants::ZERO_B256; use std::token::mint_to_address; From 251e940f81f55c55d1d31e9b8fe5c4a3e8038b29 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 11 Jul 2023 14:34:29 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20added=20forc=20v0.43?= =?UTF-8?q?=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.toml | 2 +- tests/deploy.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d85ebc5..90af049 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ description = "Sway token standard SRC-20 rust sdk" [dependencies] dotenv = "0.15.0" -fuels = { version = "0.41.1", features = ["fuel-core-lib"] } +fuels = { version = "0.43", features = ["fuel-core-lib"] } [dev-dependencies] tokio = { version = "1.12", features = ["rt", "macros"] } diff --git a/tests/deploy.rs b/tests/deploy.rs index 33526bf..f7b2373 100644 --- a/tests/deploy.rs +++ b/tests/deploy.rs @@ -1,6 +1,6 @@ use dotenv::dotenv; -use fuels::prelude::{Provider, WalletUnlocked}; -use src20_sdk::{DeployTokenConfig, deploy_token_contract}; +use fuels::{prelude::Provider, accounts::wallet::WalletUnlocked}; +use src20_sdk::{deploy_token_contract, DeployTokenConfig}; const RPC: &str = "beta-3.fuel.network"; #[tokio::test] async fn deploy() { @@ -9,7 +9,7 @@ async fn deploy() { let secret = std::env::var("ADMIN").unwrap(); let wallet = WalletUnlocked::new_from_private_key(secret.parse().unwrap(), Some(provider.clone())); - + let configs: Vec = vec![ DeployTokenConfig { name: String::from("Bitcoin"), From e83f749d2e2fcf81feaa480ca175bf0eda078164 Mon Sep 17 00:00:00 2001 From: alexey Date: Tue, 11 Jul 2023 14:59:14 +0100 Subject: [PATCH 3/4] fixed types --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 925c903..ca9dc94 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ use fuels::{ - accounts::wallet::WalletUnlocked, prelude::{abigen, Contract, LoadConfiguration, TxParameters}, - types::SizedAsciiString, + types::SizedAsciiString, accounts::wallet::WalletUnlocked, }; abigen!(Contract( From ef85499e37b2310ccb6f637a78b0a8f9bd24f773 Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 26 Jul 2023 17:49:36 +0100 Subject: [PATCH 4/4] checked out to v0.44 --- Cargo.toml | 3 ++- src/lib.rs | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 90af049..39500c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,8 @@ description = "Sway token standard SRC-20 rust sdk" [dependencies] dotenv = "0.15.0" -fuels = { version = "0.43", features = ["fuel-core-lib"] } +fuels = { version = "0.44", features = ["fuel-core-lib"] } +serde = "1.0.171" [dev-dependencies] tokio = { version = "1.12", features = ["rt", "macros"] } diff --git a/src/lib.rs b/src/lib.rs index ca9dc94..ece2ef2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,12 +1,16 @@ use fuels::{ + accounts::wallet::WalletUnlocked, prelude::{abigen, Contract, LoadConfiguration, TxParameters}, - types::SizedAsciiString, accounts::wallet::WalletUnlocked, + types::SizedAsciiString, }; +use serde::{Deserialize, Serialize}; abigen!(Contract( name = "TokenContract", abi = "contract/out/debug/FRC20-abi.json" )); + +#[derive(Serialize, Deserialize)] pub struct DeployTokenConfig { pub name: String, pub symbol: String, @@ -44,7 +48,7 @@ pub async fn deploy_token_contract( pub mod token_abi_calls { - use fuels::{programs::call_response::FuelCallResponse, types::Address}; + use fuels::{programs::call_response::FuelCallResponse, types::Address, prelude::TxDependencyExtension}; use super::*;