tx · HGjnddhc4kLE7AUn5siSG6xCpWS6r38FTgeGP4u9zYkJ 3Mup4uG7mXS2N9Fuk3JtEpoKKmzA2PtQcUY: -0.01400000 Waves 2019.09.24 17:26 [690538] smart account 3Mup4uG7mXS2N9Fuk3JtEpoKKmzA2PtQcUY > SELF 0.00000000 Waves
{ "type": 13, "id": "HGjnddhc4kLE7AUn5siSG6xCpWS6r38FTgeGP4u9zYkJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1569335251210, "version": 1, "sender": "3Mup4uG7mXS2N9Fuk3JtEpoKKmzA2PtQcUY", "senderPublicKey": "6VdgiscuZ9B1c2urnAVPPVaCS5afNjzf1RpG2SS3GUy6", "proofs": [ "25TM38uNtTpq82qhezLZVyexgTEBj1DXdKeiMVggfAZrBpxaTWYgr7wJBrqM1ZERLDaZbUTR61bZJwEyUrLqgGmu" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAMY3VycmVudFByaWNlAAAAAFF9oCwAAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAEAAAAGaW52b2tlAQAAABFmaWxlQ2VydGlmaWNhdGlvbgAAAAQAAAAEaGFzaAAAAAV0aXRsZQAAAAR1dWlkAAAABGRhdGEEAAAAB3BheW1lbnQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAAdwYXltZW50BAAAAAZhbW91bnQJAQAAAAdleHRyYWN0AAAAAQgFAAAAB3BheW1lbnQAAAAGYW1vdW50BAAAAAJpZAkBAAAAB2V4dHJhY3QAAAABCAUAAAAGaW52b2tlAAAADXRyYW5zYWN0aW9uSWQEAAAACmVudHJ5RXhpc3QEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAARoYXNoBQAAAAR1dWlkAwkAAAEAAAAC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XRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAEdXVpZAkAAlgAAAABBQAAAAJpZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAARoYXNoBQAAAAR1dWlkCQACWAAAAAEFAAAAAmlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAABXRpdGxlBQAAAAR1dWlkCQACWAAAAAEFAAAAAmlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAhkYXRhX2ZjXwkAAlgAAAABBQAAAAJpZAIAAAABXwkAAlgAAAABCAgFAAAABmludm9rZQAAAAZjYWxsZXIAAAAFYnl0ZXMFAAAABGRhdGEFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAABGJhbmsFAAAABmFtb3VudAUAAAANYWNjZXB0ZWRUb2tlbgUAAAADbmlsAAAAAJedOhg=", "chainId": 84, "height": 690538, "spentComplexity": 0 } View: original | compacted Prev: 4Aac3xFfEQNfqKcUj9Sjk7LgKHi2z3Ts3BiSUxHorne8 Next: none Diff:
Old | New | Differences | |
---|---|---|---|
18 | 18 | case _ => | |
19 | 19 | "NONE" | |
20 | 20 | } | |
21 | + | let uuidExist = match getString(this, uuid) { | |
22 | + | case a: String => | |
23 | + | a | |
24 | + | case _ => | |
25 | + | "NONE" | |
26 | + | } | |
21 | 27 | if ((entryExist != "NONE")) | |
22 | 28 | then throw("This entry already exist") | |
23 | - | else { | |
24 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
25 | - | then extract(payment.assetId) | |
26 | - | else throw("Waves is not accepted as payment") | |
27 | - | if ((paymentAssetId != acceptedToken)) | |
28 | - | then throw("Only payments in SIGN are allowed at the moment") | |
29 | - | else if ((amount != currentPrice)) | |
30 | - | then throw("The price is wrong") | |
31 | - | else ScriptResult(WriteSet([DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + toBase58String(invoke.caller.bytes)), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
32 | - | } | |
29 | + | else if ((uuidExist != "NONE")) | |
30 | + | then throw("This uuid already exist") | |
31 | + | else if ((size(uuid) > 36)) | |
32 | + | then throw("Uuid is too long") | |
33 | + | else if ((size(title) > 64)) | |
34 | + | then throw("Title is too long") | |
35 | + | else { | |
36 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
37 | + | then extract(payment.assetId) | |
38 | + | else throw("Waves is not accepted as payment") | |
39 | + | if ((paymentAssetId != acceptedToken)) | |
40 | + | then throw("Only payments in SIGN are allowed at the moment") | |
41 | + | else if ((amount != currentPrice)) | |
42 | + | then throw("The price is wrong") | |
43 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + toBase58String(invoke.caller.bytes)), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
44 | + | } | |
33 | 45 | } | |
34 | 46 | ||
35 | 47 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
5 | 5 | ||
6 | 6 | let currentPrice = 350000000000 | |
7 | 7 | ||
8 | 8 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
9 | 9 | ||
10 | 10 | @Callable(invoke) | |
11 | 11 | func fileCertification (hash,title,uuid,data) = { | |
12 | 12 | let payment = extract(invoke.payment) | |
13 | 13 | let amount = extract(payment.amount) | |
14 | 14 | let id = extract(invoke.transactionId) | |
15 | 15 | let entryExist = match getString(this, (hash + uuid)) { | |
16 | 16 | case a: String => | |
17 | 17 | a | |
18 | 18 | case _ => | |
19 | 19 | "NONE" | |
20 | 20 | } | |
21 | + | let uuidExist = match getString(this, uuid) { | |
22 | + | case a: String => | |
23 | + | a | |
24 | + | case _ => | |
25 | + | "NONE" | |
26 | + | } | |
21 | 27 | if ((entryExist != "NONE")) | |
22 | 28 | then throw("This entry already exist") | |
23 | - | else { | |
24 | - | let paymentAssetId = if (isDefined(payment.assetId)) | |
25 | - | then extract(payment.assetId) | |
26 | - | else throw("Waves is not accepted as payment") | |
27 | - | if ((paymentAssetId != acceptedToken)) | |
28 | - | then throw("Only payments in SIGN are allowed at the moment") | |
29 | - | else if ((amount != currentPrice)) | |
30 | - | then throw("The price is wrong") | |
31 | - | else ScriptResult(WriteSet([DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + toBase58String(invoke.caller.bytes)), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
32 | - | } | |
29 | + | else if ((uuidExist != "NONE")) | |
30 | + | then throw("This uuid already exist") | |
31 | + | else if ((size(uuid) > 36)) | |
32 | + | then throw("Uuid is too long") | |
33 | + | else if ((size(title) > 64)) | |
34 | + | then throw("Title is too long") | |
35 | + | else { | |
36 | + | let paymentAssetId = if (isDefined(payment.assetId)) | |
37 | + | then extract(payment.assetId) | |
38 | + | else throw("Waves is not accepted as payment") | |
39 | + | if ((paymentAssetId != acceptedToken)) | |
40 | + | then throw("Only payments in SIGN are allowed at the moment") | |
41 | + | else if ((amount != currentPrice)) | |
42 | + | then throw("The price is wrong") | |
43 | + | else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + toBase58String(invoke.caller.bytes)), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, acceptedToken)])) | |
44 | + | } | |
33 | 45 | } | |
34 | 46 | ||
35 | 47 |
github/deemru/w8io/169f3d6 45.43 ms ◑