Commit 7e16a7c1 authored by oanhnguyen's avatar oanhnguyen
Browse files

Merge branch 'rf-readme-file' into 'master'

Re-write readme file

See merge request !2
1 merge request!2Re-write readme file
Showing with 61 additions and 7 deletions
+61 -7
.DS_Store
*.abi
*.wasm
Smart contract for partner reward
**Smart contract for partner reward (v1.0.0)**
----------------------------------
**1. Policy**
Example on jungle testnet using cleos
Block Producer (BP) will initially pay a certain amount of tokens and have a three-year lock-up period.
The lock-up will be released at 1/36 rate per month.
Each month, BP claims thier reward manually. If this month, BP does not claim then CanChain will accumulate
to next month.
If a BP is banned (because they are not fit with CanChain checklist), they will be claimed tokens for previous month (they cannot claim for current month).
**2. Funcionality**
**Start partner reward `start`**
This function helps CanChain stating a contract for BP reward with: total tokens which will be locked,
time to get reward (a month).
- `@param total_reward`: The total of CAT tokens which is locked for partner reward
- `@param duration`: The time for locked
- `@param lock_duration`: The time for receive token reward
**Add a partner to CanChain `addpartner`**
After that, we must add all our BPs to CanChain, when a BP is added to this smart contract, it will be
calculate time for claming rewarding.
- `@param partner_account`: The name of partner who will be added
**Ban a partner from CanChain `banpartner`**
When a BP, they do not miss with CanChain requirement as time to produce block, security, etc, they will
be blocked by CanChain.
After BP is blocked, they cannot claim reward from current month.
- `@param partner_account`: The name of partner will be banned
**Block producer claims reward `claimreward`**
This smart contract will be calculate the amount of token which will be rewarded to BP. Therfore, in a month,
BP can claim their reward belonging CanChain's policy
- `@param partner_account`: The name of partner who will be received reward
**Example on jungle testnet using cleos**
----------------------------------
#### Get started
* Account info to play
- Account name: partnereward
- Public key: EOS6UPkEA5E6Mx2Hw7pV533D1fw6mAgtE7dCWVrc7HahmzCZC488m
- Private key: 5HyVKiUinc5bcwM7q3rVo4KNwyV8ND3EWwjYVCF8V8MESNPiZC6
- Account name: partnereward
- Public key: EOS6UPkEA5E6Mx2Hw7pV533D1fw6mAgtE7dCWVrc7HahmzCZC488m
- Private key: 5HyVKiUinc5bcwM7q3rVo4KNwyV8ND3EWwjYVCF8V8MESNPiZC6
* Endpoint network:
https://jungle2.cryptolions.io:443
`https://jungle2.cryptolions.io:443`
* Contract name: partnereward
* Contract name:
`partnereward`
##### Build & deploy smart contract
......@@ -28,6 +77,7 @@ Go to partner_reaward directory then do flowing steps:
````bash
eosio-cpp -abigen -I include -contract partnereward -o partnereward.wasm src/partnereward.cpp
````
2. Deploy to jungle test net
````bash
......@@ -153,3 +203,4 @@ $ cleos -u https://jungle2.cryptolions.io:443 get table partnereward partnerewar
````
````
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment