tx · ARRhZxWRSntt5w5ovbqWPipFrRag8fauKFWEATnAWeo8

3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o:  -0.00200000 Waves

2024.12.15 17:04 [3415770] smart account 3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o > SELF 0.00000000 Waves

{ "type": 13, "id": "ARRhZxWRSntt5w5ovbqWPipFrRag8fauKFWEATnAWeo8", "fee": 200000, "feeAssetId": null, "timestamp": 1734271459021, "version": 2, "chainId": 84, "sender": "3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o", "senderPublicKey": "2n2HckgwZhE4kaAhHqRKywLfAKYtZTXvAvCHB2hPLE4U", "proofs": [ "5f77CHnDKgREoWcLWuov9nBX8KSxq9hG13GgfAKgH6PsvfBMwkQt3RPs5M7816RnkYi4i1DDiDVw4Rv2HudwjyS7" ], "script": "base64:CAIVCAISBAoCCAgSBQoDCAgIEgQKAggBAAMBaQEJYWRkRmFybWVyAgxwdWJLZXlGYXJtZXIIdXNlcmRhdGEEBmZhcm1lcgkAnwgBCQCsAgIFDHB1YktleUZhcm1lcgIGX2NvdW50AwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIqT25seSB0aGUgdmV0IG9mZmljZSBjYW4gY3JlYXRlIG5ldyBGYXJtZXJzAwkAAAIFBmZhcm1lcgUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIJX3VzZXJkYXRhBQh1c2VyZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIIX3BlbmRpbmcCAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICBl9jb3VudAAACQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAKcIAQkA2QQBBQxwdWJLZXlGYXJtZXIA4NwqBQR1bml0BQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYWRk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GkF1QSBFbnRyeSBhbHJlYWR5IHZlcmlmaWVkAwkBASEBCQEJaXNEZWZpbmVkAQkAoggBCQCsAgIJAKwCAgUGcHViS2V5AgFfCQCkAwEFBWVudHJ5CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BAtwZW5kaW5nTGlzdAkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFBnB1YktleQIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFC3BlbmRpbmdMaXN0CQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgULcGVuZGluZ0xpc3QJAQV2YWx1ZQEFBWluZGV4AgEsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIFBnB1YktleQIBXwkApAMBBQVlbnRyeQIJX3ZlcmlmaWVkBQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUGcHViS2V5AghfcGVuZGluZwUQbmV3UGVuZGluZ1N0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAoMIeBQR1bml0BQNuaWwApyTDfQ==", "height": 3415770, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HfsLgvY4x937Jkm7gwX334ufCJmjmPDhktV2Vvbf4bky Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 8 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func addFarmer (pubKeyFarmer,userdata) = {
88 let farmer = getInteger((pubKeyFarmer + "_count"))
99 if ((i.caller != this))
1010 then throw("Only the vet office can create new Farmers")
1111 else if ((farmer == unit))
1212 then [StringEntry((pubKeyFarmer + "_userdata"), userdata), StringEntry((pubKeyFarmer + "_pending"), ""), IntegerEntry((pubKeyFarmer + "_count"), 0), ScriptTransfer(addressFromPublicKey(fromBase58String(pubKeyFarmer)), 700000, unit)]
1313 else throw("Farmer already exists")
1414 }
1515
1616
1717
1818 @Callable(i)
1919 func addAad (dataFarmer,dataVet,pubKeyFarmer) = {
2020 let count = match getInteger((pubKeyFarmer + "_count")) {
2121 case a: Int =>
2222 a
2323 case _ =>
2424 throw("Farmer does not exist")
2525 }
2626 let pending = getStringValue((pubKeyFarmer + "_pending"))
2727 let pendingList = [toString(count), split(pending, ",")]
2828 [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)]
2929 }
3030
3131
3232
3333 @Callable(i)
3434 func verify (data,entry) = {
3535 let pubKey = toBase58String(i.callerPublicKey)
3636 if (!(isDefined(getString((pubKey + "_pending")))))
3737 then throw("Farmer does not exist")
3838 else if (isDefined(getString((((pubKey + "_") + toString(entry)) + "_verified"))))
3939 then throw("AuA Entry already verified")
4040 else if (!(isDefined(getString(((pubKey + "_") + toString(entry))))))
4141 then throw((("Entry " + toString(entry)) + " does not exist"))
4242 else {
4343 let pendingList = split(getStringValue((pubKey + "_pending")), ",")
4444 let index = indexOf(pendingList, toString(entry))
4545 if ((index == unit))
4646 then throw((("Entry " + toString(entry)) + " does not exist"))
4747 else {
4848 let newPendingString = makeString(removeByIndex(pendingList, value(index)), ",")
4949 [StringEntry((((pubKey + "_") + toString(entry)) + "_verified"), data), StringEntry((pubKey + "_pending"), newPendingString), ScriptTransfer(i.caller, 500000, unit)]
5050 }
5151 }
5252 }
5353
5454

github/deemru/w8io/169f3d6 
14.17 ms