-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
Description
Title: Admin Treasury Management
Description
Create 3/5 multisig wallet for platform funds.
Acceptance Criteria:
- Requires 3/5 signatures for:
- Contract upgrades
- Prize pool adjustments
- Emergency pauses
- Tracks pending transactions
- Allows signer rotation
Technical Details:
#[starknet::contract]
mod MultiSig {
#[storage]
struct Storage {
signers: Array<felt252>,
threshold: u8,
nonce: u64
}
#[external(v0)]
fn submit_tx(
ref self: ContractState,
destination: felt252,
value: u64,
data: Array<u64>
) -> felt252 {
let tx_hash = pedersen_hash(data);
// Store pending transaction
self.pending_txs.write(tx_hash, (destination, value, data));
tx_hash
}
#[external(v0)]
fn confirm_tx(ref self: ContractState, tx_hash: felt252) {
let sig = get_caller_address();
assert(self.signers.contains(sig), 'Not signer');
self.confirmations.write((tx_hash, sig), true);
if self.get_confirm_count(tx_hash) >= self.threshold.read() {
self.execute_tx(tx_hash);
}
}
}Notes:
- Implement replay attack protection
- Add transaction expiration
- Test threshold scenarios
Reactions are currently unavailable