tx · rr6jZmPznQKKAccT35nDiQz8JTSPm2zJ3JmuJToRooh 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33: -0.01300000 Waves 2023.02.28 14:13 [2469478] smart account 3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33 > SELF 0.00000000 Waves
{ "type": 13, "id": "rr6jZmPznQKKAccT35nDiQz8JTSPm2zJ3JmuJToRooh", "fee": 1300000, "feeAssetId": null, "timestamp": 1677582893997, "version": 2, "chainId": 84, "sender": "3N65ziw5oaWWQHthPW5jzsh9VxjYxHwpv33", "senderPublicKey": "5yoY2Atq5TS6YzXkDHGig1DJdaYnWskuGToqK61rQWQd", "proofs": [ "3zE1chK6aAbHEQfpmYUZXCFK4aePqybcY2SXRbHhsHcGVre5whbSp3XH8PNQrFoHxR9ExDXSw1N9Jm3fKH7TSET5" ], "script": "base64:BgIECAISAAoBE2tleUludmVzdFd4WHRuRGVsYXkAAhMlX19pbnZlc3RXeFh0bkRlbGF5ARdrZXlJbnZlc3RXeFh0bkFtb3VudFh0bgACFyVfX2ludmVzdFd4WHRuQW1vdW50WHRuAQxrZXlXeFh0blBvb2wAAgwlX193eFh0blBvb2wBDWtleVh0bkFzc2V0SWQAAg0lX194dG5Bc3NldElkAQprZXlXeFh0bkxwAAIKJV9fd3hYdG5McAEOa2V5THBUb0FkZHJlc3MAAg4lX19scFRvQWRkcmVzcwETa2V5TWFuYWdlclB1YmxpY0tleQACFCVzX19tYW5hZ2VyUHVibGljS2V5ARhrZXlJbnZlc3RXeFh0bkxhc3RIZWlnaHQAAhglX19pbnZlc3RXeFh0bkxhc3RIZWlnaHQBFm1hbmFnZXJQdWJsaWNLZXlPclVuaXQABAckbWF0Y2gwCQCiCAEJARNrZXlNYW5hZ2VyUHVibGljS2V5AAMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXMFByRtYXRjaDAJANkEAQUBcwMJAAECBQckbWF0Y2gwAgRVbml0BQR1bml0CQACAQILTWF0Y2ggZXJyb3IBCHR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AzAgCCQEMSW50ZWdlckVudHJ5AgkBGGtleUludmVzdFd4WHRuTGFzdEhlaWdodAAFBmhlaWdodAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQERQGV4dHJOYXRpdmUoMTA2MikBCQERQGV4dHJOYXRpdmUoMTA1OCkBCQEOa2V5THBUb0FkZHJlc3MABQVscEdvdAUJbHBBc3NldElkBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXmPJo0t", "height": 2469478, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 3nJkUjxdAteAU7TY77b5Lc8PtxpHnu5wL4SA31XLrt22 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func keyInvestWxXtnDelay () = "%__investWxXtnDelay" | |
5 | + | ||
6 | + | ||
7 | + | func keyInvestWxXtnAmountXtn () = "%__investWxXtnAmountXtn" | |
8 | + | ||
9 | + | ||
10 | + | func keyWxXtnPool () = "%__wxXtnPool" | |
11 | + | ||
12 | + | ||
13 | + | func keyXtnAssetId () = "%__xtnAssetId" | |
14 | + | ||
15 | + | ||
16 | + | func keyWxXtnLp () = "%__wxXtnLp" | |
17 | + | ||
18 | + | ||
19 | + | func keyLpToAddress () = "%__lpToAddress" | |
20 | + | ||
21 | + | ||
22 | + | func keyManagerPublicKey () = "%s__managerPublicKey" | |
23 | + | ||
24 | + | ||
25 | + | func keyInvestWxXtnLastHeight () = "%__investWxXtnLastHeight" | |
26 | + | ||
27 | + | ||
28 | + | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
29 | + | case s: String => | |
30 | + | fromBase58String(s) | |
31 | + | case _: Unit => | |
32 | + | unit | |
33 | + | case _ => | |
34 | + | throw("Match error") | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func throwErr (msg) = throw(makeString(["investor.ride:", msg], " ")) | |
39 | + | ||
40 | + | ||
41 | + | @Callable(i) | |
42 | + | func investWxXtn () = { | |
43 | + | let lastCall = valueOrElse(getInteger(keyInvestWxXtnLastHeight()), 0) | |
44 | + | let delay = getIntegerValue(keyInvestWxXtnDelay()) | |
45 | + | let checks = [if ((height > (lastCall + delay))) | |
46 | + | then true | |
47 | + | else throwErr("wait to invest")] | |
48 | + | if ((checks == checks)) | |
49 | + | then { | |
50 | + | let lpAssetId = fromBase58String(getStringValue(keyWxXtnLp())) | |
51 | + | let lpBefore = assetBalance(this, lpAssetId) | |
52 | + | if ((lpBefore == lpBefore)) | |
53 | + | then { | |
54 | + | let inv = invoke(addressFromStringValue(getStringValue(keyWxXtnPool())), "putOneTkn", [0, false], [AttachedPayment(fromBase58String(getStringValue(keyXtnAssetId())), getIntegerValue(keyInvestWxXtnAmountXtn()))]) | |
55 | + | if ((inv == inv)) | |
56 | + | then { | |
57 | + | let lpAfter = assetBalance(this, lpAssetId) | |
58 | + | if ((lpAfter == lpAfter)) | |
59 | + | then { | |
60 | + | let lpGot = (lpAfter - lpBefore) | |
61 | + | let notZeroLp = if ((lpGot == 0)) | |
62 | + | then throwErr("lp to get is zero") | |
63 | + | else unit | |
64 | + | if ((notZeroLp == notZeroLp)) | |
65 | + | then [IntegerEntry(keyInvestWxXtnLastHeight(), height), ScriptTransfer(addressFromStringValue(getStringValue(keyLpToAddress())), lpGot, lpAssetId)] | |
66 | + | else throw("Strict value is not equal to itself.") | |
67 | + | } | |
68 | + | else throw("Strict value is not equal to itself.") | |
69 | + | } | |
70 | + | else throw("Strict value is not equal to itself.") | |
71 | + | } | |
72 | + | else throw("Strict value is not equal to itself.") | |
73 | + | } | |
74 | + | else throw("Strict value is not equal to itself.") | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | @Verifier(tx) | |
79 | + | func verify () = { | |
80 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
81 | + | case pk: ByteVector => | |
82 | + | pk | |
83 | + | case _: Unit => | |
84 | + | tx.senderPublicKey | |
85 | + | case _ => | |
86 | + | throw("Match error") | |
87 | + | } | |
88 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
89 | + | } | |
90 | + |
github/deemru/w8io/fabc49c 15.48 ms ◑