# Gitcoin Bounties **Lawson** --- ## Task 1: Create and deploy a simple, smart contract with cargo casper and cargo test **Prerequisites** Installing Rust ![](https://i.imgur.com/cVMsK7H.png) Installing Dependencies ![](https://i.imgur.com/Hulljxe.png) **Development Environment Setup** Installing the Casper Crates ![](https://i.imgur.com/yar0X3B.png) **Compiling to WASM** ![](https://i.imgur.com/eulYnFo.png) **Build the Contract** ![](https://i.imgur.com/IAJGMqE.png) **Test the Contract** ![](https://i.imgur.com/CPHUXRv.png) **Deploy the Contract** ![](https://i.imgur.com/Wd0Vb7b.png) **Get the Contract** ``` (env) root@lawson:~# casper-client get-deploy --node-address http://161.97.77.69:7777 2dae278c8344e5ea8f2c4800136546e7d2ef2fbff4d7197fdcebf21dc81a6acc { "id": 6485216942380371198, "jsonrpc": "2.0", "result": { "api_version": "1.3.4", "deploy": { "approvals": [ { "signature": "[130 hex chars]", "signer": "01a0d100bdc7d058e915b8d100aa3b0180935ef3c3fe320d8ccf27f45bc50c0aed" } ], "hash": "2dae278c8344e5ea8f2c4800136546e7d2ef2fbff4d7197fdcebf21dc81a6acc", "header": { "account": "01a0d100bdc7d058e915b8d100aa3b0180935ef3c3fe320d8ccf27f45bc50c0aed", "body_hash": "47de396bf9d2171ffda855bae540dfc7070dca083f835caf1859bb99e687635f", "chain_name": "casper-test", "dependencies": [], "gas_price": 1, "timestamp": "2021-09-23T20:09:14.288Z", "ttl": "30m" }, "payment": { "ModuleBytes": { "args": [ [ "amount", { "bytes": "03809698", "cl_type": "U512", "parsed": "10000000" } ] ], "module_bytes": "" } }, "session": { "ModuleBytes": { "args": [], "module_bytes": "[51990 hex chars]" } } }, "execution_results": [] } } ``` ![](https://i.imgur.com/S6igykq.png) ## Task 2: Complete one of the existing tutorials for writing smart contracts **Multi-Signature Tutorial** Setting up a local Casper Network ![](https://i.imgur.com/lOxqvuT.png) See faucet account details ![](https://i.imgur.com/XIrOwu7.png) Testing the Client ``` (env) root@lawson:~/keys-manager/client# npm run start:atomic > keys-manager@1.0.0 start:atomic > node -r dotenv/config ./src/scenario-atomic.js 0.1 Fund main account. Signed by: account-hash-d015d6eb8c2330a974d2879be2fbca5e756106d1d232480821a33dfcb39a0827 Deploy hash: 216cf584ee406eff7ca3eb96fffbb22aea71ca1e417244d0193187fb05c97930 Deploy result: { deploy: { hash: '216cf584ee406eff7ca3eb96fffbb22aea71ca1e417244d0193187fb05c97930', header: { account: '018ac385ef98fd9be3574535009874ae89eeb5cfe9d95058a4d1ba9153ef875110', timestamp: '2021-09-23T20:01:22.352Z', ttl: '30m', gas_price: 1, body_hash: '32ae8210c59dfdac2b9edaf2354985facad9c528052837fc361633ea5a638405', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { Transfer: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } [x]0.2 Install Keys Manager contract Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 9cf19861d73cd09814f86b1799c3097b0125afecfca0d42f4a96f7ebf33b002f Deploy result: { deploy: { hash: '9cf19861d73cd09814f86b1799c3097b0125afecfca0d42f4a96f7ebf33b002f', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:02:27.620Z', ttl: '30m', gas_price: 1, body_hash: '8b75c87f0c5c33503df86050553e6a490fdee8d5154d9eececdc7c22618217c8', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { ModuleBytes: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } 1. Set faucet's weight to 3 Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 31be3535dbf2a44cb4293822e30d9ef5a2d29d59d2e5a355d9d092f4f4e58f4c Deploy result: { deploy: { hash: '31be3535dbf2a44cb4293822e30d9ef5a2d29d59d2e5a355d9d092f4f4e58f4c', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:03:33.199Z', ttl: '30m', gas_price: 1, body_hash: '3347bd57203bbba7c4f3eb29776c95a191e3a7185c3b2998deb75ce12172ef48', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } 2. Set Keys Management Threshold to 3 Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 85b2c43d25a974fb7f5ea4a338bb0c56481ad93630ef7e82fb04094b6b81d591 Deploy result: { deploy: { hash: '85b2c43d25a974fb7f5ea4a338bb0c56481ad93630ef7e82fb04094b6b81d591', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:04:38.125Z', ttl: '30m', gas_price: 1, body_hash: '3f3394304ff22fe422511e62eed631bc501385f67fdd1fe71891f7d375550324', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 } ], actionThresholds: { deployment: 1, keyManagement: 3 } } 3. Set Deploy Threshold to 2. Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 787bae14e938b08e164b0f59ba8c8f79aa75deb2470065666e0e9a710cd2d5ce Deploy result: { deploy: { hash: '787bae14e938b08e164b0f59ba8c8f79aa75deb2470065666e0e9a710cd2d5ce', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:05:43.993Z', ttl: '30m', gas_price: 1, body_hash: '609e820d1eb41cd0fe90e6c5c4cf179afd2c9d9ba19bb0f21ca310a85450f228', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } 4. Add first new key with weight 1. Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: bd6a19a013f56433152ef693b8f67a2929aaa80a95edf254fa77637779fd6aeb Deploy result: { deploy: { hash: 'bd6a19a013f56433152ef693b8f67a2929aaa80a95edf254fa77637779fd6aeb', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:06:49.808Z', ttl: '30m', gas_price: 1, body_hash: '936492bacb880811fc39d65fbe94ef978bcd9e9c4a7a0e951c61e32b5aed6dc2', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 }, { accountHash: 'account-hash-2d1db745afef62794a77f10c96c53d942d946a4b77f638dffa453d0276825516', weight: 1 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } 5. Add second new key with weight 1. Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 6377d9dd58e374060053f5f590f04d0c697324462bcc64841653f0963ddb49ca Deploy result: { deploy: { hash: '6377d9dd58e374060053f5f590f04d0c697324462bcc64841653f0963ddb49ca', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:07:54.605Z', ttl: '30m', gas_price: 1, body_hash: '801f57aa0006dbcb24e7a8e7835d84baa1ffe587d51264a06312fda3daa3dd99', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 }, { accountHash: 'account-hash-20bd24f084e2e87efef0c1ab6f20459201ebb04aee9a10fd7e284d0b74d5e6fe', weight: 1 }, { accountHash: 'account-hash-2d1db745afef62794a77f10c96c53d942d946a4b77f638dffa453d0276825516', weight: 1 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } 6. Make a transfer from faucet using the new accounts. Signed by: account-hash-2d1db745afef62794a77f10c96c53d942d946a4b77f638dffa453d0276825516 Signed by: account-hash-20bd24f084e2e87efef0c1ab6f20459201ebb04aee9a10fd7e284d0b74d5e6fe Deploy hash: 97b5ae7b17892b177f76d2be5ae9ec52019057067352038ee9b3ed554d2565a5 Deploy result: { deploy: { hash: '97b5ae7b17892b177f76d2be5ae9ec52019057067352038ee9b3ed554d2565a5', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:09:00.401Z', ttl: '30m', gas_price: 1, body_hash: 'd43ac58b7bfae74c5901ba72009da7700e79a78210b532fa3816b31680f959da', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { Transfer: [Object] }, approvals: [ [Object], [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 }, { accountHash: 'account-hash-20bd24f084e2e87efef0c1ab6f20459201ebb04aee9a10fd7e284d0b74d5e6fe', weight: 1 }, { accountHash: 'account-hash-2d1db745afef62794a77f10c96c53d942d946a4b77f638dffa453d0276825516', weight: 1 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } 7. Remove the first account Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 88edd6e49664f89e56d3f7a459ec2d1b5f8d9cf9f94a0d3a725482151c376be7 Deploy result: { deploy: { hash: '88edd6e49664f89e56d3f7a459ec2d1b5f8d9cf9f94a0d3a725482151c376be7', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:10:06.280Z', ttl: '30m', gas_price: 1, body_hash: 'a4a7d0a05bcf9709e0904758a31925910b34979847e012707050a15eaba3aa98', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 }, { accountHash: 'account-hash-20bd24f084e2e87efef0c1ab6f20459201ebb04aee9a10fd7e284d0b74d5e6fe', weight: 1 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } 8. Remove the second account Signed by: account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619 Deploy hash: 5c06432258de5acfc1fd2eabf22f61a739dc9833020f33aae8a88c8f83f4eee2 Deploy result: { deploy: { hash: '5c06432258de5acfc1fd2eabf22f61a739dc9833020f33aae8a88c8f83f4eee2', header: { account: '0202be6a3283c79c44776f6f4e4a347bc424df224548a406d99e5a64ad564733d315', timestamp: '2021-09-23T20:11:11.078Z', ttl: '30m', gas_price: 1, body_hash: 'dfff16696d1c85f67a16a34750a67b6aa299ea0822ce5b375bc17c193aa11f7c', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', namedKeys: [ { name: 'keys_manager', key: 'hash-d5059d972cb3d23113ef28246eb88aa9c451221b0c50b07f6d0c337d0846cce6' }, { name: 'keys_manager_hash', key: 'uref-d5bc058a9c62497b62edadc3717a0fb0dc1e445c415133e519a3bc54693e6ebb-007' } ], mainPurse: 'uref-e7adfd669a11580886b9faed91fd5bbfa3502296823c79cee9fa682044848515-007', associatedKeys: [ { accountHash: 'account-hash-0a8832092c622d7a9df7472d2677fdc73ee40528413382a2fd7289792eed5619', weight: 3 } ], actionThresholds: { deployment: 2, keyManagement: 3 } } ``` ## Task 3: Demonstrate key management concepts **Additional scenarios == Scenario 1: signing transactions with a single key** Scenario 1 code for demo was created at client/src: ![](https://i.imgur.com/WnPi3u3.png) Testing the code demo ``` (env) root@lawson:~/keys-manager/client# npm run start:scenario_1 > keys-manager@1.0.0 start:scenario_1 > node -r dotenv/config ./src/scenario_1.js 0.1 Fund main account. Signed by: account-hash-d015d6eb8c2330a974d2879be2fbca5e756106d1d232480821a33dfcb39a0827 Deploy hash: c7ef79d98d722c0ff7e68ec8f496a036f2acb2fae62e7eb522a71da07b3a3ccf Deploy result: { deploy: { hash: 'c7ef79d98d722c0ff7e68ec8f496a036f2acb2fae62e7eb522a71da07b3a3ccf', header: { account: '018ac385ef98fd9be3574535009874ae89eeb5cfe9d95058a4d1ba9153ef875110', timestamp: '2021-09-23T20:04:30.421Z', ttl: '30m', gas_price: 1, body_hash: '24d3f56fba381ff44639abd593cfef8f93603940ba20156379d0d25a3ae28eb1', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { Transfer: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', namedKeys: [], mainPurse: 'uref-3a5c6062407e07c1e82098bda3b20ec3b2dad7cf3875554f0300f0ffae12a0ec-007', associatedKeys: [ { accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } [x]0.2 Install Keys Manager contract Signed by: account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540 Deploy hash: f0561ff9ba937f0ac435e3bfe40706a0822be992c1839b28403840294a14b574 Deploy result: { deploy: { hash: 'f0561ff9ba937f0ac435e3bfe40706a0822be992c1839b28403840294a14b574', header: { account: '0203c479714093acb83c4fb8601697d920318844aded4e5a552f6007ab7233cef218', timestamp: '2021-09-23T20:05:35.474Z', ttl: '30m', gas_price: 1, body_hash: '8b75c87f0c5c33503df86050553e6a490fdee8d5154d9eececdc7c22618217c8', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { ModuleBytes: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', namedKeys: [ { name: 'keys_manager', key: 'hash-4f864746f7463f0f74be8844194b0e232af3c3fc42030183487e74bde5b167b8' }, { name: 'keys_manager_hash', key: 'uref-981259b5a1e4499d0f5f72b0ae3c76fca9d753c15a1623a753924e0b61918508-007' } ], mainPurse: 'uref-3a5c6062407e07c1e82098bda3b20ec3b2dad7cf3875554f0300f0ffae12a0ec-007', associatedKeys: [ { accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } 1. Set faucet's weight to 1 Signed by: account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540 Deploy hash: 43ece58e40ec1b705ea97f3cb540205162b644eca3df83c0cf270a979a65105e Deploy result: { deploy: { hash: '43ece58e40ec1b705ea97f3cb540205162b644eca3df83c0cf270a979a65105e', header: { account: '0203c479714093acb83c4fb8601697d920318844aded4e5a552f6007ab7233cef218', timestamp: '2021-09-23T20:06:40.811Z', ttl: '30m', gas_price: 1, body_hash: '615b4254df60c5774b9efb6914255d4516e4599ae7ebf4c1856f8e1bde02684a', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', namedKeys: [ { name: 'keys_manager', key: 'hash-4f864746f7463f0f74be8844194b0e232af3c3fc42030183487e74bde5b167b8' }, { name: 'keys_manager_hash', key: 'uref-981259b5a1e4499d0f5f72b0ae3c76fca9d753c15a1623a753924e0b61918508-007' } ], mainPurse: 'uref-3a5c6062407e07c1e82098bda3b20ec3b2dad7cf3875554f0300f0ffae12a0ec-007', associatedKeys: [ { accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } 2. Set Keys Management Threshold to 1 Signed by: account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540 Deploy hash: 41274de2ee299acc1e928acdd802481068411905365b186bcc5cba02c9b0b7c2 Deploy result: { deploy: { hash: '41274de2ee299acc1e928acdd802481068411905365b186bcc5cba02c9b0b7c2', header: { account: '0203c479714093acb83c4fb8601697d920318844aded4e5a552f6007ab7233cef218', timestamp: '2021-09-23T20:07:46.656Z', ttl: '30m', gas_price: 1, body_hash: 'fcbeef2291716fba37f9f05b6883b80e5985a3e7ccdd8e779cca24912b24871b', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', namedKeys: [ { name: 'keys_manager', key: 'hash-4f864746f7463f0f74be8844194b0e232af3c3fc42030183487e74bde5b167b8' }, { name: 'keys_manager_hash', key: 'uref-981259b5a1e4499d0f5f72b0ae3c76fca9d753c15a1623a753924e0b61918508-007' } ], mainPurse: 'uref-3a5c6062407e07c1e82098bda3b20ec3b2dad7cf3875554f0300f0ffae12a0ec-007', associatedKeys: [ { accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } 3. Set Deploy Threshold to 1. Signed by: account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540 Deploy hash: debf2ace3512cfe870e05bd486df70f96b059065bf6fc8b8897d0eddc54eba5c Deploy result: { deploy: { hash: 'debf2ace3512cfe870e05bd486df70f96b059065bf6fc8b8897d0eddc54eba5c', header: { account: '0203c479714093acb83c4fb8601697d920318844aded4e5a552f6007ab7233cef218', timestamp: '2021-09-23T20:08:52.490Z', ttl: '30m', gas_price: 1, body_hash: '4807b024a8e1e7c7d1da5a9101a21f38303d4689905d88d4585eec852fd7216b', dependencies: [], chain_name: 'casper-net-1' }, payment: { ModuleBytes: [Object] }, session: { StoredContractByName: [Object] }, approvals: [ [Object] ] } } [x] Current state of the account: { _accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', namedKeys: [ { name: 'keys_manager', key: 'hash-4f864746f7463f0f74be8844194b0e232af3c3fc42030183487e74bde5b167b8' }, { name: 'keys_manager_hash', key: 'uref-981259b5a1e4499d0f5f72b0ae3c76fca9d753c15a1623a753924e0b61918508-007' } ], mainPurse: 'uref-3a5c6062407e07c1e82098bda3b20ec3b2dad7cf3875554f0300f0ffae12a0ec-007', associatedKeys: [ { accountHash: 'account-hash-a03f35556ae382bf3f1551abdf5f2fda965e69f779686dc9a9fad31bcd2c7540', weight: 1 } ], actionThresholds: { deployment: 1, keyManagement: 1 } } ``` ## Task 4: Learn to transfer tokens to an account on the Casper Testnet. ![](https://i.imgur.com/NSOmbuT.png) --- ``` root@lawson:~# casper-client get-deploy --node-address http://161.97.77.69:7777 e5642f5b1aabd2f87c3c6220184fad03108452bef42c1099685d8bb6a7260a91 { "id": 48077304604927060, "jsonrpc": "2.0", "result": { "api_version": "1.3.4", "deploy": { "approvals": [ { "signature": "[130 hex chars]", "signer": "01a0d100bdc7d058e915b8d100aa3b0180935ef3c3fe320d8ccf27f45bc50c0aed" } ], "hash": "e5642f5b1aabd2f87c3c6220184fad03108452bef42c1099685d8bb6a7260a91", "header": { "account": "01a0d100bdc7d058e915b8d100aa3b0180935ef3c3fe320d8ccf27f45bc50c0aed", "body_hash": "b3d6b6594c706387735aa2c43a469f1152f5ef05f773a0a09d26e47184d6add1", "chain_name": "casper-test", "dependencies": [], "gas_price": 1, "timestamp": "2021-09-23T19:42:52.277Z", "ttl": "30m" }, "payment": { "ModuleBytes": { "args": [ [ "amount", { "bytes": "0480f0fa02", "cl_type": "U512", "parsed": "50000000" } ] ], "module_bytes": "" } }, "session": { "Transfer": { "args": [ [ "amount", { "bytes": "05004429353a", "cl_type": "U512", "parsed": "250000000000" } ], [ "target", { "bytes": "98c52059d4801fe06f29337eef8e8d9766659a8b5efeaa29e9ba76ab8216562e", "cl_type": { "ByteArray": 32 }, "parsed": "98c52059d4801fe06f29337eef8e8d9766659a8b5efeaa29e9ba76ab8216562e" } ], [ "id", { "bytes": "012b02000000000000", "cl_type": { "Option": "U64" }, "parsed": 555 } ] ] } } }, "execution_results": [] } } ``` Transfer successfully ![](https://i.imgur.com/GQn6E6d.png) ## Task 5: Learn to Delegate and Undelegate on the Casper Testnet **Delegate from Casper portal** ![](https://i.imgur.com/9VSGSnV.png) **Undelegate from Casper portal** ![](https://i.imgur.com/GK0uzUl.png)