tx · Gr9thtj8mX2nBzCYqkEhmJ4CHTmJLouGWmvfFAhDKFou 3MsNyiuucHjySwoeQ8FxeofPKJyYF4cqG28: -0.00200000 Waves 2024.12.07 14:05 [3404128] smart account 3MsNyiuucHjySwoeQ8FxeofPKJyYF4cqG28 > SELF 0.00000000 Waves
{ "type": 13, "id": "Gr9thtj8mX2nBzCYqkEhmJ4CHTmJLouGWmvfFAhDKFou", "fee": 200000, "feeAssetId": null, "timestamp": 1733569507641, "version": 2, "chainId": 84, "sender": "3MsNyiuucHjySwoeQ8FxeofPKJyYF4cqG28", "senderPublicKey": "HJeoRksknZ8YoWG1bjM8cjCoh51MGhj2K7rcdzhEZn9h", "proofs": [ "41RFckMwoUpgJqQPXCo56G2yJUNNm5YcCtw3vy3CNqaF7pv5gfUm3j4S2S2KQQnMqWh48Exo1dSgMHrbquNGv8mz" ], "script": "base64:CAIYCAISBgoECAgICBIFCgMICAgSBQoDCAgBAAMBaQEJYWRkRmFybWVyBA13YWxsZXRBZGRyZXNzB2FkZHJlc3MJZmlyc3ROYW1lCGxhc3ROYW1lBAZmYXJtZXIJAJ8IAQkArAICBQdhZGRyZXNzAgZfY291bnQDCQECIT0CCAUBaQZjYWxsZXIFBHRoaXMJAAIBAipPbmx5IHRoZSB2ZXQgb2ZmaWNlIGNhbiBjcmVhdGUgbmV3IEZhcm1lcnMDCQAAAgUGZmFybWVyBQR1bml0CQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUNd2FsbGV0QWRkcmVzcwIJX3VzZXJkYXRhCQCsAgIJAKwCAgkArAICCQCsAgIFB2FkZHJlc3MCASwFCWZpcnN0TmFtZQIBLAUIbGFzdE5hbWUJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQ13YWxsZXRBZGRyZXNzAghfcGVuZGluZwIACQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFDXdhbGxldEFkZHJlc3MCBl9jb3VudAAABQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeS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QCkAwEFBWVudHJ5Ag8gZG9lcyBub3QgZXhpc3QEC3BlbmRpbmdMaXN0CQC1CQIJARFAZXh0ck5hdGl2ZSgxMDU4KQEJAKwCAgUGZmFybWVyAghfcGVuZGluZwIBLAQFaW5kZXgJAM8IAgULcGVuZGluZ0xpc3QJAKQDAQUFZW50cnkDCQAAAgUFaW5kZXgFBHVuaXQJAAIBCQCsAgIJAKwCAgIGRW50cnkgCQCkAwEFBWVudHJ5Ag8gZG9lcyBub3QgZXhpc3QEEG5ld1BlbmRpbmdTdHJpbmcJALkJAgkA0QgCBQtwZW5kaW5nTGlzdAkBBXZhbHVlAQUFaW5kZXgCASwJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICCQCsAgIJAKwCAgUGZmFybWVyAgFfCQCkAwEFBWVudHJ5AglfVmVyaWZpZWQFBGRhdGEJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQZmYXJtZXICCF9wZW5kaW5nBRBuZXdQZW5kaW5nU3RyaW5nBQNuaWwA1mQyJw==", "height": 3404128, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HftXQzSBfnJEFKEHmeVnwNH7PPPerWxoAE8z6iF8dESZ Next: 4wUZpyyhB2xn46oCKEqz1rFhX4r2J7QQW7xPV7Bx4g8J Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func addFarmer () = { | |
8 | - | let b = toString(a.caller) | |
9 | - | let c = getInteger((b + "_count")) | |
10 | - | if ((c == unit)) | |
11 | - | then [StringEntry((b + "_pending"), ""), IntegerEntry((b + "_count"), 0)] | |
12 | - | else throw("Farmer already exists") | |
7 | + | func addFarmer (b,c,d,e) = { | |
8 | + | let f = getInteger((c + "_count")) | |
9 | + | if ((a.caller != this)) | |
10 | + | then throw("Only the vet office can create new Farmers") | |
11 | + | else if ((f == unit)) | |
12 | + | then [StringEntry((b + "_userdata"), ((((c + ",") + d) + ",") + e)), StringEntry((b + "_pending"), ""), IntegerEntry((b + "_count"), 0)] | |
13 | + | else throw("Farmer already exists") | |
13 | 14 | } | |
14 | 15 | ||
15 | 16 | ||
16 | 17 | ||
17 | 18 | @Callable(a) | |
18 | - | func addAuA ( | |
19 | - | let | |
20 | - | let | |
21 | - | if ($isInstanceOf( | |
19 | + | func addAuA (g,h,f) = { | |
20 | + | let i = { | |
21 | + | let j = getInteger((f + "_count")) | |
22 | + | if ($isInstanceOf(j, "Int")) | |
22 | 23 | then { | |
23 | - | let | |
24 | - | | |
24 | + | let k = j | |
25 | + | k | |
25 | 26 | } | |
26 | 27 | else throw("Farmer does not exist") | |
27 | 28 | } | |
28 | - | let | |
29 | - | let | |
30 | - | [StringEntry(( | |
29 | + | let l = getStringValue((f + "_pending")) | |
30 | + | let m = [toString(i), split(l, ",")] | |
31 | + | [StringEntry((f + "_pending"), makeString(m, ",")), StringEntry(((f + "_") + toString(i)), g), StringEntry(((((toString(a.caller) + "_") + f) + "_") + toString(i)), h), IntegerEntry((f + "_count"), (i + 1))] | |
31 | 32 | } | |
32 | 33 | ||
33 | 34 | ||
34 | 35 | ||
35 | 36 | @Callable(a) | |
36 | - | func verify ( | |
37 | + | func verify (n,f,o) = if (!(isDefined(getString((f + "_pending"))))) | |
37 | 38 | then throw("Farmer does not exist") | |
38 | - | else if (isDefined(getString(((( | |
39 | + | else if (isDefined(getString((((f + "_") + toString(o)) + "_Verified")))) | |
39 | 40 | then throw("AuA Entry already verified") | |
40 | - | else if (!(isDefined(getString((( | |
41 | - | then throw((("Entry " + toString( | |
41 | + | else if (!(isDefined(getString(((f + "_") + toString(o)))))) | |
42 | + | then throw((("Entry " + toString(o)) + " does not exist")) | |
42 | 43 | else { | |
43 | - | let | |
44 | - | let | |
45 | - | if (( | |
46 | - | then throw((("Entry " + toString( | |
44 | + | let m = split(getStringValue((f + "_pending")), ",") | |
45 | + | let p = indexOf(m, toString(o)) | |
46 | + | if ((p == unit)) | |
47 | + | then throw((("Entry " + toString(o)) + " does not exist")) | |
47 | 48 | else { | |
48 | - | let | |
49 | - | [StringEntry(((( | |
49 | + | let q = makeString(removeByIndex(m, value(p)), ",") | |
50 | + | [StringEntry((((f + "_") + toString(o)) + "_Verified"), n), StringEntry((f + "_pending"), q)] | |
50 | 51 | } | |
51 | 52 | } | |
52 | 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(a) | |
7 | - | func addFarmer () = { | |
8 | - | let b = toString(a.caller) | |
9 | - | let c = getInteger((b + "_count")) | |
10 | - | if ((c == unit)) | |
11 | - | then [StringEntry((b + "_pending"), ""), IntegerEntry((b + "_count"), 0)] | |
12 | - | else throw("Farmer already exists") | |
7 | + | func addFarmer (b,c,d,e) = { | |
8 | + | let f = getInteger((c + "_count")) | |
9 | + | if ((a.caller != this)) | |
10 | + | then throw("Only the vet office can create new Farmers") | |
11 | + | else if ((f == unit)) | |
12 | + | then [StringEntry((b + "_userdata"), ((((c + ",") + d) + ",") + e)), StringEntry((b + "_pending"), ""), IntegerEntry((b + "_count"), 0)] | |
13 | + | else throw("Farmer already exists") | |
13 | 14 | } | |
14 | 15 | ||
15 | 16 | ||
16 | 17 | ||
17 | 18 | @Callable(a) | |
18 | - | func addAuA ( | |
19 | - | let | |
20 | - | let | |
21 | - | if ($isInstanceOf( | |
19 | + | func addAuA (g,h,f) = { | |
20 | + | let i = { | |
21 | + | let j = getInteger((f + "_count")) | |
22 | + | if ($isInstanceOf(j, "Int")) | |
22 | 23 | then { | |
23 | - | let | |
24 | - | | |
24 | + | let k = j | |
25 | + | k | |
25 | 26 | } | |
26 | 27 | else throw("Farmer does not exist") | |
27 | 28 | } | |
28 | - | let | |
29 | - | let | |
30 | - | [StringEntry(( | |
29 | + | let l = getStringValue((f + "_pending")) | |
30 | + | let m = [toString(i), split(l, ",")] | |
31 | + | [StringEntry((f + "_pending"), makeString(m, ",")), StringEntry(((f + "_") + toString(i)), g), StringEntry(((((toString(a.caller) + "_") + f) + "_") + toString(i)), h), IntegerEntry((f + "_count"), (i + 1))] | |
31 | 32 | } | |
32 | 33 | ||
33 | 34 | ||
34 | 35 | ||
35 | 36 | @Callable(a) | |
36 | - | func verify ( | |
37 | + | func verify (n,f,o) = if (!(isDefined(getString((f + "_pending"))))) | |
37 | 38 | then throw("Farmer does not exist") | |
38 | - | else if (isDefined(getString(((( | |
39 | + | else if (isDefined(getString((((f + "_") + toString(o)) + "_Verified")))) | |
39 | 40 | then throw("AuA Entry already verified") | |
40 | - | else if (!(isDefined(getString((( | |
41 | - | then throw((("Entry " + toString( | |
41 | + | else if (!(isDefined(getString(((f + "_") + toString(o)))))) | |
42 | + | then throw((("Entry " + toString(o)) + " does not exist")) | |
42 | 43 | else { | |
43 | - | let | |
44 | - | let | |
45 | - | if (( | |
46 | - | then throw((("Entry " + toString( | |
44 | + | let m = split(getStringValue((f + "_pending")), ",") | |
45 | + | let p = indexOf(m, toString(o)) | |
46 | + | if ((p == unit)) | |
47 | + | then throw((("Entry " + toString(o)) + " does not exist")) | |
47 | 48 | else { | |
48 | - | let | |
49 | - | [StringEntry(((( | |
49 | + | let q = makeString(removeByIndex(m, value(p)), ",") | |
50 | + | [StringEntry((((f + "_") + toString(o)) + "_Verified"), n), StringEntry((f + "_pending"), q)] | |
50 | 51 | } | |
51 | 52 | } | |
52 | 53 | ||
53 | 54 |
github/deemru/w8io/169f3d6 37.41 ms ◑