tx · DyeEnGvQ9VF7asVeY3wWvAuTENpD9D2JcKqepC3MopT3

3N86AryjXNvAuNs3mV9xKPTjXnAYQimiHDF:  -0.01000000 Waves

2023.09.18 17:06 [2760926] smart account 3N86AryjXNvAuNs3mV9xKPTjXnAYQimiHDF > SELF 0.00000000 Waves

{ "type": 13, "id": "DyeEnGvQ9VF7asVeY3wWvAuTENpD9D2JcKqepC3MopT3", "fee": 1000000, "feeAssetId": null, "timestamp": 1695046024662, "version": 2, "chainId": 84, "sender": "3N86AryjXNvAuNs3mV9xKPTjXnAYQimiHDF", "senderPublicKey": "7Zo8C4qkZishvcPg5SUixQPySKeM49Jeui21Tih7iPr9", "proofs": [ "2Qf6BS1js7wXoMTexMMAg3EC2SVzmmJTyTMUeQhQJ3tjGjfTBSxyuFmCHnAR7J9Rm3g5unqaTpzUsozUWDueJbUd" ], "script": "base64:BgIbCAISABIDCgEBEgQKAgICEgQKAggIEgQKAgEEGAADU0VQAgJfXwAPcmVwdXRhdGlvbkFzc2V0ASBp6x+DcpBVAG0dTZ5QIAuA7CaS8wuiEOK6KQOBSERbTgAMcHJvcG9zYWxUaW1lCQBoAgkAaAIJAGgCCQBoAgDoBwA8ADwAGAADAQtwcm9wb3NhbEtleQECaWQJALkJAgkAzAgCAgFwCQDMCAIJAKQDAQUCaWQFA25pbAUDU0VQAQtzZXRQcm9wb3NhbAcCaWQHY3JlYXRvcgV0aXRsZQR0ZXh0EXRpbWVzdGFtcENyZWF0aW9uDWNvdW50Vm90ZXNGb3IRQ291bnRWb3Rlc0FnYWluc3QJAQtTdHJpbmdFbnRyeQIJAQtwcm9wb3NhbEtleQEFAmlkCQC5CQIJAMwIAgkA3AQBCAUHY3JlYXRvcgVieXRlcwkAzAgCBQV0aXRsZQkAzAgCBQR0ZXh0CQDMCAIJAKQDAQURdGltZXN0YW1wQ3JlYXRpb24JAMwIAgkApAMBBQ1jb3VudFZvdGVzRm9yCQDMCAIJAKQDAQURQ291bnRWb3Rlc0FnYWluc3QF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V5AggIBQFpBmNhbGxlcgVieXRlcwUCaWQFBHZvdGUJAMwIAgkBDEludGVnZXJFbnRyeQIJARh1c2VyUHJvcG9zYWxWb3RlUG93ZXJLZXkCCAgFAWkGY2FsbGVyBWJ5dGVzBQJpZAkBFmJhbGFuY2VSZXB1dGF0aW9uQXNzZXQBCAgFAWkGY2FsbGVyBWJ5dGVzBQNuaWwJAMwIAgkBDEludGVnZXJFbnRyeQIJARxwcm9wb3NhbENvdW50Vm90ZXNBZ2FpbnN0S2V5AQUCaWQJAGQCCQERY291bnRWb3Rlc0FnYWluc3QBBQJpZAkBFmJhbGFuY2VSZXB1dGF0aW9uQXNzZXQBCAgFAWkGY2FsbGVyBWJ5dGVzCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQESdW5sb2NrVGltZXN0YW1wS2V5AQgIBQFpBmNhbGxlcgVieXRlcwUKdW5sb2NrVGltZQkAzAgCCQEMQm9vbGVhbkVudHJ5AgkBE3VzZXJQcm9wb3NhbFZvdGVLZXkCCAgFAWkGY2FsbGVyBWJ5dGVzBQJpZAUEdm90ZQkAzAgCCQEMSW50ZWdlckVudHJ5AgkBGHVzZXJQcm9wb3NhbFZvdGVQb3dlcktleQIICAUBaQZjYWxsZXIFYnl0ZXMFAmlkCQEWYmFsYW5jZVJlcHV0YXRpb25Bc3NldAEICAUBaQZjYWxsZXIFYnl0ZXMFA25pbAkAAgECEHByb3Bvc2FsTm90QWxpdmUBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5H7keHw==", "height": 2760926, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3b6YjoVMye43yA3vMbLB12odXsBhdWNVAD7fze31aWNR Next: 3qRuZm73k9JML2bntUPa6WPBXHhYd51VoCJRFCuZ6iDj Diff:
OldNewDifferences
1010 func proposalKey (id) = makeString(["p", toString(id)], SEP)
1111
1212
13-func setProposal (id,creator,title,text,timestampCreation,countVotesFor,CountVotesAgainst) = StringEntry(proposalKey(id), makeString([toBase58String(creator.bytes), title, text, toString(timestampCreation), toString(countVotesFor), toString(CountVotesAgainst)], SEP))
13+func setProposal (id,creator,title,text,timestampCreation,countVotesFor,CountVotesAgainst) = StringEntry(proposalKey(id), makeString([toBase16String(creator.bytes), title, text, toString(timestampCreation), toString(countVotesFor), toString(CountVotesAgainst)], SEP))
1414
1515
1616 func getProposal (id) = {
2020 case _ =>
2121 throw("proposal not found")
2222 }, SEP)
23- $Tuple6(fromBase58String(savedString[0]), savedString[1], savedString[2], parseInt(savedString[3]), parseInt(savedString[4]), parseInt(savedString[5]))
23+ $Tuple6(fromBase16String(savedString[0]), savedString[1], savedString[2], parseInt(savedString[3]), parseInt(savedString[4]), parseInt(savedString[5]))
2424 }
2525
2626
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let reputationAsset = base58'88Tkdpqchhiqc9tNNG3SWQ2gfhZB4rBJKhMNS5Xmxhqw'
77
88 let proposalTime = ((((1000 * 60) * 60) * 24) * 3)
99
1010 func proposalKey (id) = makeString(["p", toString(id)], SEP)
1111
1212
13-func setProposal (id,creator,title,text,timestampCreation,countVotesFor,CountVotesAgainst) = StringEntry(proposalKey(id), makeString([toBase58String(creator.bytes), title, text, toString(timestampCreation), toString(countVotesFor), toString(CountVotesAgainst)], SEP))
13+func setProposal (id,creator,title,text,timestampCreation,countVotesFor,CountVotesAgainst) = StringEntry(proposalKey(id), makeString([toBase16String(creator.bytes), title, text, toString(timestampCreation), toString(countVotesFor), toString(CountVotesAgainst)], SEP))
1414
1515
1616 func getProposal (id) = {
1717 let savedString = split( match getString(this, proposalKey(id)) {
1818 case s: String =>
1919 s
2020 case _ =>
2121 throw("proposal not found")
2222 }, SEP)
23- $Tuple6(fromBase58String(savedString[0]), savedString[1], savedString[2], parseInt(savedString[3]), parseInt(savedString[4]), parseInt(savedString[5]))
23+ $Tuple6(fromBase16String(savedString[0]), savedString[1], savedString[2], parseInt(savedString[3]), parseInt(savedString[4]), parseInt(savedString[5]))
2424 }
2525
2626
2727 func unlockTimestampKey (address) = makeString(["ut", toBase58String(address)], SEP)
2828
2929
3030 func countProposalsKey () = "cp"
3131
3232
3333 func proposalTitleKey (id) = makeString(["pti", toString(id)], SEP)
3434
3535
3636 func proposalTextKey (id) = makeString(["pte", toString(id)], SEP)
3737
3838
3939 func proposalTimestampCreationKey (id) = makeString(["ptc", toString(id)], SEP)
4040
4141
4242 func proposalCountVotesForKey (id) = makeString(["pcvf", toString(id)], SEP)
4343
4444
4545 func proposalCountVotesAgainstKey (id) = makeString(["pcva", toString(id)], SEP)
4646
4747
4848 func userProposalVoteKey (address,id) = makeString(["upv", toString(id), toBase58String(address)], SEP)
4949
5050
5151 func userProposalVotePowerKey (address,id) = makeString(["upvp", toString(id), toBase58String(address)], SEP)
5252
5353
5454 func pmtReputationAsset (i) = if ((size(i.payments) == 1))
5555 then if ((i.payments[0].assetId == reputationAsset))
5656 then true
5757 else throw("only reputation assets")
5858 else throw("only 1 payment")
5959
6060
6161 func getUnlockTimestamp (address) = match getInteger(this, unlockTimestampKey(address)) {
6262 case a: Int =>
6363 a
6464 case _ =>
6565 0
6666 }
6767
6868
6969 func countProposals () = match getInteger(this, countProposalsKey()) {
7070 case a: Int =>
7171 a
7272 case _ =>
7373 0
7474 }
7575
7676
7777 func countVotesFor (id) = match getInteger(this, proposalCountVotesForKey(id)) {
7878 case a: Int =>
7979 a
8080 case _ =>
8181 0
8282 }
8383
8484
8585 func countVotesAgainst (id) = match getInteger(this, proposalCountVotesAgainstKey(id)) {
8686 case a: Int =>
8787 a
8888 case _ =>
8989 0
9090 }
9191
9292
9393 func countVotesUser (address,id) = match getInteger(this, userProposalVotePowerKey(address, id)) {
9494 case a: Int =>
9595 a
9696 case _ =>
9797 0
9898 }
9999
100100
101101 func balanceReputationAsset (address) = match getInteger(this, toBase58String(address)) {
102102 case a: Int =>
103103 a
104104 case _ =>
105105 0
106106 }
107107
108108
109109 func proposalTimestampCreation (id) = match getInteger(this, proposalTimestampCreationKey(id)) {
110110 case a: Int =>
111111 a
112112 case _ =>
113113 throw("proposal not created")
114114 }
115115
116116
117117 func isProposalAlive (id) = if (if ((countProposals() > id))
118118 then ((proposalTimestampCreation(id) + proposalTime) > lastBlock.timestamp)
119119 else false)
120120 then true
121121 else throw("proposalNotAlive")
122122
123123
124124 @Callable(i)
125125 func deposit () = {
126126 let checks = [pmtReputationAsset(i)]
127127 if ((checks == checks))
128128 then {
129129 let currentKey = toBase58String(i.caller.bytes)
130130 let currentAmount = balanceReputationAsset(i.caller.bytes)
131131 let newAmount = (currentAmount + i.payments[0].amount)
132132 [IntegerEntry(currentKey, newAmount)]
133133 }
134134 else throw("onlyReputationAsset")
135135 }
136136
137137
138138
139139 @Callable(i)
140140 func withdraw (amount) = {
141141 let currentKey = toBase58String(i.caller.bytes)
142142 let currentAmount = match getInteger(this, currentKey) {
143143 case a: Int =>
144144 a
145145 case _ =>
146146 0
147147 }
148148 let newAmount = (currentAmount - amount)
149149 if ((0 > amount))
150150 then throw("Can't withdraw negative amount")
151151 else if ((getUnlockTimestamp(i.caller.bytes) > lastBlock.timestamp))
152152 then throw("Locked")
153153 else if ((0 > newAmount))
154154 then throw("Not enough balance")
155155 else [IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, reputationAsset)]
156156 }
157157
158158
159159
160160 @Callable(i)
161161 func createProposalNew (title,text) = {
162162 let count = countProposals()
163163 [setProposal(count, i.caller, toBase16String(title), toBase16String(text), lastBlock.timestamp, 0, 0)]
164164 }
165165
166166
167167
168168 @Callable(i)
169169 func createProposal (title,text) = {
170170 let count = countProposals()
171171 [StringEntry(proposalTitleKey(count), title), StringEntry(proposalTextKey(count), text), IntegerEntry(proposalTimestampCreationKey(count), lastBlock.timestamp), IntegerEntry(countProposalsKey(), (count + 1))]
172172 }
173173
174174
175175
176176 @Callable(i)
177177 func vote (id,vote) = if (isProposalAlive(id))
178178 then {
179179 let unlockTime = max([(proposalTimestampCreation(id) + proposalTime), getUnlockTimestamp(i.caller.bytes)])
180180 let u = match getBoolean(this, userProposalVoteKey(i.caller.bytes, id)) {
181181 case a: Boolean =>
182182 if (a)
183183 then IntegerEntry(proposalCountVotesForKey(id), (countVotesFor(id) - countVotesUser(i.caller.bytes, id)))
184184 else IntegerEntry(proposalCountVotesAgainstKey(id), (countVotesFor(id) - countVotesUser(i.caller.bytes, id)))
185185 case _ =>
186186 unit
187187 }
188188 if ((vote == true))
189189 then [IntegerEntry(proposalCountVotesForKey(id), (countVotesFor(id) + balanceReputationAsset(i.caller.bytes))), IntegerEntry(unlockTimestampKey(i.caller.bytes), unlockTime), BooleanEntry(userProposalVoteKey(i.caller.bytes, id), vote), IntegerEntry(userProposalVotePowerKey(i.caller.bytes, id), balanceReputationAsset(i.caller.bytes))]
190190 else [IntegerEntry(proposalCountVotesAgainstKey(id), (countVotesAgainst(id) + balanceReputationAsset(i.caller.bytes))), IntegerEntry(unlockTimestampKey(i.caller.bytes), unlockTime), BooleanEntry(userProposalVoteKey(i.caller.bytes, id), vote), IntegerEntry(userProposalVotePowerKey(i.caller.bytes, id), balanceReputationAsset(i.caller.bytes))]
191191 }
192192 else throw("proposalNotAlive")
193193
194194
195195 @Verifier(tx)
196196 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
197197

github/deemru/w8io/026f985 
31.90 ms