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