tx · 31wgkFGNAuu96w2uJwbxnYkRERnHmroP5khKd7fWKpmp 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2: -0.00400000 Waves 2022.08.18 16:45 [2189989] smart account 3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2 > SELF 0.00000000 Waves
{ "type": 13, "id": "31wgkFGNAuu96w2uJwbxnYkRERnHmroP5khKd7fWKpmp", "fee": 400000, "feeAssetId": null, "timestamp": 1660830344481, "version": 2, "chainId": 84, "sender": "3MsmgWBZKrHwbVbSQiqmStRiFyg5hkfxxa2", "senderPublicKey": "9TejtrnvgE7MvzMR4DcLbf3dqUzovyt4BKEmCsqha2z", "proofs": [ "2hsSYjHLHs4RgsWUJGa8emE8fUqDsW6h9eERqWuLzZNj3ohfgobLAZHVJg5T7b5DVPYsEMziTNj5EeFFVdp4eG5e" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACQAAAAAJaGVpZ2h0RW5kCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwIAAAAKaGVpZ2h0X2VuZAIAAAAkaGVpZ2h0X2VuZCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAAAAAAxhc3NldHNTdHJpbmcJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAABBhdmFpbGFibGVfYXNzZXRzAgAAACVBc3NldHMgbGlzdCBpcyBub3Qgc3BlY2lmaWVkIGluIHN0YXRlAQAAAAlhc0FueUxpc3QAAAABAAAAA3ZhbAQAAAAHJG1hdGNoMAUAAAADdmFsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAlMaXN0W0FueV0EAAAACnZhbEFueUx5c3QFAAAAByRtYXRjaDAFAAAACnZhbEFueUx5c3QJAAACAAAAAQIAAAAbZmFpbCB0byBjYXN0IGludG8gTGlzdFtBbnldAQAAAAVhc0ludAAAAAEAAAADdmFsBAAA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ucwUAAAADbmlsAAAAACMEUm4=", "height": 2189989, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HqPH2XfFfm5dbm4LucqGwnMmq56j2JkftfLyg8zUMUfx Next: 5XtE28HZSbSLvCddhM8i7MPU2k55iMfcPjUB1u1Wmj6m Diff:
Old | New | Differences | |
---|---|---|---|
28 | 28 | func keyUserBalance (userAddr) = makeString(["balance", toString(userAddr)], "_") | |
29 | 29 | ||
30 | 30 | ||
31 | - | func | |
31 | + | func keyUserVotingPower (userAddr) = makeString(["votingPower", userAddr], "_") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func keyUserLastVote (userAddr) = makeString(["last_vote", userAddr], "_") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(contextObj) | |
38 | - | func castVote ( | |
38 | + | func castVote (newUserSelectedOptions) = { | |
39 | 39 | let userAddress = toString(contextObj.caller) | |
40 | - | if ((containsElement(availableVotes, | |
40 | + | if ((containsElement(availableVotes, newUserSelectedOptions) == false)) | |
41 | 41 | then throw("Incorrect vote!") | |
42 | 42 | else if ((height >= heightEnd)) | |
43 | 43 | then throw("vote finished") | |
44 | 44 | else { | |
45 | 45 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddress, 0], nil)) | |
46 | 46 | let newUserVotingPower = asInt(nsbtData[0]) | |
47 | - | let newTotalByChoiceKEY = makeString(["vote", newUserChoice], "_") | |
48 | - | let newTotalByChoiceAmount = valueOrElse(getInteger(this, newTotalByChoiceKEY), 0) | |
49 | - | let newUserVotingPowerKEY = keyUserVote(userAddress, newUserChoice) | |
47 | + | let selectedOptionsArr = split(newUserSelectedOptions, ":") | |
50 | 48 | let prevUserChoiceKEY = keyUserLastVote(userAddress) | |
51 | - | let prevUserChoice = valueOrElse(getString(this, prevUserChoiceKEY), newUserChoice) | |
52 | - | let prevUserVotingPowerKEY = keyUserVote(userAddress, prevUserChoice) | |
49 | + | let prevUserSelectedOptions = valueOrElse(getString(this, prevUserChoiceKEY), newUserSelectedOptions) | |
50 | + | let prevUserSelectedOptionsArr = split(prevUserSelectedOptions, ":") | |
51 | + | let prevUserVotingPowerKEY = keyUserVotingPower(userAddress) | |
53 | 52 | let prevUserVotingPower = valueOrElse(getInteger(this, prevUserVotingPowerKEY), 0) | |
54 | - | let prevTotalByChoiceKEY = makeString(["vote", prevUserChoice], "_") | |
55 | - | let prevTotalByChoiceAmount = valueOrElse(getInteger(this, prevTotalByChoiceKEY), 0) | |
56 | - | let refreshTotals = if ((prevUserChoice != newUserChoice)) | |
57 | - | then [IntegerEntry(prevUserVotingPowerKEY, 0), IntegerEntry(prevTotalByChoiceKEY, (prevTotalByChoiceAmount - prevUserVotingPower)), IntegerEntry(newTotalByChoiceKEY, (newTotalByChoiceAmount + newUserVotingPower))] | |
58 | - | else [IntegerEntry(newTotalByChoiceKEY, ((newTotalByChoiceAmount + newUserVotingPower) - prevUserVotingPower))] | |
59 | - | (refreshTotals ++ [IntegerEntry(newUserVotingPowerKEY, newUserVotingPower), StringEntry(prevUserChoiceKEY, newUserChoice)]) | |
53 | + | func refreshVotes (data,idx) = { | |
54 | + | let newUserChoice = selectedOptionsArr[idx] | |
55 | + | let prevUserChoice = prevUserSelectedOptionsArr[idx] | |
56 | + | let newTotalByChoiceKEY = makeString(["vote", newUserChoice], "_") | |
57 | + | let newTotalByChoiceAmount = valueOrElse(getInteger(this, newTotalByChoiceKEY), 0) | |
58 | + | let prevTotalByChoiceKEY = makeString(["vote", prevUserChoice], "_") | |
59 | + | let prevTotalByChoiceAmount = valueOrElse(getInteger(this, prevTotalByChoiceKEY), 0) | |
60 | + | let refreshTotals = if ((newUserChoice != prevUserChoice)) | |
61 | + | then [IntegerEntry(prevTotalByChoiceKEY, (prevTotalByChoiceAmount - prevUserVotingPower)), IntegerEntry(newTotalByChoiceKEY, (newTotalByChoiceAmount + newUserVotingPower))] | |
62 | + | else [IntegerEntry(newTotalByChoiceKEY, ((newTotalByChoiceAmount + newUserVotingPower) - prevUserVotingPower))] | |
63 | + | (data ++ refreshTotals) | |
64 | + | } | |
65 | + | ||
66 | + | let idxes = [0, 1, 2, 3] | |
67 | + | ({ | |
68 | + | let $l = idxes | |
69 | + | let $s = size($l) | |
70 | + | let $acc0 = nil | |
71 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
72 | + | then $a | |
73 | + | else refreshVotes($a, $l[$i]) | |
74 | + | ||
75 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
76 | + | then $a | |
77 | + | else throw("List size exceeds 5") | |
78 | + | ||
79 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
80 | + | } ++ [IntegerEntry(prevUserVotingPowerKEY, newUserVotingPower), StringEntry(prevUserChoiceKEY, newUserSelectedOptions)]) | |
60 | 81 | } | |
61 | 82 | } | |
62 | 83 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let heightEnd = valueOrErrorMessage(getInteger(this, "height_end"), "height_end is not specified in state") | |
5 | 5 | ||
6 | 6 | let assetsString = valueOrErrorMessage(getString(this, "available_assets"), "Assets list is not specified in state") | |
7 | 7 | ||
8 | 8 | func asAnyList (val) = match val { | |
9 | 9 | case valAnyLyst: List[Any] => | |
10 | 10 | valAnyLyst | |
11 | 11 | case _ => | |
12 | 12 | throw("fail to cast into List[Any]") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func asInt (val) = match val { | |
17 | 17 | case valInt: Int => | |
18 | 18 | valInt | |
19 | 19 | case _ => | |
20 | 20 | throw("fail to cast into Int") | |
21 | 21 | } | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | let nsbtStakingContract = Address(base58'3MuGfNhF98CNBCfthhoJEo6SYUv7zTgkK4J') | |
25 | 25 | ||
26 | 26 | let availableVotes = split(assetsString, ",") | |
27 | 27 | ||
28 | 28 | func keyUserBalance (userAddr) = makeString(["balance", toString(userAddr)], "_") | |
29 | 29 | ||
30 | 30 | ||
31 | - | func | |
31 | + | func keyUserVotingPower (userAddr) = makeString(["votingPower", userAddr], "_") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func keyUserLastVote (userAddr) = makeString(["last_vote", userAddr], "_") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(contextObj) | |
38 | - | func castVote ( | |
38 | + | func castVote (newUserSelectedOptions) = { | |
39 | 39 | let userAddress = toString(contextObj.caller) | |
40 | - | if ((containsElement(availableVotes, | |
40 | + | if ((containsElement(availableVotes, newUserSelectedOptions) == false)) | |
41 | 41 | then throw("Incorrect vote!") | |
42 | 42 | else if ((height >= heightEnd)) | |
43 | 43 | then throw("vote finished") | |
44 | 44 | else { | |
45 | 45 | let nsbtData = asAnyList(invoke(nsbtStakingContract, "nsbtStakingSYSREADONLY", [userAddress, 0], nil)) | |
46 | 46 | let newUserVotingPower = asInt(nsbtData[0]) | |
47 | - | let newTotalByChoiceKEY = makeString(["vote", newUserChoice], "_") | |
48 | - | let newTotalByChoiceAmount = valueOrElse(getInteger(this, newTotalByChoiceKEY), 0) | |
49 | - | let newUserVotingPowerKEY = keyUserVote(userAddress, newUserChoice) | |
47 | + | let selectedOptionsArr = split(newUserSelectedOptions, ":") | |
50 | 48 | let prevUserChoiceKEY = keyUserLastVote(userAddress) | |
51 | - | let prevUserChoice = valueOrElse(getString(this, prevUserChoiceKEY), newUserChoice) | |
52 | - | let prevUserVotingPowerKEY = keyUserVote(userAddress, prevUserChoice) | |
49 | + | let prevUserSelectedOptions = valueOrElse(getString(this, prevUserChoiceKEY), newUserSelectedOptions) | |
50 | + | let prevUserSelectedOptionsArr = split(prevUserSelectedOptions, ":") | |
51 | + | let prevUserVotingPowerKEY = keyUserVotingPower(userAddress) | |
53 | 52 | let prevUserVotingPower = valueOrElse(getInteger(this, prevUserVotingPowerKEY), 0) | |
54 | - | let prevTotalByChoiceKEY = makeString(["vote", prevUserChoice], "_") | |
55 | - | let prevTotalByChoiceAmount = valueOrElse(getInteger(this, prevTotalByChoiceKEY), 0) | |
56 | - | let refreshTotals = if ((prevUserChoice != newUserChoice)) | |
57 | - | then [IntegerEntry(prevUserVotingPowerKEY, 0), IntegerEntry(prevTotalByChoiceKEY, (prevTotalByChoiceAmount - prevUserVotingPower)), IntegerEntry(newTotalByChoiceKEY, (newTotalByChoiceAmount + newUserVotingPower))] | |
58 | - | else [IntegerEntry(newTotalByChoiceKEY, ((newTotalByChoiceAmount + newUserVotingPower) - prevUserVotingPower))] | |
59 | - | (refreshTotals ++ [IntegerEntry(newUserVotingPowerKEY, newUserVotingPower), StringEntry(prevUserChoiceKEY, newUserChoice)]) | |
53 | + | func refreshVotes (data,idx) = { | |
54 | + | let newUserChoice = selectedOptionsArr[idx] | |
55 | + | let prevUserChoice = prevUserSelectedOptionsArr[idx] | |
56 | + | let newTotalByChoiceKEY = makeString(["vote", newUserChoice], "_") | |
57 | + | let newTotalByChoiceAmount = valueOrElse(getInteger(this, newTotalByChoiceKEY), 0) | |
58 | + | let prevTotalByChoiceKEY = makeString(["vote", prevUserChoice], "_") | |
59 | + | let prevTotalByChoiceAmount = valueOrElse(getInteger(this, prevTotalByChoiceKEY), 0) | |
60 | + | let refreshTotals = if ((newUserChoice != prevUserChoice)) | |
61 | + | then [IntegerEntry(prevTotalByChoiceKEY, (prevTotalByChoiceAmount - prevUserVotingPower)), IntegerEntry(newTotalByChoiceKEY, (newTotalByChoiceAmount + newUserVotingPower))] | |
62 | + | else [IntegerEntry(newTotalByChoiceKEY, ((newTotalByChoiceAmount + newUserVotingPower) - prevUserVotingPower))] | |
63 | + | (data ++ refreshTotals) | |
64 | + | } | |
65 | + | ||
66 | + | let idxes = [0, 1, 2, 3] | |
67 | + | ({ | |
68 | + | let $l = idxes | |
69 | + | let $s = size($l) | |
70 | + | let $acc0 = nil | |
71 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
72 | + | then $a | |
73 | + | else refreshVotes($a, $l[$i]) | |
74 | + | ||
75 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
76 | + | then $a | |
77 | + | else throw("List size exceeds 5") | |
78 | + | ||
79 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
80 | + | } ++ [IntegerEntry(prevUserVotingPowerKEY, newUserVotingPower), StringEntry(prevUserChoiceKEY, newUserSelectedOptions)]) | |
60 | 81 | } | |
61 | 82 | } | |
62 | 83 | ||
63 | 84 |
github/deemru/w8io/169f3d6 26.35 ms ◑