tx · BYi7aKtP4M78oJGJTUgnU2EVASzfEgKarmQRwtqcRpsk 3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd: -0.01400000 Waves 2023.04.10 12:54 [2528325] smart account 3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd > SELF 0.00000000 Waves
{ "type": 13, "id": "BYi7aKtP4M78oJGJTUgnU2EVASzfEgKarmQRwtqcRpsk", "fee": 1400000, "feeAssetId": null, "timestamp": 1681120464321, "version": 2, "chainId": 84, "sender": "3N8dYK8BQhY7z1yKFRFhdw4m9b4JjsNQJVd", "senderPublicKey": "AK6rRKpHobxNveEtJE5BBXbdwm9BpGL7ewP9Xb6VYuHx", "proofs": [ "4WH5VBJ7WuSveBDpDJEgomTzTk3LWExMcK2mHRmvHuXALyCFYBqHkJzfWYirdhFfvrXi6aRB8jpCev2MARFm7oxb" ], "script": "base64:AAIEAAAAAAAAABMIAhIFCgMIAQESAwoBARIDCgEIAAAACQAAAAADQTRBAQAAACAIZYS3D/CKahrz4mjoLgiQJMPTJ1gDzSz2Ll4L39oVpAAAAAAOQTRBU3Rha2luZ0RBcHAJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNONm9XTHlRWTJnTTdRVWtVdkJtZTFSRW5BNmQxVjd5M0FUAAAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AQAAACAbvUu+h+2As3kugOhMQC3bvgebie3kDmlbUlrvLFQPbQAAAAASY29udHJvbGxlcl9hZGRyZXNzCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAACJ2b3RpbmdfdGltZXN0YW1wX2NvbnRyb2xsZXJfcHVia2V5AAAAAAxsYXVuY2hfZXJyb3ICAAAAJERhcHAgd2lsbCBzdGFydCBWb3RpbmcgYXQgVGltZXN0YW1wIAAAAAADbXNnAgAAAC48aDE+WW91ciBWb3RlIFN1Ym1pdHRlZCBTdWNjZXNzZnVsbHkhPC9oM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AAACBQAAAAxsYXVuY2hfZXJyb3IJAAGkAAAAAQUAAAAHU3RhcnRUUwMJAABmAAAAAggFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAFAAAABUVuZFRTCQAAAgAAAAEFAAAAB3ZvdGVFcnIJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgIAAAAMVG90YWxfVm90ZXNfCQABpAAAAAEFAAAAC1BvcnBvc2FsX0lEBQAAAAp0b3RhbHZvdGVzCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAZUb3RhbF8FAAAAB1ZvdGVBc3QCAAAAAV8JAAGkAAAAAQUAAAALUG9ycG9zYWxfSUQFAAAABEFUVk8JAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgIAAAAHbWVzc2FnZQUAAAADbXNnBQAAAANuaWwAAAABaQEAAAAJRGVsZXRlS2V5AAAAAQAAAANLZXkJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADS2V5BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQUtWFc=", "height": 2528325, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4mURRdRKD3Gxue5WLY1F6SfTYpnkwqFDX3nWWX53xjER Next: 9FKQRXUF7i4uhctiwPRYUJDAVpT2GZxxEvUxq9HYhk6r Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let A4A = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
5 | 5 | ||
6 | - | let A4AStakingDApp = addressFromStringValue(" | |
6 | + | let A4AStakingDApp = addressFromStringValue("3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT") | |
7 | 7 | ||
8 | 8 | let voting_timestamp_controller_pubkey = base58'2sHRUrJCMpDhAQEcN7Zhk3LqnD9zizebpxeQXpPoscQU' | |
9 | 9 | ||
46 | 46 | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
47 | 47 | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
48 | 48 | let pubkey = toBase58String(i.caller.bytes) | |
49 | - | let readA4AStakingAmount = valueOrErrorMessage( | |
49 | + | let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.") | |
50 | 50 | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
51 | 51 | case a: Int => | |
52 | 52 | a |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let A4A = base58'Zn3cLHW7aAVPm5aACcTjvg7e7iEy2cKDtbowok5qa9H' | |
5 | 5 | ||
6 | - | let A4AStakingDApp = addressFromStringValue(" | |
6 | + | let A4AStakingDApp = addressFromStringValue("3N6oWLyQY2gM7QUkUvBme1REnA6d1V7y3AT") | |
7 | 7 | ||
8 | 8 | let voting_timestamp_controller_pubkey = base58'2sHRUrJCMpDhAQEcN7Zhk3LqnD9zizebpxeQXpPoscQU' | |
9 | 9 | ||
10 | 10 | let controller_address = addressFromPublicKey(voting_timestamp_controller_pubkey) | |
11 | 11 | ||
12 | 12 | let launch_error = "Dapp will start Voting at Timestamp " | |
13 | 13 | ||
14 | 14 | let msg = "<h1>Your Vote Submitted Successfully!</h1><br>" | |
15 | 15 | ||
16 | 16 | let pymterror = "DApp Need 0.00000001 A4A Token as Attach payment[1]." | |
17 | 17 | ||
18 | 18 | let asseterr = (("Incorrect asset attach, please attach " + toBase58String(A4A)) + " AssetID Only.") | |
19 | 19 | ||
20 | 20 | let voteErr = "Voting is Over for this Dapp." | |
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func SetVotingTimeStamps (Proposal,Voting_Start_TimeStamp,Voting_End_TimeStamp) = { | |
24 | 24 | let StartTS = Voting_Start_TimeStamp | |
25 | 25 | let EndTS = Voting_End_TimeStamp | |
26 | 26 | let pubkey = toBase58String(i.caller.bytes) | |
27 | 27 | let Previoustotalproposals = match getInteger(this, "Total_Proposals") { | |
28 | 28 | case a: Int => | |
29 | 29 | a | |
30 | 30 | case _ => | |
31 | 31 | 0 | |
32 | 32 | } | |
33 | 33 | let totalproposals = (Previoustotalproposals + 1) | |
34 | 34 | if ((size(Proposal) > 5100)) | |
35 | 35 | then throw("Subject Char Limits are Over. Reduce length less than 5100 Char.") | |
36 | 36 | else if ((i.caller != controller_address)) | |
37 | 37 | then throw((("This Address is not Authorized. Only " + toString(controller_address)) + " is Authorized Address to Sign it.")) | |
38 | 38 | else [StringEntry(("Proposal_Text_" + toString(totalproposals)), Proposal), IntegerEntry("Total_Proposals", totalproposals), StringEntry(("Proposer_" + toString(totalproposals)), pubkey), IntegerEntry(("Voting_Start_TimeStamp_" + toString(totalproposals)), StartTS), IntegerEntry(("Voting_End_TimeStamp_" + toString(totalproposals)), EndTS)] | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func Yes (Porposal_ID) = { | |
45 | 45 | let VoteAst = "Yes" | |
46 | 46 | let StartTS = getIntegerValue(this, ("Voting_Start_TimeStamp_" + toString(Porposal_ID))) | |
47 | 47 | let EndTS = getIntegerValue(this, ("Voting_End_TimeStamp_" + toString(Porposal_ID))) | |
48 | 48 | let pubkey = toBase58String(i.caller.bytes) | |
49 | - | let readA4AStakingAmount = valueOrErrorMessage( | |
49 | + | let readA4AStakingAmount = valueOrErrorMessage(getInteger(A4AStakingDApp, ("Deposit_Amount_Of_" + pubkey)), "Address not found in A4A Staking.") | |
50 | 50 | let Previoustotalvotes = match getInteger(this, ("Total_Votes_" + toString(Porposal_ID))) { | |
51 | 51 | case a: Int => | |
52 | 52 | a | |
53 | 53 | case _ => | |
54 | 54 | 0 | |
55 | 55 | } | |
56 | 56 | let totalvotes = (Previoustotalvotes + readA4AStakingAmount) | |
57 | 57 | let FTVO = match getInteger(this, ((("Total_" + VoteAst) + "_") + toString(Porposal_ID))) { | |
58 | 58 | case a: Int => | |
59 | 59 | a | |
60 | 60 | case _ => | |
61 | 61 | 0 | |
62 | 62 | } | |
63 | 63 | let ATVO = (FTVO + readA4AStakingAmount) | |
64 | 64 | if ((StartTS > lastBlock.timestamp)) | |
65 | 65 | then throw((launch_error + toString(StartTS))) | |
66 | 66 | else if ((lastBlock.timestamp > EndTS)) | |
67 | 67 | then throw(voteErr) | |
68 | 68 | else [IntegerEntry(("Total_Votes_" + toString(Porposal_ID)), totalvotes), IntegerEntry(((("Total_" + VoteAst) + "_") + toString(Porposal_ID)), ATVO), StringEntry("message", msg)] | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | ||
72 | 72 | ||
73 | 73 | @Callable(i) | |
74 | 74 | func DeleteKey (Key) = [DeleteEntry(Key)] | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Verifier(tx) | |
78 | 78 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
79 | 79 |
github/deemru/w8io/026f985 29.68 ms ◑