Skip to content

Commit

Permalink
chore: bump starknet to 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Sep 5, 2023
1 parent 305a9b1 commit 5f91407
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 45 deletions.
47 changes: 29 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ serde = { version = "1.0.164", features = ["derive"] }
serde_json = { version = "1.0.99", features = ["preserve_order"] }
serde_with = "2.3.3"
shellexpand = "3.1.0"
starknet = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "4cbf0d66c213e4d2f01c796f642916af7675c4dd" }
starknet = "0.6.0"
tempfile = "3.8.0"
thiserror = "1.0.40"
tokio = { version = "1.28.2", default-features = false, features = ["macros", "rt-multi-thread"] }
Expand Down
29 changes: 3 additions & 26 deletions src/subcommands/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,7 @@ use std::sync::Arc;
use anyhow::Result;
use clap::Parser;
use colored::Colorize;
use starknet::{
accounts::Account,
contract::ContractFactory,
core::{
types::FieldElement,
utils::{get_udc_deployed_address, UdcUniqueSettings, UdcUniqueness},
},
signers::SigningKey,
};
use starknet::{contract::ContractFactory, core::types::FieldElement, signers::SigningKey};

use crate::{
account::AccountArgs,
Expand Down Expand Up @@ -80,26 +72,11 @@ impl Deploy {
let signer = Arc::new(self.signer.into_signer()?);
let account = self.account.into_account(provider.clone(), signer).await?;

let deployed_address = get_udc_deployed_address(
salt,
class_hash,
&if self.not_unique {
UdcUniqueness::NotUnique
} else {
UdcUniqueness::Unique(UdcUniqueSettings {
deployer_address: account.address(),
udc_contract_address: DEFAULT_UDC_ADDRESS,
})
},
&ctor_args,
);

// TODO: allow custom UDC
let factory = ContractFactory::new_with_udc(class_hash, account, DEFAULT_UDC_ADDRESS);

// TODO: pre-compute and show target deployment address

let contract_deployment = factory.deploy(&ctor_args, salt, !self.not_unique);
let contract_deployment = factory.deploy(ctor_args, salt, !self.not_unique);
let deployed_address = contract_deployment.deployed_address();

let max_fee = match fee_setting {
FeeSetting::Manual(fee) => fee,
Expand Down

0 comments on commit 5f91407

Please sign in to comment.