Skip to content

Commit

Permalink
https://github.com/near/near-wallet/issues/2387
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Kouprin committed Jan 19, 2022
1 parent 5f4b763 commit 3635b26
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 3 deletions.
Binary file modified multisig-factory/res/multisig_factory.wasm
Binary file not shown.
Binary file modified multisig/res/multisig.wasm
Binary file not shown.
8 changes: 6 additions & 2 deletions multisig/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ impl Default for MultiSigContract {
impl MultiSigContract {
/// Initialize multisig contract.
/// @params num_confirmations: k of n signatures required to perform operations.
#[init]
#[init(ignore_state)]
pub fn new(num_confirmations: u32) -> Self {
assert!(!env::state_exists(), "Already initialized");
assert_eq!(
env::current_account_id(),
env::predecessor_account_id(),
"Predecessor account must match current account"
);
Self {
num_confirmations,
request_nonce: 0,
Expand Down
Binary file modified multisig2/res/multisig2.wasm
Binary file not shown.
7 changes: 6 additions & 1 deletion multisig2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ impl MultiSigContract {
/// Initialize multisig contract.
/// @params members: list of {"account_id": "name"} or {"public_key": "key"} members.
/// @params num_confirmations: k of n signatures required to perform operations.
#[init]
#[init(ignore_state)]
pub fn new(members: Vec<MultisigMember>, num_confirmations: u32) -> Self {
assert_eq!(
env::current_account_id(),
env::predecessor_account_id(),
"Predecessor account must match current account"
);
assert(
members.len() >= num_confirmations as usize,
"Members list must be equal or larger than number of confirmations",
Expand Down

0 comments on commit 3635b26

Please sign in to comment.