tx · FcwsLWi7jbPgPNeZJaGqFZm9i6DGbX4HPZGKGwd1ijmB 3N9PyUqvE9weBXRngdMZ7DyKvzL2yYZU5u6: -0.00200000 Waves 2024.12.18 16:44 [3420056] smart account 3N9PyUqvE9weBXRngdMZ7DyKvzL2yYZU5u6 > SELF 0.00000000 Waves
{ "type": 13, "id": "FcwsLWi7jbPgPNeZJaGqFZm9i6DGbX4HPZGKGwd1ijmB", "fee": 200000, "feeAssetId": null, "timestamp": 1734529491904, "version": 2, "chainId": 84, "sender": "3N9PyUqvE9weBXRngdMZ7DyKvzL2yYZU5u6", "senderPublicKey": "9Uc1MuAoRrjMxpDt4GQpxbaM7G4SVJjkuKwYj3o4d6f9", "proofs": [ "461qJVws92Uism4KNXykT27Xcni3VYvnpQHqeNro42gtT5ChYGMRsdDq38AuQAyWqWp6Z6nnA8BZ8o5LG1iynogM" ], "script": "base64:CAIVCAISBAoCCAgSBQoDCAgIEgQKAggBAAMBaQEJYWRkRmFybWVyAgxwdWJLZXlGYXJtZXIIdXNlcmRhdGEEBmZhcm1lcgkAnwgBCQCsAgIFDHB1YktleUZhcm1lcgIGX2NvdW50AwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIqT25seSB0aGUgdmV0IG9mZmljZSBjYW4gY3JlYXRlIG5ldyBGYXJtZXJzAwkAAAIFBmZhcm1lcgUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIJX3VzZXJkYXRhBQh1c2VyZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIIX3BlbmRpbmcCAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICBl9jb3VudAAACQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAKcIAQkA2QQBBQxwdWJLZXlGYXJtZXIA4NwqBQR1bml0BQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHM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mllZAkAAgECGkF1QSBFbnRyeSBhbHJlYWR5IHZlcmlmaWVkAwkBASEBCQEJaXNEZWZpbmVkAQkAoggBCQCsAgIJAKwCAgUGcHViS2V5AgFfCQCkAwEFBWVudHJ5CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BAtwZW5kaW5nTGlzdAkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFBnB1YktleQIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFC3BlbmRpbmdMaXN0CQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgULcGVuZGluZ0xpc3QJAQV2YWx1ZQEFBWluZGV4AgEsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIFBnB1YktleQIBXwkApAMBBQVlbnRyeQIJX3ZlcmlmaWVkBQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUGcHViS2V5AghfcGVuZGluZwUQbmV3UGVuZGluZ1N0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAoMIeBQR1bml0BQNuaWwApyTDfQ==", "height": 3420056, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5HEBC2fKC8EcEsEM2wd3LWVdm7Tf1ckXf9qWyBU5o6ZU Next: CLZ4ErsUgfmZVtbLEx8915UHN3iDSPyA22pzbJ9Z9vbV Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func addFarmer (pubKeyFarmer,userdata) = { | |
8 | 8 | let farmer = getInteger((pubKeyFarmer + "_count")) | |
9 | 9 | if ((i.caller != this)) | |
10 | 10 | then throw("Only the vet office can create new Farmers") | |
11 | 11 | else if ((farmer == unit)) | |
12 | 12 | then [StringEntry((pubKeyFarmer + "_userdata"), userdata), StringEntry((pubKeyFarmer + "_pending"), ""), IntegerEntry((pubKeyFarmer + "_count"), 0), ScriptTransfer(addressFromPublicKey(fromBase58String(pubKeyFarmer)), 700000, unit)] | |
13 | 13 | else throw("Farmer already exists") | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | 18 | @Callable(i) | |
19 | 19 | func addAad (dataFarmer,dataVet,pubKeyFarmer) = { | |
20 | 20 | let count = match getInteger((pubKeyFarmer + "_count")) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | throw("Farmer does not exist") | |
25 | 25 | } | |
26 | 26 | let pending = getStringValue((pubKeyFarmer + "_pending")) | |
27 | 27 | let pendingList = [toString(count), split(pending, ",")] | |
28 | 28 | [StringEntry((pubKeyFarmer + "_pending"), makeString(pendingList, ",")), StringEntry(((pubKeyFarmer + "_") + toString(count)), dataFarmer), StringEntry(((((pubKeyFarmer + "_") + toBase58String(i.callerPublicKey)) + "_") + toString(count)), dataVet), IntegerEntry((pubKeyFarmer + "_count"), (count + 1)), ScriptTransfer(i.caller, 500000, unit)] | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(i) | |
34 | 34 | func verify (data,entry) = { | |
35 | 35 | let pubKey = toBase58String(i.callerPublicKey) | |
36 | 36 | if (!(isDefined(getString((pubKey + "_pending"))))) | |
37 | 37 | then throw("Farmer does not exist") | |
38 | 38 | else if (isDefined(getString((((pubKey + "_") + toString(entry)) + "_verified")))) | |
39 | 39 | then throw("AuA Entry already verified") | |
40 | 40 | else if (!(isDefined(getString(((pubKey + "_") + toString(entry)))))) | |
41 | 41 | then throw((("Entry " + toString(entry)) + " does not exist")) | |
42 | 42 | else { | |
43 | 43 | let pendingList = split(getStringValue((pubKey + "_pending")), ",") | |
44 | 44 | let index = indexOf(pendingList, toString(entry)) | |
45 | 45 | if ((index == unit)) | |
46 | 46 | then throw((("Entry " + toString(entry)) + " does not exist")) | |
47 | 47 | else { | |
48 | 48 | let newPendingString = makeString(removeByIndex(pendingList, value(index)), ",") | |
49 | 49 | [StringEntry((((pubKey + "_") + toString(entry)) + "_verified"), data), StringEntry((pubKey + "_pending"), newPendingString), ScriptTransfer(i.caller, 500000, unit)] | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 |
github/deemru/w8io/169f3d6 26.95 ms ◑