tx · 3ZjFKrowZfv3pTACEPxpLXTYnT3AcV2BazwcdT4HAcm8

3MrwiwvG6BeUNCyXBfSAHgaXHASsxbjYMVF:  -0.00900000 Waves

2023.02.13 10:10 [2447513] smart account 3MrwiwvG6BeUNCyXBfSAHgaXHASsxbjYMVF > SELF 0.00000000 Waves

{ "type": 13, "id": "3ZjFKrowZfv3pTACEPxpLXTYnT3AcV2BazwcdT4HAcm8", "fee": 900000, "feeAssetId": null, "timestamp": 1676272245509, "version": 2, "chainId": 84, "sender": "3MrwiwvG6BeUNCyXBfSAHgaXHASsxbjYMVF", "senderPublicKey": "7m7j9TNbV4vKeeJqy37XpMNH784X3GGN6acbgLwbBiDD", "proofs": [ "oiFQ48eNubJ69DqHMUCJEnThH8sfEkL4BXAfJe4r7HicoeR2c6rWGq9xbFLdcnV9cLUrB9FoSKFcb5cBt2vetNa", "3NmR5i4pZrAFKpaj6HDKz5bqL9tHnnTcP7LJEkVsebu6v95MAjMh7VtnusESAqJV5SEyhP8awKdVox3JYnBPwNUZ" ], "script": "base64:BgIXCAISBwoFAQgIGBgSBAoCAQESBAoCAREfAA1rQWRtaW5QdWJLZXkxAgthZG1pbl9wdWJfMQANa0FkbWluUHViS2V5MgILYWRtaW5fcHViXzIADWtBZG1pblB1YktleTMCC2FkbWluX3B1Yl8zABJrQWRtaW5JbnZva2VQdWJLZXkCEGFkbWluX2ludm9rZV9wdWIAEGtNb25leUJveEFkZHJlc3MCEW1vbmV5X2JveF9hZGRyZXNzAAtrR292QWRkcmVzcwISZ292ZXJuYW5jZV9hZGRyZXNzAAdrQWN0aXZlAgZhY3RpdmUAC2tBY3RpdmVHbG9iAhRhY3RpdmVfYWxsX2NvbnRyYWN0cwANa0xhc3RTdXJ2ZXlJZAIObGFzdF9zdXJ2ZXlfaWQAF2tTdXJ2ZXlIZWlnaHRDb21wbGV0aW9uAhlfc3VydmV5X2hlaWdodF9jb21wbGV0aW9uAAxrU3VydmV5VGl0bGUCDV9zdXJ2ZXlfdGl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0CQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIJAKwCAgkApAMBBQhzdXJ2ZXlJZAIBXwkApAMBBQZvcHRpb24FD2tUb3RhbFN3b3BWb3RlZAUFdG90YWwJAJQKAgkAZAIFBm9wdGlvbgABBQNyZXMEDm9wdGlvbnNFbnRyaWVzCgACJGwFBnRvdGFscwoAAiRzCQCQAwEFAiRsCgAFJGFjYzAJAJQKAgAABQNuaWwKAQUkZjBfMQICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkBDXByZXBhcmVUb3RhbHMCBQIkYQkAkQMCBQIkbAUCJGkKAQUkZjBfMgICJGECJGkDCQBnAgUCJGkFAiRzBQIkYQkAAgECFExpc3Qgc2l6ZSBleGNlZWRzIDEwCQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoIBQ5vcHRpb25zRW50cmllcwJfMgECdHgBBnZlcmlmeQAEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFDGFkbWluUHViS2V5MQABAAAEEmFkbWluUHViS2V5MlNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAEFDGFkbWluUHViS2V5MgABAAAEEmFkbWluUHViS2V5M1NpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFDGFkbWluUHViS2V5MwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgFAsTc=", "height": 2447513, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9sZrWJ9KMBhfNTcydTLbPAQfRPgHPop1Dd3zKQdEiCUN Next: HPuxJXFWjys9TwyX4GvPpyq17rmLEPTc7CDY73AnkQRB Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "admin_pub_1"
55
66 let b = "admin_pub_2"
77
88 let c = "admin_pub_3"
99
1010 let d = "admin_invoke_pub"
1111
1212 let e = "money_box_address"
1313
1414 let f = "governance_address"
1515
1616 let g = "active"
1717
1818 let h = "active_all_contracts"
1919
2020 let i = "last_survey_id"
2121
2222 let j = "_survey_height_completion"
2323
2424 let k = "_survey_title"
2525
2626 let l = "_survey_description"
2727
2828 let m = "_survey_option_name"
2929
3030 let n = "_survey_option_type"
3131
3232 let o = "_survey_user_vote"
3333
3434 let p = "_survey_option_total_swop_voted"
3535
3636 let q = "_GSwop_amount"
3737
3838 let r = "_SWOP_amount"
3939
4040 let s = Address(base58'3MvVBtsXroQpy1tsPw21TU2ET9A8WfmrNjz')
4141
4242 func t (u) = {
4343 let v = getString(s, u)
4444 if ($isInstanceOf(v, "String"))
4545 then {
4646 let w = v
4747 fromBase58String(w)
4848 }
4949 else {
5050 let x = v
5151 throw((u + "is empty"))
5252 }
5353 }
5454
5555
5656 let y = t(a)
5757
5858 let z = t(b)
5959
6060 let A = t(c)
6161
6262 let B = t(d)
6363
6464 let C = Address(t(e))
6565
6666 let D = Address(t(f))
6767
6868 let E = valueOrElse(getBoolean(this, g), true)
6969
7070 let F = valueOrElse(getBoolean(s, h), true)
7171
7272 func G () = if (if (E)
7373 then F
7474 else false)
7575 then unit
7676 else throw("DApp is inactive at this moment")
7777
7878
7979 func H (I) = if (containsElement([y, z, A], I.callerPublicKey))
8080 then unit
8181 else throw("Only admin can call this function")
8282
8383
8484 func J (I) = if ((C == I.caller))
8585 then unit
8686 else throw("Only Money box can call this function")
8787
8888
8989 @Callable(I)
9090 func initSurvey (K,L,M,N,O) = valueOrElse(G(), valueOrElse(H(I), if ((height >= K))
9191 then throw("Height of survey completion must be greater than currnet height")
9292 else if ((size(N) > 10))
9393 then throw("Max 10 options must be specified")
9494 else if ((size(N) != size(O)))
9595 then throw("Size of optionsTypes must be same as options")
9696 else {
9797 let P = (valueOrElse(getInteger(this, i), 0) + 1)
9898 func Q (R,S) = {
9999 let T = R
100100 let U = T._1
101101 let V = T._2
102102 let W = T._3
103103 let X = ((W :+ StringEntry((((toString(P) + "_") + toString(V)) + m), S)) :+ StringEntry((((toString(P) + "_") + toString(V)) + n), U[V]))
104104 $Tuple3(U, (V + 1), X)
105105 }
106106
107107 let Y = {
108108 let Z = N
109109 let aa = size(Z)
110110 let ab = $Tuple3(O, 0, nil)
111111 func ac (ad,ae) = if ((ae >= aa))
112112 then ad
113113 else Q(ad, Z[ae])
114114
115115 func af (ad,ae) = if ((ae >= aa))
116116 then ad
117117 else throw("List size exceeds 10")
118118
119119 af(ac(ac(ac(ac(ac(ac(ac(ac(ac(ac(ab, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
120120 }
121121 ([IntegerEntry(i, P), IntegerEntry((toString(P) + j), K), StringEntry((toString(P) + k), L), StringEntry((toString(P) + l), M)] ++ Y._3)
122122 }))
123123
124124
125125
126126 @Callable(I)
127127 func vote (ag,ah) = valueOrElse(G(), if (!(isDefined(getString(this, (toString(ag) + k)))))
128128 then throw(("There is no survey with id " + toString(ag)))
129129 else if (!(isDefined(getString(this, (((toString(ag) + "_") + toString(ah)) + m)))))
130130 then throw(((("There is no option " + toString(ah)) + " in survey ") + toString(ag)))
131131 else if (isDefined(getInteger(this, (((toString(ag) + "_") + toString(I.caller)) + o))))
132132 then throw("You can't vote twice")
133133 else if ((height > value(getInteger(this, (toString(ag) + j)))))
134134 then throw("Survey already end")
135135 else if ((0 >= valueOrElse(getInteger(D, (toString(I.caller) + q)), valueOrElse(getInteger(D, (toString(I.caller) + r)), 0))))
136136 then throw("Stake swop in governance to survey")
137137 else [IntegerEntry((((toString(ag) + "_") + toString(I.caller)) + o), ah)])
138138
139139
140140
141141 @Callable(I)
142142 func writeTotals (ag,ai) = valueOrElse(G(), valueOrElse(J(I), if (!(isDefined(getString(this, (toString(ag) + k)))))
143143 then throw(("There is no survey with id " + toString(ag)))
144144 else if ((value(getInteger(this, (toString(ag) + j))) > height))
145145 then throw("Survey is not ended yet")
146146 else {
147147 func aj (R,ak) = {
148148 let al = R
149149 let ah = al._1
150150 let W = al._2
151151 let X = (W :+ IntegerEntry((((toString(ag) + "_") + toString(ah)) + p), ak))
152152 $Tuple2((ah + 1), X)
153153 }
154154
155155 let Y = {
156156 let Z = ai
157157 let aa = size(Z)
158158 let ab = $Tuple2(0, nil)
159159 func ac (ad,ae) = if ((ae >= aa))
160160 then ad
161161 else aj(ad, Z[ae])
162162
163163 func af (ad,ae) = if ((ae >= aa))
164164 then ad
165165 else throw("List size exceeds 10")
166166
167167 af(ac(ac(ac(ac(ac(ac(ac(ac(ac(ac(ab, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
168168 }
169169 Y._2
170170 }))
171171
172172
173173 @Verifier(am)
174174 func an () = {
175175 let ao = if (sigVerify(am.bodyBytes, am.proofs[0], y))
176176 then 1
177177 else 0
178178 let ap = if (sigVerify(am.bodyBytes, am.proofs[1], z))
179179 then 1
180180 else 0
181181 let aq = if (sigVerify(am.bodyBytes, am.proofs[2], A))
182182 then 1
183183 else 0
184184 (((ao + ap) + aq) >= 2)
185185 }
186186

github/deemru/w8io/026f985 
32.32 ms