tx · BMBcHomCA5AhTqbtq7tBL72uqkESVxPCfg6he5HQM8HD

3MwLcJy3MSb2kq6dUaUR5uBgm8zCKZMjz2S:  -0.01400000 Waves

2021.03.26 22:40 [1455145] smart account 3MwLcJy3MSb2kq6dUaUR5uBgm8zCKZMjz2S > SELF 0.00000000 Waves

{ "type": 13, "id": "BMBcHomCA5AhTqbtq7tBL72uqkESVxPCfg6he5HQM8HD", "fee": 1400000, "feeAssetId": null, "timestamp": 1616787653711, "version": 2, "chainId": 84, "sender": "3MwLcJy3MSb2kq6dUaUR5uBgm8zCKZMjz2S", "senderPublicKey": "CgByewRUvLk7UtWSfRMLSYw4Ap2wT5dcdVYKideqDp9M", "proofs": [ "42SFdnTikbDfxfRRcS1taPfiePFa6DdtL8hMFmjaJ1qVMK7nGiSwBpkL4h7SD4SsgvTMVDx4eUqKgBhSz42ANaMY" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAAOAAAAAA50b3RhbEZlZUV0aEtleQIAAAANdG90YWxfZmVlX2V0aAAAAAAOdG90YWxGZWVVc2RLZXkCAAAADXRvdGFsX2ZlZV91c2QAAAAAEnRvdGFsRmVlRHl6cmFwdEtleQIAAAARdG90YWxfZmVlX2R5enJhcHQAAAAADnByaWNlT2ZEeXpyYXB0AgAAAANkeXoAAAAACnByaWNlT2ZFdGgCAAAAA2V0aAAAAAANb3JhY2xlQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVL4/7s2JD7wFpgWNJdKO/aqFvcIdJFtzlgAAAAAOZHl6cmFwdEFzc2V0SWQBAAAAIJ8Z6XPZJu9QR4hmGj9/o7LyMJ48jRPQD0CePJOEpwQjAAAAAApldGhBc3NldElkAQAAACAiJlO6kpv9VYDdwqxzfY0rRQ9rtHAOIBs/eo3GguMLoQAAAAALdXNkbkFzc2V0SWQBAAAAIHxpwWtkcIB0JFIbiNXtI38nVRmozWmXoaigru9h4HfCAQAAAAxnZXRGZWVBbW91bnQAAAABAAAABmFtb3Vud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c2RuQXNzZXRJZAkAAAIAAAABAgAAAClPbmx5IHVzZG4gdG9rZW5zIGFyZSBhbGxvd2VkIGZvciBzd2FwcGluZwQAAAADZmVlCQEAAAAMZ2V0RmVlQW1vdW50AAAAAQUAAAALdG90YWxBbW91bnQEAAAABmFtb3VudAkAAGUAAAACBQAAAAt0b3RhbEFtb3VudAUAAAADZmVlBAAAAAxkeXpyYXB0UHJpY2UJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAA1vcmFjbGVBZGRyZXNzAgAAAANkeXoCAAAAFFVuYWJsZSB0byBsb2FkIHByaWNlCQAAAgAAAAEJAAGkAAAAAQUAAAAMZHl6cmFwdFByaWNlAAAAAI47sS0=", "height": 1455145, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5BnAhGPLt9iSQAhg5JcghChrtYMmwh7BL53yFLQJBdPj Next: 6wG5C4uHb58SdVvwbqPqF4YGmw34DFZh7JP1XXTJNoaz Diff:
OldNewDifferences
77
88 let c = "total_fee_dyzrapt"
99
10-let d = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB')
10+let d = "dyz"
1111
12-let e = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA'
12+let e = "eth"
1313
14-let f = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp'
14+let f = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB')
1515
16-let g = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5'
16+let g = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA'
1717
18-func h (i) = {
19- let j = fraction(i, 3, 100)
20- j
18+let h = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp'
19+
20+let i = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5'
21+
22+func j (k) = {
23+ let l = fraction(k, 3, 100)
24+ l
2125 }
2226
2327
24-func k (l) = {
25- let m = valueOrElse(getInteger(this, l), 0)
26- m
28+func m (n) = {
29+ let o = valueOrElse(getInteger(this, n), 0)
30+ o
2731 }
2832
2933
30-func n () = k(a)
34+func p () = m(a)
3135
3236
33-func o () = k(b)
37+func q () = m(b)
3438
3539
36-func p () = k(c)
40+func r () = m(c)
3741
3842
39-@Callable(q)
43+@Callable(s)
4044 func test () = {
41- let r = value(q.payments[0])
42- let s = r.assetId
43- let i = r.amount
44- if ((s == e))
45- then throw(("its a dyzrapt. Amount=" + toString(i)))
45+ let t = value(s.payments[0])
46+ let u = t.assetId
47+ let k = t.amount
48+ if ((u == g))
49+ then throw(("its a dyzrapt. Amount=" + toString(k)))
4650 else throw("its not a dyzrapt")
51+ }
52+
53+
54+
55+@Callable(s)
56+func swapUsdnToDyzrapt () = {
57+ let t = value(s.payments[0])
58+ let u = t.assetId
59+ let v = t.amount
60+ if ((u != i))
61+ then throw("Only usdn tokens are allowed for swapping")
62+ else {
63+ let l = j(v)
64+ let k = (v - l)
65+ let w = valueOrErrorMessage(getInteger(f, "dyz"), "Unable to load price")
66+ throw(toString(w))
67+ }
4768 }
4869
4970
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = "total_fee_eth"
55
66 let b = "total_fee_usd"
77
88 let c = "total_fee_dyzrapt"
99
10-let d = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB')
10+let d = "dyz"
1111
12-let e = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA'
12+let e = "eth"
1313
14-let f = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp'
14+let f = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB')
1515
16-let g = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5'
16+let g = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA'
1717
18-func h (i) = {
19- let j = fraction(i, 3, 100)
20- j
18+let h = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp'
19+
20+let i = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5'
21+
22+func j (k) = {
23+ let l = fraction(k, 3, 100)
24+ l
2125 }
2226
2327
24-func k (l) = {
25- let m = valueOrElse(getInteger(this, l), 0)
26- m
28+func m (n) = {
29+ let o = valueOrElse(getInteger(this, n), 0)
30+ o
2731 }
2832
2933
30-func n () = k(a)
34+func p () = m(a)
3135
3236
33-func o () = k(b)
37+func q () = m(b)
3438
3539
36-func p () = k(c)
40+func r () = m(c)
3741
3842
39-@Callable(q)
43+@Callable(s)
4044 func test () = {
41- let r = value(q.payments[0])
42- let s = r.assetId
43- let i = r.amount
44- if ((s == e))
45- then throw(("its a dyzrapt. Amount=" + toString(i)))
45+ let t = value(s.payments[0])
46+ let u = t.assetId
47+ let k = t.amount
48+ if ((u == g))
49+ then throw(("its a dyzrapt. Amount=" + toString(k)))
4650 else throw("its not a dyzrapt")
51+ }
52+
53+
54+
55+@Callable(s)
56+func swapUsdnToDyzrapt () = {
57+ let t = value(s.payments[0])
58+ let u = t.assetId
59+ let v = t.amount
60+ if ((u != i))
61+ then throw("Only usdn tokens are allowed for swapping")
62+ else {
63+ let l = j(v)
64+ let k = (v - l)
65+ let w = valueOrErrorMessage(getInteger(f, "dyz"), "Unable to load price")
66+ throw(toString(w))
67+ }
4768 }
4869
4970

github/deemru/w8io/169f3d6 
28.88 ms