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