A native SOL on-chain program for [Solana Blockchain].
Currently, there are five instructions to provide the queued multisig transfer operation:
Here is how to create a new multisig account on-chain.
Please refer to the [multisig_lite::multisig_lite
] module level
documentation for the other instructions' example.
``` use std::rc::Rc;
use solanasdk::commitmentconfig::CommitmentConfig; use solanasdk::pubkey::Pubkey; use solanasdk::signature::readkeypairfile; use solanasdk::signer::Signer; use solanasdk::system_program;
use anchor_client::{Client, Cluster};
fn main() -> Result<(), Box
// Gets the PDAs.
let (state_pda, state_bump) =
Pubkey::find_program_address(&[b"state", funder.pubkey().as_ref()], &pid);
let (fund_pda, fund_bump) = Pubkey::find_program_address(&[b"fund", state_pda.as_ref()], &pid);
// Creates a multisig account.
let sig = program
.request()
.accounts(multisig_lite::accounts::Create {
funder: funder.pubkey(),
state: state_pda,
fund: fund_pda,
system_program: system_program::id(),
})
.args(multisig_lite::instruction::Create {
m: 2, // m as in m/n.
signers: vec![funder.pubkey(), Pubkey::new_unique(), Pubkey::new_unique()],
q: 10, // transfer queue limit.
_state_bump: state_bump,
fund_bump,
})
.signer(funder.as_ref())
.send()?;
Ok(())
} ```
You can run [solana-program-test] based functional tests with the standard
cargo test
command:
$ cargo test
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.