tx · FwmruPTPKcouQSgY1iKbefQphmcAYAzgCKXpeXoSV4Uj 3N88HLHyQgayARc6MXuoJgYJM6Hp9q8AD4X: -0.04000000 Waves 2021.05.17 14:58 [1529644] smart account 3N88HLHyQgayARc6MXuoJgYJM6Hp9q8AD4X > SELF 0.00000000 Waves
{ "type": 13, "id": "FwmruPTPKcouQSgY1iKbefQphmcAYAzgCKXpeXoSV4Uj", "fee": 4000000, "feeAssetId": null, "timestamp": 1621252766699, "version": 2, "chainId": 84, "sender": "3N88HLHyQgayARc6MXuoJgYJM6Hp9q8AD4X", "senderPublicKey": "7d8ot6oQCGQZb8ATJ6U8KciEiWMyGupkrdYRjcoRfNzs", "proofs": [ "3gpakFWQaKzRw2Nk5h1xMC8GqHnB22NNx79XyiabVsM2GUcbBgwtizKUPwqKnwafb1fEekALvDfh3QHaMCTUu9mT" ], "script": "base64:AAIEAAAAAAAAACAIAhIECgIBCBIECgIBCBIECgIBCBIECgIBCBIECgIBCAAAAAMBAAAAEGdldERlcG9zaXRBbW91bnQAAAACAAAACXB1YmxpY0tleQAAAAVhc3NldAQAAAAHYmFsYW5jZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAAIZGVwb3NpdF8FAAAACXB1YmxpY0tleQIAAAAGX1dBVkVTAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAAB2JhbGFuY2UBAAAAD2dldEJvcnJvd0Ftb3VudAAAAAIAAAAJcHVibGljS2V5AAAABWFzc2V0BAAAAAdiYWxhbmNlBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAAB2JvcnJvd18FAAAACXB1YmxpY0tleQIAAAABXwUAAAAFYXNzZXQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1h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NhY3Rpb24GAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgYGFsQETA==", "height": 1529644, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2YXY9UAUnnrrCQwPJ2ofvsH29zpgym639VhyBbEs5Mfr Next: GoBArkMb2LyJtg7yG2J8htn46Q6jeptMXPEQ5GPhrfLi Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c) = { | |
5 | 5 | let d = { | |
6 | - | let e = getInteger(this, (( | |
6 | + | let e = getInteger(this, (("deposit_" + b) + "_WAVES")) | |
7 | 7 | if ($isInstanceOf(e, "Int")) | |
8 | 8 | then { | |
9 | 9 | let f = e |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b,c) = { | |
5 | 5 | let d = { | |
6 | - | let e = getInteger(this, (( | |
6 | + | let e = getInteger(this, (("deposit_" + b) + "_WAVES")) | |
7 | 7 | if ($isInstanceOf(e, "Int")) | |
8 | 8 | then { | |
9 | 9 | let f = e | |
10 | 10 | f | |
11 | 11 | } | |
12 | 12 | else 0 | |
13 | 13 | } | |
14 | 14 | d | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func g (b,c) = { | |
19 | 19 | let d = { | |
20 | 20 | let e = getInteger(this, ((("borrow_" + b) + "_") + c)) | |
21 | 21 | if ($isInstanceOf(e, "Int")) | |
22 | 22 | then { | |
23 | 23 | let f = e | |
24 | 24 | f | |
25 | 25 | } | |
26 | 26 | else 0 | |
27 | 27 | } | |
28 | 28 | d | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func h (b,c) = { | |
33 | 33 | let i = { | |
34 | 34 | let e = getInteger(this, ((("collateral_" + b) + "_") + c)) | |
35 | 35 | if ($isInstanceOf(e, "Int")) | |
36 | 36 | then { | |
37 | 37 | let f = e | |
38 | 38 | f | |
39 | 39 | } | |
40 | 40 | else 0 | |
41 | 41 | } | |
42 | 42 | i | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(j) | |
47 | 47 | func deposit (k,c) = { | |
48 | 48 | let b = toBase58String(j.callerPublicKey) | |
49 | 49 | let l = a(b, c) | |
50 | 50 | let m = (l + k) | |
51 | 51 | if ((c == "")) | |
52 | 52 | then [IntegerEntry((("deposit_" + b) + "_WAVES"), m)] | |
53 | 53 | else [IntegerEntry(((("deposit_" + b) + "_") + c), m)] | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | ||
58 | 58 | @Callable(j) | |
59 | 59 | func depositCollateral (k,c) = { | |
60 | 60 | let b = toBase58String(j.callerPublicKey) | |
61 | 61 | let n = h(b, c) | |
62 | 62 | let o = (n + k) | |
63 | 63 | [IntegerEntry(((("collateral_" + b) + "_") + c), o)] | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(j) | |
69 | 69 | func borrow (k,c) = { | |
70 | 70 | let b = toBase58String(j.callerPublicKey) | |
71 | 71 | let p = g(b, c) | |
72 | 72 | let i = h(b, c) | |
73 | 73 | let q = ((i * 70) / 100) | |
74 | 74 | let r = (p + k) | |
75 | 75 | if ((i >= q)) | |
76 | 76 | then [IntegerEntry(((("borrow_" + b) + "_") + c), r)] | |
77 | 77 | else throw("Not enough collateral") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | ||
82 | 82 | @Callable(j) | |
83 | 83 | func repay (k,c) = { | |
84 | 84 | let b = toBase58String(j.callerPublicKey) | |
85 | 85 | let s = g(b, c) | |
86 | 86 | if ((s > 0)) | |
87 | 87 | then [IntegerEntry(((("borrow_" + b) + "_") + c), (s - k))] | |
88 | 88 | else throw("Nothing to repay") | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | ||
93 | 93 | @Callable(j) | |
94 | 94 | func withdraw (k,c) = { | |
95 | 95 | let b = toBase58String(j.callerPublicKey) | |
96 | 96 | let t = a(b, c) | |
97 | 97 | if ((t > 0)) | |
98 | 98 | then [IntegerEntry(((("deposit_" + b) + "_") + c), (t - k))] | |
99 | 99 | else throw("Nothing to withdraw") | |
100 | 100 | } | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Verifier(u) | |
104 | 104 | func v () = { | |
105 | 105 | let e = u | |
106 | 106 | if ($isInstanceOf(e, "DataTransaction")) | |
107 | 107 | then true | |
108 | 108 | else if ($isInstanceOf(e, "SetScriptTransaction")) | |
109 | 109 | then true | |
110 | 110 | else true | |
111 | 111 | } | |
112 | 112 |
github/deemru/w8io/169f3d6 42.63 ms ◑