tx · GBeJ1L9rCZjwps4Wj8VmifAWSKqHiTeKXW7cDryaC14D

3N3sjhLSBU5duySKvnNuKe5S2YNebk2Pxye:  -0.01300000 Waves

2023.05.10 13:07 [2571648] smart account 3N3sjhLSBU5duySKvnNuKe5S2YNebk2Pxye > SELF 0.00000000 Waves

{ "type": 13, "id": "GBeJ1L9rCZjwps4Wj8VmifAWSKqHiTeKXW7cDryaC14D", "fee": 1300000, "feeAssetId": null, "timestamp": 1683713318316, "version": 2, "chainId": 84, "sender": "3N3sjhLSBU5duySKvnNuKe5S2YNebk2Pxye", "senderPublicKey": "Cm17BFEPG286HnXKy3BbrJ8QYz8AbCqoWfUi8rKwHo12", "proofs": [ "2Q1JU4Q2eynXXDRRYCPZvq1tsXP7bRqigFapn4Q6CbebGEyf32thueZb3T5r3gEPYR7Q8CgGp3y7hiE5fWEo43gn" ], "script": "base64:BgIECAISAA0BE2tleUludmVzdFd4WHRuRGVsYXkAAhMlX19pbnZlc3RXeFh0bkRlbGF5ARdrZXlJbnZlc3RXeFh0bkFtb3VudFh0bgACFyVfX2ludmVzdFd4WHRuQW1vdW50WHRuAQxrZXlXeFh0blBvb2wAAgwlX193eFh0blBvb2wBDWtleVh0bkFzc2V0SWQAAg0lX194dG5Bc3NldElkAQprZXlXeFh0bkxwAAIKJV9fd3hYdG5McAEOa2V5THBUb0FkZHJlc3MAAg4lX19scFRvQWRkcmVzcwETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARZrZXlNYW5hZ2VyVmF1bHRBZGRyZXNzAAIXJXNfX21hbmFnZXJWYXVsdEFkZHJlc3MBGGtleUludmVzdFd4WHRuTGFzdEhlaWdodAACGCVfX2ludmVzdFd4WHRuTGFzdEhlaWdodAEcZ2V0TWFuYWdlclZhdWx0QWRkcmVzc09yVGhpcwAEByRtYXRjaDAJAKIIAQkBFmtleU1hbmFnZXJWYXVsdEFkZHJlc3MAAwkAAQIFByRtYXRjaDACBlN0cmluZw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kU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQPdGFyZ2V0UHVibGljS2V5BAckbWF0Y2gwCQEWbWFuYWdlclB1YmxpY0tleU9yVW5pdAADCQABAgUHJG1hdGNoMAIKQnl0ZVZlY3RvcgQCcGsFByRtYXRjaDAFAnBrAwkAAQIFByRtYXRjaDACBFVuaXQIBQJ0eA9zZW5kZXJQdWJsaWNLZXkJAAIBAgtNYXRjaCBlcnJvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUPdGFyZ2V0UHVibGljS2V5fPlqYg==", "height": 2571648, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BYkD7ugUjVNmjnuadJaYqbnrfExy6gwx8FpUW9xNPwUp Next: none Diff:
OldNewDifferences
2828 func keyInvestWxXtnLastHeight () = "%__investWxXtnLastHeight"
2929
3030
31-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
31+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
32+ case s: String =>
33+ addressFromStringValue(s)
34+ case _ =>
35+ this
36+}
3237
3338
3439 func managerPublicKeyOrUnit () = {
35- let managerVaultAddress = getManagerAddressOrFail()
40+ let managerVaultAddress = getManagerVaultAddressOrThis()
3641 match getString(managerVaultAddress, keyManagerPublicKey()) {
3742 case s: String =>
3843 fromBase58String(s)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func keyInvestWxXtnDelay () = "%__investWxXtnDelay"
55
66
77 func keyInvestWxXtnAmountXtn () = "%__investWxXtnAmountXtn"
88
99
1010 func keyWxXtnPool () = "%__wxXtnPool"
1111
1212
1313 func keyXtnAssetId () = "%__xtnAssetId"
1414
1515
1616 func keyWxXtnLp () = "%__wxXtnLp"
1717
1818
1919 func keyLpToAddress () = "%__lpToAddress"
2020
2121
2222 func keyManagerPublicKey () = "%s__managerPublicKey"
2323
2424
2525 func keyManagerVaultAddress () = "%s__managerVaultAddress"
2626
2727
2828 func keyInvestWxXtnLastHeight () = "%__investWxXtnLastHeight"
2929
3030
31-func getManagerAddressOrFail () = addressFromStringValue(getStringValue(keyManagerVaultAddress()))
31+func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
32+ case s: String =>
33+ addressFromStringValue(s)
34+ case _ =>
35+ this
36+}
3237
3338
3439 func managerPublicKeyOrUnit () = {
35- let managerVaultAddress = getManagerAddressOrFail()
40+ let managerVaultAddress = getManagerVaultAddressOrThis()
3641 match getString(managerVaultAddress, keyManagerPublicKey()) {
3742 case s: String =>
3843 fromBase58String(s)
3944 case _: Unit =>
4045 unit
4146 case _ =>
4247 throw("Match error")
4348 }
4449 }
4550
4651
4752 func throwErr (msg) = throw(makeString(["investor.ride:", msg], " "))
4853
4954
5055 func mustManager (i) = {
5156 let pd = throwErr("permission denied")
5257 match managerPublicKeyOrUnit() {
5358 case pk: ByteVector =>
5459 if ((i.callerPublicKey == pk))
5560 then true
5661 else pd
5762 case _: Unit =>
5863 if ((i.caller == this))
5964 then true
6065 else pd
6166 case _ =>
6267 throw("Match error")
6368 }
6469 }
6570
6671
6772 @Callable(i)
6873 func investWxXtn () = {
6974 let checkCaller = mustManager(i)
7075 if ((checkCaller == checkCaller))
7176 then {
7277 let lastCall = valueOrElse(getInteger(keyInvestWxXtnLastHeight()), 0)
7378 let delay = getIntegerValue(keyInvestWxXtnDelay())
7479 let checks = [if ((height > (lastCall + delay)))
7580 then true
7681 else throwErr("wait to invest")]
7782 if ((checks == checks))
7883 then {
7984 let lpAssetId = fromBase58String(getStringValue(keyWxXtnLp()))
8085 let lpBefore = assetBalance(this, lpAssetId)
8186 if ((lpBefore == lpBefore))
8287 then {
8388 let inv = invoke(addressFromStringValue(getStringValue(keyWxXtnPool())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(keyXtnAssetId())), getIntegerValue(keyInvestWxXtnAmountXtn()))])
8489 if ((inv == inv))
8590 then {
8691 let lpAfter = assetBalance(this, lpAssetId)
8792 if ((lpAfter == lpAfter))
8893 then {
8994 let lpGot = (lpAfter - lpBefore)
9095 let notZeroLp = if ((lpGot == 0))
9196 then throwErr("lp to get is zero")
9297 else unit
9398 if ((notZeroLp == notZeroLp))
9499 then [IntegerEntry(keyInvestWxXtnLastHeight(), height), ScriptTransfer(addressFromStringValue(getStringValue(keyLpToAddress())), lpGot, lpAssetId)]
95100 else throw("Strict value is not equal to itself.")
96101 }
97102 else throw("Strict value is not equal to itself.")
98103 }
99104 else throw("Strict value is not equal to itself.")
100105 }
101106 else throw("Strict value is not equal to itself.")
102107 }
103108 else throw("Strict value is not equal to itself.")
104109 }
105110 else throw("Strict value is not equal to itself.")
106111 }
107112
108113
109114 @Verifier(tx)
110115 func verify () = {
111116 let targetPublicKey = match managerPublicKeyOrUnit() {
112117 case pk: ByteVector =>
113118 pk
114119 case _: Unit =>
115120 tx.senderPublicKey
116121 case _ =>
117122 throw("Match error")
118123 }
119124 sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey)
120125 }
121126

github/deemru/w8io/169f3d6 
36.39 ms