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+Gc6pbgGQAAAAASd2hpdGVsaXN0aW5nU3VmZml4AgAAAAxfd2hpdGVsaXN0ZWQBAAAADWlzV2hpdGVsaXN0ZWQAAAABAAAACXB1YmxpY0tleQQAAAAXa2V5T2ZXaGl0ZWxpc3RlZEFjY291bnQJAAEsAAAAAgUAAAAJcHVibGljS2V5BQAAABJ3aGl0ZWxpc3RpbmdTdWZmaXgEAAAADXdoaXRsaXN0ZWRLZXkJAAQdAAAAAgUAAAAEdGhpcwUAAAAXa2V5T2ZXaGl0ZWxpc3RlZEFjY291bnQDCQEAAAAJaXNEZWZpbmVkAAAAAQUAAAANd2hpdGxpc3RlZEtleQYHAAAAAgAAAAFpAQAAAAl3aGl0ZWxpc3QAAAABAAAACXB1YmxpY0tleQMJAAAAAAAAAggFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAA1kQXBwUHVibGljS2V5AwkBAAAADWlzV2hpdGVsaXN0ZWQAAAABBQAAAAlwdWJsaWNLZXkJAAACAAAAAQIAAAApVGhpcyBhY2NvdW50IGhhcyBhbHJlYWR5IGJlZW4gd2hpdGVsaXN0ZWQEAAAADndoaXRlbGlzdGVkS2V5CQABLAAAAAIFAAAACXB1YmxpY0tleQUAAAASd2hpdGVsaXN0aW5nU3VmZml4CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA53aGl0ZWxpc3RlZEtleQUAAAAJcHVibGljS2V5BQAAAANuaWwJAAACAAAAAQIAAAAtWW91IGFyZSBub3QgcGVybWl0dGVkIHRvIHdoaXRlbGlzdCBhbiBhY2NvdW50AAAAAWkBAAAADmFkZEJpcnRoUmVjb3JkAAAAAQAAAARpbmZvAwkBAAAADWlzV2hpdGVsaXN0ZWQAAAABCQACWAAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAAOYmlydGhSZWNvcmRLZXkJAAGkAAAAAQkABLEAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA5iaXJ0aFJlY29yZEtleQUAAAAEaW5mbwUAAAADbmlsCQAAAgAAAAECAAAAPFlvdSBhcmUgbm90IGFsbG93ZWQgdG8gY3JlYXRlIGJpcnRoIHJlY29yZCBvbiB0aGUgYmxvY2tjaGFpbgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADWRBcHBQdWJsaWNLZXkGpfQtLg==", "chainId": 84, "height": 753555, "spentComplexity": 0 } View: original | compacted Prev: 8eG2uMiMg81NTHokriCKgn1x2Vd8N7uGskFy6JrKd5C5 Next: 8eoexJsEVTPAx34UofaN9UosyvNZkecXQGFSRo8RRQ5D Diff:
OldNewDifferences
1515
1616
1717 @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")
2426
2527
2628
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let dAppPublicKey = base58'EW5L8pthNV1jLZqSb1XAsbWZWfikCDkfsp15mCGiuhHA'
55
66 let whitelistingSuffix = "_whitelisted"
77
88 func isWhitelisted (publicKey) = {
99 let keyOfWhitelistedAccount = (publicKey + whitelistingSuffix)
1010 let whitlistedKey = getString(this, keyOfWhitelistedAccount)
1111 if (isDefined(whitlistedKey))
1212 then true
1313 else false
1414 }
1515
1616
1717 @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")
2426
2527
2628
2729 @Callable(i)
2830 func addBirthRecord (info) = if (isWhitelisted(toBase58String(i.callerPublicKey)))
2931 then {
3032 let birthRecordKey = toString(toInt(i.transactionId))
3133 WriteSet([DataEntry(birthRecordKey, info)])
3234 }
3335 else throw("You are not allowed to create birth record on the blockchain")
3436
3537
3638 @Verifier(tx)
3739 func verify () = match tx {
3840 case d: SetScriptTransaction =>
3941 sigVerify(tx.bodyBytes, tx.proofs[0], dAppPublicKey)
4042 case _ =>
4143 true
4244 }
4345

github/deemru/w8io/026f985 
20.53 ms