Skip to content

Commit

Permalink
Merge pull request #52 from multiversx/esdt-lib-args
Browse files Browse the repository at this point in the history
Removed unnecessary arguments and logic from init
  • Loading branch information
andreiblt1304 authored Jun 14, 2024
2 parents 4ffa9f8 + 07950b7 commit 56e93b2
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions esdt-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
multiversx_sc::imports!();
multiversx_sc::derive_imports!();

use transaction::GasLimit;
use tx_batch_module::FIRST_BATCH_ID;

const DEFAULT_MAX_TX_BATCH_SIZE: usize = 10;
const DEFAULT_MAX_TX_BATCH_BLOCK_DURATION: u64 = 100; // ~10 minutes
const DEFAULT_MAX_USER_TX_GAS_LIMIT: GasLimit = 300_000_000;

pub mod from_sovereign;
pub mod to_sovereign;
pub mod esdt_safe_proxy;
Expand Down Expand Up @@ -37,32 +30,9 @@ pub trait EsdtSafe:
fn init(
&self,
is_sovereign_chain: bool,
min_valid_signers: u32,
initiator_address: ManagedAddress,
signers: MultiValueEncoded<ManagedAddress>,
) {
self.is_sovereign_chain().set(is_sovereign_chain);
self.max_tx_batch_size().set(DEFAULT_MAX_TX_BATCH_SIZE);
self.max_tx_batch_block_duration()
.set(DEFAULT_MAX_TX_BATCH_BLOCK_DURATION);
self.max_user_tx_gas_limit()
.set(DEFAULT_MAX_USER_TX_GAS_LIMIT);

// batch ID 0 is considered invalid
self.first_batch_id().set(FIRST_BATCH_ID);
self.last_batch_id().set(FIRST_BATCH_ID);
self.next_batch_id().set(FIRST_BATCH_ID);

self.set_min_valid_signers(min_valid_signers);
self.add_signers(signers);

self.initiator_address().set(initiator_address);

self.set_paused(true);

// Currently, false is the same as 0, which is the default value.
// If this ever changes, uncomment this line.
// self.setup_phase_complete.set(false);
}

#[only_owner]
Expand Down

0 comments on commit 56e93b2

Please sign in to comment.