tx · EJWKGMFjpoUPAyQ6ExpZSDiq6m2xoQbo2Yk5fQXAU5dj 3MuUm6vWQjCbgu5rB73n78WJh9wUVXP2iq2: -0.05000000 Waves 2023.10.06 14:50 [2786722] smart account 3MuUm6vWQjCbgu5rB73n78WJh9wUVXP2iq2 > SELF 0.00000000 Waves
{ "type": 13, "id": "EJWKGMFjpoUPAyQ6ExpZSDiq6m2xoQbo2Yk5fQXAU5dj", "fee": 5000000, "feeAssetId": null, "timestamp": 1696593022129, "version": 1, "sender": "3MuUm6vWQjCbgu5rB73n78WJh9wUVXP2iq2", "senderPublicKey": "29jYjSA5SiMDp5W4gmgw1fDrWS78eooftPX2ZYZ4phvS", "proofs": [ "3KX5fQJHca5kGREuTAa1avfKgBRCXd65Dtg9sUu8wxauVU6usSZ9wt88gpPLvP52BGBbVqTTsGrgkpTvF2mFNzh7" ], "script": "base64:BgINCAISBAoCCAESAwoBCAkBEHdyaXRlQ29uc3RTdHJpbmcCA2tleQV2YWx1ZQMJAQEhAQkBCWlzRGVmaW5lZAEJAJ0IAgUEdGhpcwUDa2V5CQELU3RyaW5nRW50cnkCBQNrZXkFBXZhbHVlCQACAQkArAICAhVhbHJlYWR5IGluaXRpYWxpemVkOiAFA2tleQASY29uZmlnQWRkcmVzc1N0b3JlAgZjb25maWcADWNvbmZpZ0FkZHJlc3MJARN2YWx1ZU9yRXJyb3JNZXNzYWdlAgkApggBCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUSY29uZmlnQWRkcmVzc1N0b3JlAiJ0cmVhc3VyeTogY29uZmlnIGFkZHJlc3Mgbm90IGZvdW5kAhZpbnZhbGlkIGNvbmZpZyBhZGRyZXNzAA12b3RpbmdSZXN1bHRzCQETdmFsdWVPckVycm9yTWVzc2FnZQIJAKYIAQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCdCAIFDWNvbmZpZ0FkZHJlc3MCFmNvbnRyYWN0X3ZvdGluZ19yZXN1bHQCGW5vIG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pZnkABAdlbmFibGVkCQELdmFsdWVPckVsc2UCCQCbCAIFDWNvbmZpZ0FkZHJlc3MJAQ5vcEFsbG93ZWRTdG9yZQECE2dvdmVybmFuY2VfYXBwbHlfdHgGAwkBASEBBQdlbmFibGVkCQACAQIrdHggYXBwbGljYXRpb24gdGhyb3cgZ292ZXJuYW5jZSBub3QgZW5hYmxlZAQCaWQJANgEAQgFAnR4AmlkBAhieVZvdGluZwkAZwIFBkhFSUdIVAkBEUBleHRyTmF0aXZlKDEwNTApAgUNdm90aW5nUmVzdWx0cwkArAICCQCsAgIJAKwCAgIZcHJvcG9zYWxfYWxsb3dfYnJvYWRjYXN0XwkApQgBBQR0aGlzAgFfBQJpZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkGBQhieVZvdGluZ9qqoQk=", "chainId": 84, "height": 2786722, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func writeConstString (key,value) = if (!(isDefined(getString(this, key)))) | |
5 | + | then StringEntry(key, value) | |
6 | + | else throw(("already initialized: " + key)) | |
7 | + | ||
8 | + | ||
9 | + | let configAddressStore = "config" | |
10 | + | ||
11 | + | let configAddress = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, configAddressStore), "treasury: config address not found")), "invalid config address") | |
12 | + | ||
13 | + | let votingResults = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(configAddress, "contract_voting_result"), "no contract_voting_result")), "invalid contract_voting_result") | |
14 | + | ||
15 | + | let HEIGHT = height | |
16 | + | ||
17 | + | func opAllowedStore (op) = (("op_" + op) + "_allowed") | |
18 | + | ||
19 | + | ||
20 | + | func allowed (op) = invoke(configAddress, "opAllowed", [op], nil) | |
21 | + | ||
22 | + | ||
23 | + | let childrenContract = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(configAddress, "contract_children"), "no childs_contract")), "invalid childs contract") | |
24 | + | ||
25 | + | let pwrAssetId = fromBase58String(valueOrErrorMessage(getString(configAddress, "powerAssetId"), "pwr asset id not found")) | |
26 | + | ||
27 | + | @Callable(i) | |
28 | + | func slash (child,amount) = { | |
29 | + | let paused = allowed("slash") | |
30 | + | if ((paused == paused)) | |
31 | + | then if ((i.caller != this)) | |
32 | + | then throw("denied") | |
33 | + | else { | |
34 | + | let slash = invoke(childrenContract, "slash", [child, amount], nil) | |
35 | + | if ((slash == slash)) | |
36 | + | then nil | |
37 | + | else throw("Strict value is not equal to itself.") | |
38 | + | } | |
39 | + | else throw("Strict value is not equal to itself.") | |
40 | + | } | |
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | @Callable(i) | |
45 | + | func init (conf) = [writeConstString(configAddressStore, conf)] | |
46 | + | ||
47 | + | ||
48 | + | @Verifier(tx) | |
49 | + | func verify () = { | |
50 | + | let enabled = valueOrElse(getBoolean(configAddress, opAllowedStore("governance_apply_tx")), true) | |
51 | + | if (!(enabled)) | |
52 | + | then throw("tx application throw governance not enabled") | |
53 | + | else { | |
54 | + | let id = toBase58String(tx.id) | |
55 | + | let byVoting = (HEIGHT >= getIntegerValue(votingResults, ((("proposal_allow_broadcast_" + toString(this)) + "_") + id))) | |
56 | + | if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)) | |
57 | + | then true | |
58 | + | else byVoting | |
59 | + | } | |
60 | + | } | |
61 | + |
github/deemru/w8io/026f985 20.64 ms ◑