tx · 4qV9EVJ5ZQ2mwaVux3ysFBJV5aJUu8Mo82tqbkPRN1Mt 3MpKvUfNxrgF7QotPjFwi8thMagSveNScKe: -0.01400000 Waves 2020.11.30 20:46 [1288475] smart account 3MpKvUfNxrgF7QotPjFwi8thMagSveNScKe > SELF 0.00000000 Waves
{ "type": 13, "id": "4qV9EVJ5ZQ2mwaVux3ysFBJV5aJUu8Mo82tqbkPRN1Mt", "fee": 1400000, "feeAssetId": null, "timestamp": 1606758394634, "version": 2, "chainId": 84, "sender": "3MpKvUfNxrgF7QotPjFwi8thMagSveNScKe", "senderPublicKey": "9GE2xN4fms9YNDxR1hGg52RynqDd8125TA42g4X29ZV7", "proofs": [ "4bMoZo2o62S9Doe7tj3wM9QYb1sTNasYL3nUgGDRh6SGiShoSX8A8kbBVL1eUDANyd2LysLs7AvAaAd5MErkj2fo" ], "script": "base64:AAIEAAAAAAAAABsIAhIFCgMIAQgSBQoDAQgBEgQKAggIEgMKAQgAAAAFAAAAAAJjZgkBAAAAFGFkZHJlc3NGcm9tUHVibGljS2V5AAAAAQkAAlkAAAABAgAAACxKN3Z5b1VBOEdkNVFNcTRZVnRlZHB2MTlkd0NZcm9aRVlyTjhiS2dMenFWOAAAAAADZ3R3CQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQACWQAAAAECAAAALEM4alJvWEVDRmhlVDZKUGNBa2N5V1BhZFlieEJBNnRTeUFxWHFqcTVkaWNTAAAAAARvcGJyAQAAACCZ/Lmhr2gdslh5wdeyxpqCoiFBjOQ+l8StmOhlSrjFfwEAAAAQZ2V0QWxsb3dlZFRva2VucwAAAAEAAAAHdG9rZW5JZAQAAAAFYWxsb3cEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAAHdG9rZW5JZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBwUAAAAFYWxsb3cBAAAADHZlcmlmaWN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AAFpAAAABmNhbGxlcgAAAAVieXRlcwMDCQEAAAACIT0AAAACBQAAAARBZGRyCQAEJQAAAAEFAAAABHRoaXMJAQAAAAIhPQAAAAIFAAAABEFkZHIJAAQlAAAAAQUAAAACY2YHCQAAAgAAAAECAAAALFRoZSBhZGRyZXNzIGlzIG5vdCBhdXRob3JpemVkIHRvIGxpc3QgdG9rZW5zCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAB3Rva2VuSWQFAAAABnRpY2tlcgkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAJjZgAAAAAAAA9CQAUAAAAEdW5pdAUAAAADbmlsAAAAAWkBAAAAC3Rva2VuRGVsaXN0AAAAAQAAAAd0b2tlbklkBAAAAARBZGRyCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDAwkBAAAAAiE9AAAAAgUAAAAEQWRkcgkABCUAAAABBQAAAAR0aGlzCQEAAAACIT0AAAACBQAAAARBZGRyCQAEJQAAAAEFAAAAAmNmBwkAAAIAAAABAgAAAC5UaGUgYWRkcmVzcyBpcyBub3QgYXV0aG9yaXplZCB0byBkZWxpc3QgdG9rZW5zCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAAB3Rva2VuSWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAACY2YAAAAAAACYloAFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5U5SRww==", "height": 1288475, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EfWQ7CUKSC7EEC7YT23JzPyqyJyBNPkzTj1EEnJmjp1B Next: 9Lf9kbCkyTXnRoDw11CoS6vmYE5cZxusnbwuPP1sDLaw Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let cf = addressFromPublicKey(fromBase58String("J7vyoUA8Gd5QMq4YVtedpv19dwCYroZEYrN8bKgLzqV8")) | |
5 | 5 | ||
6 | - | let opbr = base58'HMov2457acf5MEJr85fvXYL3vrTEevFpsEQkHh1yfdUT' | |
6 | + | let gtw = addressFromPublicKey(fromBase58String("C8jRoXECFheT6JPcAkcyWPadYbxBA6tSyAqXqjq5dicS")) | |
7 | + | ||
8 | + | let opbr = base58'BN6ta4Sfmmh8tfmJE4pqJrSxLNJReAqnerPePYqkjcjG' | |
7 | 9 | ||
8 | 10 | func getAllowedTokens (tokenId) = { | |
9 | 11 | let allow = match getString(this, tokenId) { | |
20 | 22 | let getMsg = toBytes(toBase58String(keccak256(blake2b256(toBytes(m))))) | |
21 | 23 | sigVerify(getMsg, fromBase58String(s), base58'C8jRoXECFheT6JPcAkcyWPadYbxBA6tSyAqXqjq5dicS') | |
22 | 24 | } | |
23 | - | ||
24 | - | ||
25 | - | @Callable(i) | |
26 | - | func opbrTest (tokenId,qtd,sig) = { | |
27 | - | let pmt = i.payments | |
28 | - | if ((tokenId == "kjflkdsjf")) | |
29 | - | then throw("nada") | |
30 | - | else throw((tokenId + toString((qtd + pmt[0].amount)))) | |
31 | - | } | |
32 | - | ||
33 | 25 | ||
34 | 26 | ||
35 | 27 | @Callable(i) | |
55 | 47 | let c = fraction(1, pmt[0].amount, 100) | |
56 | 48 | [ScriptTransfer(i.caller, qtd, opbr), ScriptTransfer(cf, c, pmt[0].assetId)] | |
57 | 49 | } | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func bygtw (orderId,payoutAddr,amount) = { | |
56 | + | let senderAddr = toBase58String(i.caller.bytes) | |
57 | + | if ((senderAddr != toString(gtw))) | |
58 | + | then throw("Your account is not authorized for gateway execution") | |
59 | + | else [ScriptTransfer(i.caller, 1000000, unit), ScriptTransfer(addressFromStringValue(payoutAddr), amount, opbr)] | |
58 | 60 | } | |
59 | 61 | ||
60 | 62 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let cf = addressFromPublicKey(fromBase58String("J7vyoUA8Gd5QMq4YVtedpv19dwCYroZEYrN8bKgLzqV8")) | |
5 | 5 | ||
6 | - | let opbr = base58'HMov2457acf5MEJr85fvXYL3vrTEevFpsEQkHh1yfdUT' | |
6 | + | let gtw = addressFromPublicKey(fromBase58String("C8jRoXECFheT6JPcAkcyWPadYbxBA6tSyAqXqjq5dicS")) | |
7 | + | ||
8 | + | let opbr = base58'BN6ta4Sfmmh8tfmJE4pqJrSxLNJReAqnerPePYqkjcjG' | |
7 | 9 | ||
8 | 10 | func getAllowedTokens (tokenId) = { | |
9 | 11 | let allow = match getString(this, tokenId) { | |
10 | 12 | case a: String => | |
11 | 13 | a | |
12 | 14 | case _ => | |
13 | 15 | false | |
14 | 16 | } | |
15 | 17 | allow | |
16 | 18 | } | |
17 | 19 | ||
18 | 20 | ||
19 | 21 | func verification (m,s) = { | |
20 | 22 | let getMsg = toBytes(toBase58String(keccak256(blake2b256(toBytes(m))))) | |
21 | 23 | sigVerify(getMsg, fromBase58String(s), base58'C8jRoXECFheT6JPcAkcyWPadYbxBA6tSyAqXqjq5dicS') | |
22 | 24 | } | |
23 | - | ||
24 | - | ||
25 | - | @Callable(i) | |
26 | - | func opbrTest (tokenId,qtd,sig) = { | |
27 | - | let pmt = i.payments | |
28 | - | if ((tokenId == "kjflkdsjf")) | |
29 | - | then throw("nada") | |
30 | - | else throw((tokenId + toString((qtd + pmt[0].amount)))) | |
31 | - | } | |
32 | - | ||
33 | 25 | ||
34 | 26 | ||
35 | 27 | @Callable(i) | |
36 | 28 | func opbrBuy (tokenId,qtd,sig) = { | |
37 | 29 | let buyerAddr = toBase58String(i.caller.bytes) | |
38 | 30 | let pmt = i.payments | |
39 | 31 | let allowed = getAllowedTokens(tokenId) | |
40 | 32 | if ((size(pmt) == 0)) | |
41 | 33 | then throw("Payment for exchange is mandatory") | |
42 | 34 | else if ((size(pmt) == 2)) | |
43 | 35 | then throw("Only one payment per transaction is allowed") | |
44 | 36 | else if (!(verification((tokenId + toString((qtd + pmt[0].amount))), sig))) | |
45 | 37 | then throw("Stop hacking me!") | |
46 | 38 | else if (if (isDefined(pmt[0].assetId)) | |
47 | 39 | then (allowed == false) | |
48 | 40 | else false) | |
49 | 41 | then throw("The used token is not accepted") | |
50 | 42 | else if (if (isDefined(pmt[0].assetId)) | |
51 | 43 | then (fromBase58String(tokenId) != pmt[0].assetId) | |
52 | 44 | else false) | |
53 | 45 | then throw("declared token is different from submitted token") | |
54 | 46 | else { | |
55 | 47 | let c = fraction(1, pmt[0].amount, 100) | |
56 | 48 | [ScriptTransfer(i.caller, qtd, opbr), ScriptTransfer(cf, c, pmt[0].assetId)] | |
57 | 49 | } | |
50 | + | } | |
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | @Callable(i) | |
55 | + | func bygtw (orderId,payoutAddr,amount) = { | |
56 | + | let senderAddr = toBase58String(i.caller.bytes) | |
57 | + | if ((senderAddr != toString(gtw))) | |
58 | + | then throw("Your account is not authorized for gateway execution") | |
59 | + | else [ScriptTransfer(i.caller, 1000000, unit), ScriptTransfer(addressFromStringValue(payoutAddr), amount, opbr)] | |
58 | 60 | } | |
59 | 61 | ||
60 | 62 | ||
61 | 63 | ||
62 | 64 | @Callable(i) | |
63 | 65 | func tokenList (tokenId,ticker) = { | |
64 | 66 | let Addr = toBase58String(i.caller.bytes) | |
65 | 67 | if (if ((Addr != toString(this))) | |
66 | 68 | then (Addr != toString(cf)) | |
67 | 69 | else false) | |
68 | 70 | then throw("The address is not authorized to list tokens") | |
69 | 71 | else [StringEntry(tokenId, ticker), ScriptTransfer(cf, 1000000, unit)] | |
70 | 72 | } | |
71 | 73 | ||
72 | 74 | ||
73 | 75 | ||
74 | 76 | @Callable(i) | |
75 | 77 | func tokenDelist (tokenId) = { | |
76 | 78 | let Addr = toBase58String(i.caller.bytes) | |
77 | 79 | if (if ((Addr != toString(this))) | |
78 | 80 | then (Addr != toString(cf)) | |
79 | 81 | else false) | |
80 | 82 | then throw("The address is not authorized to delist tokens") | |
81 | 83 | else [DeleteEntry(tokenId), ScriptTransfer(cf, 10000000, unit)] | |
82 | 84 | } | |
83 | 85 | ||
84 | 86 | ||
85 | 87 | @Verifier(tx) | |
86 | 88 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
87 | 89 |
github/deemru/w8io/169f3d6 44.10 ms ◑