tx · Gi2ueMUbGNi7A1LqbUvwEc3L23WjcBNMEkZUXocCuZjq 3MtfPw9WToc7NF6diRAmwdUiMdE9XeQEofL: -0.00200000 Waves 2024.12.12 21:42 [3411751] smart account 3MtfPw9WToc7NF6diRAmwdUiMdE9XeQEofL > SELF 0.00000000 Waves
{ "type": 13, "id": "Gi2ueMUbGNi7A1LqbUvwEc3L23WjcBNMEkZUXocCuZjq", "fee": 200000, "feeAssetId": null, "timestamp": 1734028958909, "version": 2, "chainId": 84, "sender": "3MtfPw9WToc7NF6diRAmwdUiMdE9XeQEofL", "senderPublicKey": "HupaUPUjjbPLxvBWv83vFdCNXDEpPcicyfNxr6D6CEwD", "proofs": [ "38UytJfnarDs3tcgwy175vf66Rjjkjx6phJ5DGtyMxZupR8FqLeKCkmzn2jj9Dxmj95L6VSHbTEJbcjXboXPKq6t" ], "script": "base64:CAIWCAISBAoCCAgSBQoDCAgIEgUKAwgIAQADAWkBCWFkZEZhcm1lcgIMcHViS2V5RmFybWVyCHVzZXJkYXRhBAZmYXJtZXIJAJ8IAQkArAICBQxwdWJLZXlGYXJtZXICBl9jb3VudAMJAQIhPQIIBQFpBmNhbGxlcgUEdGhpcwkAAgECKk9ubHkgdGhlIHZldCBvZmZpY2UgY2FuIGNyZWF0ZSBuZXcgRmFybWVycwMJAAACBQZmYXJtZXIFBHVuaXQJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICCV91c2VyZGF0YQUIdXNlcmRhdGEJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQxwdWJLZXlGYXJtZXICCF9wZW5kaW5nAgAJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUMcHViS2V5RmFybWVyAgZfY291bnQAAAUDbmlsCQACAQIVRmFybWVyIGFscmVhZHkgZXhpc3RzAWkBBmFkZEF1QQMKZGF0YUZhcm1lcgdkYXRhVmV0DHB1YktleUZhcm1lcgQFY291bnQEByRtYXRjaDAJAJ8IAQkArAICB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ApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BAtwZW5kaW5nTGlzdAkAtQkCCQERQGV4dHJOYXRpdmUoMTA1OCkBCQCsAgIFDHB1YktleUZhcm1lcgIIX3BlbmRpbmcCASwEBWluZGV4CQDPCAIFC3BlbmRpbmdMaXN0CQCkAwEFBWVudHJ5AwkAAAIFBWluZGV4BQR1bml0CQACAQkArAICCQCsAgICBkVudHJ5IAkApAMBBQVlbnRyeQIPIGRvZXMgbm90IGV4aXN0BBBuZXdQZW5kaW5nU3RyaW5nCQC5CQIJANEIAgULcGVuZGluZ0xpc3QJAQV2YWx1ZQEFBWluZGV4AgEsCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICCQCsAgIFDHB1YktleUZhcm1lcgIBXwkApAMBBQVlbnRyeQIJX1ZlcmlmaWVkBQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUMcHViS2V5RmFybWVyAghfcGVuZGluZwUQbmV3UGVuZGluZ1N0cmluZwUDbmlsAMM5jsA=", "height": 3411751, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 44dDNjUNniMnrR6hT34yPTn1JV5u8tL7L4QbmZUsxUhK Next: C3VHJ9XPgjweywoS1YfzAZHNGA7U2RHS6AbyuzwzvAEy 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(i) | |
7 | 7 | func addFarmer (pubKeyFarmer,userdata) = { | |
8 | 8 | let farmer = getInteger((pubKeyFarmer + "_count")) | |
9 | 9 | if ((i.caller != this)) | |
10 | 10 | then throw("Only the vet office can create new Farmers") | |
11 | 11 | else if ((farmer == unit)) | |
12 | 12 | then [StringEntry((pubKeyFarmer + "_userdata"), userdata), StringEntry((pubKeyFarmer + "_pending"), ""), IntegerEntry((pubKeyFarmer + "_count"), 0)] | |
13 | 13 | else throw("Farmer already exists") | |
14 | 14 | } | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | ||
18 | 18 | @Callable(i) | |
19 | 19 | func addAuA (dataFarmer,dataVet,pubKeyFarmer) = { | |
20 | 20 | let count = match getInteger((pubKeyFarmer + "_count")) { | |
21 | 21 | case a: Int => | |
22 | 22 | a | |
23 | 23 | case _ => | |
24 | 24 | throw("Farmer does not exist") | |
25 | 25 | } | |
26 | 26 | let pending = getStringValue((pubKeyFarmer + "_pending")) | |
27 | 27 | let pendingList = [toString(count), split(pending, ",")] | |
28 | 28 | [StringEntry((pubKeyFarmer + "_pending"), makeString(pendingList, ",")), StringEntry(((pubKeyFarmer + "_") + toString(count)), dataFarmer), StringEntry(((((toBase58String(i.callerPublicKey) + "_") + pubKeyFarmer) + "_") + toString(count)), dataVet), IntegerEntry((pubKeyFarmer + "_count"), (count + 1))] | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | ||
33 | 33 | @Callable(i) | |
34 | 34 | func verify (data,pubKeyFarmer,entry) = if (!(isDefined(getString((pubKeyFarmer + "_pending"))))) | |
35 | 35 | then throw("Farmer does not exist") | |
36 | 36 | else if (isDefined(getString((((pubKeyFarmer + "_") + toString(entry)) + "_Verified")))) | |
37 | 37 | then throw("AuA Entry already verified") | |
38 | 38 | else if (!(isDefined(getString(((pubKeyFarmer + "_") + toString(entry)))))) | |
39 | 39 | then throw((("Entry " + toString(entry)) + " does not exist")) | |
40 | 40 | else { | |
41 | 41 | let pendingList = split(getStringValue((pubKeyFarmer + "_pending")), ",") | |
42 | 42 | let index = indexOf(pendingList, toString(entry)) | |
43 | 43 | if ((index == unit)) | |
44 | 44 | then throw((("Entry " + toString(entry)) + " does not exist")) | |
45 | 45 | else { | |
46 | 46 | let newPendingString = makeString(removeByIndex(pendingList, value(index)), ",") | |
47 | 47 | [StringEntry((((pubKeyFarmer + "_") + toString(entry)) + "_Verified"), data), StringEntry((pubKeyFarmer + "_pending"), newPendingString)] | |
48 | 48 | } | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 |
github/deemru/w8io/169f3d6 30.62 ms ◑