tx · 3KN4Vt3juHsHNSmh67GF98wgMWJT3TQGFPtYZrkwHsU7 3N3uKL5Bd3Bz4qpFn9f7nFd8RUJx6DucvPy: -0.00200000 Waves 2024.11.21 23:59 [3381731] smart account 3N3uKL5Bd3Bz4qpFn9f7nFd8RUJx6DucvPy > SELF 0.00000000 Waves
{ "type": 13, "id": "3KN4Vt3juHsHNSmh67GF98wgMWJT3TQGFPtYZrkwHsU7", "fee": 200000, "feeAssetId": null, "timestamp": 1732222801477, "version": 2, "chainId": 84, "sender": "3N3uKL5Bd3Bz4qpFn9f7nFd8RUJx6DucvPy", "senderPublicKey": "36MZT726dzokx3z57SXTuZqJsabkLgJrhLwwE5gQYTGx", "proofs": [ "wKjjUt7CyxNdStFdPLQH7u6uoLCxGCsHzzQJ7TViT3CauGTh47gbNk9Z5AHT5tnMLCDat6fHCRP97P91nNk9ULR" ], "script": "base64:CAISCAISABIFCgMICAgSBQoDCAgBAAMBaQEJYWRkRmFybWVyAAQHYWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEBmZhcm1lcgkAnwgBCQCsAgIFB2FkZHJlc3MCBl9jb3VudAMJAAACBQZmYXJtZXIFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQdhZGRyZXNzAghfcGVuZGluZwIACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFB2FkZHJlc3MCBl9jb3VudAAABQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYWRkQXVBAwpkYXRhRmFybWVyB2RhdGFWZXQGZmFybWVyBAVjb3VudAQHJG1hdGNoMAkAnwgBCQCsAgIFBmZhcm1lcgIGX2NvdW50AwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQAABAdwZW5kaW5nCQCiCAEJAKwCAgUGZmFybWVyAghfcGVuZGluZwMJAQEhAQkBCWlzRGVmaW5lZAEFB3BlbmRpbmcJAAIBAhVGYXJtZXIgZG9lcyBub3QgZXhpc3Q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G5vdCBleGlzdAQNcGVuZGluZ1N0cmluZwkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFBmZhcm1lcgIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFDXBlbmRpbmdTdHJpbmcJAKQDAQUFZW50cnkDCQAAAgUFaW5kZXgFBHVuaXQJAAIBCQCsAgIJAKwCAgIGRW50cnkgCQCkAwEFBWVudHJ5Ag8gZG9lcyBub3QgZXhpc3QEEG5ld1BlbmRpbmdTdHJpbmcJALkJAgkA0QgCBQ1wZW5kaW5nU3RyaW5nCQEFdmFsdWUBBQVpbmRleAIBLAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgkArAICBQZmYXJtZXICAV8JAKQDAQUFZW50cnkCCV9WZXJpZmllZAUEZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFBmZhcm1lcgIIX3BlbmRpbmcFEG5ld1BlbmRpbmdTdHJpbmcFA25pbAChuHXC", "height": 3381731, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5kiGo77vxxpQgcYeztce3AAibv3eTbkXe9RBNDZ6FPhW Next: ACPEE4BfxwZgDJFmN5bMw2HPNekbff1be6egLY23ydDa Diff:
Old | New | Differences | |
---|---|---|---|
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | - | func verify (data,farmer,entry) = if (isDefined(getString((((farmer + "_") + toString(entry)) + "_Verified")))) | |
37 | - | then throw("AuA Entry already verified") | |
38 | - | else if (!(isDefined(getString((((farmer + "_") + toString(entry)) + "_F"))))) | |
39 | - | then throw((("Entry " + toString(entry)) + " does not exist")) | |
40 | - | else [StringEntry((((farmer + "_") + toString(entry)) + "_Verified"), data)] | |
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 | + | } | |
41 | 52 | ||
42 | 53 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 8 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func addFarmer () = { | |
8 | 8 | let address = toString(i.caller) | |
9 | 9 | let farmer = getInteger((address + "_count")) | |
10 | 10 | if ((farmer == unit)) | |
11 | 11 | then [StringEntry((address + "_pending"), ""), IntegerEntry((address + "_count"), 0)] | |
12 | 12 | else throw("Farmer already exists") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | 18 | func addAuA (dataFarmer,dataVet,farmer) = { | |
19 | 19 | let count = match getInteger((farmer + "_count")) { | |
20 | 20 | case a: Int => | |
21 | 21 | a | |
22 | 22 | case _ => | |
23 | 23 | 0 | |
24 | 24 | } | |
25 | 25 | let pending = getString((farmer + "_pending")) | |
26 | 26 | if (!(isDefined(pending))) | |
27 | 27 | then throw("Farmer does not exist") | |
28 | 28 | else if ((pending == "")) | |
29 | 29 | then [StringEntry((farmer + "_pending"), "0"), StringEntry((farmer + "_0_F"), dataFarmer), StringEntry((farmer + "_0_V"), dataVet), IntegerEntry((farmer + "_count"), 1)] | |
30 | 30 | else [StringEntry((farmer + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry((((farmer + "_") + toString(count)) + "_F"), dataFarmer), StringEntry((((farmer + "_") + toString(count)) + "_V"), dataVet), IntegerEntry((farmer + "_count"), (count + 1))] | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | ||
35 | 35 | @Callable(i) | |
36 | - | func verify (data,farmer,entry) = if (isDefined(getString((((farmer + "_") + toString(entry)) + "_Verified")))) | |
37 | - | then throw("AuA Entry already verified") | |
38 | - | else if (!(isDefined(getString((((farmer + "_") + toString(entry)) + "_F"))))) | |
39 | - | then throw((("Entry " + toString(entry)) + " does not exist")) | |
40 | - | else [StringEntry((((farmer + "_") + toString(entry)) + "_Verified"), data)] | |
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 | + | } | |
41 | 52 | ||
42 | 53 |
github/deemru/w8io/169f3d6 22.16 ms ◑