tx · E1Gq2hLSxv75J7bYfhEyxJTovxkSj53qF1ZoqNja2gvY 3N32GeQUdczGs7Z7ydw61pwvSiQBZzcw3JT: -0.00100000 Waves 2024.11.16 22:48 [3374448] smart account 3N32GeQUdczGs7Z7ydw61pwvSiQBZzcw3JT > SELF 0.00000000 Waves
{ "type": 13, "id": "E1Gq2hLSxv75J7bYfhEyxJTovxkSj53qF1ZoqNja2gvY", "fee": 100000, "feeAssetId": null, "timestamp": 1731786516627, "version": 2, "chainId": 84, "sender": "3N32GeQUdczGs7Z7ydw61pwvSiQBZzcw3JT", "senderPublicKey": "ET6ym4HVZdZ7NydKrh8XyxxRd45au4zvLQq7LieAFSs1", "proofs": [ "5Kp8vhWeQT2Gqf2o9sHGTLTCR3NFFAGJ5RUgrxgMWBSyfWLwxkZ2WFwNaqPwsgRTk7qyseV2LsBQiZ8DzZnrwsuX" ], "script": "base64:CAIKCAISABIECgIICAACAWkBCWFkZEZhcm1lcgAEB2FkZHJlc3MJAKUIAQgFAWkGY2FsbGVyBAZmYXJtZXIJAJ8IAQUHYWRkcmVzcwMJAAACBQZmYXJtZXIFBHVuaXQJAMwIAgkBDEludGVnZXJFbnRyeQIFB2FkZHJlc3MAAAUDbmlsCQACAQIVRmFybWVyIGFscmVhZHkgZXhpc3RzAWkBBmFkZEF1QQIEZGF0YQZmYXJtZXIEB2FkZHJlc3MJAKUIAQgFAWkGY2FsbGVyBAVjb3VudAQHJG1hdGNoMAkAnwgBBQdhZGRyZXNzAwkAAQIFByRtYXRjaDACA0ludAQBYQUHJG1hdGNoMAUBYQAABAdwZW5kaW5nCQCiCAEJAKwCAgUHYWRkcmVzcwIIX3BlbmRpbmcDCQEBIQEJAQlpc0RlZmluZWQBCQCiCAEFB2FkZHJlc3MJAAIBAhVGYXJtZXIgZG9lcyBub3QgZXhpc3QDCQAAAgUHcGVuZGluZwUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFB2FkZHJlc3MCCF9wZW5kaW5nAgEwCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYWRkcmVzcwICXzAFBGRhdGEJAMwIAgkBDEludGVnZXJFbnRyeQIFB2FkZHJlc3MAAQUDbmlsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUHYWRkcmVzcwIIX3BlbmRpbmcJAKwCAgkArAICCQEFdmFsdWUBBQdwZW5kaW5nAgEsCQCkAwEFBWNvdW50CQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQdhZGRyZXNzAgFfCQCkAwEFBWNvdW50BQRkYXRhCQDMCAIJAQxJbnRlZ2VyRW50cnkCBQdhZGRyZXNzCQBkAgUFY291bnQAAQUDbmlsAD/q8JU=", "height": 3374448, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6rfVNUVW5g6UPbYL5P5C2s1gPkGJVkQaUpoE12KMyKJy Next: DhSzEsTaQGedqNTWt5BZAywDW9qWRf3B629MPGNBPRHu Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let pending = getString((address + "_pending")) | |
27 | - | if ((pending == unit)) | |
28 | - | then [StringEntry((address + "_pending"), "0"), StringEntry((address + "_0"), data), IntegerEntry(address, 1)] | |
29 | - | else [StringEntry((address + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry(((address + "_") + toString(count)), data), IntegerEntry(address, (count + 1))] | |
27 | + | if (!(isDefined(getString(address)))) | |
28 | + | then throw("Farmer does not exist") | |
29 | + | else if ((pending == unit)) | |
30 | + | then [StringEntry((address + "_pending"), "0"), StringEntry((address + "_0"), data), IntegerEntry(address, 1)] | |
31 | + | else [StringEntry((address + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry(((address + "_") + toString(count)), data), IntegerEntry(address, (count + 1))] | |
30 | 32 | } | |
31 | 33 | ||
32 | 34 |
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) | |
10 | 10 | if ((farmer == unit)) | |
11 | 11 | then [IntegerEntry(address, 0)] | |
12 | 12 | else throw("Farmer already exists") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | 17 | @Callable(i) | |
18 | 18 | func addAuA (data,farmer) = { | |
19 | 19 | let address = toString(i.caller) | |
20 | 20 | let count = match getInteger(address) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | 0 | |
25 | 25 | } | |
26 | 26 | let pending = getString((address + "_pending")) | |
27 | - | if ((pending == unit)) | |
28 | - | then [StringEntry((address + "_pending"), "0"), StringEntry((address + "_0"), data), IntegerEntry(address, 1)] | |
29 | - | else [StringEntry((address + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry(((address + "_") + toString(count)), data), IntegerEntry(address, (count + 1))] | |
27 | + | if (!(isDefined(getString(address)))) | |
28 | + | then throw("Farmer does not exist") | |
29 | + | else if ((pending == unit)) | |
30 | + | then [StringEntry((address + "_pending"), "0"), StringEntry((address + "_0"), data), IntegerEntry(address, 1)] | |
31 | + | else [StringEntry((address + "_pending"), ((value(pending) + ",") + toString(count))), StringEntry(((address + "_") + toString(count)), data), IntegerEntry(address, (count + 1))] | |
30 | 32 | } | |
31 | 33 | ||
32 | 34 |
github/deemru/w8io/026f985 12.91 ms ◑