tx · DL1MoXoAkrCJftoj2qyBcgb1ZYKYFUL3Bs7G4FcawpUs 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB: -0.01400000 Waves 2019.12.28 11:00 [828628] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves
{ "type": 13, "id": "DL1MoXoAkrCJftoj2qyBcgb1ZYKYFUL3Bs7G4FcawpUs", "fee": 1400000, "feeAssetId": null, "timestamp": 1577520050996, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "4KK5xRFZ7RWQVNo4HZWcT5BhQDPrqd9de9Wrvpguux6YYPGJc4J6QcJayV1oSdvHApHb7Z1dowdScVPBwGawtFiK" ], "script": "base64:AAIDAAAAAAAAAAsIARIHCgUICAgICAAAAAIAAAAACHZlcmlmaWVyCQEAAAAHZXh0cmFjdAAAAAEJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOMnM1UnRhSFBCZW5Dc3gyRUNjb0ZSYllIeDNub1poWFcxAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAEAAAAGaW52b2tlAQAAABFmaWxlQ2VydGlmaWNhdGlvbgAAAAUAAAAEaGFzaAAAAAV0aXRsZQAAAAR1dWlkAAAABGRhdGEAAAAEZnJvbQQAAAACaWQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAA10cmFuc2FjdGlvbklkBAAAAAplbnRyeUV4aXN0BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaGFzaAUAAAAEdXVpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAROT05FBAAAAAl1dWlkRX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ANY2FsbGVyQWRkcmVzcwUAAAAEZGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAEYmFuawUAAAAGYW1vdW50CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwAAAAAP40M8w==", "chainId": 84, "height": 828628, "spentComplexity": 0 } View: original | compacted Prev: FmNpAaSPn7chevZbgubn4oubhBNEs2EhuuAiaFmFQHg Next: H1QXaFgLQac6cJ4b8xAFTfVRZ5qABmAdgsZCstyb6jAL Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
7 | 7 | ||
8 | 8 | @Callable(invoke) | |
9 | - | func fileCertification (hash,title,uuid,data) = { | |
9 | + | func fileCertification (hash,title,uuid,data,from) = { | |
10 | 10 | let id = extract(invoke.transactionId) | |
11 | 11 | let entryExist = match getString(this, (hash + uuid)) { | |
12 | 12 | case a: String => |
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 | - | func fileCertification (hash,title,uuid,data) = { | |
9 | + | func fileCertification (hash,title,uuid,data,from) = { | |
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 if ((callerIsWhiteListedNum > 0)) | |
41 | 41 | 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)])) | |
42 | 42 | else { | |
43 | 43 | let payment = extract(invoke.payment) | |
44 | 44 | let amount = extract(payment.amount) | |
45 | 45 | let paymentAssetId = if (isDefined(payment.assetId)) | |
46 | 46 | then extract(payment.assetId) | |
47 | 47 | else throw("Waves is not accepted as payment") | |
48 | 48 | let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) { | |
49 | 49 | case a: String => | |
50 | 50 | a | |
51 | 51 | case _ => | |
52 | 52 | throw("This token is not accepted at the moment") | |
53 | 53 | } | |
54 | 54 | let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId)))) | |
55 | 55 | if ((acceptedToken != "WHITELISTED")) | |
56 | 56 | then throw("This token is not accepted at the moment") | |
57 | 57 | else if (if ((amount != currentPrice)) | |
58 | 58 | then (0 >= callerIsWhiteListedNum) | |
59 | 59 | else false) | |
60 | 60 | then throw("The price is wrong") | |
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 23.23 ms ◑