tx · BmtCAFyoL1LWZ8bfqrZguijQvg5LeDPiUSx4RumV4d5i 3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN: -0.01000000 Waves 2023.01.20 21:41 [2413667] smart account 3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN > SELF 0.00000000 Waves
{ "type": 13, "id": "BmtCAFyoL1LWZ8bfqrZguijQvg5LeDPiUSx4RumV4d5i", "fee": 1000000, "feeAssetId": null, "timestamp": 1674240109047, "version": 2, "chainId": 84, "sender": "3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN", "senderPublicKey": "2Gtgx295VLiew3CzXqh9eXfFZBTEpDW2nLsrJZ1C4i9J", "proofs": [ "2ascc63HN5sDEXQ38xr3Hxj7tLJcK2V4wxCwCePB6A8DHQHirXSRAtQir1Tp9zvtAKHcXw133zdURkbVWMtgRCqL" ], "script": "base64:AAIFAAAAAAAAACMIAhIGCgQIBAgEEgMKAQgSBwoFCAgIAQgSAwoBCBIECgIICAAAAAoBAAAAFHRyeUdldFN0cmluZ0V4dGVybmFsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAABV0cnlHZXRJbnRlZ2VyRXh0ZXJuYWwAAAACAAAAB2FkZHJlc3MAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAAAAAAAAAAAAAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQkBAAAAFHRyeUdldFN0cmluZ0V4dGVybmFsAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAA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kAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAANuaWwAAAABaQEAAAASZmluYWxpemVPdXRnb2luZ1R4AAAAAgAAAAR0eElkAAAACW90aGVyVHhJZAMJAQAAAAIhPQAAAAIJAQAAAAx0cnlHZXRTdHJpbmcAAAABCQABLAAAAAIJAAEsAAAAAgIAAAADdHhfBQAAAAR0eElkAgAAAAhfb3RoZXJJZAIAAAAACQAAAgAAAAEJAAEsAAAAAgUAAAAEdHhJZAIAAAAcIGlzIGFscmVhZHkgZnVsbHkgcHJvY2Vzc2VkIQMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAAEdGhpcwkAAAIAAAABAgAAAA1EaXJ0eSBoYWNrZXIhCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAN0eF8FAAAABHR4SWQCAAAAB19zdGF0dXMCAAAACVBST0NFU1NFRAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAADdHhfBQAAAAR0eElkAgAAAAhfb3RoZXJJZAUAAAAJb3RoZXJUeElkBQAAAANuaWwAAAAAZGa65Q==", "height": 2413667, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: H6mJ7TjZEhbmP9jg2zUQMiQKMUQTMJeEm5viKyvzCmvf Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func tryGetStringExternal (address,key) = match getString(address, key) { | |
5 | + | case a: String => | |
6 | + | a | |
7 | + | case _ => | |
8 | + | "" | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func tryGetIntegerExternal (address,key) = match getInteger(address, key) { | |
13 | + | case b: Int => | |
14 | + | b | |
15 | + | case _ => | |
16 | + | 0 | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func tryGetString (key) = tryGetStringExternal(this, key) | |
21 | + | ||
22 | + | ||
23 | + | func tryGetInteger (key) = tryGetIntegerExternal(this, key) | |
24 | + | ||
25 | + | ||
26 | + | func tryGetBoolean (key) = match getBoolean(this, key) { | |
27 | + | case b: Boolean => | |
28 | + | b | |
29 | + | case _ => | |
30 | + | false | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | func assetIdToString (assetId) = toBase58String(value(assetId)) | |
35 | + | ||
36 | + | ||
37 | + | func nativeAssetKey (nativeAsset) = ("nativeAsset_" + nativeAsset) | |
38 | + | ||
39 | + | ||
40 | + | func otherChainAssetKey (otherChainAsset) = ("otherChainAsset_" + otherChainAsset) | |
41 | + | ||
42 | + | ||
43 | + | func reissueable (asset) = ("reissueable_" + asset) | |
44 | + | ||
45 | + | ||
46 | + | func validatePayment (payment) = { | |
47 | + | let pmt = value(payment) | |
48 | + | if (!(isDefined(pmt.assetId))) | |
49 | + | then throw("It needs to be an asset") | |
50 | + | else { | |
51 | + | let assetDetails = value(assetInfo(value(pmt.assetId))) | |
52 | + | if ((1 > pmt.amount)) | |
53 | + | then throw("You didnt attached a payment!") | |
54 | + | else assetIdToString(pmt.assetId) | |
55 | + | } | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | @Callable(i) | |
60 | + | func initiateAssets (nativeAsset,nativeAssetReissueable,otherChainAsset,otherChainAssetReissueable) = if ((tryGetString(nativeAssetKey(nativeAsset)) != "")) | |
61 | + | then throw("Native Asset already listed!") | |
62 | + | else if ((tryGetString(otherChainAssetKey(otherChainAsset)) != "")) | |
63 | + | then throw("Other Asset already listed!") | |
64 | + | else [StringEntry(nativeAssetKey(nativeAsset), otherChainAsset), StringEntry(otherChainAssetKey(otherChainAsset), nativeAsset), BooleanEntry(reissueable(nativeAsset), nativeAssetReissueable), BooleanEntry(reissueable(otherChainAsset), otherChainAssetReissueable)] | |
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | @Callable(i) | |
69 | + | func initiateOutGoingTx (destination) = { | |
70 | + | let payment = i.payments | |
71 | + | if ((size(payment) != 1)) | |
72 | + | then throw("Invalid payment added!") | |
73 | + | else if ((1 > payment[0].amount)) | |
74 | + | then throw("Invalid amount added!") | |
75 | + | else { | |
76 | + | let assetId = validatePayment(payment[0]) | |
77 | + | let specifiqueData = if (tryGetBoolean(reissueable(assetId))) | |
78 | + | then [Burn(fromBase58String(assetId), payment[0].amount), StringEntry((("tx_" + toBase58String(i.transactionId)) + "_asset_to_receive"), tryGetString(otherChainAssetKey(assetId)))] | |
79 | + | else [StringEntry((("tx_" + toBase58String(i.transactionId)) + "_asset_to_receive"), tryGetString(nativeAssetKey(assetId)))] | |
80 | + | ([StringEntry((("tx_" + toBase58String(i.transactionId)) + "_dest"), destination), StringEntry((("tx_" + toBase58String(i.transactionId)) + "_status"), "UNPROCESSED")] ++ specifiqueData) | |
81 | + | } | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | @Callable(i) | |
87 | + | func storeDataIncomingTx (txId,destination,assetId,amount,assetIdToReceive) = if (if ((tryGetString((("tx_" + txId) + "_status")) != "")) | |
88 | + | then true | |
89 | + | else (tryGetString((("tx_" + txId) + "_dest")) != "")) | |
90 | + | then throw((txId + " is already stored!")) | |
91 | + | else if ((i.caller != this)) | |
92 | + | then throw("Dirty hacker") | |
93 | + | else [StringEntry((("tx_" + txId) + "_dest"), destination), StringEntry((("tx_" + txId) + "_status"), "UNPROCESSED"), StringEntry((("tx_" + txId) + "_assetId"), assetId), StringEntry((("tx_" + txId) + "_assetId_to_receive"), assetIdToReceive), IntegerEntry((("tx_" + txId) + "_amount"), amount)] | |
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | @Callable(i) | |
98 | + | func releaseIncomingTx (txId) = { | |
99 | + | let status = tryGetString((("tx_" + txId) + "_status")) | |
100 | + | if ((status == "")) | |
101 | + | then throw("No such txid found!") | |
102 | + | else if ((status == "PROCESSED")) | |
103 | + | then throw("Already processed!") | |
104 | + | else { | |
105 | + | let assetIdToReceive = tryGetString((("tx_" + txId) + "_assetId_to_receive")) | |
106 | + | let destination = tryGetString((("tx_" + txId) + "_dest")) | |
107 | + | let amount = tryGetInteger((("tx_" + txId) + "_amount")) | |
108 | + | let assetId = tryGetString((("tx_" + txId) + "_assetId")) | |
109 | + | let specifiqueData = if (tryGetBoolean(reissueable(assetIdToReceive))) | |
110 | + | then if ((tryGetString(otherChainAssetKey(assetId)) != assetIdToReceive)) | |
111 | + | then throw("Skipping tx, corrupt data!") | |
112 | + | else [Reissue(fromBase58String(assetIdToReceive), amount, true)] | |
113 | + | else if ((tryGetString(nativeAssetKey(assetId)) != assetIdToReceive)) | |
114 | + | then throw("Skipping tx, corrupt data!") | |
115 | + | else nil | |
116 | + | (specifiqueData ++ [ScriptTransfer(addressFromStringValue(destination), amount, fromBase58String(assetIdToReceive)), StringEntry((("tx_" + txId) + "_status"), "PROCESSED"), StringEntry((("tx_" + txId) + "_otherId"), toBase58String(i.transactionId))]) | |
117 | + | } | |
118 | + | } | |
119 | + | ||
120 | + | ||
121 | + | ||
122 | + | @Callable(i) | |
123 | + | func finalizeOutgoingTx (txId,otherTxId) = if ((tryGetString((("tx_" + txId) + "_otherId")) != "")) | |
124 | + | then throw((txId + " is already fully processed!")) | |
125 | + | else if ((i.caller != this)) | |
126 | + | then throw("Dirty hacker!") | |
127 | + | else [StringEntry((("tx_" + txId) + "_status"), "PROCESSED"), StringEntry((("tx_" + txId) + "_otherId"), otherTxId)] | |
128 | + | ||
129 | + |
github/deemru/w8io/169f3d6 28.04 ms ◑