tx · 6rLDGc3LbqLUJ3PZpgk1Qk767UaRebabVp756Tep7zw6 3NBpQq52q11826tWYLwts9XP5ThKrXvPnAN: -0.00200000 Waves 2024.11.23 17:34 [3384216] smart account 3NBpQq52q11826tWYLwts9XP5ThKrXvPnAN > SELF 0.00000000 Waves
{ "type": 13, "id": "6rLDGc3LbqLUJ3PZpgk1Qk767UaRebabVp756Tep7zw6", "fee": 200000, "feeAssetId": null, "timestamp": 1732372485687, "version": 2, "chainId": 84, "sender": "3NBpQq52q11826tWYLwts9XP5ThKrXvPnAN", "senderPublicKey": "9iPKKDFisRwELdZFUAPPT3UhR7v23GA4BWaqPL7xjHay", "proofs": [ "2Q671J2es8gg3GF6f6JAbibaR2W7CcX3VXDPtN6FdZD6qd8xo7Ck4Pv2ZomZNrDjD9aGR4H831WYLw9rdr5VHwG7" ], "script": "base64:CAISCAISABIFCgMICAgSBQoDCAgBAAMBaQEJYWRkRmFybWVyAAQHYWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEBmZhcm1lcgkAnwgBCQCsAgIFB2FkZHJlc3MCBl9jb3VudAMJAAACBQZmYXJtZXIFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQdhZGRyZXNzAghfcGVuZGluZwIACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFB2FkZHJlc3MCBl9jb3VudAAABQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYWRkQXVBAwpkYXRhRmFybWVyB2RhdGFWZXQGZmFybWVyBAVjb3VudAQHJG1hdGNoMAkAnwgBCQCsAgIFBmZhcm1lcgIGX2NvdW50AwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQAABAdwZW5kaW5nCQCiCAEJAKwCAgUGZmFybWVyAghfcGVuZGluZwMJAQEhAQkBCWlzRGVmaW5lZAEFB3BlbmRpbmcJAAIBAhVGYXJtZXIgZG9lcyBub3QgZXhpc3QDCQAAAgUHcGVuZGluZ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bnRyeQICX0YJAAIBCQCsAgIJAKwCAgIGRW50cnkgCQCkAwEFBWVudHJ5Ag8gZG9lcyBub3QgZXhpc3QEDXBlbmRpbmdTdHJpbmcJALUJAgkBEUBleHRyTmF0aXZlKDEwNTgpAQkArAICBQZmYXJtZXICCF9wZW5kaW5nAgEsBAVpbmRleAkAzwgCBQ1wZW5kaW5nU3RyaW5nCQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgUNcGVuZGluZ1N0cmluZwkBBXZhbHVlAQUFaW5kZXgCASwJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKwCAgUGZmFybWVyAgFfCQCkAwEFBWVudHJ5AglfVmVyaWZpZWQFBGRhdGEJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQZmYXJtZXICCF9wZW5kaW5nBRBuZXdQZW5kaW5nU3RyaW5nBQNuaWwAExHSMA==", "height": 3384216, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 2fPHMgCXeHEEaNq73gjENgpzy1Yq2xLX3xwyhyPTdCTX 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 | + | 0 | |
24 | + | } | |
25 | + | let pending = getString((farmer + "_pending")) | |
26 | + | if (!(isDefined(pending))) | |
27 | + | then throw("Farmer does not exist") | |
28 | + | else if ((pending == "")) | |
29 | + | then [StringEntry((farmer + "_pending"), "0"), StringEntry((farmer + "_0_F"), dataFarmer), StringEntry((((toString(i.caller) + "_") + farmer) + "_0_V"), dataVet), IntegerEntry((farmer + "_count"), 1)] | |
30 | + | else [StringEntry((farmer + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry((((farmer + "_") + toString(count)) + "_F"), dataFarmer), StringEntry((((((toString(i.caller) + "_") + farmer) + "_") + toString(count)) + "_V"), dataVet), IntegerEntry((farmer + "_count"), (count + 1))] | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | @Callable(i) | |
36 | + | func verify (data,farmer,entry) = if (!(isDefined(getString((farmer + "_pending"))))) | |
37 | + | then throw("Farmer does not exist") | |
38 | + | else if (isDefined(getString((((farmer + "_") + toString(entry)) + "_Verified")))) | |
39 | + | then throw("AuA Entry already verified") | |
40 | + | else if (!(isDefined(getString((((farmer + "_") + toString(entry)) + "_F"))))) | |
41 | + | then throw((("Entry " + toString(entry)) + " does not exist")) | |
42 | + | else { | |
43 | + | let pendingString = split(getStringValue((farmer + "_pending")), ",") | |
44 | + | let index = indexOf(pendingString, toString(entry)) | |
45 | + | if ((index == unit)) | |
46 | + | then throw((("Entry " + toString(entry)) + " does not exist")) | |
47 | + | else { | |
48 | + | let newPendingString = makeString(removeByIndex(pendingString, value(index)), ",") | |
49 | + | [StringEntry((((farmer + "_") + toString(entry)) + "_Verified"), data), StringEntry((farmer + "_pending"), newPendingString)] | |
50 | + | } | |
51 | + | } | |
52 | + | ||
53 | + |
github/deemru/w8io/026f985 11.25 ms ◑