tx · CVaubVt52jHZtMCJMQpefwu3tHPzgXpBjj8bc6Z93kJy 3N86KmEbcQg17dbZU5Hzxky1RUASLhfitP2: -0.00200000 Waves 2024.12.02 14:42 [3396993] smart account 3N86KmEbcQg17dbZU5Hzxky1RUASLhfitP2 > SELF 0.00000000 Waves
{ "type": 13, "id": "CVaubVt52jHZtMCJMQpefwu3tHPzgXpBjj8bc6Z93kJy", "fee": 200000, "feeAssetId": null, "timestamp": 1733139757639, "version": 2, "chainId": 84, "sender": "3N86KmEbcQg17dbZU5Hzxky1RUASLhfitP2", "senderPublicKey": "kA5qegfBDjbbcVcxt9SKNspwzfJXmSjdMFFHKeeAinT", "proofs": [ "LGGaaziMmGZCYRppN14HrUoRBz6uuSR5945XonL2pHyor4wLC4KdKJVEL5owUTYHrqSRxx5Q1eGyhesCW3R2osN" ], "script": "base64:CAISCAISABIFCgMICAgSBQoDCAgBAAMBaQEJYWRkRmFybWVyAAQHYWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEBmZhcm1lcgkAnwgBCQCsAgIFB2FkZHJlc3MCBl9jb3VudAMJAAACBQZmYXJtZXIFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQdhZGRyZXNzAghfcGVuZGluZwIACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFB2FkZHJlc3MCBl9jb3VudAAABQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYWRkQXVBAwpkYXRhRmFybWVyB2RhdGFWZXQGZmFybWVyBAVjb3VudAQHJG1hdGNoMAkAnwgBCQCsAgIFBmZhcm1lcgIGX2NvdW50AwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQkAAgECFUZhcm1lciBkb2VzIG5vdCBleGlzdAQHcGVuZGluZwkBEUBleHRyTmF0aXZlKDEwNTgpAQkArAICBQZmYXJtZXICCF9wZW5kaW5nBAtwZW5kaW5nTGlzdAkAzAgCCQCkAwEFBWNvdW50CQ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hpc3QEEG5ld1BlbmRpbmdTdHJpbmcJALkJAgkA0QgCBQtwZW5kaW5nTGlzdAkBBXZhbHVlAQUFaW5kZXgCASwJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKwCAgUGZmFybWVyAgFfCQCkAwEFBWVudHJ5AglfVmVyaWZpZWQFBGRhdGEJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQZmYXJtZXICCF9wZW5kaW5nBRBuZXdQZW5kaW5nU3RyaW5nBQNuaWwAyCUaXw==", "height": 3396993, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none 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 () = { | |
8 | + | let address = toString(i.caller) | |
9 | + | let farmer = getInteger((address + "_count")) | |
10 | + | if ((farmer == unit)) | |
11 | + | then [StringEntry((address + "_pending"), ""), IntegerEntry((address + "_count"), 0)] | |
12 | + | else throw("Farmer already exists") | |
13 | + | } | |
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | @Callable(i) | |
18 | + | func addAuA (dataFarmer,dataVet,farmer) = { | |
19 | + | let count = match getInteger((farmer + "_count")) { | |
20 | + | case a: Int => | |
21 | + | a | |
22 | + | case _ => | |
23 | + | throw("Farmer does not exist") | |
24 | + | } | |
25 | + | let pending = getStringValue((farmer + "_pending")) | |
26 | + | let pendingList = [toString(count), split(pending, ",")] | |
27 | + | [StringEntry((farmer + "_pending"), makeString(pendingList, ",")), StringEntry((((farmer + "_") + toString(count)) + "_F"), dataFarmer), StringEntry((((((toString(i.caller) + "_") + farmer) + "_") + toString(count)) + "_V"), dataVet), IntegerEntry((farmer + "_count"), (count + 1))] | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | @Callable(i) | |
33 | + | func verify (data,farmer,entry) = if (!(isDefined(getString((farmer + "_pending"))))) | |
34 | + | then throw("Farmer does not exist") | |
35 | + | else if (isDefined(getString((((farmer + "_") + toString(entry)) + "_Verified")))) | |
36 | + | then throw("AuA Entry already verified") | |
37 | + | else if (!(isDefined(getString((((farmer + "_") + toString(entry)) + "_F"))))) | |
38 | + | then throw((("Entry " + toString(entry)) + " does not exist")) | |
39 | + | else { | |
40 | + | let pendingList = split(getStringValue((farmer + "_pending")), ",") | |
41 | + | let index = indexOf(pendingList, toString(entry)) | |
42 | + | if ((index == unit)) | |
43 | + | then throw((("Entry " + toString(entry)) + " does not exist")) | |
44 | + | else { | |
45 | + | let newPendingString = makeString(removeByIndex(pendingList, value(index)), ",") | |
46 | + | [StringEntry((((farmer + "_") + toString(entry)) + "_Verified"), data), StringEntry((farmer + "_pending"), newPendingString)] | |
47 | + | } | |
48 | + | } | |
49 | + | ||
50 | + |
github/deemru/w8io/026f985 9.72 ms ◑