tx · CBYs4ZYX1kE9NBRoAXCVaxETAvhum2ezCvPtD7yRMhBf 3N8E47kq3vcJK5kUS7RXL6N39ZH4c1QUDKD: -0.02800000 Waves 2023.10.09 09:53 [2790766] smart account 3N8E47kq3vcJK5kUS7RXL6N39ZH4c1QUDKD > SELF 0.00000000 Waves
{ "type": 13, "id": "CBYs4ZYX1kE9NBRoAXCVaxETAvhum2ezCvPtD7yRMhBf", "fee": 2800000, "feeAssetId": null, "timestamp": 1696834391595, "version": 2, "chainId": 84, "sender": "3N8E47kq3vcJK5kUS7RXL6N39ZH4c1QUDKD", "senderPublicKey": "AG741qAD1eZhE9HUtfAHocrDYdxfk74RgTJETx9raT7n", "proofs": [ "4vJtXsUs4JFSE5T9Fuan9YHzToV8iTyrDS4CX1UZ1XuKaRfK59poN9fsxXySPtQhXDenTWr3ahhXVqHXjYS7DziZ" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgEAAAAHZ2V0RGF0YQAAAAIAAAADYWRyAAAAA2tleQQAAAAEZGF0YQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAANhZHIFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAAFAAAABGRhdGEBAAAACGF1dGhVc2VyAAAAAQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAAE2NhbGxlclB1YmxpY0tleUhhc2gJAAJYAAAAAQkAAfcAAAABBQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAACWRhdGFWYWx1ZQkBAAAAB2dldERhdGEAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAALY29ubmVjdGlvbi4FAAAAE2NhbGxlclB1YmxpY0tleUhhc2gCAAAABy5zY3JpcHQEAAAADWV4cGVjdGVkVmFsdWUCAAAACmF1dGhvcml6ZWQDCQAAAAAAAAIFAAAACWRhdGFWYWx1ZQUAAAANZXhwZWN0ZWRWYWx1ZQYHAAAAAQAAAAFpAQAAAAtyZWZ1bmRXYXZlcwAAAAEAAAAEY29zdAQAAAANYXV0aGVudGljYXRlZAkBAAAACGF1dGhVc2VyAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkBAAAAASEAAAABBQAAAA1hdXRoZW50aWNhdGVkCQAAAgAAAAECAAAAPUFjY291bnQgaGF0IG5pY2h0IGRpZSBuw7Z0aWdlIEJlcmVjaHRpZ3VuZyBmw7xyIGRpZXNlIEFrdGlvbi4JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAARjb3N0BQAAAAR1bml0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleagB5D8=", "height": 2790766, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getData (adr,key) = { | |
5 | + | let data = match getString(adr, key) { | |
6 | + | case a: String => | |
7 | + | a | |
8 | + | case _ => | |
9 | + | "" | |
10 | + | } | |
11 | + | data | |
12 | + | } | |
13 | + | ||
14 | + | ||
15 | + | func authUser (callerPublicKey) = { | |
16 | + | let callerPublicKeyHash = toBase58String(sha256(callerPublicKey)) | |
17 | + | let dataValue = getData(this, (("connection." + callerPublicKeyHash) + ".script")) | |
18 | + | let expectedValue = "authorized" | |
19 | + | if ((dataValue == expectedValue)) | |
20 | + | then true | |
21 | + | else false | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | @Callable(i) | |
26 | + | func refundWaves (cost) = { | |
27 | + | let authenticated = authUser(i.callerPublicKey) | |
28 | + | if (!(authenticated)) | |
29 | + | then throw("Account hat nicht die nötige Berechtigung für diese Aktion.") | |
30 | + | else [ScriptTransfer(i.caller, cost, unit)] | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | @Verifier(tx) | |
35 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
36 | + |
github/deemru/w8io/026f985 28.98 ms ◑