tx · 3ft8CfRSD4WVmKQ5zMUNZwjzzHBgLsZwrmTyLb8tWqF5 3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN: -0.01000000 Waves 2023.02.25 18:43 [2465400] smart account 3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN > SELF 0.00000000 Waves
{ "type": 13, "id": "3ft8CfRSD4WVmKQ5zMUNZwjzzHBgLsZwrmTyLb8tWqF5", "fee": 1000000, "feeAssetId": null, "timestamp": 1677339809818, "version": 2, "chainId": 84, "sender": "3N9ZoipEVJyQhhijNYxkcomvgGrrEeDhPvN", "senderPublicKey": "2Gtgx295VLiew3CzXqh9eXfFZBTEpDW2nLsrJZ1C4i9J", "proofs": [ "4Eh14z91xyzn971wv64xuSkXoBVa6WH4im2ThR77Ry2ztTCnYhZVSvbJuxzwkvqDg7GhrypcjUrXP99nkp4MoTu8" ], "script": "base64:AAIFAAAAAAAAACUIAhIICgYIBAQIBAQSAwoBCBIHCgUICAgBCBIDCgEIEgQKAggIAAAAEQEAAAAKb3JhY2xlc0tleQAAAAACAAAAC29yYWNsZXNMaXN0AQAAABJnZXRFeHRlcm5hbE9yYWNsZXMAAAAACQAEtQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMJAQAAAApvcmFjbGVzS2V5AAAAAAIAAAABLAAAAAADZmVlAAAAAAAAAAACAAAAAAhmZWVTY2FsZQAAAAAAAAAD6AEAAAAUdHJ5R2V0U3RyaW5nRXh0ZXJuYWwAAAACAAAAB2FkZHJlc3MAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAAB2FkZHJlc3MFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAFXRyeUdldEludGVnZXJFeHRlcm5hbAAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgU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AIFAAAABHR4SWQCAAAAHCBpcyBhbHJlYWR5IGZ1bGx5IHByb2Nlc3NlZCEDCQEAAAABIQAAAAEDBQAAAAlkZXN0Q2hlY2sFAAAAC3N0YXR1c0NoZWNrBwkAAAIAAAABAgAAAA1EaXJ0eSBoYWNrZXIhBAAAAAdhc3NldElkCQEAAAAMdHJ5R2V0U3RyaW5nAAAAAQkAASwAAAACCQABLAAAAAICAAAAA3R4XwUAAAAEdHhJZAIAAAAIX2Fzc2V0SWQEAAAABmFtb3VudAkBAAAADXRyeUdldEludGVnZXIAAAABCQABLAAAAAIJAAEsAAAAAgIAAAADdHhfBQAAAAR0eElkAgAAAAdfYW1vdW50CQAETgAAAAIICQEAAAAMcmV3YXJkT3JhY2xlAAAAAgUAAAAHYXNzZXRJZAUAAAAGYW1vdW50AAAAAl8xCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAN0eF8FAAAABHR4SWQCAAAAB19zdGF0dXMCAAAACVBST0NFU1NFRAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgIAAAADdHhfBQAAAAR0eElkAgAAAAhfb3RoZXJJZAUAAAAJb3RoZXJUeElkBQAAAANuaWwAAAAA6eA0AQ==", "height": 2465400, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4qVhh5TQteQcmy1BaQQZ6zJ5i7KbEgfKAkMVGDNNvT93 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
4 | + | func oraclesKey () = "oraclesList" | |
5 | 5 | ||
6 | - | let fee = 1 | |
6 | + | ||
7 | + | func getExternalOracles () = split(getStringValue(this, oraclesKey()), ",") | |
8 | + | ||
9 | + | ||
10 | + | let fee = 2 | |
7 | 11 | ||
8 | 12 | let feeScale = 1000 | |
9 | 13 | ||
46 | 50 | func otherChainAssetKey (otherChainAsset) = ("otherChainAsset_" + otherChainAsset) | |
47 | 51 | ||
48 | 52 | ||
53 | + | func tnAsset (assetId) = ("tn_asset_" + assetId) | |
54 | + | ||
55 | + | ||
49 | 56 | func reissueable (asset) = ("reissueable_" + asset) | |
50 | 57 | ||
51 | 58 | ||
64 | 71 | ||
65 | 72 | func rewardOracle (assetId,baseAmount) = { | |
66 | 73 | let reward = fraction(baseAmount, fee, feeScale, DOWN) | |
67 | - | let rewardForOracle = fraction(reward, 1, size( | |
74 | + | let rewardForOracle = fraction(reward, 1, size(getExternalOracles()), DOWN) | |
68 | 75 | func calculatePayout (acc,externalOracle) = (acc ++ [ScriptTransfer(addressFromStringValue(externalOracle), rewardForOracle, fromBase58String(assetId))]) | |
69 | 76 | ||
70 | 77 | let result = { | |
71 | - | let $l = | |
78 | + | let $l = getExternalOracles() | |
72 | 79 | let $s = size($l) | |
73 | 80 | let $acc0 = nil | |
74 | 81 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
101 | 108 | throw("Invalid Value!") | |
102 | 109 | } | |
103 | 110 | ||
104 | - | let $l = | |
111 | + | let $l = getExternalOracles() | |
105 | 112 | let $s = size($l) | |
106 | 113 | let $acc0 = true | |
107 | 114 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
117 | 124 | ||
118 | 125 | ||
119 | 126 | @Callable(i) | |
120 | - | func initiateAssets (nativeAsset,nativeAssetReissueable,otherChainAsset,otherChainAssetReissueable) = if ((i.caller != this)) | |
127 | + | func initiateAssets (nativeAsset,nativeAssetReissueable,nativeAssetTN,otherChainAsset,otherChainAssetReissueable,otherChainAssetTN) = if ((i.caller != this)) | |
121 | 128 | then throw("Only the owner dapp can add additional assets!") | |
122 | 129 | else if ((tryGetString(nativeAssetKey(nativeAsset)) != "")) | |
123 | 130 | then throw("Native Asset already listed!") | |
124 | 131 | else if ((tryGetString(otherChainAssetKey(otherChainAsset)) != "")) | |
125 | 132 | then throw("Other Asset already listed!") | |
126 | - | else [StringEntry(nativeAssetKey(nativeAsset), otherChainAsset), StringEntry(otherChainAssetKey(otherChainAsset), nativeAsset), BooleanEntry(reissueable(nativeAsset), nativeAssetReissueable), BooleanEntry(reissueable(otherChainAsset), otherChainAssetReissueable)] | |
133 | + | else [StringEntry(nativeAssetKey(nativeAsset), otherChainAsset), StringEntry(otherChainAssetKey(otherChainAsset), nativeAsset), BooleanEntry(reissueable(nativeAsset), nativeAssetReissueable), BooleanEntry(reissueable(otherChainAsset), otherChainAssetReissueable), BooleanEntry(tnAsset(nativeAsset), nativeAssetTN), BooleanEntry(tnAsset(otherChainAsset), otherChainAssetTN)] | |
127 | 134 | ||
128 | 135 | ||
129 | 136 | ||
148 | 155 | ||
149 | 156 | ||
150 | 157 | @Callable(i) | |
151 | - | func storeDataIncomingTx (txId,destination,assetId,amount,assetIdToReceive) = if (if ( | |
158 | + | func storeDataIncomingTx (txId,destination,assetId,amount,assetIdToReceive) = if (if ((tryGetString((("tx_" + txId) + "_status")) != "")) | |
152 | 159 | then true | |
153 | - | else !(contains(destination, "3"))) | |
154 | - | then true | |
155 | - | else (assetId == "")) | |
156 | - | then true | |
157 | - | else (amount == 0)) | |
158 | - | then true | |
159 | - | else (assetIdToReceive == "")) | |
160 | - | then throw("Parameters seem wrong!") | |
161 | - | else if (if ((tryGetString((("tx_" + txId) + "_status")) != "")) | |
160 | + | else (tryGetString((("tx_" + txId) + "_dest")) != "")) | |
161 | + | then throw((txId + " is already stored!")) | |
162 | + | else if (if (if (if (if ((txId == "")) | |
162 | 163 | then true | |
163 | - | else (tryGetString((("tx_" + txId) + "_dest")) != "")) | |
164 | - | then throw((txId + " is already stored!")) | |
164 | + | else !(contains(destination, "3"))) | |
165 | + | then true | |
166 | + | else (assetId == "")) | |
167 | + | then true | |
168 | + | else (amount == 0)) | |
169 | + | then true | |
170 | + | else (assetIdToReceive == "")) | |
171 | + | then throw("Parameters seem wrong!") | |
165 | 172 | else { | |
166 | 173 | let destCheck = checkKey((("tx_" + txId) + "_dest"), destination) | |
167 | 174 | let statusCheck = checkKey((("tx_" + txId) + "_status"), "UNPROCESSED") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
4 | + | func oraclesKey () = "oraclesList" | |
5 | 5 | ||
6 | - | let fee = 1 | |
6 | + | ||
7 | + | func getExternalOracles () = split(getStringValue(this, oraclesKey()), ",") | |
8 | + | ||
9 | + | ||
10 | + | let fee = 2 | |
7 | 11 | ||
8 | 12 | let feeScale = 1000 | |
9 | 13 | ||
10 | 14 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
11 | 15 | case a: String => | |
12 | 16 | a | |
13 | 17 | case _ => | |
14 | 18 | "" | |
15 | 19 | } | |
16 | 20 | ||
17 | 21 | ||
18 | 22 | func tryGetIntegerExternal (address,key) = match getInteger(address, key) { | |
19 | 23 | case b: Int => | |
20 | 24 | b | |
21 | 25 | case _ => | |
22 | 26 | 0 | |
23 | 27 | } | |
24 | 28 | ||
25 | 29 | ||
26 | 30 | func tryGetString (key) = tryGetStringExternal(this, key) | |
27 | 31 | ||
28 | 32 | ||
29 | 33 | func tryGetInteger (key) = tryGetIntegerExternal(this, key) | |
30 | 34 | ||
31 | 35 | ||
32 | 36 | func tryGetBoolean (key) = match getBoolean(this, key) { | |
33 | 37 | case b: Boolean => | |
34 | 38 | b | |
35 | 39 | case _ => | |
36 | 40 | false | |
37 | 41 | } | |
38 | 42 | ||
39 | 43 | ||
40 | 44 | func assetIdToString (assetId) = toBase58String(value(assetId)) | |
41 | 45 | ||
42 | 46 | ||
43 | 47 | func nativeAssetKey (nativeAsset) = ("nativeAsset_" + nativeAsset) | |
44 | 48 | ||
45 | 49 | ||
46 | 50 | func otherChainAssetKey (otherChainAsset) = ("otherChainAsset_" + otherChainAsset) | |
47 | 51 | ||
48 | 52 | ||
53 | + | func tnAsset (assetId) = ("tn_asset_" + assetId) | |
54 | + | ||
55 | + | ||
49 | 56 | func reissueable (asset) = ("reissueable_" + asset) | |
50 | 57 | ||
51 | 58 | ||
52 | 59 | func validatePayment (payment) = { | |
53 | 60 | let pmt = value(payment) | |
54 | 61 | if (!(isDefined(pmt.assetId))) | |
55 | 62 | then throw("It needs to be an asset") | |
56 | 63 | else { | |
57 | 64 | let assetDetails = value(assetInfo(value(pmt.assetId))) | |
58 | 65 | if ((1 > pmt.amount)) | |
59 | 66 | then throw("You didnt attached a payment!") | |
60 | 67 | else assetIdToString(pmt.assetId) | |
61 | 68 | } | |
62 | 69 | } | |
63 | 70 | ||
64 | 71 | ||
65 | 72 | func rewardOracle (assetId,baseAmount) = { | |
66 | 73 | let reward = fraction(baseAmount, fee, feeScale, DOWN) | |
67 | - | let rewardForOracle = fraction(reward, 1, size( | |
74 | + | let rewardForOracle = fraction(reward, 1, size(getExternalOracles()), DOWN) | |
68 | 75 | func calculatePayout (acc,externalOracle) = (acc ++ [ScriptTransfer(addressFromStringValue(externalOracle), rewardForOracle, fromBase58String(assetId))]) | |
69 | 76 | ||
70 | 77 | let result = { | |
71 | - | let $l = | |
78 | + | let $l = getExternalOracles() | |
72 | 79 | let $s = size($l) | |
73 | 80 | let $acc0 = nil | |
74 | 81 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
75 | 82 | then $a | |
76 | 83 | else calculatePayout($a, $l[$i]) | |
77 | 84 | ||
78 | 85 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
79 | 86 | then $a | |
80 | 87 | else throw("List size exceeds 5") | |
81 | 88 | ||
82 | 89 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
83 | 90 | } | |
84 | 91 | $Tuple2(result, reward) | |
85 | 92 | } | |
86 | 93 | ||
87 | 94 | ||
88 | 95 | func checkKey (key,value) = { | |
89 | 96 | func checkIfKeyExist (acc,externalOracle) = match value { | |
90 | 97 | case b: String => | |
91 | 98 | let result = tryGetStringExternal(addressFromStringValue(externalOracle), key) | |
92 | 99 | if ((result != value)) | |
93 | 100 | then throw(("String Key not matching in " + externalOracle)) | |
94 | 101 | else true | |
95 | 102 | case b: Int => | |
96 | 103 | let result = tryGetIntegerExternal(addressFromStringValue(externalOracle), key) | |
97 | 104 | if ((result != value)) | |
98 | 105 | then throw(("Integer Key not matching in " + externalOracle)) | |
99 | 106 | else true | |
100 | 107 | case _ => | |
101 | 108 | throw("Invalid Value!") | |
102 | 109 | } | |
103 | 110 | ||
104 | - | let $l = | |
111 | + | let $l = getExternalOracles() | |
105 | 112 | let $s = size($l) | |
106 | 113 | let $acc0 = true | |
107 | 114 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
108 | 115 | then $a | |
109 | 116 | else checkIfKeyExist($a, $l[$i]) | |
110 | 117 | ||
111 | 118 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
112 | 119 | then $a | |
113 | 120 | else throw("List size exceeds 5") | |
114 | 121 | ||
115 | 122 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
116 | 123 | } | |
117 | 124 | ||
118 | 125 | ||
119 | 126 | @Callable(i) | |
120 | - | func initiateAssets (nativeAsset,nativeAssetReissueable,otherChainAsset,otherChainAssetReissueable) = if ((i.caller != this)) | |
127 | + | func initiateAssets (nativeAsset,nativeAssetReissueable,nativeAssetTN,otherChainAsset,otherChainAssetReissueable,otherChainAssetTN) = if ((i.caller != this)) | |
121 | 128 | then throw("Only the owner dapp can add additional assets!") | |
122 | 129 | else if ((tryGetString(nativeAssetKey(nativeAsset)) != "")) | |
123 | 130 | then throw("Native Asset already listed!") | |
124 | 131 | else if ((tryGetString(otherChainAssetKey(otherChainAsset)) != "")) | |
125 | 132 | then throw("Other Asset already listed!") | |
126 | - | else [StringEntry(nativeAssetKey(nativeAsset), otherChainAsset), StringEntry(otherChainAssetKey(otherChainAsset), nativeAsset), BooleanEntry(reissueable(nativeAsset), nativeAssetReissueable), BooleanEntry(reissueable(otherChainAsset), otherChainAssetReissueable)] | |
133 | + | else [StringEntry(nativeAssetKey(nativeAsset), otherChainAsset), StringEntry(otherChainAssetKey(otherChainAsset), nativeAsset), BooleanEntry(reissueable(nativeAsset), nativeAssetReissueable), BooleanEntry(reissueable(otherChainAsset), otherChainAssetReissueable), BooleanEntry(tnAsset(nativeAsset), nativeAssetTN), BooleanEntry(tnAsset(otherChainAsset), otherChainAssetTN)] | |
127 | 134 | ||
128 | 135 | ||
129 | 136 | ||
130 | 137 | @Callable(i) | |
131 | 138 | func initiateOutGoingTx (destination) = { | |
132 | 139 | let payment = i.payments | |
133 | 140 | if ((size(payment) != 1)) | |
134 | 141 | then throw("Invalid payment added!") | |
135 | 142 | else if ((1 > payment[0].amount)) | |
136 | 143 | then throw("Invalid amount added!") | |
137 | 144 | else if (!(contains(destination, "3"))) | |
138 | 145 | then throw("Please make sure your destination is correctly") | |
139 | 146 | else { | |
140 | 147 | let assetId = validatePayment(payment[0]) | |
141 | 148 | let specifiqueData = if (tryGetBoolean(reissueable(assetId))) | |
142 | 149 | then [Burn(fromBase58String(assetId), payment[0].amount), StringEntry((("tx_" + toBase58String(i.transactionId)) + "_asset_to_receive"), tryGetString(otherChainAssetKey(assetId)))] | |
143 | 150 | else [StringEntry((("tx_" + toBase58String(i.transactionId)) + "_asset_to_receive"), tryGetString(nativeAssetKey(assetId)))] | |
144 | 151 | ([StringEntry((("tx_" + toBase58String(i.transactionId)) + "_dest"), destination), StringEntry((("tx_" + toBase58String(i.transactionId)) + "_status"), "UNPROCESSED")] ++ specifiqueData) | |
145 | 152 | } | |
146 | 153 | } | |
147 | 154 | ||
148 | 155 | ||
149 | 156 | ||
150 | 157 | @Callable(i) | |
151 | - | func storeDataIncomingTx (txId,destination,assetId,amount,assetIdToReceive) = if (if ( | |
158 | + | func storeDataIncomingTx (txId,destination,assetId,amount,assetIdToReceive) = if (if ((tryGetString((("tx_" + txId) + "_status")) != "")) | |
152 | 159 | then true | |
153 | - | else !(contains(destination, "3"))) | |
154 | - | then true | |
155 | - | else (assetId == "")) | |
156 | - | then true | |
157 | - | else (amount == 0)) | |
158 | - | then true | |
159 | - | else (assetIdToReceive == "")) | |
160 | - | then throw("Parameters seem wrong!") | |
161 | - | else if (if ((tryGetString((("tx_" + txId) + "_status")) != "")) | |
160 | + | else (tryGetString((("tx_" + txId) + "_dest")) != "")) | |
161 | + | then throw((txId + " is already stored!")) | |
162 | + | else if (if (if (if (if ((txId == "")) | |
162 | 163 | then true | |
163 | - | else (tryGetString((("tx_" + txId) + "_dest")) != "")) | |
164 | - | then throw((txId + " is already stored!")) | |
164 | + | else !(contains(destination, "3"))) | |
165 | + | then true | |
166 | + | else (assetId == "")) | |
167 | + | then true | |
168 | + | else (amount == 0)) | |
169 | + | then true | |
170 | + | else (assetIdToReceive == "")) | |
171 | + | then throw("Parameters seem wrong!") | |
165 | 172 | else { | |
166 | 173 | let destCheck = checkKey((("tx_" + txId) + "_dest"), destination) | |
167 | 174 | let statusCheck = checkKey((("tx_" + txId) + "_status"), "UNPROCESSED") | |
168 | 175 | let assetIdCheck = checkKey((("tx_" + txId) + "_assetId"), assetId) | |
169 | 176 | let assetId_to_receiveCheck = checkKey((("tx_" + txId) + "_assetId_to_receive"), assetIdToReceive) | |
170 | 177 | let amountCheck = checkKey((("tx_" + txId) + "_amount"), amount) | |
171 | 178 | if (!(if (if (if (if (destCheck) | |
172 | 179 | then statusCheck | |
173 | 180 | else false) | |
174 | 181 | then assetIdCheck | |
175 | 182 | else false) | |
176 | 183 | then assetId_to_receiveCheck | |
177 | 184 | else false) | |
178 | 185 | then amountCheck | |
179 | 186 | else false)) | |
180 | 187 | then throw("Dirty hacker!") | |
181 | 188 | 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)] | |
182 | 189 | } | |
183 | 190 | ||
184 | 191 | ||
185 | 192 | ||
186 | 193 | @Callable(i) | |
187 | 194 | func releaseIncomingTx (txId) = if ((txId == "")) | |
188 | 195 | then throw("Invalid data!") | |
189 | 196 | else { | |
190 | 197 | let status = tryGetString((("tx_" + txId) + "_status")) | |
191 | 198 | if ((status == "")) | |
192 | 199 | then throw("No such txid found!") | |
193 | 200 | else if ((status == "PROCESSED")) | |
194 | 201 | then throw("Already processed!") | |
195 | 202 | else { | |
196 | 203 | let assetIdToReceive = tryGetString((("tx_" + txId) + "_assetId_to_receive")) | |
197 | 204 | let destination = tryGetString((("tx_" + txId) + "_dest")) | |
198 | 205 | let amount = tryGetInteger((("tx_" + txId) + "_amount")) | |
199 | 206 | let assetId = tryGetString((("tx_" + txId) + "_assetId")) | |
200 | 207 | let specifiqueData = if (tryGetBoolean(reissueable(assetIdToReceive))) | |
201 | 208 | then if ((tryGetString(nativeAssetKey(assetId)) != assetIdToReceive)) | |
202 | 209 | then throw("RE: Skipping tx, corrupt data!") | |
203 | 210 | else [Reissue(fromBase58String(assetIdToReceive), amount, true)] | |
204 | 211 | else if ((tryGetString(otherChainAssetKey(assetId)) != assetIdToReceive)) | |
205 | 212 | then throw("URE: Skipping tx, corrupt data!") | |
206 | 213 | else nil | |
207 | 214 | ((specifiqueData ++ [ScriptTransfer(addressFromStringValue(destination), (amount - rewardOracle(assetIdToReceive, amount)._2), fromBase58String(assetIdToReceive)), StringEntry((("tx_" + txId) + "_status"), "PROCESSED"), StringEntry((("tx_" + txId) + "_otherId"), toBase58String(i.transactionId))]) ++ rewardOracle(assetIdToReceive, amount)._1) | |
208 | 215 | } | |
209 | 216 | } | |
210 | 217 | ||
211 | 218 | ||
212 | 219 | ||
213 | 220 | @Callable(i) | |
214 | 221 | func finalizeOutgoingTx (txId,otherTxId) = if (if ((txId == "")) | |
215 | 222 | then true | |
216 | 223 | else (otherTxId == "")) | |
217 | 224 | then throw("Broken data!") | |
218 | 225 | else { | |
219 | 226 | let destCheck = checkKey((("tx_" + txId) + "_otherId"), otherTxId) | |
220 | 227 | let statusCheck = checkKey((("tx_" + txId) + "_status"), "PROCESSED") | |
221 | 228 | if ((tryGetString((("tx_" + txId) + "_otherId")) != "")) | |
222 | 229 | then throw((txId + " is already fully processed!")) | |
223 | 230 | else if (!(if (destCheck) | |
224 | 231 | then statusCheck | |
225 | 232 | else false)) | |
226 | 233 | then throw("Dirty hacker!") | |
227 | 234 | else { | |
228 | 235 | let assetId = tryGetString((("tx_" + txId) + "_assetId")) | |
229 | 236 | let amount = tryGetInteger((("tx_" + txId) + "_amount")) | |
230 | 237 | (rewardOracle(assetId, amount)._1 ++ [StringEntry((("tx_" + txId) + "_status"), "PROCESSED"), StringEntry((("tx_" + txId) + "_otherId"), otherTxId)]) | |
231 | 238 | } | |
232 | 239 | } | |
233 | 240 | ||
234 | 241 |
github/deemru/w8io/169f3d6 54.19 ms ◑