diff --git a/Cargo.toml b/Cargo.toml index d85ebc5..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.41.1", 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/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; diff --git a/src/lib.rs b/src/lib.rs index 925c903..ece2ef2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,11 +3,14 @@ use fuels::{ prelude::{abigen, Contract, LoadConfiguration, TxParameters}, 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, @@ -45,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::*; 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"),