tx · 8Z8WHoZXjWQ7338p2LtYh8DNKJrfo34TQAqfsgcRB3Ve
3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr: -0.01400000 Waves
2023.03.13 13:03 [2488109] smart account 3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr > SELF 0.00000000 Waves
{
"type": 13,
"id": "8Z8WHoZXjWQ7338p2LtYh8DNKJrfo34TQAqfsgcRB3Ve",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1678701852628,
"version": 2,
"chainId": 84,
"sender": "3NBLecFWuYaQuc56Nt6nZm8jdPt9f8vfyFr",
"senderPublicKey": "GV3FbBXZru1WpaCa9x1zhwSWrXSDrxKMVEV7BML6EzY1",
"proofs": [
"5F2XhtnoFHzvUXkE5yVshFzAJb7ByhA9inke1aum8Dbfxnq6dTvNoKcPm5Jsr8wjAcPu7v2561AWbeP9b5ZP2zEE"
],
"script": "base64:AAIEAAAAAAAAAAoIAhIECgIBARIAAAAADQAAAAAidm90aW5nX3RpbWVzdGFtcF9jb250cm9sbGVyX3B1YmtleQEAAAAg5g4cxIx/mBTW7Lp5wRrLBngjYDPW920p4vT6l2ZrPEIAAAAAEmNvbnRyb2xsZXJfYWRkcmVzcwkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQUAAAAidm90aW5nX3RpbWVzdGFtcF9jb250cm9sbGVyX3B1YmtleQAAAAAEVk9URQEAAAAgCGWEtw/wimoa8+Jo6C4IkCTD0ydYA80s9i5eC9/aFaQAAAAADGxhdW5jaF9lcnJvcgIAAAAkRGFwcCB3aWxsIHN0YXJ0IFZvdGluZyBhdCBUaW1lc3RhbXAgAAAAAANtc2cCAAAALTxoMT5Zb3UgVm90ZSBTdWJtaXR0ZWQgU3VjY2Vzc2Z1bGx5ITwvaDE+PGJyPgAAAAAJcHltdGVycm9yAgAAACxEQXBwIE5lZWQgMSBWT1RFIFRva2VuIGFzIEF0dGFjaCBwYXltZW50WzFdLgAAAAALbWluYmFsZXJy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kABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAAdtZXNzYWdlBQAAAANtc2cFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5aTI/Tw==",
"height": 2488109,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 2X9nmjTMtSMHrKJ7MYWetJn6NXHp5JMzdeUBcoZYq5Cz
Next: BdWYegBiBToeTDAm8ubNLjSwNNCsD8EcYHQJjtEykGW8
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let voting_timestamp_controller_pubkey = base58'GV3FbBXZru1WpaCa9x1zhwSWrXSDrxKMVEV7BML6EzY1' |
---|
| 5 | + | |
---|
| 6 | + | let controller_address = addressFromPublicKey(voting_timestamp_controller_pubkey) |
---|
| 7 | + | |
---|
4 | 8 | | let VOTE = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' |
---|
5 | 9 | | |
---|
6 | | - | let StartTS = 1679270400000 |
---|
7 | | - | |
---|
8 | | - | let EndTS = 1680566400000 |
---|
9 | | - | |
---|
10 | | - | let launch_error = ("Dapp will start Voting at Timestamp " + toString(StartTS)) |
---|
| 10 | + | let launch_error = "Dapp will start Voting at Timestamp " |
---|
11 | 11 | | |
---|
12 | 12 | | let msg = "<h1>You Vote Submitted Successfully!</h1><br>" |
---|
13 | 13 | | |
---|
|
33 | 33 | | let totalvotes = (Previoustotalvotes + 1) |
---|
34 | 34 | | |
---|
35 | 35 | | @Callable(i) |
---|
| 36 | + | func SetVotingTimeStamps (Voting_Start_TimeStamp,Voting_End_TimeStamp) = { |
---|
| 37 | + | let StartTS = Voting_Start_TimeStamp |
---|
| 38 | + | let EndTS = Voting_End_TimeStamp |
---|
| 39 | + | if ((i.caller != controller_address)) |
---|
| 40 | + | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) |
---|
| 41 | + | else [IntegerEntry("Voting_Start_TimeStamp", StartTS), IntegerEntry("Voting_End_TimeStamp", EndTS)] |
---|
| 42 | + | } |
---|
| 43 | + | |
---|
| 44 | + | |
---|
| 45 | + | |
---|
| 46 | + | @Callable(i) |
---|
36 | 47 | | func Option1 () = { |
---|
37 | 48 | | let VoteAst = "OPTION_1" |
---|
| 49 | + | let StartTS = getIntegerValue(this, "Voting_Start_TimeStamp") |
---|
| 50 | + | let EndTS = getIntegerValue(this, "Voting_End_TimeStamp") |
---|
| 51 | + | let pubkey = toBase58String(i.caller.bytes) |
---|
38 | 52 | | let pmt = if ((size(i.payments) == 1)) |
---|
39 | 53 | | then i.payments[0] |
---|
40 | 54 | | else throw(pymterror) |
---|
41 | | - | let pubkey = toBase58String(i.caller.bytes) |
---|
42 | 55 | | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) |
---|
43 | 56 | | let Previous_User_total_Votes = match getInteger(this, ("User_Total_Votes_" + pubkey)) { |
---|
44 | 57 | | case a: Int => |
---|
|
69 | 82 | | } |
---|
70 | 83 | | let ATVO = (FTVO + 1) |
---|
71 | 84 | | if ((StartTS > lastBlock.timestamp)) |
---|
72 | | - | then throw(launch_error) |
---|
| 85 | + | then throw((launch_error + toString(StartTS))) |
---|
73 | 86 | | else if ((1 > assetbal)) |
---|
74 | 87 | | then throw(minbalerror) |
---|
75 | 88 | | else if ((pmt.assetId != VOTE)) |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
| 4 | + | let voting_timestamp_controller_pubkey = base58'GV3FbBXZru1WpaCa9x1zhwSWrXSDrxKMVEV7BML6EzY1' |
---|
| 5 | + | |
---|
| 6 | + | let controller_address = addressFromPublicKey(voting_timestamp_controller_pubkey) |
---|
| 7 | + | |
---|
4 | 8 | | let VOTE = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' |
---|
5 | 9 | | |
---|
6 | | - | let StartTS = 1679270400000 |
---|
7 | | - | |
---|
8 | | - | let EndTS = 1680566400000 |
---|
9 | | - | |
---|
10 | | - | let launch_error = ("Dapp will start Voting at Timestamp " + toString(StartTS)) |
---|
| 10 | + | let launch_error = "Dapp will start Voting at Timestamp " |
---|
11 | 11 | | |
---|
12 | 12 | | let msg = "<h1>You Vote Submitted Successfully!</h1><br>" |
---|
13 | 13 | | |
---|
14 | 14 | | let pymterror = "DApp Need 1 VOTE Token as Attach payment[1]." |
---|
15 | 15 | | |
---|
16 | 16 | | let minbalerror = "Min. 1 VOTE required on Your Address to Vote. Please Mint or hold min. 1 VOTE on this Address." |
---|
17 | 17 | | |
---|
18 | 18 | | let asseterr = (("Incorrect asset attach, please attach " + toBase58String(VOTE)) + " AssetID Only.") |
---|
19 | 19 | | |
---|
20 | 20 | | let minamterr = "Please Attach Exact 1 VOTE To Vote." |
---|
21 | 21 | | |
---|
22 | 22 | | let voteErr = "Voting is Over for this Dapp." |
---|
23 | 23 | | |
---|
24 | 24 | | let AlreadyVotedErr = "You have Already Voted from this address." |
---|
25 | 25 | | |
---|
26 | 26 | | let Previoustotalvotes = match getInteger(this, "Total_Votes") { |
---|
27 | 27 | | case a: Int => |
---|
28 | 28 | | a |
---|
29 | 29 | | case _ => |
---|
30 | 30 | | 0 |
---|
31 | 31 | | } |
---|
32 | 32 | | |
---|
33 | 33 | | let totalvotes = (Previoustotalvotes + 1) |
---|
34 | 34 | | |
---|
35 | 35 | | @Callable(i) |
---|
| 36 | + | func SetVotingTimeStamps (Voting_Start_TimeStamp,Voting_End_TimeStamp) = { |
---|
| 37 | + | let StartTS = Voting_Start_TimeStamp |
---|
| 38 | + | let EndTS = Voting_End_TimeStamp |
---|
| 39 | + | if ((i.caller != controller_address)) |
---|
| 40 | + | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) |
---|
| 41 | + | else [IntegerEntry("Voting_Start_TimeStamp", StartTS), IntegerEntry("Voting_End_TimeStamp", EndTS)] |
---|
| 42 | + | } |
---|
| 43 | + | |
---|
| 44 | + | |
---|
| 45 | + | |
---|
| 46 | + | @Callable(i) |
---|
36 | 47 | | func Option1 () = { |
---|
37 | 48 | | let VoteAst = "OPTION_1" |
---|
| 49 | + | let StartTS = getIntegerValue(this, "Voting_Start_TimeStamp") |
---|
| 50 | + | let EndTS = getIntegerValue(this, "Voting_End_TimeStamp") |
---|
| 51 | + | let pubkey = toBase58String(i.caller.bytes) |
---|
38 | 52 | | let pmt = if ((size(i.payments) == 1)) |
---|
39 | 53 | | then i.payments[0] |
---|
40 | 54 | | else throw(pymterror) |
---|
41 | | - | let pubkey = toBase58String(i.caller.bytes) |
---|
42 | 55 | | let assetbal = assetBalance(addressFromPublicKey(i.callerPublicKey), VOTE) |
---|
43 | 56 | | let Previous_User_total_Votes = match getInteger(this, ("User_Total_Votes_" + pubkey)) { |
---|
44 | 57 | | case a: Int => |
---|
45 | 58 | | a |
---|
46 | 59 | | case _ => |
---|
47 | 60 | | 0 |
---|
48 | 61 | | } |
---|
49 | 62 | | let User_total_Votes = (Previous_User_total_Votes + 1) |
---|
50 | 63 | | let UWVFA = match getInteger(this, ((("User_Total_Votes_" + pubkey) + "-") + VoteAst)) { |
---|
51 | 64 | | case a: Int => |
---|
52 | 65 | | a |
---|
53 | 66 | | case _ => |
---|
54 | 67 | | 0 |
---|
55 | 68 | | } |
---|
56 | 69 | | let UTWVFA = (UWVFA + 1) |
---|
57 | 70 | | let FUVFA = match getInteger(this, ((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst)) { |
---|
58 | 71 | | case a: Int => |
---|
59 | 72 | | a |
---|
60 | 73 | | case _ => |
---|
61 | 74 | | 0 |
---|
62 | 75 | | } |
---|
63 | 76 | | let UTVFA = (FUVFA + 1) |
---|
64 | 77 | | let FTVO = match getInteger(this, ("Total_Votes_" + VoteAst)) { |
---|
65 | 78 | | case a: Int => |
---|
66 | 79 | | a |
---|
67 | 80 | | case _ => |
---|
68 | 81 | | 0 |
---|
69 | 82 | | } |
---|
70 | 83 | | let ATVO = (FTVO + 1) |
---|
71 | 84 | | if ((StartTS > lastBlock.timestamp)) |
---|
72 | | - | then throw(launch_error) |
---|
| 85 | + | then throw((launch_error + toString(StartTS))) |
---|
73 | 86 | | else if ((1 > assetbal)) |
---|
74 | 87 | | then throw(minbalerror) |
---|
75 | 88 | | else if ((pmt.assetId != VOTE)) |
---|
76 | 89 | | then throw(asseterr) |
---|
77 | 90 | | else if ((pmt.amount != 1)) |
---|
78 | 91 | | then throw(minamterr) |
---|
79 | 92 | | else if ((User_total_Votes > 1)) |
---|
80 | 93 | | then throw(AlreadyVotedErr) |
---|
81 | 94 | | else if ((EndTS > lastBlock.timestamp)) |
---|
82 | 95 | | then throw(voteErr) |
---|
83 | 96 | | else [IntegerEntry("Total_Votes", totalvotes), IntegerEntry(("Total_Votes_" + VoteAst), ATVO), IntegerEntry(("User_Total_Votes_" + pubkey), User_total_Votes), IntegerEntry(((("User_Total_Votes_" + pubkey) + "-") + VoteAst), UTWVFA), IntegerEntry(((("User_Total_Asset_Votes_" + pubkey) + "_") + VoteAst), UTVFA), StringEntry("message", msg)] |
---|
84 | 97 | | } |
---|
85 | 98 | | |
---|
86 | 99 | | |
---|
87 | 100 | | @Verifier(tx) |
---|
88 | 101 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
89 | 102 | | |
---|