| Crates.io | komodo_airdrop |
| lib.rs | komodo_airdrop |
| version | 0.0.2 |
| created_at | 2019-02-08 18:50:12.543687+00 |
| updated_at | 2020-01-08 12:21:07.897828+00 |
| description | An airdrop manager for Komodo and its assetchains |
| homepage | |
| repository | |
| max_upload_size | |
| id | 113563 |
| size | 25,611 |
This Airdrop crate makes it easy to perform an airdrop from a Komodo Platform Assetchain, using KMD or any other assetchain.
extern crate komodo_airdrop;
fn main() {
let snapshot = komodo_airdrop::Snapshot::builder()
.on_chain(Chain::CHAIN)
.exclude_addresses(vec![
String::from("REbwjC5mfQBRevH78CuRjcvQudxa3ii5Ma"),
String::from("RU9F2EdDzUNK4LUMgjLTMDmtCmDK1a9vrY"),
String::from("RYEufBcEUsofxwt4bGUdroRGmAQxBR8aJG")
])
.using_threshold(1.0) // only include addresses that contain at least 1 CHAIN
.build()
.unwrap();
let airdrop = komodo_airdrop::Airdrop::builder()
.using_chain(Chain::KMD)
.include_interest(true)
.using_snapshot(&snapshot)
.fund_address("RQT7m4jcnWQxwqQQzh77WKNCuZotkRkAuk")
.payout_ratio(0.75)
.build()
.unwrap();
}
If an airdrop happens from a multisig address (starts with b):
let signing_string = airdrop.signing_string(Some(String::from("<redeem_script here>")));
println!("{}", signing_string);
If not:
let signing_string = airdrop.signing_string(None);
println!("{}", signing_string);
signing_string creates a raw transaction from the inputs of all utxos in the fund_address, and uses the resulting hex (a running daemon of the fund_address blockchain is required)
to create a string that can be used as parameter string for the signrawtransaction daemon RPC, where in case of a multisig, a private key (WIF) needs to be supplied manually by the signer.
build() nowratio and amount in AirdropMultisig yes/no
Ratio
Amount
Interest included