tx · 5otf7xvxDDPkYwxckjFVuxsdUB5fzGh8gKvDshrErJtA

3N2sRWeWnMTXiS1ip6WwQcr54LUjxjBNdP1:  -0.01300000 Waves

2023.05.02 09:54 [2559810] smart account 3N2sRWeWnMTXiS1ip6WwQcr54LUjxjBNdP1 > SELF 0.00000000 Waves

{ "type": 13, "id": "5otf7xvxDDPkYwxckjFVuxsdUB5fzGh8gKvDshrErJtA", "fee": 1300000, "feeAssetId": null, "timestamp": 1683010465134, "version": 2, "chainId": 84, "sender": "3N2sRWeWnMTXiS1ip6WwQcr54LUjxjBNdP1", "senderPublicKey": "DEnu4Lzkx2FVXHJ6PZBWsEshWeUpdpYtdsBerfEhqHv8", "proofs": [ "2FJHUvb29VLwLZfuSwwRhU2b4QgaoTmLTVufo4jApVUW8VpWVrkw9Fm7QwWEEtLb6b5fUw2JwMbHMQgWCvGuse65" ], "script": "base64:BgIICAISABIAEgAPAAxjb250cmFjdEZpbGUCD3Byb3h5X3BlcGUucmlkZQARa2V5c1dhdmVzQ29udHJhY3QCEiVzX19zV2F2ZXNDb250cmFjdAAQa2V5c1dhdmVzQXNzZXRJZAIRJXNfX3NXYXZlc0Fzc2V0SWQBD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5ARNwZXBlQ29udHJhY3RBZGRyZXNzAAkBD2dldFN0cmluZ09yRmFpbAEFEWtleXNXYXZlc0NvbnRyYWN0AQ5zV2F2ZXNJZFN0cmluZwAJAQ9nZXRTdHJpbmdPckZhaWwBBRBrZXlzV2F2ZXNBc3NldElkAAxwZXBlQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEJARNwZXBlQ29udHJhY3RBZGRyZXNzAAAGc1dhdmVzCQDZBAEJAQ5zV2F2ZXNJZFN0cmluZwABE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc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N0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgECdHgBBnZlcmlmeQAED3RhcmdldFB1YmxpY0tleQQHJG1hdGNoMAkBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQAAwkAAQIFByRtYXRjaDACCkJ5dGVWZWN0b3IEAnBrBQckbWF0Y2gwBQJwawMJAAECBQckbWF0Y2gwAgRVbml0CAUCdHgPc2VuZGVyUHVibGljS2V5CQACAQILTWF0Y2ggZXJyb3IJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFD3RhcmdldFB1YmxpY0tleRS1W1Q=", "height": 2559810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DMi8ki3A2z2YWPdvMMneMBMdhyrrcbNiWXBWyesHacBa Next: none Diff:
OldNewDifferences
2323 func keyManagerPublicKey () = "%s__managerPublicKey"
2424
2525
26-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
26+func keyManagerVaultAddress () = "%s__managerVaultAddress"
27+
28+
29+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
2730
2831
2932 func error (msg) = throw(((contractFile + ": ") + msg))
3033
3134
32-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
33- case s: String =>
34- fromBase58String(s)
35- case _: Unit =>
36- unit
37- case _ =>
38- throw("Match error")
39-}
40-
41-
42-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
43- case s: String =>
44- fromBase58String(s)
45- case _: Unit =>
46- unit
47- case _ =>
48- throw("Match error")
49-}
35+func managerPublicKeyOrUnit () = {
36+ let managerVaultAddress = getManagerAddressOrFail()
37+ match getString(managerVaultAddress, keyManagerPublicKey()) {
38+ case s: String =>
39+ fromBase58String(s)
40+ case _: Unit =>
41+ unit
42+ case _ =>
43+ throw("Match error")
44+ }
45+ }
5046
5147
5248 func isManager (i) = match managerPublicKeyOrUnit() {
114110 }
115111
116112
117-
118-@Callable(i)
119-func setManager (pendingManagerPublicKey) = {
120- let checkCaller = mustManager(i)
121- if ((checkCaller == checkCaller))
122- then {
123- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
124- if ((checkManagerPublicKey == checkManagerPublicKey))
125- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
126- else throw("Strict value is not equal to itself.")
127- }
128- else throw("Strict value is not equal to itself.")
129- }
130-
131-
132-
133-@Callable(i)
134-func confirmManager () = {
135- let pm = pendingManagerPublicKeyOrUnit()
136- let hasPM = if (isDefined(pm))
137- then true
138- else throw("no pending manager")
139- if ((hasPM == hasPM))
140- then {
141- let checkPM = if ((i.callerPublicKey == value(pm)))
142- then true
143- else throw("you are not pending manager")
144- if ((checkPM == checkPM))
145- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
146- else throw("Strict value is not equal to itself.")
147- }
148- else throw("Strict value is not equal to itself.")
149- }
150-
151-
152113 @Verifier(tx)
153114 func verify () = {
154115 let targetPublicKey = match managerPublicKeyOrUnit() {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "proxy_pepe.ride"
55
66 let keysWavesContract = "%s__sWavesContract"
77
88 let keysWavesAssetId = "%s__sWavesAssetId"
99
1010 func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), ("No data for this.key=" + key))
1111
1212
1313 func pepeContractAddress () = getStringOrFail(keysWavesContract)
1414
1515
1616 func sWavesIdString () = getStringOrFail(keysWavesAssetId)
1717
1818
1919 let pepeContract = addressFromStringValue(pepeContractAddress())
2020
2121 let sWaves = fromBase58String(sWavesIdString())
2222
2323 func keyManagerPublicKey () = "%s__managerPublicKey"
2424
2525
26-func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey"
26+func keyManagerVaultAddress () = "%s__managerVaultAddress"
27+
28+
29+func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
2730
2831
2932 func error (msg) = throw(((contractFile + ": ") + msg))
3033
3134
32-func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) {
33- case s: String =>
34- fromBase58String(s)
35- case _: Unit =>
36- unit
37- case _ =>
38- throw("Match error")
39-}
40-
41-
42-func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
43- case s: String =>
44- fromBase58String(s)
45- case _: Unit =>
46- unit
47- case _ =>
48- throw("Match error")
49-}
35+func managerPublicKeyOrUnit () = {
36+ let managerVaultAddress = getManagerAddressOrFail()
37+ match getString(managerVaultAddress, keyManagerPublicKey()) {
38+ case s: String =>
39+ fromBase58String(s)
40+ case _: Unit =>
41+ unit
42+ case _ =>
43+ throw("Match error")
44+ }
45+ }
5046
5147
5248 func isManager (i) = match managerPublicKeyOrUnit() {
5349 case pk: ByteVector =>
5450 (i.callerPublicKey == pk)
5551 case _: Unit =>
5652 (i.caller == this)
5753 case _ =>
5854 throw("Match error")
5955 }
6056
6157
6258 func mustManager (i) = if (isManager(i))
6359 then true
6460 else throw("permission denied")
6561
6662
6763 @Callable(i)
6864 func getRate () = {
6965 let results = invoke(pepeContract, "getRate", nil, nil)
7066 match results {
7167 case t: String =>
7268 $Tuple2(nil, parseIntValue(t))
7369 case _ =>
7470 error("getRate(): unexpected return")
7571 }
7672 }
7773
7874
7975
8076 @Callable(i)
8177 func deposit () = {
8278 let startBalance = assetBalance(this, sWaves)
8379 if ((startBalance == startBalance))
8480 then {
8581 let results = invoke(pepeContract, "deposit", nil, i.payments)
8682 if ((results == results))
8783 then {
8884 let newBalance = assetBalance(this, sWaves)
8985 let sendAmount = (newBalance - startBalance)
9086 $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount)
9187 }
9288 else throw("Strict value is not equal to itself.")
9389 }
9490 else throw("Strict value is not equal to itself.")
9591 }
9692
9793
9894
9995 @Callable(i)
10096 func withdraw () = {
10197 let startBalance = wavesBalance(this).available
10298 if ((startBalance == startBalance))
10399 then {
104100 let results = invoke(pepeContract, "withdraw", nil, i.payments)
105101 if ((results == results))
106102 then {
107103 let newBalance = wavesBalance(this).available
108104 let sendAmount = (newBalance - startBalance)
109105 $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount)
110106 }
111107 else throw("Strict value is not equal to itself.")
112108 }
113109 else throw("Strict value is not equal to itself.")
114110 }
115111
116112
117-
118-@Callable(i)
119-func setManager (pendingManagerPublicKey) = {
120- let checkCaller = mustManager(i)
121- if ((checkCaller == checkCaller))
122- then {
123- let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey)
124- if ((checkManagerPublicKey == checkManagerPublicKey))
125- then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)]
126- else throw("Strict value is not equal to itself.")
127- }
128- else throw("Strict value is not equal to itself.")
129- }
130-
131-
132-
133-@Callable(i)
134-func confirmManager () = {
135- let pm = pendingManagerPublicKeyOrUnit()
136- let hasPM = if (isDefined(pm))
137- then true
138- else throw("no pending manager")
139- if ((hasPM == hasPM))
140- then {
141- let checkPM = if ((i.callerPublicKey == value(pm)))
142- then true
143- else throw("you are not pending manager")
144- if ((checkPM == checkPM))
145- then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
146- else throw("Strict value is not equal to itself.")
147- }
148- else throw("Strict value is not equal to itself.")
149- }
150-
151-
152113 @Verifier(tx)
153114 func verify () = {
154115 let targetPublicKey = match managerPublicKeyOrUnit() {
155116 case pk: ByteVector =>
156117 pk
157118 case _: Unit =>
158119 tx.senderPublicKey
159120 case _ =>
160121 throw("Match error")
161122 }
162123 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
163124 }
164125

github/deemru/w8io/fabc49c 
27.65 ms