tx · GGDFEb91qvr2CBSWBjxsKVWgRv7rLe3H91LR44UqzaAk

3MxZp5dE4bdw4ySwWuP8oa5u7oJ9v3mCd9o:  -0.01400000 Waves

2020.09.10 07:04 [1170714] smart account 3MxZp5dE4bdw4ySwWuP8oa5u7oJ9v3mCd9o > SELF 0.00000000 Waves

{ "type": 13, "id": "GGDFEb91qvr2CBSWBjxsKVWgRv7rLe3H91LR44UqzaAk", "fee": 1400000, "feeAssetId": null, "timestamp": 1599710644456, "version": 2, "chainId": 84, "sender": "3MxZp5dE4bdw4ySwWuP8oa5u7oJ9v3mCd9o", "senderPublicKey": "6Bsee4KX5PTUcBfCH4bFHLzLRZSPQF8HH4oYtNZFsCAG", "proofs": [ "5zLxzA1vxnZKyLexM4QvvTvDpp9bXuuegTQw7dA95Xcifh77uMMgpYrbitB77fkwJp2sPhrZfCEeFJ51fTiv1msM" ], "script": "base64:AAIEAAAAAAAAABoIAhIGCgQICAgIEg4KDAgICAgICAEICAgICAAAACkAAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAANdXNlcldoaXRlbGlzdAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXBKRWIzNlpReWsxaGFLbm9jYXlKY1lNMzFjTlBYUGlLMwAAAAAMc2lnblZlcmlmaWVyCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOQzI4aFNpdnJtc1RVWGFZRDF4NkwzNjJKNFpwVW5vVGRCAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAGdXNkbklEAgAAACwzS0ZYQkdHTENqQTVaMkR1VzREcTlmRERySGpKSlAxWkVrYW9halN6dUtzQwAAAAAFYWRtaW4CAAAAIzNOQ3FwZGI4akhXMWQxaHFaZ2VTOUFFMk1KMktlaD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AxrZXlBcnRJc3N1ZWQAAAACBQAAAA1jYWxsZXJBZGRyZXNzBQAAAAVhcnRJZAAAAAAAAAAAAAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkBAAAADGtleUFydE9uU2FsZQAAAAIFAAAADWNhbGxlckFkZHJlc3MFAAAABWFydElkBwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA5sYXN0X2ludm9rZV9pZAUAAAAFYXJ0SWQFAAAAA25pbAAAAACN/atf", "height": 1170714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HJtNYUjptmGXrxw29UivPMWBYiRnLopStemrBVbA6f7y Next: 3wWXEJsrtwTsYHVqxe5kdFZEzzcM9D9dJNMG4G5S5hxD Diff:
OldNewDifferences
4747 }
4848
4949
50+func keyUserAddr (callerAddr) = ("user_" + callerAddr)
51+
52+
53+func keyUserName (callerAddr) = ("user_name_" + callerAddr)
54+
55+
56+func keyUserDesc (callerAddr) = ("user_desc_" + callerAddr)
57+
58+
59+func keyUserSocial (callerAddr) = ("user_social_" + callerAddr)
60+
61+
62+func keyUserThumb (callerAddr) = ("user_thumb_" + callerAddr)
63+
64+
5065 func keyUserIsArtist (callerAddr) = ("user_isartist_" + callerAddr)
66+
67+
68+func keyUserStatus (callerAddr) = ("user_status_" + callerAddr)
69+
70+
71+func keyUserDate (callerAddr) = ("user_date_" + callerAddr)
5172
5273
5374 func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr)
98119 func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("art_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr)))))
99120
100121
122+@Callable(i)
123+func registerUser (name,description,thumb,social) = {
124+ let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
125+ let id = toBase58String(i.transactionId)
126+ let timestamp = lastBlock.timestamp
127+[IntegerEntry(keyUserDate(callerAddr), timestamp), StringEntry(keyUserAddr(callerAddr), ((id + "_") + toString(lastBlock.timestamp))), StringEntry(keyUserName(callerAddr), name), StringEntry(keyUserDesc(callerAddr), description), StringEntry(keyUserSocial(callerAddr), social), StringEntry(keyUserThumb(callerAddr), thumb), BooleanEntry(keyUserIsArtist(callerAddr), false), StringEntry(keyUserStatus(callerAddr), userCreated), StringEntry("last_invoke_id", id)]
128+ }
129+
130+
131+
101132 @Callable(invoke)
102133 func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
103134 let artId = toBase58String(invoke.transactionId)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
66 let userWhitelist = value(addressFromString("3MpJEb36ZQyk1haKnocayJcYM31cNPXPiK3"))
77
88 let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB"))
99
1010 let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1111
1212 let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
1313
1414 let admin = "3NCqpdb8jHW1d1hqZgeS9AE2MJ2Keh95jMC"
1515
1616 let VERIFIEDONLY = true
1717
1818 let userCreated = "CREATED"
1919
2020 let userVerified = "VERIFIED"
2121
2222 let userSuspended = "SUSPENDED"
2323
2424 let userRemoved = "REMOVED"
2525
2626 let userUnregistered = "UNREGISTERED"
2727
2828 let onSale = "ON_SALE"
2929
3030 let sold = "SOLD"
3131
3232 let canceled = "CANCELED"
3333
3434 func getStringByKey (key) = match getString(this, key) {
3535 case a: String =>
3636 a
3737 case _ =>
3838 ""
3939 }
4040
4141
4242 func getIntegerByKey (key) = match getInteger(this, key) {
4343 case i: Int =>
4444 i
4545 case _ =>
4646 0
4747 }
4848
4949
50+func keyUserAddr (callerAddr) = ("user_" + callerAddr)
51+
52+
53+func keyUserName (callerAddr) = ("user_name_" + callerAddr)
54+
55+
56+func keyUserDesc (callerAddr) = ("user_desc_" + callerAddr)
57+
58+
59+func keyUserSocial (callerAddr) = ("user_social_" + callerAddr)
60+
61+
62+func keyUserThumb (callerAddr) = ("user_thumb_" + callerAddr)
63+
64+
5065 func keyUserIsArtist (callerAddr) = ("user_isartist_" + callerAddr)
66+
67+
68+func keyUserStatus (callerAddr) = ("user_status_" + callerAddr)
69+
70+
71+func keyUserDate (callerAddr) = ("user_date_" + callerAddr)
5172
5273
5374 func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr)
5475
5576
5677 func keyArtName (callerAddr,artId) = ((("art_name_" + artId) + "_") + callerAddr)
5778
5879
5980 func keyArtDesc (callerAddr,artId) = ((("art_desc_" + artId) + "_") + callerAddr)
6081
6182
6283 func keyArtDisplayCid (callerAddr,artId) = ((("art_display_cid_" + artId) + "_") + callerAddr)
6384
6485
6586 func keyArtExportHash (callerAddr,artId) = ((("art_export_hash_" + artId) + "_") + callerAddr)
6687
6788
6889 func keyArtExportCid (callerAddr,artId) = ((("art_export_cid_" + artId) + "_") + callerAddr)
6990
7091
7192 func keyArtMaxMint (callerAddr,artId) = ((("art_maxmint_" + artId) + "_") + callerAddr)
7293
7394
7495 func keyArtSignID (callerAddr,artId) = ((("art_signid_" + artId) + "_") + callerAddr)
7596
7697
7798 func keyArtIssued (callerAddr,artId) = ((("art_issued_" + artId) + "_") + callerAddr)
7899
79100
80101 func keyArtOnSale (callerAddr,artId) = ((("art_onsale_" + artId) + "_") + callerAddr)
81102
82103
83104 func keyArtLicenceHash (callerAddr,artId) = ((("art_licence_hash_" + artId) + "_") + callerAddr)
84105
85106
86107 func keyArtLicenceCid (callerAddr,artId) = ((("art_licence_cid_" + artId) + "_") + callerAddr)
87108
88109
89110 func keyArtTags (callerAddr,artId) = ((("art_tags_" + artId) + "_") + callerAddr)
90111
91112
92113 func keyArtType (callerAddr,artId) = ((("art_type_" + artId) + "_") + callerAddr)
93114
94115
95116 func keyArtOwnerByHash (sha256Hash) = ("art_owner_by_hash_" + sha256Hash)
96117
97118
98119 func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("art_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr)))))
99120
100121
122+@Callable(i)
123+func registerUser (name,description,thumb,social) = {
124+ let callerAddr = toString(addressFromPublicKey(i.callerPublicKey))
125+ let id = toBase58String(i.transactionId)
126+ let timestamp = lastBlock.timestamp
127+[IntegerEntry(keyUserDate(callerAddr), timestamp), StringEntry(keyUserAddr(callerAddr), ((id + "_") + toString(lastBlock.timestamp))), StringEntry(keyUserName(callerAddr), name), StringEntry(keyUserDesc(callerAddr), description), StringEntry(keyUserSocial(callerAddr), social), StringEntry(keyUserThumb(callerAddr), thumb), BooleanEntry(keyUserIsArtist(callerAddr), false), StringEntry(keyUserStatus(callerAddr), userCreated), StringEntry("last_invoke_id", id)]
128+ }
129+
130+
131+
101132 @Callable(invoke)
102133 func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = {
103134 let artId = toBase58String(invoke.transactionId)
104135 let callerAddress = toBase58String(invoke.caller.bytes)
105136 let timestamp = lastBlock.timestamp
106137 [StringEntry(keyArtOwnerByHash(sha256Hash), callerAddress), StringEntry(keyArtTxidByHashOwner(sha256Hash, callerAddress), artId), BooleanEntry(keyUserIsArtist(callerAddress), true), IntegerEntry(keyArtDate(callerAddress, artId), timestamp), StringEntry(keyArtName(callerAddress, artId), name), StringEntry(keyArtDesc(callerAddress, artId), description), StringEntry(keyArtDisplayCid(callerAddress, artId), cidDisplay), StringEntry(keyArtExportCid(callerAddress, artId), cidExport), StringEntry(keyArtExportHash(callerAddress, artId), sha256Export), StringEntry(keyArtLicenceHash(callerAddress, artId), sha256Licence), StringEntry(keyArtLicenceCid(callerAddress, artId), cidLicence), StringEntry(keyArtType(callerAddress, artId), type), StringEntry(keyArtTags(callerAddress, artId), tags), IntegerEntry(keyArtMaxMint(callerAddress, artId), maxmint), StringEntry(keyArtSignID(callerAddress, artId), signID), IntegerEntry(keyArtIssued(callerAddress, artId), 0), BooleanEntry(keyArtOnSale(callerAddress, artId), false), StringEntry("last_invoke_id", artId)]
107138 }
108139
109140

github/deemru/w8io/026f985 
25.81 ms