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/eo3GguMLoQAAAAALdXNkbkFzc2V0SWQBAAAAIHxpwWtkcIB0JFIbiNXtI38nVRmozWmXoaigru9h4HfCAQAAAAxnZXRGZWVBbW91bnQAAAABAA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kBQAAAAt1c2RuQXNzZXRJZAkAAAIAAAABAgAAAClPbmx5IHVzZG4gdG9rZW5zIGFyZSBhbGxvd2VkIGZvciBzd2FwcGluZwQAAAADZmVlCQEAAAAMZ2V0RmVlQW1vdW50AAAAAQUAAAALdG90YWxBbW91bnQEAAAABmFtb3VudAkAAGUAAAACBQAAAAt0b3RhbEFtb3VudAUAAAADZmVlBAAAAAxkeXpyYXB0UHJpY2UJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAA1vcmFjbGVBZGRyZXNzAgAAAANkeXoCAAAAFFVuYWJsZSB0byBsb2FkIHByaWNlCQAAAgAAAAEJAAGkAAAAAQUAAAAMZHl6cmFwdFByaWNlAAAAAI47sS0=",
"height": 1455145,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 5BnAhGPLt9iSQAhg5JcghChrtYMmwh7BL53yFLQJBdPj
Next: 6wG5C4uHb58SdVvwbqPqF4YGmw34DFZh7JP1XXTJNoaz
Diff:
Old | New | | Differences |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "total_fee_dyzrapt" |
---|
9 | 9 | | |
---|
10 | | - | let d = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB') |
---|
| 10 | + | let d = "dyz" |
---|
11 | 11 | | |
---|
12 | | - | let e = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA' |
---|
| 12 | + | let e = "eth" |
---|
13 | 13 | | |
---|
14 | | - | let f = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp' |
---|
| 14 | + | let f = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB') |
---|
15 | 15 | | |
---|
16 | | - | let g = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5' |
---|
| 16 | + | let g = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA' |
---|
17 | 17 | | |
---|
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 |
---|
21 | 25 | | } |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|
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 |
---|
27 | 31 | | } |
---|
28 | 32 | | |
---|
29 | 33 | | |
---|
30 | | - | func n () = k(a) |
---|
| 34 | + | func p () = m(a) |
---|
31 | 35 | | |
---|
32 | 36 | | |
---|
33 | | - | func o () = k(b) |
---|
| 37 | + | func q () = m(b) |
---|
34 | 38 | | |
---|
35 | 39 | | |
---|
36 | | - | func p () = k(c) |
---|
| 40 | + | func r () = m(c) |
---|
37 | 41 | | |
---|
38 | 42 | | |
---|
39 | | - | @Callable(q) |
---|
| 43 | + | @Callable(s) |
---|
40 | 44 | | 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))) |
---|
46 | 50 | | 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 | + | } |
---|
47 | 68 | | } |
---|
48 | 69 | | |
---|
49 | 70 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "total_fee_eth" |
---|
5 | 5 | | |
---|
6 | 6 | | let b = "total_fee_usd" |
---|
7 | 7 | | |
---|
8 | 8 | | let c = "total_fee_dyzrapt" |
---|
9 | 9 | | |
---|
10 | | - | let d = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB') |
---|
| 10 | + | let d = "dyz" |
---|
11 | 11 | | |
---|
12 | | - | let e = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA' |
---|
| 12 | + | let e = "eth" |
---|
13 | 13 | | |
---|
14 | | - | let f = base58'3JJkzB4pFXcqdJvC9TcV8ys1FLgesr5SxbhmykkpceQp' |
---|
| 14 | + | let f = Address(base58'3N7G2kVtBTh94aEnDHQ9dpi4EdsDxAiDXjB') |
---|
15 | 15 | | |
---|
16 | | - | let g = base58'9Nf5wpj6jds3VRZKDryp6Dtf3R9d8MdbjNhencLogCr5' |
---|
| 16 | + | let g = base58'Bi4jxKEFjjYG2emeyxZfpkVMS88N7uAogHNsi1urkoJA' |
---|
17 | 17 | | |
---|
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 |
---|
21 | 25 | | } |
---|
22 | 26 | | |
---|
23 | 27 | | |
---|
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 |
---|
27 | 31 | | } |
---|
28 | 32 | | |
---|
29 | 33 | | |
---|
30 | | - | func n () = k(a) |
---|
| 34 | + | func p () = m(a) |
---|
31 | 35 | | |
---|
32 | 36 | | |
---|
33 | | - | func o () = k(b) |
---|
| 37 | + | func q () = m(b) |
---|
34 | 38 | | |
---|
35 | 39 | | |
---|
36 | | - | func p () = k(c) |
---|
| 40 | + | func r () = m(c) |
---|
37 | 41 | | |
---|
38 | 42 | | |
---|
39 | | - | @Callable(q) |
---|
| 43 | + | @Callable(s) |
---|
40 | 44 | | 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))) |
---|
46 | 50 | | 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 | + | } |
---|
47 | 68 | | } |
---|
48 | 69 | | |
---|
49 | 70 | | |
---|