tx · 4cHqi8C96gnjY5FuhdgUUcCDxKgFBkXAEF1vqLUGq8bd

3N9EXJ2Y7szbSfrxUwhWxnL3zK8wf3xosDE:  -0.01400000 Waves

2019.12.17 09:54 [812575] smart account 3N9EXJ2Y7szbSfrxUwhWxnL3zK8wf3xosDE > SELF 0.00000000 Waves

{ "type": 13, "id": "4cHqi8C96gnjY5FuhdgUUcCDxKgFBkXAEF1vqLUGq8bd", "fee": 1400000, "feeAssetId": null, "timestamp": 1576565830648, "version": 1, "sender": "3N9EXJ2Y7szbSfrxUwhWxnL3zK8wf3xosDE", "senderPublicKey": "9mENuoC82QFsBookiU4McsBPyUkyY7VNWe8nikxj47eh", "proofs": [ "4hxHhNanzZYwdja3dtBN78eknjTNb9wmSvQBMpZLoX5teTXdqv5AQG3mM9qUmDy2LjpyuHttNsuSt5JHBfAFuya7" ], "script": "base64:AAIDAAAAAAAAABIIARIECgIICBIDCgEIEgMKAQgAAAAKAAAAABRkQXBwQWNjb3VudFB1YmxpY0tleQEAAAAggjItYz1wDPYf7XYzYhDTkZ7oouxwtfQFF4TErvLkmhoAAAAACnVzZXJTdWZmaXgCAAAABl9fdXNlcgAAAAAUdW52ZXJpZmllZFVzZXJTdWZmaXgCAAAADF9fdW52ZXJpZmllZAAAAAASdmVyaWZpZWRVc2VyU3VmZml4AgAAAApfX3ZlcmlmaWVkAAAAAAljYXRlZ29yeTECAAAACmFtYmFzc2Fkb3IAAAAACWNhdGVnb3J5MgIAAAASYWN0aXZlIGNvbnRyaWJ1dG9yAAAAAAljYXRlZ29yeTMCAAAAFmNvbW11bml0eSBwYXJ0aWNpcGFudHMBAAAABmlzVXNlcgAAAAEAAAAPY2FsbGVyUHVibGljS2V5BAAAAAd1c2VyS2V5CQABLAAAAAIFAAAAD2NhbGxlclB1YmxpY0tleQUAAAAKdXNlclN1ZmZpeAMJAQAAAAlpc0RlZmluZWQAAAABCQAEHQAAAAIFAAAABHRoaXMFAAAAB3VzZXJLZXkGBwEAAAAPaXNWY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ZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAABRkQXBwQWNjb3VudFB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAWkFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwBgdnc9i2", "chainId": 84, "height": 812575, "spentComplexity": 0 } View: original | compacted Prev: 48XVExcKjyEnta9WhvfKiX5RwyyJ583gczQNW2weKXKo Next: FPF1aNfEQr99RtbzTNXewpR64ugwPYBR5PUTy6euZPaz Diff:
OldNewDifferences
6060 else {
6161 let currentKey = callerPublicKey
6262 let userCategory = isValidCategory(category)
63- let currentUserRegistrationValue = (info + unverifiedUserSuffix)
63+ let currentUserRegistrationValue = (((info + "__") + userCategory) + unverifiedUserSuffix)
6464 WriteSet([DataEntry((currentKey + userSuffix), currentUserRegistrationValue)])
6565 }
6666 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let dAppAccountPublicKey = base58'9mENuoC82QFsBookiU4McsBPyUkyY7VNWe8nikxj47eh'
55
66 let userSuffix = "__user"
77
88 let unverifiedUserSuffix = "__unverified"
99
1010 let verifiedUserSuffix = "__verified"
1111
1212 let category1 = "ambassador"
1313
1414 let category2 = "active contributor"
1515
1616 let category3 = "community participants"
1717
1818 func isUser (callerPublicKey) = {
1919 let userKey = (callerPublicKey + userSuffix)
2020 if (isDefined(getString(this, userKey)))
2121 then true
2222 else false
2323 }
2424
2525
2626 func isValidCategory (category) = if (if (if ((category == category1))
2727 then true
2828 else (category == category2))
2929 then true
3030 else (category == category3))
3131 then category
3232 else throw("Category is invalid")
3333
3434
3535 func isVerified (publicKey) = {
3636 let key = (publicKey + userSuffix)
3737 let userKey = getString(this, key)
3838 if (isDefined(userKey))
3939 then {
4040 let userData = match getString(this, key) {
4141 case a: String =>
4242 a
4343 case _ =>
4444 throw("Record not found")
4545 }
4646 let userList = split(userData, "__")
4747 if ((userList[1] == "verified"))
4848 then true
4949 else false
5050 }
5151 else false
5252 }
5353
5454
5555 @Callable(i)
5656 func signUp (info,category) = {
5757 let callerPublicKey = toBase58String(i.callerPublicKey)
5858 if (isUser(callerPublicKey))
5959 then throw("You are already registered")
6060 else {
6161 let currentKey = callerPublicKey
6262 let userCategory = isValidCategory(category)
63- let currentUserRegistrationValue = (info + unverifiedUserSuffix)
63+ let currentUserRegistrationValue = (((info + "__") + userCategory) + unverifiedUserSuffix)
6464 WriteSet([DataEntry((currentKey + userSuffix), currentUserRegistrationValue)])
6565 }
6666 }
6767
6868
6969
7070 @Callable(i)
7171 func verifyUser (publicKey) = if ((i.callerPublicKey != dAppAccountPublicKey))
7272 then throw("Only dApp account can verify a user")
7373 else if (isVerified(publicKey))
7474 then throw("This user has already been verified")
7575 else if (isUser(publicKey))
7676 then {
7777 let userData = match getString(this, (publicKey + userSuffix)) {
7878 case a: String =>
7979 a
8080 case _ =>
8181 throw("User not found")
8282 }
8383 let userList = split(userData, "__")
8484 let userInfo = userList[0]
8585 let updatedUserValue = (userInfo + verifiedUserSuffix)
8686 let userKey = (publicKey + userSuffix)
8787 WriteSet([DataEntry(userKey, updatedUserValue)])
8888 }
8989 else throw("This is not a registered user")
9090
9191
9292
9393 @Callable(i)
9494 func tip (publicKeyOfUserToTip) = if (isVerified(publicKeyOfUserToTip))
9595 then {
9696 let payment = extract(i.payment)
9797 let publicKey = fromBase58String(publicKeyOfUserToTip)
9898 if (isDefined(payment.assetId))
9999 then throw("can hodl waves only at the moment")
100100 else TransferSet([ScriptTransfer(addressFromPublicKey(publicKey), payment.amount, unit)])
101101 }
102102 else throw("You can't tip this user")
103103
104104
105105 @Verifier(tx)
106106 func verify () = match tx {
107107 case s: SetScriptTransaction =>
108108 sigVerify(tx.bodyBytes, tx.proofs[0], dAppAccountPublicKey)
109109 case i: InvokeScriptTransaction =>
110110 true
111111 case t: TransferTransaction =>
112112 true
113113 case _ =>
114114 false
115115 }
116116

github/deemru/w8io/169f3d6 
35.42 ms