tx · 8MRrrW4RqJ4uhcBGyWxt7npwEb7hBFiFoTkmMyovJxaR 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB: -0.01400000 Waves 2019.12.28 09:15 [828521] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves
{ "type": 13, "id": "8MRrrW4RqJ4uhcBGyWxt7npwEb7hBFiFoTkmMyovJxaR", "fee": 1400000, "feeAssetId": null, "timestamp": 1577513749173, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "2YoGRbofimawPXGCa7apiK6hQf6PDsqaPWfGu3Znjick1xsb8HoJGcawM21SozBmYYk6PGLGi8tjB6SRrKaXfoKD" ], "script": "base64:AAIDAAAAAAAAAAoIARIGCgQICAgIAAAAAgAAAAAIdmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAQAAAAZpbnZva2UBAAAAEWZpbGVDZXJ0aWZpY2F0aW9uAAAABAAAAARoYXNoAAAABXRpdGxlAAAABHV1aWQAAAAEZGF0YQQAAAACaWQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAA10cmFuc2FjdGlvbklkBAAAAAplbnRyeUV4aXN0BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaGFzaAUAAAAEdXVpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAROT05FBAAAAAl1dWlkRXhpc3QEAAAAByRtYX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AANY2FsbGVyQWRkcmVzcwUAAAAEZGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAEYmFuawUAAAAGYW1vdW50CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwAAAAAx9gPzg==", "chainId": 84, "height": 828521, "spentComplexity": 0 } View: original | compacted Prev: A9G1AoUFjupmsnmKV93SZH2XPhLZ7jD8PrYCHXRQNbAz Next: 5jXYB2vHzyaeFuprimucAKzFwVhEEyXvdQY1HZXc3iTr Diff:
Old | New | Differences | |
---|---|---|---|
57 | 57 | else false) | |
58 | 58 | then throw("The price is wrong") | |
59 | 59 | else if ((callerIsWhiteListedNum > 0)) | |
60 | - | 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, | |
60 | + | 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, 500100, payment.assetId)])) | |
61 | 61 | 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)])) | |
62 | 62 | } | |
63 | 63 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
7 | 7 | ||
8 | 8 | @Callable(invoke) | |
9 | 9 | func fileCertification (hash,title,uuid,data) = { | |
10 | 10 | let id = extract(invoke.transactionId) | |
11 | 11 | let entryExist = match getString(this, (hash + uuid)) { | |
12 | 12 | case a: String => | |
13 | 13 | a | |
14 | 14 | case _ => | |
15 | 15 | "NONE" | |
16 | 16 | } | |
17 | 17 | let uuidExist = match getString(this, uuid) { | |
18 | 18 | case a: String => | |
19 | 19 | a | |
20 | 20 | case _ => | |
21 | 21 | "NONE" | |
22 | 22 | } | |
23 | 23 | let callerAddress = toBase58String(invoke.caller.bytes) | |
24 | 24 | let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) { | |
25 | 25 | case a: Int => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | 0 | |
29 | 29 | } | |
30 | 30 | if ((entryExist != "NONE")) | |
31 | 31 | then throw("This entry already exist") | |
32 | 32 | else if ((uuidExist != "NONE")) | |
33 | 33 | then throw("This uuid already exist") | |
34 | 34 | else if ((size(uuid) > 36)) | |
35 | 35 | then throw("Uuid is too long") | |
36 | 36 | else if ((size(hash) > 64)) | |
37 | 37 | then throw("Hash is too long") | |
38 | 38 | else if ((size(title) > 64)) | |
39 | 39 | then throw("Title is too long") | |
40 | 40 | else { | |
41 | 41 | let payment = extract(invoke.payment) | |
42 | 42 | let amount = extract(payment.amount) | |
43 | 43 | let paymentAssetId = if (isDefined(payment.assetId)) | |
44 | 44 | then extract(payment.assetId) | |
45 | 45 | else throw("Waves is not accepted as payment") | |
46 | 46 | let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) { | |
47 | 47 | case a: String => | |
48 | 48 | a | |
49 | 49 | case _ => | |
50 | 50 | throw("This token is not accepted at the moment") | |
51 | 51 | } | |
52 | 52 | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
53 | 53 | if ((acceptedToken != "WHITELISTED")) | |
54 | 54 | then throw("This token is not accepted at the moment") | |
55 | 55 | else if (if ((amount != currentPrice)) | |
56 | 56 | then (0 >= callerIsWhiteListedNum) | |
57 | 57 | else false) | |
58 | 58 | then throw("The price is wrong") | |
59 | 59 | else if ((callerIsWhiteListedNum > 0)) | |
60 | - | 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, | |
60 | + | 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, 500100, payment.assetId)])) | |
61 | 61 | 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)])) | |
62 | 62 | } | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 |
github/deemru/w8io/026f985 71.62 ms ◑