tx · ACzQzrxZLN1pbjvvJ2ZW27CTYa4HJksudkuaPaKTofVW 3MvKHZaw68MMNfaBakAvJqhMCbiwup5Ytqq: -0.01400000 Waves 2020.10.03 20:27 [1204680] smart account 3MvKHZaw68MMNfaBakAvJqhMCbiwup5Ytqq > SELF 0.00000000 Waves
{ "type": 13, "id": "ACzQzrxZLN1pbjvvJ2ZW27CTYa4HJksudkuaPaKTofVW", "fee": 1400000, "feeAssetId": null, "timestamp": 1601746172170, "version": 2, "chainId": 84, "sender": "3MvKHZaw68MMNfaBakAvJqhMCbiwup5Ytqq", "senderPublicKey": "DVurAHVNxvueWRUSmTevhhCD34tpNStCcpCWGFZwVEoN", "proofs": [ "Eyb67G66ZaxQUgtRP7jDX7mqUb3PpwPZ3M3VCMYthLXZoaHsX8A9kVvm4E9WM3MdRuYQ28VgB3A72zRZ4n4d61V" ], "script": "base64:AAIDAAAAAAAAAA4IARIECgIICBIECgIIAQAAAAMBAAAABWdlS2V5AAAAAQAAAAdvcmRlcklECQABLAAAAAIJAAEsAAAAAgIAAAAMSU5BUlRFX2NlcnRfBQAAAAdvcmRlcklEAgAAAAFfAAAAABVvd25lckFjY291bnRQdWJsaWNLZXkBAAAAILm0Qr8R+sM4V9Jhr6JVRW5qWD79OBgyxAsriovxBLsVAQAAABFnZXRLZXlDZXJ0aWZpY2F0bwAAAAIAAAAIc3VwcGxpZXIAAAAHb3JkZXJJRAkAASwAAAACCQEAAAAFZ2VLZXkAAAABBQAAAAdvcmRlcklECQACWAAAAAEJAAH3AAAAAQkAAZsAAAABBQAAAAhzdXBwbGllcgAAAAIAAAABaQEAAAAOYWRkQ2VydGlmaWNhdG8AAAACAAAAB29yZGVySUQAAAAEZGF0YQQAAAAPc3VwcGxpZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAABGl0ZW0JAQAAABFnZXRLZXlDZXJ0aWZpY2F0bwAAAAIFAAAAD3N1cHBsaWVyQWRkcmVz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AAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAFW93bmVyQWNjb3VudFB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABZQUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAAFW93bmVyQWNjb3VudFB1YmxpY0tleQfAuWtb", "height": 1204680, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Hg38ZvQVRWw6A3H8ZEt311vKLtjRr87Z761ChtZpeBqW Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let ownerAccountPublicKey = base58'GVsR75VQKH14tJzX66X9CAbJ535kUtBchPVEJTtRhXeh' | |
5 | - | ||
6 | - | func getKeyItem (supplier,orderID) = ((("INARTE_cert_" + orderID) + "_") + toBase58String(sha256(toBytes(supplier)))) | |
4 | + | func geKey (orderID) = (("INARTE_cert_" + orderID) + "_") | |
7 | 5 | ||
8 | 6 | ||
9 | - | ||
7 | + | let ownerAccountPublicKey = base58'DVurAHVNxvueWRUSmTevhhCD34tpNStCcpCWGFZwVEoN' | |
10 | 8 | ||
11 | - | ||
12 | - | func getKeyItemSupplier (item) = (item + "_owner") | |
9 | + | func getKeyCertificato (supplier,orderID) = (geKey(orderID) + toBase58String(sha256(toBytes(supplier)))) | |
13 | 10 | ||
14 | 11 | ||
15 | 12 | @Callable(i) | |
16 | 13 | func addCertificato (orderID,data) = { | |
17 | 14 | let supplierAddress = toBase58String(i.caller.bytes) | |
18 | - | let item = | |
15 | + | let item = getKeyCertificato(supplierAddress, orderID) | |
19 | 16 | WriteSet([DataEntry(item, data)]) | |
20 | 17 | } | |
21 | 18 | ||
19 | + | ||
20 | + | ||
21 | + | @Callable(i) | |
22 | + | func votaCertificato (orderID,stelle) = { | |
23 | + | let chiaveVoti = (("INARTE_voti_" + orderID) + "_") | |
24 | + | let chiaveVotanti = (("INARTE_votanti_" + orderID) + "_") | |
25 | + | let votiAttuali = match getInteger(this, chiaveVoti) { | |
26 | + | case a: Int => | |
27 | + | a | |
28 | + | case _ => | |
29 | + | 0 | |
30 | + | } | |
31 | + | let votantiAttuali = match getInteger(this, chiaveVotanti) { | |
32 | + | case a: Int => | |
33 | + | a | |
34 | + | case _ => | |
35 | + | 0 | |
36 | + | } | |
37 | + | WriteSet([DataEntry(chiaveVoti, (votiAttuali + stelle)), DataEntry(chiaveVotanti, (votantiAttuali + 1))]) | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | @Verifier(tx) | |
42 | + | func verify () = match tx { | |
43 | + | case d: SetScriptTransaction => | |
44 | + | sigVerify(tx.bodyBytes, tx.proofs[0], ownerAccountPublicKey) | |
45 | + | case e: TransferTransaction => | |
46 | + | sigVerify(tx.bodyBytes, tx.proofs[0], ownerAccountPublicKey) | |
47 | + | case _ => | |
48 | + | false | |
49 | + | } | |
22 | 50 |
github/deemru/w8io/169f3d6 42.74 ms ◑