tx · B56NDiiu33fjTrhsLUhPDXh569UP8fdbH3k4jtdLbLMN 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB: -0.01400000 Waves 2020.03.16 13:15 [911671] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves
{ "type": 13, "id": "B56NDiiu33fjTrhsLUhPDXh569UP8fdbH3k4jtdLbLMN", "fee": 1400000, "feeAssetId": null, "timestamp": 1584353740083, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "3dotyeJ19bKav9bEEhpEXvPSfUD7x41c7eWWxFEeNqxQF48GAhBssohcQVRY3VNHBHEb8HKn638MGTvjrx8iZVuY" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIHCgUICAgICBIICgYICAgBCAgSBQoDCAgIEgAAAAAOAAAAAA9zdG9yYWdlVmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wEAAAAKY2hlY2tFbnRyeQAAAAIAAAAGcHJlZml4AAAABHV1aWQEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAZwcmVmaXgFAAAABHV1aWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAETk9ORQEAAAAJY2hlY2tVVUlEAAAAAQAAAAR1dWlkBAAAAAckbWF0Y2gwCQAEHQ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"chainId": 84, "height": 911671, "spentComplexity": 0 } View: original | compacted Prev: Bg9sdAXp69J9iih3BmBmKtr84HMs7htfUjmewHQTTG71 Next: HzRUDfSQ9qxxcGdhhCnwEHX4Cxhv3inowDJSmMLvWbrB Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let storageVerifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
7 | 7 | ||
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | - | func isAdress (addr) = if (if ((size(addr) == 35)) | |
35 | - | then (take(addr, 2) == " | |
34 | + | func isAdress (addr) = if (if (if ((size(addr) == 35)) | |
35 | + | then (take(addr, 2) == "3P") | |
36 | 36 | else false) | |
37 | + | then true | |
38 | + | else (take(addr, 2) == "3N")) | |
37 | 39 | then true | |
38 | 40 | else (take(addr, 2) == "3M") | |
39 | 41 | ||
78 | 80 | } | |
79 | 81 | ||
80 | 82 | ||
83 | + | func asString (bv) = match bv { | |
84 | + | case bv0: String => | |
85 | + | bv0 | |
86 | + | case _ => | |
87 | + | throw("Sponsored Public Key String expected") | |
88 | + | } | |
89 | + | ||
90 | + | ||
81 | 91 | @Callable(invoke) | |
82 | - | func fileCertification (hash,title,uuid,data) = { | |
92 | + | func fileCertification (hash,title,uuid,data,signerPubKey) = { | |
83 | 93 | let id = extract(invoke.transactionId) | |
84 | 94 | let entryExist = checkEntry(hash, uuid) | |
85 | 95 | let uuidExist = checkUUID(uuid) | |
86 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
96 | + | let callerIsDapp = (this == invoke.caller) | |
97 | + | let callerAddress = if (callerIsDapp) | |
98 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
99 | + | else toBase58String(invoke.caller.bytes) | |
87 | 100 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
88 | 101 | if ((entryExist != "NONE")) | |
89 | 102 | then throw("This entry already exist") | |
96 | 109 | else if ((size(title) > 64)) | |
97 | 110 | then throw("Title is too long") | |
98 | 111 | else if ((callerIsWhiteListedNum > 0)) | |
99 | - | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)])) | |
100 | - | else { | |
101 | - | let payment = extract(invoke.payment) | |
102 | - | let amount = extract(payment.amount) | |
103 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
104 | - | then extract(payment.assetId) | |
105 | - | else throw("Waves is not accepted as payment") | |
106 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
107 | - | if ((acceptedToken != paymentAssetId)) | |
108 | - | then throw("This token is not accepted at the moment") | |
109 | - | else if (if ((amount != currentPrice)) | |
110 | - | then (0 >= callerIsWhiteListedNum) | |
111 | - | else false) | |
112 | - | then throw("The price is wrong") | |
113 | - | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
114 | - | } | |
112 | + | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken)])) | |
113 | + | else if (!(callerIsDapp)) | |
114 | + | then { | |
115 | + | let payment = extract(invoke.payment) | |
116 | + | let amount = extract(payment.amount) | |
117 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
118 | + | then extract(payment.assetId) | |
119 | + | else throw("Waves is not accepted as payment") | |
120 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
121 | + | if ((acceptedToken != paymentAssetId)) | |
122 | + | then throw("This token is not accepted at the moment") | |
123 | + | else if (if ((amount != currentPrice)) | |
124 | + | then (0 >= callerIsWhiteListedNum) | |
125 | + | else false) | |
126 | + | then throw("The price is wrong") | |
127 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
128 | + | } | |
129 | + | else throw("You are not allowed to do that") | |
115 | 130 | } | |
116 | 131 | ||
117 | 132 | ||
118 | 133 | ||
119 | 134 | @Callable(invoke) | |
120 | - | func emailCertification (messageid,uuid,data) = { | |
135 | + | func emailCertification (messageid,uuid,data,title,signerPubKey) = { | |
121 | 136 | let id = extract(invoke.transactionId) | |
122 | 137 | let entryExist = checkEntry(messageid, uuid) | |
123 | 138 | let uuidExist = checkUUID(uuid) | |
124 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
139 | + | let callerIsDapp = (this == invoke.caller) | |
140 | + | let callerAddress = if (callerIsDapp) | |
141 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
142 | + | else toBase58String(invoke.caller.bytes) | |
125 | 143 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
126 | 144 | if ((entryExist != "NONE")) | |
127 | 145 | then throw("This entry already exist") | |
129 | 147 | then throw("This uuid already exist") | |
130 | 148 | else if ((size(uuid) > 36)) | |
131 | 149 | then throw("Uuid is too long") | |
132 | - | else if ((callerIsWhiteListedNum > 0)) | |
133 | - | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)])) | |
134 | - | else { | |
135 | - | let payment = extract(invoke.payment) | |
136 | - | let amount = extract(payment.amount) | |
137 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
138 | - | then extract(payment.assetId) | |
139 | - | else throw("Waves is not accepted as payment") | |
140 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
141 | - | if ((acceptedToken != paymentAssetId)) | |
142 | - | then throw("This token is not accepted at the moment") | |
143 | - | else if (if ((amount != currentPrice)) | |
144 | - | then (0 >= callerIsWhiteListedNum) | |
145 | - | else false) | |
146 | - | then throw("The price is wrong") | |
147 | - | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
148 | - | } | |
150 | + | else if ((size(messageid) > 64)) | |
151 | + | then throw("Message-id is too long") | |
152 | + | else if ((size(title) > 64)) | |
153 | + | then throw("Title is too long") | |
154 | + | else if ((callerIsWhiteListedNum > 0)) | |
155 | + | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken)])) | |
156 | + | else if (!(callerIsDapp)) | |
157 | + | then { | |
158 | + | let payment = extract(invoke.payment) | |
159 | + | let amount = extract(payment.amount) | |
160 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
161 | + | then extract(payment.assetId) | |
162 | + | else throw("Waves is not accepted as payment") | |
163 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
164 | + | if ((acceptedToken != paymentAssetId)) | |
165 | + | then throw("This token is not accepted at the moment") | |
166 | + | else if (if ((amount != currentPrice)) | |
167 | + | then (0 >= callerIsWhiteListedNum) | |
168 | + | else false) | |
169 | + | then throw("The price is wrong") | |
170 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
171 | + | } | |
172 | + | else throw("You are not allowed to do that") | |
149 | 173 | } | |
150 | 174 | ||
151 | 175 | ||
152 | 176 | ||
153 | 177 | @Callable(invoke) | |
154 | - | func createAgreement (hash,title,addresses) = { | |
178 | + | func createAgreement (hash,title,addresses,num,signerPubKey,uuid) = { | |
155 | 179 | let id = extract(invoke.transactionId) | |
156 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
180 | + | let entryExist = checkEntry(hash, uuid) | |
181 | + | let uuidExist = checkUUID(uuid) | |
182 | + | let callerIsDapp = (this == invoke.caller) | |
183 | + | let callerAddress = if (callerIsDapp) | |
184 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
185 | + | else toBase58String(invoke.caller.bytes) | |
157 | 186 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
158 | - | let JSON = ((((getJsonBeforeValue(addresses, "creator") + "\"") + | |
187 | + | let JSON = ((((getJsonBeforeValue(addresses, "creator") + "\"") + callerAddress) + "\"") + getJsonAfterValue(addresses, "creator")) | |
159 | 188 | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
160 | - | let totalAddresses = { | |
161 | - | let $list75687608 = addressesArray | |
162 | - | let $size75687608 = size($list75687608) | |
163 | - | let $acc075687608 = 0 | |
164 | - | if (($size75687608 == 0)) | |
165 | - | then $acc075687608 | |
166 | - | else { | |
167 | - | let $acc175687608 = countParties($acc075687608, $list75687608[0]) | |
168 | - | if (($size75687608 == 1)) | |
169 | - | then $acc175687608 | |
170 | - | else { | |
171 | - | let $acc275687608 = countParties($acc175687608, $list75687608[1]) | |
172 | - | if (($size75687608 == 2)) | |
173 | - | then $acc275687608 | |
174 | - | else { | |
175 | - | let $acc375687608 = countParties($acc275687608, $list75687608[2]) | |
176 | - | if (($size75687608 == 3)) | |
177 | - | then $acc375687608 | |
178 | - | else { | |
179 | - | let $acc475687608 = countParties($acc375687608, $list75687608[3]) | |
180 | - | if (($size75687608 == 4)) | |
181 | - | then $acc475687608 | |
182 | - | else { | |
183 | - | let $acc575687608 = countParties($acc475687608, $list75687608[4]) | |
184 | - | if (($size75687608 == 5)) | |
185 | - | then $acc575687608 | |
186 | - | else { | |
187 | - | let $acc675687608 = countParties($acc575687608, $list75687608[5]) | |
188 | - | if (($size75687608 == 6)) | |
189 | - | then $acc675687608 | |
190 | - | else { | |
191 | - | let $acc775687608 = countParties($acc675687608, $list75687608[6]) | |
192 | - | throw("List size exceed 6") | |
193 | - | } | |
194 | - | } | |
195 | - | } | |
196 | - | } | |
197 | - | } | |
198 | - | } | |
199 | - | } | |
200 | - | } | |
201 | - | let globalDataTitle = DataEntry(("title_MA_" + toBase58String(id)), title) | |
202 | - | let globalDataHash = DataEntry(("hash_MA_" + toBase58String(id)), hash) | |
189 | + | let totalAddresses = num | |
190 | + | let globalDataTitle = DataEntry((title + uuid), toBase58String(id)) | |
191 | + | let globalDataHash = DataEntry((hash + uuid), toBase58String(id)) | |
203 | 192 | let globalDataJson = DataEntry(((("data_MA_" + toBase58String(id)) + "_") + callerAddress), JSON) | |
204 | 193 | let globalDataOwner = DataEntry(((callerAddress + "_MA_") + toBase58String(id)), ("SIGNED_" + toBase58String(id))) | |
205 | 194 | let dataWhiteListed = DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - (totalAddresses + 1))) | |
206 | - | if ((totalAddresses == 1)) | |
207 | - | then if ((callerIsWhiteListedNum > 0)) | |
208 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
209 | - | then throw("You don't have enough certification credit") | |
210 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
211 | - | else { | |
212 | - | let payment = extract(invoke.payment) | |
213 | - | let amount = if (isDefined(payment.amount)) | |
214 | - | then extract(payment.amount) | |
215 | - | else 0 | |
216 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
217 | - | then extract(payment.assetId) | |
218 | - | else acceptedToken | |
219 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
220 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
221 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
222 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
223 | - | } | |
224 | - | else if ((totalAddresses == 2)) | |
225 | - | then if ((callerIsWhiteListedNum > 0)) | |
226 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
227 | - | then throw("You don't have enough certification credit") | |
228 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
229 | - | else { | |
230 | - | let payment = extract(invoke.payment) | |
231 | - | let amount = if (isDefined(payment.amount)) | |
232 | - | then extract(payment.amount) | |
233 | - | else 0 | |
234 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
235 | - | then extract(payment.assetId) | |
236 | - | else acceptedToken | |
237 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
238 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
239 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
240 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
241 | - | } | |
242 | - | else if ((totalAddresses == 3)) | |
243 | - | then if ((callerIsWhiteListedNum > 0)) | |
244 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
245 | - | then throw("You don't have enough certification credit") | |
246 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
247 | - | else { | |
248 | - | let payment = extract(invoke.payment) | |
249 | - | let amount = if (isDefined(payment.amount)) | |
250 | - | then extract(payment.amount) | |
251 | - | else 0 | |
252 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
253 | - | then extract(payment.assetId) | |
254 | - | else acceptedToken | |
255 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
256 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
257 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
258 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
259 | - | } | |
260 | - | else if ((totalAddresses == 4)) | |
261 | - | then if ((callerIsWhiteListedNum > 0)) | |
262 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
263 | - | then throw("You don't have enough certification credit") | |
264 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
265 | - | else { | |
266 | - | let payment = extract(invoke.payment) | |
267 | - | let amount = if (isDefined(payment.amount)) | |
268 | - | then extract(payment.amount) | |
269 | - | else 0 | |
270 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
271 | - | then extract(payment.assetId) | |
272 | - | else acceptedToken | |
273 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
274 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
275 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
276 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
277 | - | } | |
278 | - | else if ((totalAddresses == 5)) | |
279 | - | then if ((callerIsWhiteListedNum > 0)) | |
195 | + | if ((entryExist != "NONE")) | |
196 | + | then throw("This entry already exist") | |
197 | + | else if ((uuidExist != "NONE")) | |
198 | + | then throw("This uuid already exist") | |
199 | + | else if ((size(uuid) > 36)) | |
200 | + | then throw("Uuid is too long") | |
201 | + | else if ((size(hash) > 64)) | |
202 | + | then throw("Message-id is too long") | |
203 | + | else if ((size(title) > 64)) | |
204 | + | then throw("Title is too long") | |
205 | + | else if ((callerIsWhiteListedNum > 0)) | |
280 | 206 | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
281 | 207 | then throw("You don't have enough certification credit") | |
282 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
283 | - | else { | |
284 | - | let payment = extract(invoke.payment) | |
285 | - | let amount = if (isDefined(payment.amount)) | |
286 | - | then extract(payment.amount) | |
287 | - | else 0 | |
288 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
289 | - | then extract(payment.assetId) | |
290 | - | else acceptedToken | |
291 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
292 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
293 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
294 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
295 | - | } | |
296 | - | else if ((totalAddresses == 6)) | |
297 | - | then if ((callerIsWhiteListedNum > 0)) | |
298 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
299 | - | then throw("You don't have enough certification credit") | |
300 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
301 | - | else { | |
208 | + | else if ((totalAddresses == 6)) | |
209 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
210 | + | else if ((totalAddresses == 5)) | |
211 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
212 | + | else if ((totalAddresses == 4)) | |
213 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
214 | + | else if ((totalAddresses == 3)) | |
215 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
216 | + | else if ((totalAddresses == 2)) | |
217 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
218 | + | else if ((totalAddresses == 1)) | |
219 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
220 | + | else throw("Wrong number of participants") | |
221 | + | else if (!(callerIsDapp)) | |
222 | + | then { | |
302 | 223 | let payment = extract(invoke.payment) | |
303 | 224 | let amount = if (isDefined(payment.amount)) | |
304 | 225 | then extract(payment.amount) | |
306 | 227 | let paymentAssetId = if (isDefined(payment.assetId)) | |
307 | 228 | then extract(payment.assetId) | |
308 | 229 | else acceptedToken | |
309 | - | let currentPrice = getIntegerValue( | |
230 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
310 | 231 | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
311 | 232 | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
312 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
233 | + | else if ((totalAddresses == 6)) | |
234 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
235 | + | else if ((totalAddresses == 5)) | |
236 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
237 | + | else if ((totalAddresses == 4)) | |
238 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
239 | + | else if ((totalAddresses == 3)) | |
240 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
241 | + | else if ((totalAddresses == 2)) | |
242 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
243 | + | else if ((totalAddresses == 1)) | |
244 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
245 | + | else throw(("Needs 1 to 6 recipient addresses, currently sent: " + toString(totalAddresses))) | |
313 | 246 | } | |
314 | - | else throw( | |
247 | + | else throw("You are not allowed to do that") | |
315 | 248 | } | |
316 | 249 | ||
317 | 250 | ||
318 | 251 | ||
319 | 252 | @Callable(invoke) | |
320 | - | func signAgreement (hash,agreementId) = { | |
253 | + | func signAgreement (hash,agreementId,signerPubKey) = { | |
321 | 254 | let payment = extract(invoke.payment) | |
322 | 255 | let amount = extract(payment.amount) | |
323 | 256 | let id = extract(invoke.transactionId) | |
324 | - | let signer = toBase58String(invoke.caller.bytes) | |
257 | + | let callerIsDapp = (this == invoke.caller) | |
258 | + | let signer = if (callerIsDapp) | |
259 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
260 | + | else toBase58String(invoke.caller.bytes) | |
325 | 261 | let signingRequestExist = checkIfPendingToSign(((signer + "_MA_") + agreementId)) | |
326 | 262 | if (!(signingRequestExist)) | |
327 | 263 | then throw("Sorry there is no pending signature") | |
328 | - | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + agreementId), ("SIGNED_" + toBase58String(id)))]), TransferSet([ScriptTransfer(addressFromStringValue(signer), | |
264 | + | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + agreementId), ("SIGNED_" + toBase58String(id)))]), TransferSet([ScriptTransfer(addressFromStringValue(signer), 0, acceptedToken)])) | |
329 | 265 | } | |
330 | 266 | ||
267 | + | ||
268 | + | ||
269 | + | @Callable(invoke) | |
270 | + | func usdnSignCredits () = { | |
271 | + | let payment = extract(invoke.payment) | |
272 | + | let callerAddress = toBase58String(invoke.caller.bytes) | |
273 | + | let tokenId = extract(payment.assetId) | |
274 | + | let amount = extract(payment.amount) | |
275 | + | let numberOfCredits = ((amount * 2) / 1000000) | |
276 | + | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
277 | + | if ((toBase58String(tokenId) != "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
278 | + | then throw("Only USDN can be exchanged") | |
279 | + | else if (if (((amount % 1000000) != 0)) | |
280 | + | then ((amount % 1000000) != 500000) | |
281 | + | else false) | |
282 | + | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(amount), 6)) + ".") + takeRight(toString(amount), 6))) | |
283 | + | else ScriptResult(WriteSet([DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum + numberOfCredits))]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, tokenId)])) | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | @Verifier(tx) | |
288 | + | func verifier () = match tx { | |
289 | + | case inv: InvokeScriptTransaction => | |
290 | + | if (if (if ((inv.function == "fileCertification")) | |
291 | + | then true | |
292 | + | else (inv.function == "emailCertification")) | |
293 | + | then true | |
294 | + | else (inv.function == "createAgreement")) | |
295 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4]))) | |
296 | + | else if ((inv.function == "signAgreement")) | |
297 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
298 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
299 | + | case _ => | |
300 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
301 | + | } | |
331 | 302 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let storageVerifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
7 | 7 | ||
8 | 8 | let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
9 | 9 | ||
10 | 10 | func checkEntry (prefix,uuid) = match getString(this, (prefix + uuid)) { | |
11 | 11 | case a: String => | |
12 | 12 | a | |
13 | 13 | case _ => | |
14 | 14 | "NONE" | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func checkUUID (uuid) = match getString(this, uuid) { | |
19 | 19 | case a: String => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | "NONE" | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func checkIfWhiteListed (callerAddress) = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) { | |
27 | 27 | case a: Int => | |
28 | 28 | a | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | - | func isAdress (addr) = if (if ((size(addr) == 35)) | |
35 | - | then (take(addr, 2) == " | |
34 | + | func isAdress (addr) = if (if (if ((size(addr) == 35)) | |
35 | + | then (take(addr, 2) == "3P") | |
36 | 36 | else false) | |
37 | + | then true | |
38 | + | else (take(addr, 2) == "3N")) | |
37 | 39 | then true | |
38 | 40 | else (take(addr, 2) == "3M") | |
39 | 41 | ||
40 | 42 | ||
41 | 43 | func countParties (accumulator,addr) = if ((size(addr) > 0)) | |
42 | 44 | then (accumulator + 1) | |
43 | 45 | else (accumulator + 0) | |
44 | 46 | ||
45 | 47 | ||
46 | 48 | func checkIfPendingToSign (key) = match getString(this, key) { | |
47 | 49 | case a: String => | |
48 | 50 | if ((a == "PENDING")) | |
49 | 51 | then true | |
50 | 52 | else false | |
51 | 53 | case _ => | |
52 | 54 | false | |
53 | 55 | } | |
54 | 56 | ||
55 | 57 | ||
56 | 58 | func getValueString (json) = take(drop(json, 1), value(indexOf(drop(json, 1), "\""))) | |
57 | 59 | ||
58 | 60 | ||
59 | 61 | func getValue (json,key) = { | |
60 | 62 | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
61 | 63 | let data = drop(json, ((keyIndex + size(key)) + 3)) | |
62 | 64 | let jsonValue = getValueString(data) | |
63 | 65 | jsonValue | |
64 | 66 | } | |
65 | 67 | ||
66 | 68 | ||
67 | 69 | func getJsonBeforeValue (json,key) = { | |
68 | 70 | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
69 | 71 | let data = take(json, ((keyIndex + size(key)) + 3)) | |
70 | 72 | data | |
71 | 73 | } | |
72 | 74 | ||
73 | 75 | ||
74 | 76 | func getJsonAfterValue (json,key) = { | |
75 | 77 | let keyIndex = value(indexOf(json, (("\"" + key) + "\":"))) | |
76 | 78 | let data = takeRight(json, (size(json) - ((((keyIndex + size(key)) + 3) + 0) + 2))) | |
77 | 79 | data | |
78 | 80 | } | |
79 | 81 | ||
80 | 82 | ||
83 | + | func asString (bv) = match bv { | |
84 | + | case bv0: String => | |
85 | + | bv0 | |
86 | + | case _ => | |
87 | + | throw("Sponsored Public Key String expected") | |
88 | + | } | |
89 | + | ||
90 | + | ||
81 | 91 | @Callable(invoke) | |
82 | - | func fileCertification (hash,title,uuid,data) = { | |
92 | + | func fileCertification (hash,title,uuid,data,signerPubKey) = { | |
83 | 93 | let id = extract(invoke.transactionId) | |
84 | 94 | let entryExist = checkEntry(hash, uuid) | |
85 | 95 | let uuidExist = checkUUID(uuid) | |
86 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
96 | + | let callerIsDapp = (this == invoke.caller) | |
97 | + | let callerAddress = if (callerIsDapp) | |
98 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
99 | + | else toBase58String(invoke.caller.bytes) | |
87 | 100 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
88 | 101 | if ((entryExist != "NONE")) | |
89 | 102 | then throw("This entry already exist") | |
90 | 103 | else if ((uuidExist != "NONE")) | |
91 | 104 | then throw("This uuid already exist") | |
92 | 105 | else if ((size(uuid) > 36)) | |
93 | 106 | then throw("Uuid is too long") | |
94 | 107 | else if ((size(hash) > 64)) | |
95 | 108 | then throw("Hash is too long") | |
96 | 109 | else if ((size(title) > 64)) | |
97 | 110 | then throw("Title is too long") | |
98 | 111 | else if ((callerIsWhiteListedNum > 0)) | |
99 | - | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)])) | |
100 | - | else { | |
101 | - | let payment = extract(invoke.payment) | |
102 | - | let amount = extract(payment.amount) | |
103 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
104 | - | then extract(payment.assetId) | |
105 | - | else throw("Waves is not accepted as payment") | |
106 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
107 | - | if ((acceptedToken != paymentAssetId)) | |
108 | - | then throw("This token is not accepted at the moment") | |
109 | - | else if (if ((amount != currentPrice)) | |
110 | - | then (0 >= callerIsWhiteListedNum) | |
111 | - | else false) | |
112 | - | then throw("The price is wrong") | |
113 | - | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
114 | - | } | |
112 | + | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken)])) | |
113 | + | else if (!(callerIsDapp)) | |
114 | + | then { | |
115 | + | let payment = extract(invoke.payment) | |
116 | + | let amount = extract(payment.amount) | |
117 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
118 | + | then extract(payment.assetId) | |
119 | + | else throw("Waves is not accepted as payment") | |
120 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
121 | + | if ((acceptedToken != paymentAssetId)) | |
122 | + | then throw("This token is not accepted at the moment") | |
123 | + | else if (if ((amount != currentPrice)) | |
124 | + | then (0 >= callerIsWhiteListedNum) | |
125 | + | else false) | |
126 | + | then throw("The price is wrong") | |
127 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
128 | + | } | |
129 | + | else throw("You are not allowed to do that") | |
115 | 130 | } | |
116 | 131 | ||
117 | 132 | ||
118 | 133 | ||
119 | 134 | @Callable(invoke) | |
120 | - | func emailCertification (messageid,uuid,data) = { | |
135 | + | func emailCertification (messageid,uuid,data,title,signerPubKey) = { | |
121 | 136 | let id = extract(invoke.transactionId) | |
122 | 137 | let entryExist = checkEntry(messageid, uuid) | |
123 | 138 | let uuidExist = checkUUID(uuid) | |
124 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
139 | + | let callerIsDapp = (this == invoke.caller) | |
140 | + | let callerAddress = if (callerIsDapp) | |
141 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
142 | + | else toBase58String(invoke.caller.bytes) | |
125 | 143 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
126 | 144 | if ((entryExist != "NONE")) | |
127 | 145 | then throw("This entry already exist") | |
128 | 146 | else if ((uuidExist != "NONE")) | |
129 | 147 | then throw("This uuid already exist") | |
130 | 148 | else if ((size(uuid) > 36)) | |
131 | 149 | then throw("Uuid is too long") | |
132 | - | else if ((callerIsWhiteListedNum > 0)) | |
133 | - | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)])) | |
134 | - | else { | |
135 | - | let payment = extract(invoke.payment) | |
136 | - | let amount = extract(payment.amount) | |
137 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
138 | - | then extract(payment.assetId) | |
139 | - | else throw("Waves is not accepted as payment") | |
140 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
141 | - | if ((acceptedToken != paymentAssetId)) | |
142 | - | then throw("This token is not accepted at the moment") | |
143 | - | else if (if ((amount != currentPrice)) | |
144 | - | then (0 >= callerIsWhiteListedNum) | |
145 | - | else false) | |
146 | - | then throw("The price is wrong") | |
147 | - | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
148 | - | } | |
150 | + | else if ((size(messageid) > 64)) | |
151 | + | then throw("Message-id is too long") | |
152 | + | else if ((size(title) > 64)) | |
153 | + | then throw("Title is too long") | |
154 | + | else if ((callerIsWhiteListedNum > 0)) | |
155 | + | then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken)])) | |
156 | + | else if (!(callerIsDapp)) | |
157 | + | then { | |
158 | + | let payment = extract(invoke.payment) | |
159 | + | let amount = extract(payment.amount) | |
160 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
161 | + | then extract(payment.assetId) | |
162 | + | else throw("Waves is not accepted as payment") | |
163 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
164 | + | if ((acceptedToken != paymentAssetId)) | |
165 | + | then throw("This token is not accepted at the moment") | |
166 | + | else if (if ((amount != currentPrice)) | |
167 | + | then (0 >= callerIsWhiteListedNum) | |
168 | + | else false) | |
169 | + | then throw("The price is wrong") | |
170 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)])) | |
171 | + | } | |
172 | + | else throw("You are not allowed to do that") | |
149 | 173 | } | |
150 | 174 | ||
151 | 175 | ||
152 | 176 | ||
153 | 177 | @Callable(invoke) | |
154 | - | func createAgreement (hash,title,addresses) = { | |
178 | + | func createAgreement (hash,title,addresses,num,signerPubKey,uuid) = { | |
155 | 179 | let id = extract(invoke.transactionId) | |
156 | - | let callerAddress = toBase58String(invoke.caller.bytes) | |
180 | + | let entryExist = checkEntry(hash, uuid) | |
181 | + | let uuidExist = checkUUID(uuid) | |
182 | + | let callerIsDapp = (this == invoke.caller) | |
183 | + | let callerAddress = if (callerIsDapp) | |
184 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
185 | + | else toBase58String(invoke.caller.bytes) | |
157 | 186 | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
158 | - | let JSON = ((((getJsonBeforeValue(addresses, "creator") + "\"") + | |
187 | + | let JSON = ((((getJsonBeforeValue(addresses, "creator") + "\"") + callerAddress) + "\"") + getJsonAfterValue(addresses, "creator")) | |
159 | 188 | let addressesArray = [getValue(addresses, "address1"), getValue(addresses, "address2"), getValue(addresses, "address3"), getValue(addresses, "address4"), getValue(addresses, "address5"), getValue(addresses, "address6")] | |
160 | - | let totalAddresses = { | |
161 | - | let $list75687608 = addressesArray | |
162 | - | let $size75687608 = size($list75687608) | |
163 | - | let $acc075687608 = 0 | |
164 | - | if (($size75687608 == 0)) | |
165 | - | then $acc075687608 | |
166 | - | else { | |
167 | - | let $acc175687608 = countParties($acc075687608, $list75687608[0]) | |
168 | - | if (($size75687608 == 1)) | |
169 | - | then $acc175687608 | |
170 | - | else { | |
171 | - | let $acc275687608 = countParties($acc175687608, $list75687608[1]) | |
172 | - | if (($size75687608 == 2)) | |
173 | - | then $acc275687608 | |
174 | - | else { | |
175 | - | let $acc375687608 = countParties($acc275687608, $list75687608[2]) | |
176 | - | if (($size75687608 == 3)) | |
177 | - | then $acc375687608 | |
178 | - | else { | |
179 | - | let $acc475687608 = countParties($acc375687608, $list75687608[3]) | |
180 | - | if (($size75687608 == 4)) | |
181 | - | then $acc475687608 | |
182 | - | else { | |
183 | - | let $acc575687608 = countParties($acc475687608, $list75687608[4]) | |
184 | - | if (($size75687608 == 5)) | |
185 | - | then $acc575687608 | |
186 | - | else { | |
187 | - | let $acc675687608 = countParties($acc575687608, $list75687608[5]) | |
188 | - | if (($size75687608 == 6)) | |
189 | - | then $acc675687608 | |
190 | - | else { | |
191 | - | let $acc775687608 = countParties($acc675687608, $list75687608[6]) | |
192 | - | throw("List size exceed 6") | |
193 | - | } | |
194 | - | } | |
195 | - | } | |
196 | - | } | |
197 | - | } | |
198 | - | } | |
199 | - | } | |
200 | - | } | |
201 | - | let globalDataTitle = DataEntry(("title_MA_" + toBase58String(id)), title) | |
202 | - | let globalDataHash = DataEntry(("hash_MA_" + toBase58String(id)), hash) | |
189 | + | let totalAddresses = num | |
190 | + | let globalDataTitle = DataEntry((title + uuid), toBase58String(id)) | |
191 | + | let globalDataHash = DataEntry((hash + uuid), toBase58String(id)) | |
203 | 192 | let globalDataJson = DataEntry(((("data_MA_" + toBase58String(id)) + "_") + callerAddress), JSON) | |
204 | 193 | let globalDataOwner = DataEntry(((callerAddress + "_MA_") + toBase58String(id)), ("SIGNED_" + toBase58String(id))) | |
205 | 194 | let dataWhiteListed = DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - (totalAddresses + 1))) | |
206 | - | if ((totalAddresses == 1)) | |
207 | - | then if ((callerIsWhiteListedNum > 0)) | |
208 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
209 | - | then throw("You don't have enough certification credit") | |
210 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
211 | - | else { | |
212 | - | let payment = extract(invoke.payment) | |
213 | - | let amount = if (isDefined(payment.amount)) | |
214 | - | then extract(payment.amount) | |
215 | - | else 0 | |
216 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
217 | - | then extract(payment.assetId) | |
218 | - | else acceptedToken | |
219 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
220 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
221 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
222 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
223 | - | } | |
224 | - | else if ((totalAddresses == 2)) | |
225 | - | then if ((callerIsWhiteListedNum > 0)) | |
226 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
227 | - | then throw("You don't have enough certification credit") | |
228 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
229 | - | else { | |
230 | - | let payment = extract(invoke.payment) | |
231 | - | let amount = if (isDefined(payment.amount)) | |
232 | - | then extract(payment.amount) | |
233 | - | else 0 | |
234 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
235 | - | then extract(payment.assetId) | |
236 | - | else acceptedToken | |
237 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
238 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
239 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
240 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
241 | - | } | |
242 | - | else if ((totalAddresses == 3)) | |
243 | - | then if ((callerIsWhiteListedNum > 0)) | |
244 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
245 | - | then throw("You don't have enough certification credit") | |
246 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
247 | - | else { | |
248 | - | let payment = extract(invoke.payment) | |
249 | - | let amount = if (isDefined(payment.amount)) | |
250 | - | then extract(payment.amount) | |
251 | - | else 0 | |
252 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
253 | - | then extract(payment.assetId) | |
254 | - | else acceptedToken | |
255 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
256 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
257 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
258 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
259 | - | } | |
260 | - | else if ((totalAddresses == 4)) | |
261 | - | then if ((callerIsWhiteListedNum > 0)) | |
262 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
263 | - | then throw("You don't have enough certification credit") | |
264 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
265 | - | else { | |
266 | - | let payment = extract(invoke.payment) | |
267 | - | let amount = if (isDefined(payment.amount)) | |
268 | - | then extract(payment.amount) | |
269 | - | else 0 | |
270 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
271 | - | then extract(payment.assetId) | |
272 | - | else acceptedToken | |
273 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
274 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
275 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
276 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
277 | - | } | |
278 | - | else if ((totalAddresses == 5)) | |
279 | - | then if ((callerIsWhiteListedNum > 0)) | |
195 | + | if ((entryExist != "NONE")) | |
196 | + | then throw("This entry already exist") | |
197 | + | else if ((uuidExist != "NONE")) | |
198 | + | then throw("This uuid already exist") | |
199 | + | else if ((size(uuid) > 36)) | |
200 | + | then throw("Uuid is too long") | |
201 | + | else if ((size(hash) > 64)) | |
202 | + | then throw("Message-id is too long") | |
203 | + | else if ((size(title) > 64)) | |
204 | + | then throw("Title is too long") | |
205 | + | else if ((callerIsWhiteListedNum > 0)) | |
280 | 206 | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
281 | 207 | then throw("You don't have enough certification credit") | |
282 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
283 | - | else { | |
284 | - | let payment = extract(invoke.payment) | |
285 | - | let amount = if (isDefined(payment.amount)) | |
286 | - | then extract(payment.amount) | |
287 | - | else 0 | |
288 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
289 | - | then extract(payment.assetId) | |
290 | - | else acceptedToken | |
291 | - | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
292 | - | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
293 | - | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
294 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
295 | - | } | |
296 | - | else if ((totalAddresses == 6)) | |
297 | - | then if ((callerIsWhiteListedNum > 0)) | |
298 | - | then if (((totalAddresses + 1) > callerIsWhiteListedNum)) | |
299 | - | then throw("You don't have enough certification credit") | |
300 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
301 | - | else { | |
208 | + | else if ((totalAddresses == 6)) | |
209 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
210 | + | else if ((totalAddresses == 5)) | |
211 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
212 | + | else if ((totalAddresses == 4)) | |
213 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
214 | + | else if ((totalAddresses == 3)) | |
215 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
216 | + | else if ((totalAddresses == 2)) | |
217 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
218 | + | else if ((totalAddresses == 1)) | |
219 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, dataWhiteListed, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(callerAddress), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
220 | + | else throw("Wrong number of participants") | |
221 | + | else if (!(callerIsDapp)) | |
222 | + | then { | |
302 | 223 | let payment = extract(invoke.payment) | |
303 | 224 | let amount = if (isDefined(payment.amount)) | |
304 | 225 | then extract(payment.amount) | |
305 | 226 | else 0 | |
306 | 227 | let paymentAssetId = if (isDefined(payment.assetId)) | |
307 | 228 | then extract(payment.assetId) | |
308 | 229 | else acceptedToken | |
309 | - | let currentPrice = getIntegerValue( | |
230 | + | let currentPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
310 | 231 | if (((currentPrice * (totalAddresses + 1)) > amount)) | |
311 | 232 | then throw(("The price is wrong, it should be " + toString((currentPrice * (totalAddresses + 1))))) | |
312 | - | else ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
233 | + | else if ((totalAddresses == 6)) | |
234 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[5] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[5]), 0, acceptedToken)])) | |
235 | + | else if ((totalAddresses == 5)) | |
236 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[4] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[4]), 0, acceptedToken)])) | |
237 | + | else if ((totalAddresses == 4)) | |
238 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[3] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[3]), 0, acceptedToken)])) | |
239 | + | else if ((totalAddresses == 3)) | |
240 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[2] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[2]), 0, acceptedToken)])) | |
241 | + | else if ((totalAddresses == 2)) | |
242 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING"), DataEntry(((addressesArray[1] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[1]), 0, acceptedToken)])) | |
243 | + | else if ((totalAddresses == 1)) | |
244 | + | then ScriptResult(WriteSet([globalDataTitle, globalDataHash, globalDataJson, globalDataOwner, DataEntry(((addressesArray[0] + "_MA_") + toBase58String(id)), "PENDING")]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken), ScriptTransfer(addressFromStringValue(addressesArray[0]), 0, acceptedToken)])) | |
245 | + | else throw(("Needs 1 to 6 recipient addresses, currently sent: " + toString(totalAddresses))) | |
313 | 246 | } | |
314 | - | else throw( | |
247 | + | else throw("You are not allowed to do that") | |
315 | 248 | } | |
316 | 249 | ||
317 | 250 | ||
318 | 251 | ||
319 | 252 | @Callable(invoke) | |
320 | - | func signAgreement (hash,agreementId) = { | |
253 | + | func signAgreement (hash,agreementId,signerPubKey) = { | |
321 | 254 | let payment = extract(invoke.payment) | |
322 | 255 | let amount = extract(payment.amount) | |
323 | 256 | let id = extract(invoke.transactionId) | |
324 | - | let signer = toBase58String(invoke.caller.bytes) | |
257 | + | let callerIsDapp = (this == invoke.caller) | |
258 | + | let signer = if (callerIsDapp) | |
259 | + | then toString(addressFromPublicKey(fromBase58String(signerPubKey))) | |
260 | + | else toBase58String(invoke.caller.bytes) | |
325 | 261 | let signingRequestExist = checkIfPendingToSign(((signer + "_MA_") + agreementId)) | |
326 | 262 | if (!(signingRequestExist)) | |
327 | 263 | then throw("Sorry there is no pending signature") | |
328 | - | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + agreementId), ("SIGNED_" + toBase58String(id)))]), TransferSet([ScriptTransfer(addressFromStringValue(signer), | |
264 | + | else ScriptResult(WriteSet([DataEntry(((signer + "_MA_") + agreementId), ("SIGNED_" + toBase58String(id)))]), TransferSet([ScriptTransfer(addressFromStringValue(signer), 0, acceptedToken)])) | |
329 | 265 | } | |
330 | 266 | ||
267 | + | ||
268 | + | ||
269 | + | @Callable(invoke) | |
270 | + | func usdnSignCredits () = { | |
271 | + | let payment = extract(invoke.payment) | |
272 | + | let callerAddress = toBase58String(invoke.caller.bytes) | |
273 | + | let tokenId = extract(payment.assetId) | |
274 | + | let amount = extract(payment.amount) | |
275 | + | let numberOfCredits = ((amount * 2) / 1000000) | |
276 | + | let callerIsWhiteListedNum = checkIfWhiteListed(callerAddress) | |
277 | + | if ((toBase58String(tokenId) != "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC")) | |
278 | + | then throw("Only USDN can be exchanged") | |
279 | + | else if (if (((amount % 1000000) != 0)) | |
280 | + | then ((amount % 1000000) != 500000) | |
281 | + | else false) | |
282 | + | then throw(((("You can only exchange multiple of 0.5, you sent:" + dropRight(toString(amount), 6)) + ".") + takeRight(toString(amount), 6))) | |
283 | + | else ScriptResult(WriteSet([DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum + numberOfCredits))]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, tokenId)])) | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | @Verifier(tx) | |
288 | + | func verifier () = match tx { | |
289 | + | case inv: InvokeScriptTransaction => | |
290 | + | if (if (if ((inv.function == "fileCertification")) | |
291 | + | then true | |
292 | + | else (inv.function == "emailCertification")) | |
293 | + | then true | |
294 | + | else (inv.function == "createAgreement")) | |
295 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[4]))) | |
296 | + | else if ((inv.function == "signAgreement")) | |
297 | + | then sigVerify(tx.bodyBytes, tx.proofs[0], fromBase58String(asString(inv.args[2]))) | |
298 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
299 | + | case _ => | |
300 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
301 | + | } | |
331 | 302 |
github/deemru/w8io/026f985 68.83 ms ◑