tx · ARRhZxWRSntt5w5ovbqWPipFrRag8fauKFWEATnAWeo8 3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o: -0.00200000 Waves 2024.12.15 17:04 [3415770] smart account 3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o > SELF 0.00000000 Waves
{ "type": 13, "id": "ARRhZxWRSntt5w5ovbqWPipFrRag8fauKFWEATnAWeo8", "fee": 200000, "feeAssetId": null, "timestamp": 1734271459021, "version": 2, "chainId": 84, "sender": "3MwSUCtcFsczXspn2zXnuY2Qbc3ntMV5j9o", "senderPublicKey": "2n2HckgwZhE4kaAhHqRKywLfAKYtZTXvAvCHB2hPLE4U", "proofs": [ "5f77CHnDKgREoWcLWuov9nBX8KSxq9hG13GgfAKgH6PsvfBMwkQt3RPs5M7816RnkYi4i1DDiDVw4Rv2HudwjyS7" ], "script": "base64:CAIVCAISBAoCCAgSBQoDCAgIEgQKAggBAAMBaQEJYWRkRmFybWVyAgxwdWJLZXlGYXJtZXIIdXNlcmRhdGEEBmZhcm1lcgkAnwgBCQCsAgIFDHB1YktleUZhcm1lcgIGX2NvdW50AwkBAiE9AggFAWkGY2FsbGVyBQR0aGlzCQACAQIqT25seSB0aGUgdmV0IG9mZmljZSBjYW4gY3JlYXRlIG5ldyBGYXJtZXJzAwkAAAIFBmZhcm1lcgUEdW5pdAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIJX3VzZXJkYXRhBQh1c2VyZGF0YQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFDHB1YktleUZhcm1lcgIIX3BlbmRpbmcCAAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICBl9jb3VudAAACQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAKcIAQkA2QQBBQxwdWJLZXlGYXJtZXIA4NwqBQR1bml0BQNuaWwJAAIBAhVGYXJtZXIgYWxyZWFkeSBleGlzdHMBaQEGYWRkQ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kF1QSBFbnRyeSBhbHJlYWR5IHZlcmlmaWVkAwkBASEBCQEJaXNEZWZpbmVkAQkAoggBCQCsAgIJAKwCAgUGcHViS2V5AgFfCQCkAwEFBWVudHJ5CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BAtwZW5kaW5nTGlzdAkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFBnB1YktleQIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFC3BlbmRpbmdMaXN0CQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgULcGVuZGluZ0xpc3QJAQV2YWx1ZQEFBWluZGV4AgEsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIFBnB1YktleQIBXwkApAMBBQVlbnRyeQIJX3ZlcmlmaWVkBQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUGcHViS2V5AghfcGVuZGluZwUQbmV3UGVuZGluZ1N0cmluZwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAoMIeBQR1bml0BQNuaWwApyTDfQ==", "height": 3415770, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HfsLgvY4x937Jkm7gwX334ufCJmjmPDhktV2Vvbf4bky Next: none Full:
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 | 7 | func addFarmer (b,c) = { | |
8 | 8 | let d = getInteger((b + "_count")) | |
9 | 9 | if ((a.caller != this)) | |
10 | 10 | then throw("Only the vet office can create new Farmers") | |
11 | 11 | else if ((d == unit)) | |
12 | 12 | then [StringEntry((b + "_userdata"), c), StringEntry((b + "_pending"), ""), IntegerEntry((b + "_count"), 0), ScriptTransfer(addressFromPublicKey(fromBase58String(b)), 700000, unit)] | |
13 | 13 | else throw("Farmer already exists") | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | 18 | @Callable(a) | |
19 | 19 | func addAad (e,f,b) = { | |
20 | 20 | let g = { | |
21 | 21 | let h = getInteger((b + "_count")) | |
22 | 22 | if ($isInstanceOf(h, "Int")) | |
23 | 23 | then { | |
24 | 24 | let i = h | |
25 | 25 | i | |
26 | 26 | } | |
27 | 27 | else throw("Farmer does not exist") | |
28 | 28 | } | |
29 | 29 | let j = getStringValue((b + "_pending")) | |
30 | 30 | let k = [toString(g), split(j, ",")] | |
31 | 31 | [StringEntry((b + "_pending"), makeString(k, ",")), StringEntry(((b + "_") + toString(g)), e), StringEntry(((((b + "_") + toBase58String(a.callerPublicKey)) + "_") + toString(g)), f), IntegerEntry((b + "_count"), (g + 1)), ScriptTransfer(a.caller, 500000, unit)] | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(a) | |
37 | 37 | func verify (l,m) = { | |
38 | 38 | let n = toBase58String(a.callerPublicKey) | |
39 | 39 | if (!(isDefined(getString((n + "_pending"))))) | |
40 | 40 | then throw("Farmer does not exist") | |
41 | 41 | else if (isDefined(getString((((n + "_") + toString(m)) + "_verified")))) | |
42 | 42 | then throw("AuA Entry already verified") | |
43 | 43 | else if (!(isDefined(getString(((n + "_") + toString(m)))))) | |
44 | 44 | then throw((("Entry " + toString(m)) + " does not exist")) | |
45 | 45 | else { | |
46 | 46 | let k = split(getStringValue((n + "_pending")), ",") | |
47 | 47 | let o = indexOf(k, toString(m)) | |
48 | 48 | if ((o == unit)) | |
49 | 49 | then throw((("Entry " + toString(m)) + " does not exist")) | |
50 | 50 | else { | |
51 | 51 | let p = makeString(removeByIndex(k, value(o)), ",") | |
52 | 52 | [StringEntry((((n + "_") + toString(m)) + "_verified"), l), StringEntry((n + "_pending"), p), ScriptTransfer(a.caller, 500000, unit)] | |
53 | 53 | } | |
54 | 54 | } | |
55 | 55 | } | |
56 | 56 | ||
57 | 57 |
github/deemru/w8io/169f3d6 18.06 ms ◑