tx · 8eG2uMiMg81NTHokriCKgn1x2Vd8N7uGskFy6JrKd5C5 3MpHH6zrns5Yr1gp4bHYeBtEd9BBKsCTou6: -0.01000000 Waves 2019.11.06 23:42 [753547] smart account 3MpHH6zrns5Yr1gp4bHYeBtEd9BBKsCTou6 > SELF 0.00000000 Waves
{ "type": 13, "id": "8eG2uMiMg81NTHokriCKgn1x2Vd8N7uGskFy6JrKd5C5", "fee": 1000000, "feeAssetId": null, "timestamp": 1573072988009, "version": 1, "sender": "3MpHH6zrns5Yr1gp4bHYeBtEd9BBKsCTou6", "senderPublicKey": "EW5L8pthNV1jLZqSb1XAsbWZWfikCDkfsp15mCGiuhHA", "proofs": [ "2MQAgLhexN499SX6RvDbySUGLMV5CRYJf2LnFFcCTskvQrU5ZSLp62Si6wBAGjZcHfAFJktjXqFgHNgkhmWCQ4tZ" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQgAAAADAAAAAA1kQXBwUHVibGljS2V5AQAAACDImqtav2kViIMuL/Nq4AnGoS+Z9OYPbeY31+Gc6pbgGQAAAAASd2hpdGVsaXN0aW5nU3VmZml4AgAAAAxfd2hpdGVsaXN0ZWQBAAAADWlzV2hpdGVsaXN0ZWQAAAABAAAACXB1YmxpY0tleQQAAAAXa2V5T2ZXaGl0ZWxpc3RlZEFjY291bnQJAAEsAAAAAgUAAAAJcHVibGljS2V5BQAAABJ3aGl0ZWxpc3RpbmdTdWZmaXgEAAAADXdoaXRsaXN0ZWRLZXkJAAQdAAAAAgUAAAAEdGhpcwUAAAAXa2V5T2ZXaGl0ZWxpc3RlZEFjY291bnQDCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAANd2hpdGxpc3RlZEtleQYHAAAAAgAAAAFpAQAAAAl3aGl0ZWxpc3QAAAABAAAACXB1YmxpY0tleQMJAQAAAA1pc1doaXRlbGlzdGVkAAAAAQUAAAAJcHVibGljS2V5CQAAAgAAAAECAAAAKVRoaXMgYWNjb3VudCBoYXMgYWxyZWFkeSBiZWVuIHdoaXRlbGlzdGVkBAAAAA53aGl0ZWxpc3RlZEtleQkAASwAAAACBQAAAAlwdWJsaWNLZXkFAAAAEndoaXRlbGlzdGluZ1N1ZmZpeAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAOd2hpdGVsaXN0ZWRLZXkFAAAACXB1YmxpY0tleQUAAAADbmlsAAAAAWkBAAAADmFkZEJpcnRoUmVjb3JkAAAAAQAAAARpbmZvAwkBAAAADWlzV2hpdGVsaXN0ZWQAAAABCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAAOYmlydGhSZWNvcmRLZXkJAAGkAAAAAQkABLEAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA5iaXJ0aFJlY29yZEtleQUAAAAEaW5mbwUAAAADbmlsCQAAAgAAAAECAAAAPFlvdSBhcmUgbm90IGFsbG93ZWQgdG8gY3JlYXRlIGJpcnRoIHJlY29yZCBvbiB0aGUgYmxvY2tjaGFpbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADWRBcHBQdWJsaWNLZXkG/d2jKA==", "chainId": 84, "height": 753547, "spentComplexity": 0 } View: original | compacted Prev: none Next: 6pyZC5zSPCNV2FTws7GQYkmSLCmSCPBKBGotbBS3bA7J Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let dAppPublicKey = base58'EW5L8pthNV1jLZqSb1XAsbWZWfikCDkfsp15mCGiuhHA' | |
5 | + | ||
6 | + | let whitelistingSuffix = "_whitelisted" | |
7 | + | ||
8 | + | func isWhitelisted (publicKey) = { | |
9 | + | let keyOfWhitelistedAccount = (publicKey + whitelistingSuffix) | |
10 | + | let whitlistedKey = getString(this, keyOfWhitelistedAccount) | |
11 | + | if (isDefined(whitlistedKey)) | |
12 | + | then true | |
13 | + | else false | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | @Callable(i) | |
18 | + | func whitelist (publicKey) = if (isWhitelisted(publicKey)) | |
19 | + | then throw("This account has already been whitelisted") | |
20 | + | else { | |
21 | + | let whitelistedKey = (publicKey + whitelistingSuffix) | |
22 | + | WriteSet([DataEntry(whitelistedKey, publicKey)]) | |
23 | + | } | |
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | @Callable(i) | |
28 | + | func addBirthRecord (info) = if (isWhitelisted(toBase58String(i.callerPublicKey))) | |
29 | + | then { | |
30 | + | let birthRecordKey = toString(toInt(i.transactionId)) | |
31 | + | WriteSet([DataEntry(birthRecordKey, info)]) | |
32 | + | } | |
33 | + | else throw("You are not allowed to create birth record on the blockchain") | |
34 | + | ||
35 | + | ||
36 | + | @Verifier(tx) | |
37 | + | func verify () = match tx { | |
38 | + | case d: SetScriptTransaction => | |
39 | + | sigVerify(tx.bodyBytes, tx.proofs[0], dAppPublicKey) | |
40 | + | case _ => | |
41 | + | true | |
42 | + | } | |
43 | + |
github/deemru/w8io/026f985 20.60 ms ◑