tx · HwkvVKESTGvBf9KgrmBv1zMnRLmPJsJz8xuL868XZYJt

3N5CayN8CtoM2QuWDDDQFCPdiviGSt9GTpt:  -0.01300000 Waves

2023.05.10 13:16 [2571656] smart account 3N5CayN8CtoM2QuWDDDQFCPdiviGSt9GTpt > SELF 0.00000000 Waves

{ "type": 13, "id": "HwkvVKESTGvBf9KgrmBv1zMnRLmPJsJz8xuL868XZYJt", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713796949, "version": 2, "chainId": 84, "sender": "3N5CayN8CtoM2QuWDDDQFCPdiviGSt9GTpt", "senderPublicKey": "8z79nXR33yhmSzh8WGovFPyrSqSq4gYftBwUQBsc577Y", "proofs": [ "3MQKzYDWSjuu13tkgF4wbterGYeJ4NP9qbBjnKAjeFpVUfAWpyXmv4Xex2oHJok4Dp5YTnz9XEK1QUJxUoGtyHGF" ], "script": "base64:BgIICAISABIAEgAPAAxjb250cmFjdEZpbGUCD3Byb3h5X3BlcGUucmlkZQARa2V5c1dhdmVzQ29udHJhY3QCEiVzX19zV2F2ZXNDb250cmFjdAAQa2V5c1dhdmVzQXNzZXRJZAIRJXNfX3NXYXZlc0Fzc2V0SWQBD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5CQCsAgICFU5vIGRhdGEgZm9yIHRoaXMua2V5PQUDa2V5ARNwZXBlQ29udHJhY3RBZGRyZXNzAAkBD2dldFN0cmluZ09yRmFpbAEFEWtleXNXYXZlc0NvbnRyYWN0AQ5zV2F2ZXNJZFN0cmluZwAJAQ9nZXRTdHJpbmdPckZhaWwBBRBrZXlzV2F2ZXNBc3NldElkAAxwZXBlQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEJARNwZXBlQ29udHJhY3RBZGRyZXNzAAAGc1dhdmVzCQDZBAEJAQ5zV2F2ZXNJZFN0cmluZwABE2tleU1hbmFnZXJQdWJsaWNLZXkAAhQlc19fbWFu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pY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXmL8IHr", "height": 2571656, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8KKaYQJyBhmR4Szt7XySQqXoPrzmEwNtyYRicDZPNp8x Next: none Diff:
OldNewDifferences
2626 func keyManagerVaultAddress () = "%s__managerVaultAddress"
2727
2828
29-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
29+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
30+ case s: String =>
31+ addressFromStringValue(s)
32+ case _ =>
33+ this
34+}
3035
3136
3237 func error (msg) = throw(((contractFile + ": ") + msg))
3338
3439
3540 func managerPublicKeyOrUnit () = {
36- let managerVaultAddress = getManagerAddressOrFail()
41+ let managerVaultAddress = getManagerVaultAddressOrThis()
3742 match getString(managerVaultAddress, keyManagerPublicKey()) {
3843 case s: String =>
3944 fromBase58String(s)
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
2626 func keyManagerVaultAddress () = "%s__managerVaultAddress"
2727
2828
29-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
29+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
30+ case s: String =>
31+ addressFromStringValue(s)
32+ case _ =>
33+ this
34+}
3035
3136
3237 func error (msg) = throw(((contractFile + ": ") + msg))
3338
3439
3540 func managerPublicKeyOrUnit () = {
36- let managerVaultAddress = getManagerAddressOrFail()
41+ let managerVaultAddress = getManagerVaultAddressOrThis()
3742 match getString(managerVaultAddress, keyManagerPublicKey()) {
3843 case s: String =>
3944 fromBase58String(s)
4045 case _: Unit =>
4146 unit
4247 case _ =>
4348 throw("Match error")
4449 }
4550 }
4651
4752
4853 func isManager (i) = match managerPublicKeyOrUnit() {
4954 case pk: ByteVector =>
5055 (i.callerPublicKey == pk)
5156 case _: Unit =>
5257 (i.caller == this)
5358 case _ =>
5459 throw("Match error")
5560 }
5661
5762
5863 func mustManager (i) = if (isManager(i))
5964 then true
6065 else throw("permission denied")
6166
6267
6368 @Callable(i)
6469 func getRate () = {
6570 let results = invoke(pepeContract, "getRate", nil, nil)
6671 match results {
6772 case t: String =>
6873 $Tuple2(nil, parseIntValue(t))
6974 case _ =>
7075 error("getRate(): unexpected return")
7176 }
7277 }
7378
7479
7580
7681 @Callable(i)
7782 func deposit () = {
7883 let startBalance = assetBalance(this, sWaves)
7984 if ((startBalance == startBalance))
8085 then {
8186 let results = invoke(pepeContract, "deposit", nil, i.payments)
8287 if ((results == results))
8388 then {
8489 let newBalance = assetBalance(this, sWaves)
8590 let sendAmount = (newBalance - startBalance)
8691 $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount)
8792 }
8893 else throw("Strict value is not equal to itself.")
8994 }
9095 else throw("Strict value is not equal to itself.")
9196 }
9297
9398
9499
95100 @Callable(i)
96101 func withdraw () = {
97102 let startBalance = wavesBalance(this).available
98103 if ((startBalance == startBalance))
99104 then {
100105 let results = invoke(pepeContract, "withdraw", nil, i.payments)
101106 if ((results == results))
102107 then {
103108 let newBalance = wavesBalance(this).available
104109 let sendAmount = (newBalance - startBalance)
105110 $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount)
106111 }
107112 else throw("Strict value is not equal to itself.")
108113 }
109114 else throw("Strict value is not equal to itself.")
110115 }
111116
112117
113118 @Verifier(tx)
114119 func verify () = {
115120 let targetPublicKey = match managerPublicKeyOrUnit() {
116121 case pk: ByteVector =>
117122 pk
118123 case _: Unit =>
119124 tx.senderPublicKey
120125 case _ =>
121126 throw("Match error")
122127 }
123128 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
124129 }
125130

github/deemru/w8io/026f985 
21.17 ms