tx · BqwA3gysyomn4rrLYkCKid1C7X3JRkcMrqhYBsRYFNBh

3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6:  -0.01500000 Waves

2021.04.21 13:50 [1492112] smart account 3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6 > SELF 0.00000000 Waves

{ "type": 13, "id": "BqwA3gysyomn4rrLYkCKid1C7X3JRkcMrqhYBsRYFNBh", "fee": 1500000, "feeAssetId": null, "timestamp": 1619002188453, "version": 2, "chainId": 84, "sender": "3N8DijjUMpYq512vvE9GHnCTUBUd4AZwhH6", "senderPublicKey": "75SuvmjmHX6J7smVGHvWY6acr5mqyRQCYpFxeFQh8Cy3", "proofs": [ "4zX6EqGtMfczaV4Z5HetLNYwxv7dMGyjWpd3KbBHfjsXCKXqafi5rXhAbTjdSs3q9Hzqvb6q7CY3r26Q41xguwLq" ], "script": "base64:AAIEAAAAAAAAABsIAhIAEgQKAggIEgUKAwEEARIECgIBCBIAEgAAAAAbAAAAAAd2ZXJzaW9uAgAAAAUxLjAuMAAAAAAKa2V5VmVyc2lvbgIAAAAHdmVyc2lvbgAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAAEWtleU51bWJlck9mVm90aW5nAgAAAA1udW1iZXJfdm90aW5nAAAAAA9rZXlIZWlnaHRPZlBvb2wCAAAAB19oZWlnaHQAAAAABWtleU5vAgAAAANfbm8AAAAABmtleVllcwIAAAAEX3llcwAAAAARa2V5U3RhdHVzT2ZWb3RpbmcCAAAAB19zdGF0dXMAAAAAEWtleUFtb3VudE9mVm90aW5nAgAAAA1hbW91bnRfdm90aW5nAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAAhrZXlDYXVzZQIAAAAOc2h1dGRvd25fY2F1c2UAAAAADmtleUNhbmNlbENhdXNlAgAAAA1fY2Fu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Z2VyRW50cnkAAAACBQAAABFrZXlOdW1iZXJPZlZvdGluZwkAAGUAAAACBQAAAA5udW1iZXJPZlZvdGluZwAAAAAAAAAAAQkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkAASwAAAACCQABpAAAAAEFAAAABnZvdGluZwUAAAARa2V5U3RhdHVzT2ZWb3RpbmcHCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAZ2b3RpbmcFAAAADmtleUNhbmNlbENhdXNlBQAAAAVjYXVzZQUAAAADbmlsAAAAAWkBAAAACHNodXRkb3duAAAAAAMJAQAAAAEhAAAAAQUAAAAIaXNBY3RpdmUJAAACAAAAAQkAASwAAAACAgAAACJEQXBwIGlzIGFscmVhZHkgc3VzcGVuZGVkLiBDYXVzZTogCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMFAAAACGtleUNhdXNlAgAAABp0aGUgY2F1c2Ugd2Fzbid0IHNwZWNpZmllZAkBAAAAB3N1c3BlbmQAAAABAgAAAA9QYXVzZWQgYnkgYWRtaW4AAAABaQEAAAAIYWN0aXZhdGUAAAAAAwUAAAAIaXNBY3RpdmUJAAACAAAAAQIAAAAWREFwcCBpcyBhbHJlYWR5IGFjdGl2ZQkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgUAAAAJa2V5QWN0aXZlBgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAAhrZXlDYXVzZQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAaa5TA+", "height": 1492112, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6CoSEKknwXX6jCdLtMWwA7tZEXvLQNNxZ9MsuBErQeYj Next: BvTcyVAv1fY7gxFWJkKXdQhA68stt2JqjJdvMd2FmwjQ Diff:
OldNewDifferences
8888
8989 @Callable(i)
9090 func voteForPool (voting,yesOrNo,voteAmt) = if (yesOrNo)
91- then [IntegerEntry((toString(voting) + keyYes), voteAmt), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)]
92- else [IntegerEntry((toString(voting) + keyNo), voteAmt), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)]
91+ then {
92+ let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt)
93+[IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)]
94+ }
95+ else {
96+ let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt)
97+[IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)]
98+ }
9399
94100
95101
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let version = "1.0.0"
55
66 let keyVersion = "version"
77
88 let keyActive = "active"
99
1010 let keyNumberOfVoting = "number_voting"
1111
1212 let keyHeightOfPool = "_height"
1313
1414 let keyNo = "_no"
1515
1616 let keyYes = "_yes"
1717
1818 let keyStatusOfVoting = "_status"
1919
2020 let keyAmountOfVoting = "amount_voting"
2121
2222 let keyCommission = "commission"
2323
2424 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
2525
2626 let keyCause = "shutdown_cause"
2727
2828 let keyCancelCause = "_cancel_cause"
2929
3030 let kUserTotalSWOP = "_SWOP_amount"
3131
3232 let isActive = getBooleanValue(this, keyActive)
3333
3434 let numberOfVoting = getIntegerValue(this, keyNumberOfVoting)
3535
3636 let amountOfVoting = getIntegerValue(this, keyAmountOfVoting)
3737
3838 let comissionForInitalizationOfVoting = 1000000000
3939
4040 let scaleValue3 = 1000
4141
4242 let scaleValue8 = 100000000
4343
4444 let slippageToleranceDelimiter = 1000
4545
4646 let scaleValue8Digits = 8
4747
4848 let maxAmountOfVoting = 5
4949
5050 let fiveDays = (1440 * 5)
5151
5252 func getAssetInfoFromString (assetStr) = if ((assetStr == "WAVES"))
5353 then unit
5454 else fromBase58String(assetStr)
5555
5656
5757 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
5858
5959
6060 func throwInsufficientAvailableBalance (amount,assetName) = throw(((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking.") + ". Please contact support in Telegram: https://t.me/swopfisupport"))
6161
6262
6363 @Callable(i)
6464 func init () = {
6565 let initNumberOfVoting = 0
6666 let initAmountOfVoting = 0
6767 let initKeyActive = true
6868 [StringEntry(keyVersion, version), BooleanEntry(keyActive, initKeyActive), IntegerEntry(keyNumberOfVoting, initNumberOfVoting), IntegerEntry(keyAmountOfVoting, initAmountOfVoting)]
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func initVotingForNewPool (assetA,assetB) = {
7575 let $t029433042 = $Tuple2(getAssetInfoFromString(assetA), getAssetInfoFromString(assetB))
7676 let poolAssetIdA = $t029433042._1
7777 let poolAssetIdB = $t029433042._2
7878 if (!(isActive))
7979 then throw("DApp is inactive at this moment")
8080 else if ((poolAssetIdA == poolAssetIdB))
8181 then throw("Assets must be different")
8282 else if ((numberOfVoting > maxAmountOfVoting))
8383 then throw(("Too many votes. Maximum quantity -" + toString(maxAmountOfVoting)))
8484 else [IntegerEntry(((((assetA + "_") + assetB) + "_") + toString(amountOfVoting)), amountOfVoting), IntegerEntry((toString(amountOfVoting) + keyHeightOfPool), (height + fiveDays)), BooleanEntry((toString(amountOfVoting) + keyStatusOfVoting), true), IntegerEntry(keyAmountOfVoting, (amountOfVoting + 1)), IntegerEntry(keyNumberOfVoting, (numberOfVoting + 1))]
8585 }
8686
8787
8888
8989 @Callable(i)
9090 func voteForPool (voting,yesOrNo,voteAmt) = if (yesOrNo)
91- then [IntegerEntry((toString(voting) + keyYes), voteAmt), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)]
92- else [IntegerEntry((toString(voting) + keyNo), voteAmt), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)]
91+ then {
92+ let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyYes)), 0) + voteAmt)
93+[IntegerEntry((toString(voting) + keyYes), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyYes), voteAmt)]
94+ }
95+ else {
96+ let newVote = (valueOrElse(getInteger(this, (toString(voting) + keyNo)), 0) + voteAmt)
97+[IntegerEntry((toString(voting) + keyNo), newVote), IntegerEntry((((toString(i.caller) + "_") + toString(voting)) + keyNo), voteAmt)]
98+ }
9399
94100
95101
96102 @Callable(i)
97103 func cancellationVoting (voting,cause) = [IntegerEntry(keyNumberOfVoting, (numberOfVoting - 1)), BooleanEntry((toString(voting) + keyStatusOfVoting), false), StringEntry((toString(voting) + keyCancelCause), cause)]
98104
99105
100106
101107 @Callable(i)
102108 func shutdown () = if (!(isActive))
103109 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified")))
104110 else suspend("Paused by admin")
105111
106112
107113
108114 @Callable(i)
109115 func activate () = if (isActive)
110116 then throw("DApp is already active")
111117 else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)]
112118
113119
114120 @Verifier(tx)
115121 func verify () = true
116122

github/deemru/w8io/026f985 
40.35 ms