komodo_airdrop-0.0.2 doesn't have any documentation.
Komodo Airdrop
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;
If an airdrop happens from a multisig address (starts with b
):
let signing_string = airdrop.signing_string;
println!;
If not:
let signing_string = airdrop.signing_string;
println!;
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.
notes:
- ratio is applied to both balance and interest. any change includes interest against the same ratio
todo:
- documentation
- why this airdrop crate is needed: KMD platform addresses are the same etc, so the only differentiator is an AC
- define static payout amount in addition to ratio
-
let the builder pattern work with Results (trait type?)impossible, checking is done inbuild()
now - send back any remainders and/or interest to fund_address
- add P2SH inputs to support multisig airdrop
- airdrop take a reference to snapshot
- use JSON file as input to Airdrop
- only include necessary utxos as input to the transaction, to prevent using all utxos when it's not needed since the required amount to airdrop has been reached.
- what about interest? if KMD && interest_included then spend all inputs to include all interest.
- else spend only required utxos
- with some kind of ordering of utxos to only use largest utxos
- use a global komodod daemon client instead of instantiating it a couple of times.
- use an Enum for
ratio
andamount
inAirdrop
- Enum: add nonexhaustive to not have a breaking change when adding a new Enum variant
scenarios tested
- Multisig yes/no
- Ratio
- Amount
- payout full amount
- Interest included
long term maybe's:
- serialize multisig raw tx for easy multiparty signing
- would likely be separate crate