tx · 5UtSetHduvm2WkQVDLwUYghJybjEbHThgwLxc8VP7GyD

3NCVp18FAUoyhqmpShGvFPUZ9GVXub79QqF:  -0.05000000 Waves

2021.09.29 16:58 [1724332] smart account 3NCVp18FAUoyhqmpShGvFPUZ9GVXub79QqF > SELF 0.00000000 Waves

{ "type": 13, "id": "5UtSetHduvm2WkQVDLwUYghJybjEbHThgwLxc8VP7GyD", "fee": 5000000, "feeAssetId": null, "timestamp": 1632923871373, "version": 2, "chainId": 84, "sender": "3NCVp18FAUoyhqmpShGvFPUZ9GVXub79QqF", "senderPublicKey": "4RrGWbA8e8thBzBtEHyrov2WBWdwDG5KA2ZG76cJbjX8", "proofs": [ "2NVhCe5xtYe3CBGXoeHwHScvhvsaZBvNFbyVvfN88MaH1AmSCjHXCM8gXdJgcrtcD7EPJqDgTqFgKxMF6iFB4Dn7" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAGAAAAAAtmcm9lQXNzZXRJZAEAAAAgSsv1ZJ09Ny43QbbnBS7IGxI8mddY9Mw8h+wjzyuSMzUAAAAABm9uZURheQAAAAAAAAAFoAAAAAAPZGF5c1ZvdGVJc1ZhbGlkCQAAaAAAAAIFAAAABm9uZURheQAAAAAAAAAABwAAAAAXZGF5c1ZvdGVJc1ZhbGlkSW5CbG9ja3MJAABkAAAAAgUAAAAPZGF5c1ZvdGVJc1ZhbGlkBQAAAAZoZWlnaHQAAAAACmdyYW5kVG90YWwJAAPwAAAAAgUAAAAEdGhpcwUAAAALZnJvZUFzc2V0SWQBAAAAD2NhbGN1bGF0ZVJld2FyZAAAAAEAAAAKcGVyY2VudGFnZQQAAAAQcGVyY2VudGFnZVJld2FyZAkAAGkAAAACBQAAAApwZXJjZW50YWdlAAAAAAAAAABkBAAAAAZyZXdhcmQJAABoAAAAAgUAAAAQcGVyY2VudGFnZVJld2FyZAUAAAAKZ3JhbmRUb3RhbAUAAAAGcmV3YXJkAAAAAgAAAAFpAQAAAARWb3RlAAAAAAQAAAADc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Zm9yIGVsaWdpYmxlIHdpdGhkcmF3YWxzAwkAAAAAAAACBQAAAA5jaGVja1ZhbGlkVm90ZQAAAAAAAAAAAAkAAAIAAAABAgAAABNObyBWYWxpZCBWb3RlIEZvdW5kCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkAAGQAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzCQABLAAAAAICAAAAEFZvdGVfQW1vdW50X0Zvcl8FAAAADkFkZHJlc3NPZlZvdGVyBQAAAAZyZXdhcmQFAAAAC2Zyb2VBc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleeXwnF0=", "height": 1724332, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F5xL3zwkzXmLdx9WQ2UieF8hU2R28oWL5KPyXRftGXyn Next: FtFqz9XSKVHy3ZeTAsmBRYgUmT821kUrkqCSB7LjsvUm Diff:
OldNewDifferences
1010 let daysVoteIsValidInBlocks = (daysVoteIsValid + height)
1111
1212 let grandTotal = assetBalance(this, froeAssetId)
13-
14-func initialWithDrawstate () = StringEntry("Withdraw_State", "DISABLED")
15-
16-
17-func votersCounter (index) = {
18- let initialIndex = index
19- initialIndex
20- }
21-
2213
2314 func calculateReward (percentage) = {
2415 let percentageReward = (percentage / 100)
5849 then throw((("Incorrect asset attached, please attach " + toBase58String(froeAssetId)) + " only."))
5950 else if ((10000 != pmt.amount))
6051 then throw("Exactly 1 Froe is need to make a vote")
61- else [StringEntry("Voter", AddressOfVoter), IntegerEntry(("Vote_Amount_For" + AddressOfVoter), pmt.amount), IntegerEntry("Vote_Index", (votersIndex + 1)), IntegerEntry("Voting_Reward", rewardValue)]
52+ else [StringEntry("Voter", AddressOfVoter), IntegerEntry(("Vote_Amount_For_" + AddressOfVoter), pmt.amount), IntegerEntry("Vote_Index", (votersIndex + 1))]
6253 }
6354
6455
6859 let checkWithDrawState = getStringValue("Withdraw_State")
6960 let AddressOfVoter = toBase58String(i.caller.bytes)
7061 let reward = calculateReward(81)
71- let checkValidVote = getIntegerValue(this, ("Vote_Amount_For" + AddressOfVoter))
62+ let checkValidVote = getIntegerValue(this, ("Vote_Amount_For_" + AddressOfVoter))
7263 if ((checkWithDrawState == "DISABLED"))
73- then throw("Withdrawal Is currently disabled. A minimum of 7 Days is need for eligible withdrawals")
64+ then throw("Withdrawal Is currently disabled. A minimum of 7 Days is needed for eligible withdrawals")
7465 else if ((checkValidVote == 0))
7566 then throw("No Valid Vote Found")
76- else [ScriptTransfer(i.caller, (getIntegerValue(this, ("Vote_Amount_For" + AddressOfVoter)) + reward), froeAssetId)]
67+ else [ScriptTransfer(i.caller, (getIntegerValue(this, ("Vote_Amount_For_" + AddressOfVoter)) + reward), froeAssetId)]
7768 }
7869
7970
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let froeAssetId = base58'62yYzfZL17bnZ2aPCuDoT1mfwick4PMHNooyAewfq8Sp'
55
66 let oneDay = 1440
77
88 let daysVoteIsValid = (oneDay * 7)
99
1010 let daysVoteIsValidInBlocks = (daysVoteIsValid + height)
1111
1212 let grandTotal = assetBalance(this, froeAssetId)
13-
14-func initialWithDrawstate () = StringEntry("Withdraw_State", "DISABLED")
15-
16-
17-func votersCounter (index) = {
18- let initialIndex = index
19- initialIndex
20- }
21-
2213
2314 func calculateReward (percentage) = {
2415 let percentageReward = (percentage / 100)
2516 let reward = (percentageReward * grandTotal)
2617 reward
2718 }
2819
2920
3021 @Callable(i)
3122 func Vote () = {
3223 let pmt = if ((size(i.payments) == 1))
3324 then i.payments[0]
3425 else throw("You need exactly one froe to make a vote")
3526 let AddressOfVoter = toBase58String(i.caller.bytes)
3627 let currentvalue = match getInteger(this, "Total_vote_amount") {
3728 case t: Int =>
3829 t
3930 case _ =>
4031 0
4132 }
4233 let checkVoter = match getInteger(this, ("Vote_Amount_For" + AddressOfVoter)) {
4334 case c: Int =>
4435 c
4536 case _ =>
4637 unit
4738 }
4839 let votersIndex = match getInteger(this, "Vote_Index") {
4940 case a: Int =>
5041 a
5142 case _ =>
5243 0
5344 }
5445 let rewardValue = calculateReward(81)
5546 if ((checkVoter != unit))
5647 then throw("You already Voted")
5748 else if ((pmt.assetId != froeAssetId))
5849 then throw((("Incorrect asset attached, please attach " + toBase58String(froeAssetId)) + " only."))
5950 else if ((10000 != pmt.amount))
6051 then throw("Exactly 1 Froe is need to make a vote")
61- else [StringEntry("Voter", AddressOfVoter), IntegerEntry(("Vote_Amount_For" + AddressOfVoter), pmt.amount), IntegerEntry("Vote_Index", (votersIndex + 1)), IntegerEntry("Voting_Reward", rewardValue)]
52+ else [StringEntry("Voter", AddressOfVoter), IntegerEntry(("Vote_Amount_For_" + AddressOfVoter), pmt.amount), IntegerEntry("Vote_Index", (votersIndex + 1))]
6253 }
6354
6455
6556
6657 @Callable(i)
6758 func Withdraw () = {
6859 let checkWithDrawState = getStringValue("Withdraw_State")
6960 let AddressOfVoter = toBase58String(i.caller.bytes)
7061 let reward = calculateReward(81)
71- let checkValidVote = getIntegerValue(this, ("Vote_Amount_For" + AddressOfVoter))
62+ let checkValidVote = getIntegerValue(this, ("Vote_Amount_For_" + AddressOfVoter))
7263 if ((checkWithDrawState == "DISABLED"))
73- then throw("Withdrawal Is currently disabled. A minimum of 7 Days is need for eligible withdrawals")
64+ then throw("Withdrawal Is currently disabled. A minimum of 7 Days is needed for eligible withdrawals")
7465 else if ((checkValidVote == 0))
7566 then throw("No Valid Vote Found")
76- else [ScriptTransfer(i.caller, (getIntegerValue(this, ("Vote_Amount_For" + AddressOfVoter)) + reward), froeAssetId)]
67+ else [ScriptTransfer(i.caller, (getIntegerValue(this, ("Vote_Amount_For_" + AddressOfVoter)) + reward), froeAssetId)]
7768 }
7869
7970
8071 @Verifier(tx)
8172 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
8273

github/deemru/w8io/026f985 
36.78 ms