tx · HDCymHAoH3TDBuY6dM1xoUBTBURcxip5hR8ssJA7uzJa 3MqsDXvFU9WM8hEzCcrw2aVGtVimCgbNeXD: -0.00200000 Waves 2024.04.24 09:32 [3076555] smart account 3MqsDXvFU9WM8hEzCcrw2aVGtVimCgbNeXD > SELF 0.00000000 Waves
{ "type": 13, "id": "HDCymHAoH3TDBuY6dM1xoUBTBURcxip5hR8ssJA7uzJa", "fee": 200000, "feeAssetId": null, "timestamp": 1713940355677, "version": 1, "sender": "3MqsDXvFU9WM8hEzCcrw2aVGtVimCgbNeXD", "senderPublicKey": "4dNR2Up6mpwUEcy9WQuE2wAzR7HRURa6Pk9jrFKgcHqB", "proofs": [ "5uzssuqFvYqRhnb8MNfwE6vJuQe5bbXUexfEGrNgY7HDDRyHhmMDschBhcrSxYNq46kgCtX1sSHTrxPz9RKcJm6P" ], "script": "base64:BgIICAISBAoCCAQOABBjb250cmFjdEZpbGVuYW1lAg5mb3JjZXN0b3AucmlkZQADU0VQAgJfXwEHd3JhcEVycgEDbXNnCQC5CQIJAMwIAgUQY29udHJhY3RGaWxlbmFtZQkAzAgCAgI6IAkAzAgCBQNtc2cFA25pbAIAAQh0aHJvd0VycgEDbXNnCQACAQkBB3dyYXBFcnIBBQNtc2cBFmtleU1hbmFnZXJWYXVsdEFkZHJlc3MACQC5CQIJAMwIAgICJXMJAMwIAgITbWFuYWdlclZhdWx0QWRkcmVzcwUDbmlsBQNTRVABE2tleU1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABEWtleVBlcm1pc3Npb25MaXN0AAkAuQkCCQDMCAICAiVzCQDMCAICE2ZvcmNlU3RvcFBlcm1pc3Npb24FA25pbAUDU0VQAQxrZXlGb3JjZVN0b3ABB2FkZHJlc3MJALkJAgkAzAgCAgQlcyVzCQDMCAICBHN0b3AJAMwIAgUHYWRkcmVzcwUDbmlsBQNTRVAADnBlcm1pc3Npb25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bGxlcgQFY2hlY2sJAMwIAgMJAQ9jb250YWluc0VsZW1lbnQCBQ5wZXJtaXNzaW9uTGlzdAUTY2FsbGVyQWRkcmVzc1N0cmluZwYJAQttdXN0TWFuYWdlcgEFAWkFA25pbAMJAAACBQVjaGVjawUFY2hlY2sJAMwIAgkBDEJvb2xlYW5FbnRyeQIJAQxrZXlGb3JjZVN0b3ABBQdhZGRyZXNzBQRzdG9wBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABA90YXJnZXRQdWJsaWNLZXkEByRtYXRjaDAJARZtYW5hZ2VyUHVibGljS2V5T3JVbml0AAMJAAECBQckbWF0Y2gwAgpCeXRlVmVjdG9yBAJwawUHJG1hdGNoMAUCcGsDCQABAgUHJG1hdGNoMAIEVW5pdAgFAnR4D3NlbmRlclB1YmxpY0tleQkAAgECC01hdGNoIGVycm9yCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQ90YXJnZXRQdWJsaWNLZXmYHBDT", "chainId": 84, "height": 3076555, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 76P5DacsbzZJgyU8699u2EDCk99F6FiquQyANm7cDgMC Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let contractFilename = "forcestop.ride" | |
5 | + | ||
6 | + | let SEP = "__" | |
7 | + | ||
8 | + | func wrapErr (msg) = makeString([contractFilename, ": ", msg], "") | |
9 | + | ||
10 | + | ||
11 | + | func throwErr (msg) = throw(wrapErr(msg)) | |
12 | + | ||
13 | + | ||
14 | + | func keyManagerVaultAddress () = makeString(["%s", "managerVaultAddress"], SEP) | |
15 | + | ||
16 | + | ||
17 | + | func keyManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
18 | + | ||
19 | + | ||
20 | + | func keyPermissionList () = makeString(["%s", "forceStopPermission"], SEP) | |
21 | + | ||
22 | + | ||
23 | + | func keyForceStop (address) = makeString(["%s%s", "stop", address], SEP) | |
24 | + | ||
25 | + | ||
26 | + | let permissionList = split(valueOrElse(getString(this, keyPermissionList()), ""), SEP) | |
27 | + | ||
28 | + | let permissionDeniedError = throwErr("Permission denied") | |
29 | + | ||
30 | + | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
31 | + | case s: String => | |
32 | + | addressFromStringValue(s) | |
33 | + | case _ => | |
34 | + | this | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func managerPublicKeyOrUnit () = { | |
39 | + | let managerVaultAddress = getManagerVaultAddressOrThis() | |
40 | + | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
41 | + | case s: String => | |
42 | + | fromBase58String(s) | |
43 | + | case _: Unit => | |
44 | + | unit | |
45 | + | case _ => | |
46 | + | throw("Match error") | |
47 | + | } | |
48 | + | } | |
49 | + | ||
50 | + | ||
51 | + | func mustThis (i) = if ((i.caller == this)) | |
52 | + | then true | |
53 | + | else permissionDeniedError | |
54 | + | ||
55 | + | ||
56 | + | func mustManager (i) = match managerPublicKeyOrUnit() { | |
57 | + | case pk: ByteVector => | |
58 | + | if ((i.callerPublicKey == pk)) | |
59 | + | then true | |
60 | + | else permissionDeniedError | |
61 | + | case _: Unit => | |
62 | + | mustThis(i) | |
63 | + | case _ => | |
64 | + | throw("Match error") | |
65 | + | } | |
66 | + | ||
67 | + | ||
68 | + | @Callable(i) | |
69 | + | func forceStopContract (address,stop) = { | |
70 | + | let callerAddressString = toString(i.caller) | |
71 | + | let check = [if (containsElement(permissionList, callerAddressString)) | |
72 | + | then true | |
73 | + | else mustManager(i)] | |
74 | + | if ((check == check)) | |
75 | + | then [BooleanEntry(keyForceStop(address), stop)] | |
76 | + | else throw("Strict value is not equal to itself.") | |
77 | + | } | |
78 | + | ||
79 | + | ||
80 | + | @Verifier(tx) | |
81 | + | func verify () = { | |
82 | + | let targetPublicKey = match managerPublicKeyOrUnit() { | |
83 | + | case pk: ByteVector => | |
84 | + | pk | |
85 | + | case _: Unit => | |
86 | + | tx.senderPublicKey | |
87 | + | case _ => | |
88 | + | throw("Match error") | |
89 | + | } | |
90 | + | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
91 | + | } | |
92 | + |
github/deemru/w8io/169f3d6 37.01 ms ◑