tx · FSN6msGN1bdf3bhqqzG4TzNQptuTusrL6Rx8rF8sAdmb

3MxucfJzTSr41JRJ9xemPjB2gxfwPm39wDa:  -0.00200000 Waves

2024.12.13 22:12 [3413217] smart account 3MxucfJzTSr41JRJ9xemPjB2gxfwPm39wDa > SELF 0.00000000 Waves

{ "type": 13, "id": "FSN6msGN1bdf3bhqqzG4TzNQptuTusrL6Rx8rF8sAdmb", "fee": 200000, "feeAssetId": null, "timestamp": 1734117230306, "version": 2, "chainId": 84, "sender": "3MxucfJzTSr41JRJ9xemPjB2gxfwPm39wDa", "senderPublicKey": "AUZ9DqdRKTMRKBy85NueJcRXW6LW1CRnf4dmkRqnasWh", "proofs": [ "5YVhG5GtaXH7jStSQm9xhT3DN4yisyA14UeiSRufGZWeT7nFe7FKwm9Do7P4TCWcPLWJd4Ug9PqhijUHZPHpD4rm" ], "script": "base64:CAIVCAISBAoCCAgSBQoDCAgIEgQKAggBAAMBaQEJYWRkRmFybWVyAgxwdWJLZXlGYXJtZXIIdXNlcmRhdGEEBmZhcm1lcgkAnwgBCQCsAgIFDHB1YktleUZhcm1lcgIGX2NvdW50AwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIqT25seSB0aGUgdmV0IG9mZmljZSBjYW4gY3JlYXRlIG5ldyBGYXJtZXJzAwkAAAIFBmZhcm1lcgUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIJX3VzZXJkYXRhBQh1c2VyZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIIX3BlbmRpbmcCAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICBl9jb3VudAAACQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAKcIAQkA2QQBBQxwdWJLZXlGYXJtZXIAwM8kBQR1bml0BQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYW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gECGkF1QSBFbnRyeSBhbHJlYWR5IHZlcmlmaWVkAwkBASEBCQEJaXNEZWZpbmVkAQkAoggBCQCsAgIJAKwCAgUGcHViS2V5AgFfCQCkAwEFBWVudHJ5CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BAtwZW5kaW5nTGlzdAkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFBnB1YktleQIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFC3BlbmRpbmdMaXN0CQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgULcGVuZGluZ0xpc3QJAQV2YWx1ZQEFBWluZGV4AgEsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIFBnB1YktleQIBXwkApAMBBQVlbnRyeQIJX3ZlcmlmaWVkBQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUGcHViS2V5AghfcGVuZGluZwUQbmV3UGVuZGluZ1N0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAoMIeBQR1bml0BQNuaWwAHXX5kw==", "height": 3413217, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4U2SLQox4XbcfTHcxVXnVZYm12HfrskeW9xGuu3TwJcP Full:
OldNewDifferences
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)), 600000, 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 
16.33 ms