tx · 5dtNnjNdnoHmk49iqqVGkQRRGL9J2FenuXy7GKyLfkxN
3MsU428UzSefm85q7jvBsRV66Du7E72xEkL: -0.01000000 Waves
2022.06.09 16:08 [2088878] smart account 3MsU428UzSefm85q7jvBsRV66Du7E72xEkL > SELF 0.00000000 Waves
{
"type": 13,
"id": "5dtNnjNdnoHmk49iqqVGkQRRGL9J2FenuXy7GKyLfkxN",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1654780101781,
"version": 2,
"chainId": 84,
"sender": "3MsU428UzSefm85q7jvBsRV66Du7E72xEkL",
"senderPublicKey": "58FFoU7LCj1DKboVntQXuE3KQDpf92NouXncN5b4vY8U",
"proofs": [
"3wkMsJbe2ZtiC7XsjwNTf1mrvQes4dC3uvg6C37xbq6usf8jC6aRcDrpvLP9UoG2Eh7gT2XQ3qPzvbnr5Y1vnoXq"
],
"script": "base64:AAIFAAAAAAAAAA0IAhIAEgASABIDCgEIAAAAAwAAAAAFQVNTRVQBAAAAIC03E4HTJDddn+FvdtPRD5PvLCz03YmtXEpW6HzJAXIbAAAAAAtTVEFLRV9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQAAAAADVJFV0FSRF9BTU9VTlQAAAAAF0h26AAAAAAEAAAAAWkBAAAABXN0YWtlAAAAAAQAAAAJJHQwMjk3MzcyCQAFFAAAAAIICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAAAABmFtb3VudAgJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAAAAAHYXNzZXRJZAQAAAAJcG10QW1vdW50CAUAAAAJJHQwMjk3MzcyAAAAAl8xBAAAAApwbXRBc3NldElkCAUAAAAJJHQwMjk3MzcyAAAAAl8yAwMDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAQAAAAIhPQAAAAIFAAAACnBtdEFzc2V0SWQFAAAAC1N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AAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmVHFwL",
"height": 2088878,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 8AVX6sJtKNMujW2vXfyGbTmbCR9ZWLJUZf2bfbCXQMK9
Next: 6eC7XpinLjD7ZWisd4M5TyHy41mSk9PgvHEUDHHc5UMq
Diff:
Old | New | | Differences |
---|
21 | 21 | | else { |
---|
22 | 22 | | let currentKey = toBase58String(i.caller.bytes) |
---|
23 | 23 | | let getStakedAmount = valueOrElse(getInteger(this, (currentKey + "_staked")), 0) |
---|
| 24 | + | let totalAmount = valueOrElse(getInteger(this, "total"), 0) |
---|
24 | 25 | | let totalStaked = (getStakedAmount + pmtAmount) |
---|
25 | | - | [IntegerEntry((((currentKey + "_") + toString(height)) + "_staked"), totalStaked)] |
---|
| 26 | + | [IntegerEntry((((currentKey + "_") + toString(height)) + "_staked"), totalStaked), IntegerEntry("total", (totalAmount + totalStaked))] |
---|
26 | 27 | | } |
---|
27 | 28 | | } |
---|
28 | 29 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ASSET = base58'43W4FcqA1rEpSmUGHoGiXvpSLfhadws9LS5j3SJsKxxS' |
---|
5 | 5 | | |
---|
6 | 6 | | let STAKE_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' |
---|
7 | 7 | | |
---|
8 | 8 | | let REWARD_AMOUNT = 100000000000 |
---|
9 | 9 | | |
---|
10 | 10 | | @Callable(i) |
---|
11 | 11 | | func stake () = { |
---|
12 | 12 | | let $t0297372 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) |
---|
13 | 13 | | let pmtAmount = $t0297372._1 |
---|
14 | 14 | | let pmtAssetId = $t0297372._2 |
---|
15 | 15 | | if (if (if ((size(i.payments) == 0)) |
---|
16 | 16 | | then (pmtAssetId != STAKE_ASSET) |
---|
17 | 17 | | else false) |
---|
18 | 18 | | then (0 >= pmtAmount) |
---|
19 | 19 | | else false) |
---|
20 | 20 | | then throw("send token to stake") |
---|
21 | 21 | | else { |
---|
22 | 22 | | let currentKey = toBase58String(i.caller.bytes) |
---|
23 | 23 | | let getStakedAmount = valueOrElse(getInteger(this, (currentKey + "_staked")), 0) |
---|
| 24 | + | let totalAmount = valueOrElse(getInteger(this, "total"), 0) |
---|
24 | 25 | | let totalStaked = (getStakedAmount + pmtAmount) |
---|
25 | | - | [IntegerEntry((((currentKey + "_") + toString(height)) + "_staked"), totalStaked)] |
---|
| 26 | + | [IntegerEntry((((currentKey + "_") + toString(height)) + "_staked"), totalStaked), IntegerEntry("total", (totalAmount + totalStaked))] |
---|
26 | 27 | | } |
---|
27 | 28 | | } |
---|
28 | 29 | | |
---|
29 | 30 | | |
---|
30 | 31 | | |
---|
31 | 32 | | @Callable(i) |
---|
32 | 33 | | func withdraw () = throw("test") |
---|
33 | 34 | | |
---|
34 | 35 | | |
---|
35 | 36 | | |
---|
36 | 37 | | @Callable(i) |
---|
37 | 38 | | func claimReward () = throw("test") |
---|
38 | 39 | | |
---|
39 | 40 | | |
---|
40 | 41 | | |
---|
41 | 42 | | @Callable(i) |
---|
42 | 43 | | func del (key) = [DeleteEntry(key)] |
---|
43 | 44 | | |
---|
44 | 45 | | |
---|
45 | 46 | | @Verifier(tx) |
---|
46 | 47 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
47 | 48 | | |
---|