Real-Time Lockdrop
Declaimer: This is an experimental module. Some features don't work or work with issues. Please report problems on GitHub if they arise.

Quick Install

    1.
    Install dependencies according to README.
    2.
    Fetch the custom lockdrop branch of plasm-node.
1
git clone https://github.com/staketechnologies/Plasm -b plasm-real-time-lockdrop && cd Plasm
Copied!
    1.
    Build Plasm binary.
1
cargo build --release
Copied!

Preparing for tests

    1.
    Launch your node in your development environment:
1
./target/release/plasm-node --dev
Copied!
Previous versions of db should be removed before the launch: ./target/release/plasm-node purge-chain --dev
    1.
    Open Plasm Portal "Settings page".
    2.
    Choose Local Node in the remote node section.
    3.
    Check out the "Developer" tab and put the following custom types.
1
{
2
"ClaimId": "H256",
3
"Lockdrop": {
4
"type": "u8",
5
"transaction_hash": "H256",
6
"public_key": "[u8; 33]",
7
"duration": "u64",
8
"value": "u128"
9
},
10
"TickerRate": {
11
"authority": "u16",
12
"btc": "DollarRate",
13
"eth": "DollarRate"
14
},
15
"DollarRate": "u128",
16
"AuthorityId": "AccountId",
17
"AuthorityVote": "u32",
18
"ClaimVote": {
19
"claim_id": "ClaimId",
20
"approve": "bool",
21
"authority": "u16"
22
},
23
"Claim": {
24
"params": "Lockdrop",
25
"approve": "AuthorityVote",
26
"decline": "AuthorityVote",
27
"amount": "u128",
28
"complete": "bool"
29
}
30
}
Copied!

Price Oracle

After the launch, your authority node starts to fetch and send the current USD price of BTC and ETH into your chain. By opening explorer, you can see the dollar rate extrinsics in each imported module. This dollar rate is used in Lockdrop Substrate Pallet for checking the price during the Lockdrop periods.

Lockdrop Request

Plasm Network team has deployed the Lockdrop smart contract on Ethereum Ropsten network just for testing purpose. You can check it here:
https://ropsten.etherscan.io/address/0xeed84a89675342fb04fafe06f7bb176fe35cb168
ropsten.etherscan.io
Let's send a transaction to the lockdrop smart contract using Etherscan and Metamask!
After locking your ETH, you can make a claim on your local chain.
You can use a test data below:
1
0x6c4364b2f5a847ffc69f787a0894191b75aa278a95020f02e4753c76119324e0
2
0x039360c9cbbede9ee771a55581d4a53cbcc4640953169549993a3b0e6ec7984061
3
2592000
4
100000000000000000
Copied!
And here is the results available on chain:
Any questions? Feel free to ask us on Discord Tech Channel.
Last modified 1yr ago