Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
14 changes: 3 additions & 11 deletions contract/Forc.lock
Original file line number Diff line number Diff line change
@@ -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']
2 changes: 1 addition & 1 deletion contract/Forc.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ license = "Apache-2.0"
name = "FRC20"

[dependencies]
string = { git = "https://github.com/FuelLabs/sway-libs"}
# string = { git = "https://github.com/FuelLabs/sway-libs"}
8 changes: 4 additions & 4 deletions contract/out/debug/FRC20-abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"type": 6,
"typeArguments": null
},
"offset": 3480
"offset": 3512
},
{
"name": "NAME",
Expand All @@ -146,7 +146,7 @@
"type": 2,
"typeArguments": null
},
"offset": 3488
"offset": 3520
},
{
"name": "SYMBOL",
Expand All @@ -155,7 +155,7 @@
"type": 3,
"typeArguments": null
},
"offset": 3520
"offset": 3552
},
{
"name": "OWNER",
Expand All @@ -164,7 +164,7 @@
"type": 4,
"typeArguments": []
},
"offset": 3384
"offset": 3416
}
]
}
2 changes: 1 addition & 1 deletion contract/src/main.sw
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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::*;

Expand Down
6 changes: 3 additions & 3 deletions tests/deploy.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand All @@ -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<DeployTokenConfig> = vec![
DeployTokenConfig {
name: String::from("Bitcoin"),
Expand Down