diff --git a/src/stablecoin/src/multi_sig_wallet.rs b/src/stablecoin/src/multi_sig_wallet.rs new file mode 100644 index 0000000..442c7ac --- /dev/null +++ b/src/stablecoin/src/multi_sig_wallet.rs @@ -0,0 +1,26 @@ +// src/multi_sig_wallet.rs +use std::collections::HashSet; + +pub struct MultiSigWallet { + owners: HashSet, + required_signatures: usize, +} + +impl MultiSigWallet { + pub fn new(owners: HashSet, required_signatures: usize) -> Self { + MultiSigWallet { + owners, + required_signatures, + } + } + + pub fn execute_transaction(&self, transaction: &str, signatures: &HashSet) -> bool { + if signatures.len() >= self.required_signatures { + // Execute the transaction + println!("Transaction executed: {}", transaction); + return true; + } + println!("Not enough signatures to execute transaction."); + false + } +}