tx · 6KRJvR4qcEFmVvFEF6YB6P47xL1X8GX5WWG7YsKropwU

3NBNKJTqCGbPCDw1A86tAH3oLjFfhAmUYKW:  -0.00600000 Waves

2022.08.26 15:10 [2201430] smart account 3NBNKJTqCGbPCDw1A86tAH3oLjFfhAmUYKW > SELF 0.00000000 Waves

{ "type": 13, "id": "6KRJvR4qcEFmVvFEF6YB6P47xL1X8GX5WWG7YsKropwU", "fee": 600000, "feeAssetId": null, "timestamp": 1661515791225, "version": 2, "chainId": 84, "sender": "3NBNKJTqCGbPCDw1A86tAH3oLjFfhAmUYKW", "senderPublicKey": "5KgB1ZojKX7qznjw2mAXoU9asTrLAHv5nEvk36suSN3c", "proofs": [ "5LMJmF7HT5LqKT5Gmt8dtYocovmw3osPxY499VUSdC9xxwJRPcv8SpJHqEP9QZ5nXu6uBfubZgmbnGDkqhUSpsdL" ], "script": "base64:BgIHCAISAwoBAQEABGRhcHABGgFU61C/dqMfxvABbM6dnx1tiGfoEC0nPfYlAQFpAQlmcmVlV2F2ZXMBBmFtb3VudAMJAGYCBQZhbW91bnQAgISvXwkAAgECGXRoZSBtYXggYW1vdW50IGlzIDIgd2F2ZXMEBnNlbmRlcggFAWkGY2FsbGVyBApzZW5kZXJfa2V5CQCsAgIJAKUIAQUGc2VuZGVyAgZfV0FWRVMEDGdldE9sZEFtb3VudAkAmggCBQR0aGlzBQpzZW5kZXJfa2V5BAlvbGRBbW91bnQEByRtYXRjaDAFDGdldE9sZEFtb3VudAMJAAECBQckbWF0Y2gwAgNJbnQEAmluBQckbWF0Y2gwCQBkAgUCaW4AAAMJAAECBQckbWF0Y2gwAgRVbml0BAJ1bgUHJG1hdGNoMAAAAAADCQBmAgUJb2xkQW1vdW50AICo1rkHCQACAQImdGhlIG1heCBhbW91bnQgdG8gd2l0aGRyYXcgaXMgMTAgd2F2ZXMECW5ld0Ftb3VudAkAZAIFCW9sZEFtb3VudAUGYW1vdW50BARzYXZlCQEMSW50ZWdlckVudHJ5AgUKc2VuZGVyX2tleQUJbmV3QW1vdW50BAh0cmFuc2ZlcgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQZhbW91bnQFBHVuaXQJAMwIAgUIdHJhbnNmZXIJAMwIAgUEc2F2ZQUDbmlsAFb1oto=", "height": 2201430, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E5LmmHMfXY9bchycWQ64mbHat3EX8nXBJw2KjNesLx2u Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = base58'FVXgJ86erBw5GAMeAw1CnYXwQn48BFAEAhRyHPUjbMQB'
4+let a = base58'3NBNKJTqCGbPCDw1A86tAH3oLjFfhAmUYKW'
55
6-let b = base58'HRut8ESAGXxwvsKJky1V96qRtqyXQd4Apq4GY7TE5yGP'
7-
8-let c = "3N3DCngjidivkJbTJwFTEvbYRTffCWVBLCL"
9-
10-let d = 5
11-
12-let e = base58'3MzwNdM8LQZEPXq3d4uXvxeZGpBwVQXs9RD'
13-
14-func f (g) = {
15- let h = getInteger(this, g)
16- if ($isInstanceOf(h, "Int"))
17- then {
18- let i = h
19- i
20- }
21- else 0
22- }
23-
24-
25-@Callable(j)
26-func buy_usdn_ticket () = if ((j.payments[0].assetId != a))
27- then throw("Please deposit USD-N token only")
6+@Callable(b)
7+func freeWaves (c) = if ((c > 200000000))
8+ then throw("the max amount is 2 waves")
289 else {
29- let k = f((("usdn_" + toString(j.originCaller)) + "_credit"))
30- let l = j.payments[0].amount
31- let m = (k + l)
32- let n = f("usdn_all_credit")
33- let o = (n + l)
34- let p = {
35- let h = lastBlock.height
10+ let d = b.caller
11+ let e = (toString(d) + "_WAVES")
12+ let f = getInteger(this, e)
13+ let g = {
14+ let h = f
3615 if ($isInstanceOf(h, "Int"))
3716 then {
38- let q = h
39- q
17+ let i = h
18+ (i + 0)
4019 }
41- else throw("Error! with blochchain height")
20+ else if ($isInstanceOf(h, "Unit"))
21+ then {
22+ let j = h
23+ 0
24+ }
25+ else 0
4226 }
43- let r = invoke(Address(e), "usdN_stake", nil, [AttachedPayment(a, l)])
44- if ((r == r))
45- then [IntegerEntry((("usdn_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdn_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdn_all_credit", o), IntegerEntry("usdn_all_block", p)]
46- else throw("Strict value is not equal to itself.")
47- }
48-
49-
50-
51-@Callable(j)
52-func buy_usdc_ticket () = if ((j.payments[0].assetId != b))
53- then throw("Please deposit USD-N token only")
54- else {
55- let k = f((("usdc_" + toString(j.originCaller)) + "_credit"))
56- let l = j.payments[0].amount
57- let m = (k + l)
58- let n = f("usdc_all_credit")
59- let o = (n + l)
60- let p = {
61- let h = lastBlock.height
62- if ($isInstanceOf(h, "Int"))
63- then {
64- let q = h
65- q
66- }
67- else throw("Error block number")
68- }
69- let r = invoke(Address(e), "usdC_stake", nil, [AttachedPayment(b, l)])
70- if ((r == r))
71- then [IntegerEntry((("usdc_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdc_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdc_all_credit", o), IntegerEntry("usdc_all_block", p)]
72- else throw("Strict value is not equal to itself.")
73- }
74-
75-
76-
77-@Callable(j)
78-func sell_usdn_ticket (s) = {
79- let k = f((("usdn_" + toString(j.originCaller)) + "_credit"))
80- if ((s > k))
81- then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(k)))
82- else {
83- let m = (k - s)
84- let n = f("usdn_all_credit")
85- let o = (n - s)
86- let p = {
87- let h = lastBlock.height
88- if ($isInstanceOf(h, "Int"))
89- then {
90- let q = h
91- q
92- }
93- else throw("Error block number")
94- }
95- let r = invoke(Address(e), "usdN_cancelStake", [s], nil)
96- if ((r == r))
97- then [IntegerEntry((("usdn_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdn_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdn_all_credit", o), IntegerEntry("usdn_all_block", p)]
98- else throw("Strict value is not equal to itself.")
99- }
100- }
101-
102-
103-
104-@Callable(j)
105-func sell_usdc_ticket (s) = {
106- let k = f((("usdc_" + toString(j.originCaller)) + "_credit"))
107- if ((s > k))
108- then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(k)))
109- else {
110- let m = (k - s)
111- let n = f("usdc_all_credit")
112- let o = (n - s)
113- let p = {
114- let h = lastBlock.height
115- if ($isInstanceOf(h, "Int"))
116- then {
117- let q = h
118- q
119- }
120- else throw("Error block number")
121- }
122- let r = invoke(Address(e), "usdC_cancelStake", [s], nil)
123- if ((r == r))
124- then [IntegerEntry((("usdc_" + toString(j.originCaller)) + "_credit"), m), IntegerEntry((("usdc_" + toString(j.originCaller)) + "_block"), p), IntegerEntry("usdc_all_credit", o), IntegerEntry("usdc_all_block", p)]
125- else throw("Strict value is not equal to itself.")
126- }
127- }
128-
129-
130-
131-@Callable(j)
132-func usdn_calc_profit_amount () = if ((toString(j.originCaller) != c))
133- then throw("Sorry! you are not allowed to use this funaction")
134- else {
135- let t = f("usdn_profit_last_block")
136- let u = f("usdn_profit_last_amount")
137- let p = {
138- let h = lastBlock.height
139- if ($isInstanceOf(h, "Int"))
140- then {
141- let q = h
142- q
143- }
144- else throw("Error block number")
145- }
146- let v = (p - t)
147- if ((d > v))
148- then throw((("Please try again after " + toString((d - v))) + " block"))
27+ if ((g > 2000000000))
28+ then throw("the max amount to withdraw is 10 waves")
14929 else {
150- let w = assetBalance(this, a)
151-[IntegerEntry("usdn_profit_last_block", p), IntegerEntry("usdn_profit_last_amount", w)]
30+ let k = (g + c)
31+ let l = IntegerEntry(e, k)
32+ let m = ScriptTransfer(b.caller, c, unit)
33+[m, l]
15234 }
15335 }
15436
155-
156-
157-@Callable(j)
158-func usdn_send_profit_amount () = {
159- let u = f("usdn_profit_last_amount")
160- if ((0 >= u))
161- then throw(("you dont have profit amount " + toString(u)))
162- else {
163- let x = ScriptTransfer(addressFromStringValue(c), u, a)
164-[x]
165- }
166- }
167-
168-
169-
170-@Callable(j)
171-func usdc_calc_profit_amount () = if ((toString(j.originCaller) != c))
172- then throw("Sorry! you are not allowed to use this funaction")
173- else {
174- let y = f("usdc_profit_last_block")
175- let z = f("usdc_profit_last_amount")
176- let p = {
177- let h = lastBlock.height
178- if ($isInstanceOf(h, "Int"))
179- then {
180- let q = h
181- q
182- }
183- else throw("Error block number")
184- }
185- let v = (p - y)
186- if ((d > v))
187- then throw((("Please try again after " + toString((d - v))) + " block"))
188- else {
189- let A = assetBalance(this, b)
190-[IntegerEntry("usdc_profit_last_block", p), IntegerEntry("usdc_profit_last_amount", A)]
191- }
192- }
193-
194-
195-
196-@Callable(j)
197-func usdc_send_profit_amount () = {
198- let z = f("usdc_profit_last_amount")
199- if ((0 >= z))
200- then throw(("you dont have profit amount " + toString(z)))
201- else {
202- let x = ScriptTransfer(addressFromStringValue(c), z, b)
203-[x]
204- }
205- }
206-
207-
208-@Verifier(B)
209-func C () = sigVerify(B.bodyBytes, B.proofs[0], B.senderPublicKey)
21037

github/deemru/w8io/169f3d6 
43.92 ms