tx · 3qaF8yWaXuiA8yKpXcGe36BRH1Lzy1j6xeEcvNWWyhx5 3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9: -0.04000000 Waves 2021.08.25 01:02 [1672975] smart account 3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9 > SELF 0.00000000 Waves
{ "type": 13, "id": "3qaF8yWaXuiA8yKpXcGe36BRH1Lzy1j6xeEcvNWWyhx5", "fee": 4000000, "feeAssetId": null, "timestamp": 1629842628033, "version": 2, "chainId": 84, "sender": "3NAToHPcRGMR4M2pUpy6gPcpiMX5via7vf9", "senderPublicKey": "5fe3Hm6UB8fRqvLYhGeeNdy7rEgwpxWjdEFPgnNwSRCz", "proofs": [ "4wdnjQZDG9s6HvPU3EyENUvCCQSEuiWUgJd2AbxuoX1yRuVHrfmwwiG15i7LS8GdJJcj8Pq9eASCCmCBzgQzq7GZ" ], "script": "base64:AAIFAAAAAAAAABAIAhIECgIIBBIGCgQICAgIAAAAJgAAAAAKYmFzZUZhY3RvcgAAAAAAAAAD6AAAAAAJYmFzZUluZGV4AAAjhvJvwQAAAAAAAA1ibG9ja3NQZXJZZWFyAAAAAAAACAUgAAAAAAZjb25maWcJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwIAAAANY29uZmlnQWRkcmVzcwIAAAAAAAAAAAVhZG1pbgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAABWFkbWluAgAAAAAAAAAAC3dhdmV0cm9sbGVyCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABmNvbmZpZwIAAAALd2F2ZXRyb2xsZXICAAAAAAAAAAAKYXNzZXRJZFN1YgkBAAAAE3ZhbHVlT3JFcnJvck1lc3NhZ2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAA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udHJ5AAAAAgIAAAAMZFRva2VuU3VwcGx5AAAAAAAAAAAABQAAAANuaWwJAAACAAAAAQIAAAATUG9vbCBhbHJlYWR5IHNldHVwIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5spREUA==", "height": 1672975, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7LX4KFy4adsUVVFcX55c93fM6Z6AQXonwZubXjzGS5a Next: HMUEtCchxDdV1xTpRzndU8y9ErztQF1Dnun7hm8E7ZzT Diff:
Old | New | Differences | |
---|---|---|---|
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(aa) | |
111 | - | func deposit (ab,ac) = if (x(aa.caller)) | |
112 | - | then { | |
113 | - | let ad = Y(aa.payments[0].amount) | |
114 | - | let ae = (q + ad) | |
115 | - | let af = (D(ab) + ad) | |
111 | + | func deposit (ab,ac) = { | |
112 | + | let ad = Y(aa.payments[0].amount) | |
113 | + | let ae = (q + ad) | |
114 | + | let af = (D(ab) + ad) | |
116 | 115 | [Reissue(fromBase58String(s), ad, true), B("dTokenSupply", ae), B((ab + "_tokenBalance"), af), BooleanEntry((ab + "_useAsCollateral"), ac), B("totalBorrow", P), B("totalSupply", (R + aa.payments[0].amount)), B("totalReserve", S), B("storedIndex", O), B("storedHeight", height), ScriptTransfer(aa.caller, ad, fromBase58String(s))] | |
117 | - | } | |
118 | - | else throw("Address does not match with wavetroller address!") | |
116 | + | } | |
119 | 117 | ||
120 | 118 | ||
121 | 119 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 1000 | |
5 | 5 | ||
6 | 6 | let b = 10000000000000000 | |
7 | 7 | ||
8 | 8 | let c = 525600 | |
9 | 9 | ||
10 | 10 | let d = valueOrElse(getString(this, "configAddress"), "") | |
11 | 11 | ||
12 | 12 | let e = valueOrElse(getString(addressFromStringValue(d), "admin"), "") | |
13 | 13 | ||
14 | 14 | let f = valueOrElse(getString(addressFromStringValue(d), "wavetroller"), "") | |
15 | 15 | ||
16 | 16 | let g = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!") | |
17 | 17 | ||
18 | 18 | let h = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Decimals")), (("No key " + (g + "_Decimals")) + " was found")) | |
19 | 19 | ||
20 | 20 | let i = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Multiplier")), (("No key " + (g + "_Multiplier")) + " was found")) | |
21 | 21 | ||
22 | 22 | let j = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_Kink")), (("No key " + (g + "_Kink")) + " was found")) | |
23 | 23 | ||
24 | 24 | let k = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_JumpMultiplier")), (("No key " + (g + "_JumpMultiplier")) + " was found")) | |
25 | 25 | ||
26 | 26 | let l = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_BaseRate")), (("No key " + (g + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | 28 | let m = valueOrErrorMessage(getInteger(addressFromStringValue(d), (g + "_ReserveFactor")), (("No key " + (g + "_ReserveFactor")) + " was found")) | |
29 | 29 | ||
30 | 30 | let n = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
31 | 31 | ||
32 | 32 | let o = valueOrElse(getInteger(this, "totalSupply"), 0) | |
33 | 33 | ||
34 | 34 | let p = valueOrElse(getInteger(this, "totalReserve"), 0) | |
35 | 35 | ||
36 | 36 | let q = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
37 | 37 | ||
38 | 38 | let r = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
39 | 39 | ||
40 | 40 | let s = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
41 | 41 | ||
42 | 42 | let t = valueOrElse(getInteger(this, "storedHeight"), height) | |
43 | 43 | ||
44 | 44 | let u = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000) | |
45 | 45 | ||
46 | 46 | func v (w) = if ((addressFromStringValue(e) == w)) | |
47 | 47 | then true | |
48 | 48 | else false | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func x (w) = if ((addressFromStringValue(f) == w)) | |
52 | 52 | then true | |
53 | 53 | else false | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func y (z,A) = StringEntry(z, A) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | func B (z,C) = IntegerEntry(z, C) | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func D (E) = valueOrElse(getInteger(this, (E + "_tokenBalance")), 0) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let F = fraction(n, a, o) | |
66 | 66 | ||
67 | 67 | let G = { | |
68 | 68 | let H = [F, j] | |
69 | 69 | let I = min(H) | |
70 | 70 | let J = [0, (F - j)] | |
71 | 71 | let K = max(J) | |
72 | 72 | ((fraction(i, I, a) + fraction(k, K, a)) + l) | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | let L = fraction(fraction(G, F, a), (a - m), a) | |
76 | 76 | ||
77 | 77 | let M = fraction(G, b, (c * a)) | |
78 | 78 | ||
79 | 79 | let N = (height - t) | |
80 | 80 | ||
81 | 81 | let O = fraction(u, (b + (M * N)), b, CEILING) | |
82 | 82 | ||
83 | 83 | let P = fraction(n, O, u) | |
84 | 84 | ||
85 | 85 | let Q = fraction(n, (M * N), b) | |
86 | 86 | ||
87 | 87 | let R = (o + fraction((a - m), Q, a)) | |
88 | 88 | ||
89 | 89 | let S = (p + fraction(m, Q, a)) | |
90 | 90 | ||
91 | 91 | let T = if ((q > 0)) | |
92 | 92 | then { | |
93 | 93 | let U = ((10 - 8) + h) | |
94 | 94 | let V = pow(10, 2, U, 2, 18, CEILING) | |
95 | 95 | fraction(R, V, q) | |
96 | 96 | } | |
97 | 97 | else { | |
98 | 98 | let W = (h + 6) | |
99 | 99 | let X = pow(10, 2, W, 2, 18, CEILING) | |
100 | 100 | fraction(2, X, 1) | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | func Y (Z) = { | |
104 | 104 | let U = ((10 - 8) + h) | |
105 | 105 | let V = pow(10, 2, U, 2, 18, CEILING) | |
106 | 106 | fraction(Z, V, T) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(aa) | |
111 | - | func deposit (ab,ac) = if (x(aa.caller)) | |
112 | - | then { | |
113 | - | let ad = Y(aa.payments[0].amount) | |
114 | - | let ae = (q + ad) | |
115 | - | let af = (D(ab) + ad) | |
111 | + | func deposit (ab,ac) = { | |
112 | + | let ad = Y(aa.payments[0].amount) | |
113 | + | let ae = (q + ad) | |
114 | + | let af = (D(ab) + ad) | |
116 | 115 | [Reissue(fromBase58String(s), ad, true), B("dTokenSupply", ae), B((ab + "_tokenBalance"), af), BooleanEntry((ab + "_useAsCollateral"), ac), B("totalBorrow", P), B("totalSupply", (R + aa.payments[0].amount)), B("totalReserve", S), B("storedIndex", O), B("storedHeight", height), ScriptTransfer(aa.caller, ad, fromBase58String(s))] | |
117 | - | } | |
118 | - | else throw("Address does not match with wavetroller address!") | |
116 | + | } | |
119 | 117 | ||
120 | 118 | ||
121 | 119 | ||
122 | 120 | @Callable(aa) | |
123 | 121 | func setup (ag,ah,ai,aj) = if (if (!(isDefined(getString(this, "config")))) | |
124 | 122 | then !(isDefined(getString(this, "admin"))) | |
125 | 123 | else false) | |
126 | 124 | then { | |
127 | 125 | let ak = Issue(ai, aj, 0, 8, true) | |
128 | 126 | let al = calculateAssetId(ak) | |
129 | 127 | [y("assetId", ag), y("configAddress", ah), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", b), IntegerEntry("storedHeight", height), y("dTokenName", ai), y("dTokenId", toBase58String(al)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)] | |
130 | 128 | } | |
131 | 129 | else throw("Pool already setup!") | |
132 | 130 | ||
133 | 131 | ||
134 | 132 | @Verifier(am) | |
135 | 133 | func an () = sigVerify(am.bodyBytes, am.proofs[0], am.senderPublicKey) | |
136 | 134 |
github/deemru/w8io/169f3d6 52.95 ms ◑