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:AAIEAAAAAAAAABoIAhIGCgQICAgIEg4KDAgICAgICAEICAgICAAAACkAAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAANdXNlcldoaXRlbGlzdAkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTXBKRWIzNlpReWsxaGFLbm9jYXlKY1lNMzFjTlBYUGlLMwAAAAAMc2lnblZlcmlmaWVyCQEAAAAFdmFsdWUAAAABCQAEJgAAAAECAAAAIzNOQzI4aFNpdnJtc1RVWGFZRDF4NkwzNjJKNFpwVW5vVGRCAAAAAA1hY2NlcHRlZFRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAAGdXNkbklEAgAAACwzS0ZYQkdHTENqQTVaMkR1VzREcTlmRERySGpKSlAxWkVrYW9halN6dUtzQwAAAAAFYWRtaW4CAAAAIzNOQ3FwZGI4akhXMWQxaHFaZ2VTOUFFMk1KMktlaDk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xrZXlBcnRJc3N1ZWQAAAACBQAAAA1jYWxsZXJBZGRyZXNzBQAAAAVhcnRJZAAAAAAAAAAAAAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgkBAAAADGtleUFydE9uU2FsZQAAAAIFAAAADWNhbGxlckFkZHJlc3MFAAAABWFydElkBwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAA5sYXN0X2ludm9rZV9pZAUAAAAFYXJ0SWQFAAAAA25pbAAAAACN/atf", "height": 1170714, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HJtNYUjptmGXrxw29UivPMWBYiRnLopStemrBVbA6f7y Next: 3wWXEJsrtwTsYHVqxe5kdFZEzzcM9D9dJNMG4G5S5hxD Diff:
Old | New | Differences | |
---|---|---|---|
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
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 | + | ||
50 | 65 | func keyUserIsArtist (callerAddr) = ("user_isartist_" + callerAddr) | |
66 | + | ||
67 | + | ||
68 | + | func keyUserStatus (callerAddr) = ("user_status_" + callerAddr) | |
69 | + | ||
70 | + | ||
71 | + | func keyUserDate (callerAddr) = ("user_date_" + callerAddr) | |
51 | 72 | ||
52 | 73 | ||
53 | 74 | func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr) | |
98 | 119 | func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("art_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr))))) | |
99 | 120 | ||
100 | 121 | ||
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 | + | ||
101 | 132 | @Callable(invoke) | |
102 | 133 | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
103 | 134 | let artId = toBase58String(invoke.transactionId) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let userWhitelist = value(addressFromString("3MpJEb36ZQyk1haKnocayJcYM31cNPXPiK3")) | |
7 | 7 | ||
8 | 8 | let signVerifier = value(addressFromString("3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB")) | |
9 | 9 | ||
10 | 10 | let acceptedToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
11 | 11 | ||
12 | 12 | let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
13 | 13 | ||
14 | 14 | let admin = "3NCqpdb8jHW1d1hqZgeS9AE2MJ2Keh95jMC" | |
15 | 15 | ||
16 | 16 | let VERIFIEDONLY = true | |
17 | 17 | ||
18 | 18 | let userCreated = "CREATED" | |
19 | 19 | ||
20 | 20 | let userVerified = "VERIFIED" | |
21 | 21 | ||
22 | 22 | let userSuspended = "SUSPENDED" | |
23 | 23 | ||
24 | 24 | let userRemoved = "REMOVED" | |
25 | 25 | ||
26 | 26 | let userUnregistered = "UNREGISTERED" | |
27 | 27 | ||
28 | 28 | let onSale = "ON_SALE" | |
29 | 29 | ||
30 | 30 | let sold = "SOLD" | |
31 | 31 | ||
32 | 32 | let canceled = "CANCELED" | |
33 | 33 | ||
34 | 34 | func getStringByKey (key) = match getString(this, key) { | |
35 | 35 | case a: String => | |
36 | 36 | a | |
37 | 37 | case _ => | |
38 | 38 | "" | |
39 | 39 | } | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func getIntegerByKey (key) = match getInteger(this, key) { | |
43 | 43 | case i: Int => | |
44 | 44 | i | |
45 | 45 | case _ => | |
46 | 46 | 0 | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
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 | + | ||
50 | 65 | func keyUserIsArtist (callerAddr) = ("user_isartist_" + callerAddr) | |
66 | + | ||
67 | + | ||
68 | + | func keyUserStatus (callerAddr) = ("user_status_" + callerAddr) | |
69 | + | ||
70 | + | ||
71 | + | func keyUserDate (callerAddr) = ("user_date_" + callerAddr) | |
51 | 72 | ||
52 | 73 | ||
53 | 74 | func keyArtDate (callerAddr,artId) = ((("art_date_" + artId) + "_") + callerAddr) | |
54 | 75 | ||
55 | 76 | ||
56 | 77 | func keyArtName (callerAddr,artId) = ((("art_name_" + artId) + "_") + callerAddr) | |
57 | 78 | ||
58 | 79 | ||
59 | 80 | func keyArtDesc (callerAddr,artId) = ((("art_desc_" + artId) + "_") + callerAddr) | |
60 | 81 | ||
61 | 82 | ||
62 | 83 | func keyArtDisplayCid (callerAddr,artId) = ((("art_display_cid_" + artId) + "_") + callerAddr) | |
63 | 84 | ||
64 | 85 | ||
65 | 86 | func keyArtExportHash (callerAddr,artId) = ((("art_export_hash_" + artId) + "_") + callerAddr) | |
66 | 87 | ||
67 | 88 | ||
68 | 89 | func keyArtExportCid (callerAddr,artId) = ((("art_export_cid_" + artId) + "_") + callerAddr) | |
69 | 90 | ||
70 | 91 | ||
71 | 92 | func keyArtMaxMint (callerAddr,artId) = ((("art_maxmint_" + artId) + "_") + callerAddr) | |
72 | 93 | ||
73 | 94 | ||
74 | 95 | func keyArtSignID (callerAddr,artId) = ((("art_signid_" + artId) + "_") + callerAddr) | |
75 | 96 | ||
76 | 97 | ||
77 | 98 | func keyArtIssued (callerAddr,artId) = ((("art_issued_" + artId) + "_") + callerAddr) | |
78 | 99 | ||
79 | 100 | ||
80 | 101 | func keyArtOnSale (callerAddr,artId) = ((("art_onsale_" + artId) + "_") + callerAddr) | |
81 | 102 | ||
82 | 103 | ||
83 | 104 | func keyArtLicenceHash (callerAddr,artId) = ((("art_licence_hash_" + artId) + "_") + callerAddr) | |
84 | 105 | ||
85 | 106 | ||
86 | 107 | func keyArtLicenceCid (callerAddr,artId) = ((("art_licence_cid_" + artId) + "_") + callerAddr) | |
87 | 108 | ||
88 | 109 | ||
89 | 110 | func keyArtTags (callerAddr,artId) = ((("art_tags_" + artId) + "_") + callerAddr) | |
90 | 111 | ||
91 | 112 | ||
92 | 113 | func keyArtType (callerAddr,artId) = ((("art_type_" + artId) + "_") + callerAddr) | |
93 | 114 | ||
94 | 115 | ||
95 | 116 | func keyArtOwnerByHash (sha256Hash) = ("art_owner_by_hash_" + sha256Hash) | |
96 | 117 | ||
97 | 118 | ||
98 | 119 | func keyArtTxidByHashOwner (sha256Hash,callerAddr) = ("art_txid_by_hash_owner_" + toBase58String(sha256_16Kb(toBytes((sha256Hash + callerAddr))))) | |
99 | 120 | ||
100 | 121 | ||
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 | + | ||
101 | 132 | @Callable(invoke) | |
102 | 133 | func addArtwork (sha256Hash,signID,name,description,tags,type,maxmint,cidDisplay,sha256Export,cidExport,sha256Licence,cidLicence) = { | |
103 | 134 | let artId = toBase58String(invoke.transactionId) | |
104 | 135 | let callerAddress = toBase58String(invoke.caller.bytes) | |
105 | 136 | let timestamp = lastBlock.timestamp | |
106 | 137 | [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)] | |
107 | 138 | } | |
108 | 139 | ||
109 | 140 |
github/deemru/w8io/026f985 28.94 ms ◑