tx · Ai1Z1acoXVR4XornNhK21iesFTvhL45ZZ7x4g3XADBY4

3N88HLHyQgayARc6MXuoJgYJM6Hp9q8AD4X:  -0.01000000 Waves

2021.05.17 13:30 [1529559] smart account 3N88HLHyQgayARc6MXuoJgYJM6Hp9q8AD4X > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
21.16 ms