Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallet: Access to the account can be lost after enabling 2FA #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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