tx · 9PWw1yBsP7VTFb3kDc1uJTx8LPsHBEBT7GEbP9VmAyV7 3MpB2tTBcSmsiaYrTfPKjo75jTKju8C7MrN: -0.01000000 Waves 2019.09.24 15:28 [690419] smart account 3MpB2tTBcSmsiaYrTfPKjo75jTKju8C7MrN > SELF 0.00000000 Waves
{ "type": 13, "id": "9PWw1yBsP7VTFb3kDc1uJTx8LPsHBEBT7GEbP9VmAyV7", "fee": 1000000, "feeAssetId": null, "timestamp": 1569328154134, "version": 1, "sender": "3MpB2tTBcSmsiaYrTfPKjo75jTKju8C7MrN", "senderPublicKey": "3qjJzeNxb1LGAK29USYTTeQeEoidsZ5Pw7TDfii92KAr", "proofs": [ "pwS4gcHuvKZ8NC5CvNoGAububBYiym8wQFjuw9Pg2LoCfDSFeRzN9enwPbs748g5Y7xeXnuAoPxSkUGHoaA9yS9" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAAdtaW5Wb3RlAAAAAAAAAAABAAAAAAdtYXhWb3RlAAAAAAAAAAADAAAAABJzdG9wQmxvY2tUaW1lc3RhbXAAAAABbWNvlMAAAAAAD3N1Ym1pdEtleVByZWZpeAIAAAAHc3VibWl0XwEAAAAMZ2V0U3VibWl0S2V5AAAAAQAAAA9jYWxsZXJQdWJsaWNLZXkJAAEsAAAAAgUAAAAPc3VibWl0S2V5UHJlZml4CQACWAAAAAEFAAAAD2NhbGxlclB1YmxpY0tleQAAAAEAAAADY3R4AQAAAAR2b3RlAAAAAQAAAAd0aGVWb3RlAwkAAGcAAAACCAUAAAAJbGFzdEJsb2NrAAAACXRpbWVzdGFtcAUAAAASc3RvcEJsb2NrVGltZXN0YW1wCQAAAgAAAAECAAAAOVZvdGluZyBpcyBvdmVyLCBzaW5jZSB0aGUgc3RvcCBibG9jayB0aW1lc3RhbXAgaXMgcmVhY2hlZAQAAAAPZGF0YUZyb21TdG9yYWdlCQAEGgAAAAIFAAAABHRoaXMJAAJYAAAAAQgFAAAAA2N0eAAAAA9jYWxsZXJQdWJsaWNLZXkDCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAAPZGF0YUZyb21TdG9yYWdlCQAAAgAAAAECAAAAN1lvdSBoYXZlIGFscmVhZHkgdm90ZWQhIER1cGxpY2F0ZSB2b3RlcyBhcmUgcHJvaGliaXRlZC4DAwkAAGYAAAACBQAAAAdtaW5Wb3RlBQAAAAd0aGVWb3RlBgkAAGYAAAACBQAAAAd0aGVWb3RlBQAAAAdtYXhWb3RlCQAAAgAAAAECAAAAFFZvdGUgaXMgb3V0IG9mIHJhbmdlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAMZ2V0U3VibWl0S2V5AAAAAQgFAAAAA2N0eAAAAA9jYWxsZXJQdWJsaWNLZXkFAAAAB3RoZVZvdGUFAAAAA25pbAAAAAEAAAABdAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAABdAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAWkFAAAAByRtYXRjaDAGCQAAAgAAAAECAAAAJlRoaXMgdHlwZSBvZiB0cmFuc2FjdGlvbiBpcyBwcm9oaWJpdGVkaEXz5w==", "chainId": 84, "height": 690419, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let minVote = 1 | |
5 | + | ||
6 | + | let maxVote = 3 | |
7 | + | ||
8 | + | let stopBlockTimestamp = 1569331320000 | |
9 | + | ||
10 | + | let submitKeyPrefix = "submit_" | |
11 | + | ||
12 | + | func getSubmitKey (callerPublicKey) = (submitKeyPrefix + toBase58String(callerPublicKey)) | |
13 | + | ||
14 | + | ||
15 | + | @Callable(ctx) | |
16 | + | func vote (theVote) = if ((lastBlock.timestamp >= stopBlockTimestamp)) | |
17 | + | then throw("Voting is over, since the stop block timestamp is reached") | |
18 | + | else { | |
19 | + | let dataFromStorage = getInteger(this, toBase58String(ctx.callerPublicKey)) | |
20 | + | if (isDefined(dataFromStorage)) | |
21 | + | then throw("You have already voted! Duplicate votes are prohibited.") | |
22 | + | else if (if ((minVote > theVote)) | |
23 | + | then true | |
24 | + | else (theVote > maxVote)) | |
25 | + | then throw("Vote is out of range") | |
26 | + | else WriteSet([DataEntry(getSubmitKey(ctx.callerPublicKey), theVote)]) | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | @Verifier(t) | |
31 | + | func verify () = match t { | |
32 | + | case i: InvokeScriptTransaction => | |
33 | + | true | |
34 | + | case _ => | |
35 | + | throw("This type of transaction is prohibited") | |
36 | + | } | |
37 | + |
github/deemru/w8io/026f985 19.34 ms ◑