tx · BEGfzUrNJfFkmXeLeX2M27TqGKUV7VChnM9RjCQ7WeNr 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo: -0.04000000 Waves 2021.09.02 00:46 [1684525] smart account 3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo > SELF 0.00000000 Waves
{ "type": 13, "id": "BEGfzUrNJfFkmXeLeX2M27TqGKUV7VChnM9RjCQ7WeNr", "fee": 4000000, "feeAssetId": null, "timestamp": 1630532847948, "version": 2, "chainId": 84, "sender": "3MvGMtmdY1eSW4iY922zj5bx8hBfyP1qgHo", "senderPublicKey": "CD4N2SBeZVBUwmtsqwfmQ3ZKnBP3AxpZCvJ5QkHytUed", "proofs": [ "q8S3XhfiL6UZaV1VdM9BxxLKxCNGLv83wQTZf8xYYxSejXkVAhtoARpWDrYktYV6hkFxY53pCnvBFAxQuuGBTZe" ], "script": "base64:AAIFAAAAAAAAAB0IAhIECgIIGBIDCgEIEgMKAQgSBAoCCAQSAwoBCAAAAAcAAAAABmNvbmZpZwkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAAGY29uZmlnAgAAAAAAAAAABWFkbWluCQEAAAALdmFsdWVPckVsc2UAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAAVhZG1pbgIAAAAAAAAAAAVwb29scwkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAABXBvb2xzAgAAABZObyBrZXkgcG9vbHMgd2FzIGZvdW5kAQAAAAdpc0FkbWluAAAAAQAAAA1jYWxsZXJBZGRyZXNzAwkAAAAAAAACBQAAAA1jYWxsZXJBZGRyZXNzCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAVhZG1pbgYHAQAAAAljaGVja1Bvb2wAAAABAAAAB3Bvb2xBZGQDCQEAAAAIY29udGFp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QAAAAhwYXltZW50cwMJAAAAAAAAAgUAAAALdG9rZW5BbW91bnQFAAAAC3Rva2VuQW1vdW50BAAAAAd0b2tlbklkCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAtwb29sQWRkcmVzcwIAAAAHYXNzZXRJZAQAAAAHJG1hdGNoMAUAAAALdG9rZW5BbW91bnQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABdAUAAAAHJG1hdGNoMAMJAAAAAAAAAgUAAAAHdG9rZW5JZAIAAAAFV0FWRVMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAF0BQAAAAR1bml0BQAAAANuaWwJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAF0CQACWQAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAF0BQAAAAckbWF0Y2gwBQAAAANuaWwJAAACAAAAAQIAAAAYSW5jb3JyZWN0IGludm9rZSByZXN1bHQhCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgkAAAIAAAABAgAAABRObyBwYXltZW50IGF0dGFjaGVkIQkAAAIAAAABAgAAABdBc3NldElkcyBkb2VzIG5vdCBtYXRjaAkAAAIAAAABAgAAABdQb29sIGFkZHJlc3Mgbm90IGZvdW5kIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5rbnSSA==", "height": 1684525, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G2JWKd3wygEgd4HPnwDaiRUVCttDsu37jeF6jU87xqvf Next: DD7XMnCCbX2kdYpWFPv3T9ebNR4EW5FStoCQKU4LJvTK Diff:
Old | New | Differences | |
---|---|---|---|
87 | 87 | func withdrawFrom (o) = if (f(o)) | |
88 | 88 | then { | |
89 | 89 | let x = getStringValue(addressFromStringValue(o), "dTokenId") | |
90 | - | if (( | |
90 | + | if ((fromBase58String(x) == m.payments[0].assetId)) | |
91 | 91 | then if ((size(m.payments) > 0)) | |
92 | 92 | then { | |
93 | 93 | let s = toBase58String(m.caller.bytes) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = valueOrElse(getStringValue(this, "config"), "") | |
5 | 5 | ||
6 | 6 | let b = valueOrElse(getStringValue(this, "admin"), "") | |
7 | 7 | ||
8 | 8 | let c = valueOrErrorMessage(getString(this, "pools"), "No key pools was found") | |
9 | 9 | ||
10 | 10 | func d (e) = if ((e == addressFromStringValue(b))) | |
11 | 11 | then true | |
12 | 12 | else false | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func f (g) = if (contains(c, g)) | |
16 | 16 | then true | |
17 | 17 | else false | |
18 | 18 | ||
19 | 19 | ||
20 | 20 | func h (i,j) = StringEntry(i, j) | |
21 | 21 | ||
22 | 22 | ||
23 | 23 | func k (i,l) = IntegerEntry(i, l) | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(m) | |
27 | 27 | func setup (n,c) = if (if (!(isDefined(getString(this, "config")))) | |
28 | 28 | then !(isDefined(getString(this, "pools"))) | |
29 | 29 | else false) | |
30 | 30 | then [h("config", n), h("pools", makeString(c, ";"))] | |
31 | 31 | else throw("Admin and config address already definied!") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(m) | |
36 | 36 | func addPool (o) = if (d(m.caller)) | |
37 | 37 | then { | |
38 | 38 | let p = split(c, ";") | |
39 | 39 | if ((containsElement(p, o) == false)) | |
40 | 40 | then { | |
41 | 41 | let q = (p :+ o) | |
42 | 42 | [h("pools", makeString(q, ";"))] | |
43 | 43 | } | |
44 | 44 | else throw("Pool already exists!") | |
45 | 45 | } | |
46 | 46 | else throw("Address does not match with admin address!") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | ||
50 | 50 | @Callable(m) | |
51 | 51 | func updateConfig (n) = if (d(m.caller)) | |
52 | 52 | then [h("config", n)] | |
53 | 53 | else throw("Address does not match with admin address!") | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(m) | |
58 | 58 | func depositAt (o,r) = if (f(o)) | |
59 | 59 | then if ((size(m.payments) > 0)) | |
60 | 60 | then { | |
61 | 61 | let s = toBase58String(m.caller.bytes) | |
62 | 62 | let t = invoke(addressFromStringValue(o), "deposit", [s, r], m.payments) | |
63 | 63 | if ((t == t)) | |
64 | 64 | then { | |
65 | 65 | let u = getStringValue(addressFromStringValue(o), "dTokenId") | |
66 | 66 | let v = t | |
67 | 67 | if ($isInstanceOf(v, "Int")) | |
68 | 68 | then { | |
69 | 69 | let w = v | |
70 | 70 | [ScriptTransfer(m.caller, w, fromBase58String(u))] | |
71 | 71 | } | |
72 | 72 | else if ($isInstanceOf(v, "String")) | |
73 | 73 | then { | |
74 | 74 | let w = v | |
75 | 75 | nil | |
76 | 76 | } | |
77 | 77 | else throw("Incorrect invoke result!") | |
78 | 78 | } | |
79 | 79 | else throw("Strict value is not equal to itself.") | |
80 | 80 | } | |
81 | 81 | else throw("No payment attached!") | |
82 | 82 | else throw("Pool address not found!") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | @Callable(m) | |
87 | 87 | func withdrawFrom (o) = if (f(o)) | |
88 | 88 | then { | |
89 | 89 | let x = getStringValue(addressFromStringValue(o), "dTokenId") | |
90 | - | if (( | |
90 | + | if ((fromBase58String(x) == m.payments[0].assetId)) | |
91 | 91 | then if ((size(m.payments) > 0)) | |
92 | 92 | then { | |
93 | 93 | let s = toBase58String(m.caller.bytes) | |
94 | 94 | let t = invoke(addressFromStringValue(o), "withdraw", [s], m.payments) | |
95 | 95 | if ((t == t)) | |
96 | 96 | then { | |
97 | 97 | let u = getStringValue(addressFromStringValue(o), "assetId") | |
98 | 98 | let v = t | |
99 | 99 | if ($isInstanceOf(v, "Int")) | |
100 | 100 | then { | |
101 | 101 | let w = v | |
102 | 102 | if ((u == "WAVES")) | |
103 | 103 | then [ScriptTransfer(m.caller, w, unit)] | |
104 | 104 | else [ScriptTransfer(m.caller, w, fromBase58String(u))] | |
105 | 105 | } | |
106 | 106 | else if ($isInstanceOf(v, "String")) | |
107 | 107 | then { | |
108 | 108 | let w = v | |
109 | 109 | nil | |
110 | 110 | } | |
111 | 111 | else throw("Incorrect invoke result!") | |
112 | 112 | } | |
113 | 113 | else throw("Strict value is not equal to itself.") | |
114 | 114 | } | |
115 | 115 | else throw("No payment attached!") | |
116 | 116 | else throw("AssetIds does not match") | |
117 | 117 | } | |
118 | 118 | else throw("Pool address not found!") | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | @Verifier(y) | |
122 | 122 | func z () = sigVerify(y.bodyBytes, y.proofs[0], y.senderPublicKey) | |
123 | 123 |
github/deemru/w8io/026f985 22.82 ms ◑