tx · 6jC6PRhKzTfdz4HnJZwQRHAj9Q8tm1YUUpUvGBx77iPW 3MvGbCQfRKnagRd5JmZTvgupznuJD7MyKfo: -0.01400000 Waves 2022.05.15 18:31 [2052973] smart account 3MvGbCQfRKnagRd5JmZTvgupznuJD7MyKfo > SELF 0.00000000 Waves
{ "type": 13, "id": "6jC6PRhKzTfdz4HnJZwQRHAj9Q8tm1YUUpUvGBx77iPW", "fee": 1400000, "feeAssetId": null, "timestamp": 1652628702862, "version": 2, "chainId": 84, "sender": "3MvGbCQfRKnagRd5JmZTvgupznuJD7MyKfo", "senderPublicKey": "8Gc2RCQPWrzPyyDuKYbKYRCrEHXZSYqCAdiiRQAooSZ6", "proofs": [ "5ogLjTxFxmnuHHXfqhZucNi87YxWYrkqMA34WC4qiRVX6Zd5HcQE8vbuwVTvLW7qpw7c5PMXYKuF6j14P1443Ch6" ], "script": "base64:AAIFAAAAAAAAACkIAhIDCgEIEgkKBwgICAgBAQESCQoHCAgICAEBARIECgIICBIECgIICAAAAAgAAAAACW9yYWNsZUtleQIAAAAJb3JhY2xlS2V5AQAAAAZnZXRTdHIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgIAAAAAAQAAAAZnZXRJbnQAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAAAAAAGb3JhY2xlCQEAAAAGZ2V0U3RyAAAAAQUAAAAJb3JhY2xlS2V5AAAAAAlvcmFjbGVGZWUJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQUAAAAGb3JhY2xlAAAAAApzY29uZXhEYXBwCQAEJgAAAAEJAQAAABN2YWx1Z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zczFUZWFtUmV3YXJkBQAAABJhZGRyZXNzMlRlYW1SZXdhcmQFAAAAEmFkZHJlc3MzVGVhbVJld2FyZAQAAAAUc2NyaXB0VHJhbnNmZXJTZWxsZXIDCQAAAAAAAAIFAAAABnNlbGxlcgIAAAAABQAAAANuaWwJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGc2VsbGVyBQAAAAxzZWxsZXJSZXdhcmQICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAAAAB2Fzc2V0SWQFAAAAA25pbAkABE4AAAACCQAETgAAAAIJAAROAAAAAgkABE4AAAACCQAETgAAAAIJAAROAAAAAgUAAAAac2NyaXB0VHJhbnNmZXJBZGRyZXNzVGVhbTEFAAAAGnNjcmlwdFRyYW5zZmVyQWRkcmVzc1RlYW0yBQAAABpzY3JpcHRUcmFuc2ZlckFkZHJlc3NUZWFtMwUAAAAWc2NyaXB0VHJhbnNmZXJBZGRyZXNzMQUAAAAWc2NyaXB0VHJhbnNmZXJBZGRyZXNzMgUAAAAWc2NyaXB0VHJhbnNmZXJBZGRyZXNzMwUAAAAUc2NyaXB0VHJhbnNmZXJTZWxsZXIAAAAA5zd+YQ==", "height": 2052973, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: NtQDmivhWU6gPqe75XuFuufdipDzoXeuwHfGVDaXEH5 Next: BLWsZWtpea4nCN2ce8NVcXRB9qDwCEPQ6ygxZLzCVCQD Diff:
Old | New | Differences | |
---|---|---|---|
105 | 105 | ||
106 | 106 | ||
107 | 107 | @Callable(i) | |
108 | - | func payFeeResell (txId,seller) = { | |
109 | - | let sconexFeePercentage = 3 | |
110 | - | let amount = value(i.payments[0].amount) | |
111 | - | let assetId = value(i.payments[0].assetId) | |
112 | - | let address1ShareCreator = getInt((txId + "_creator_share1")) | |
113 | - | let address2ShareCreator = getInt((txId + "_creator_share2")) | |
114 | - | let address3ShareCreator = getInt((txId + "_creator_share3")) | |
115 | - | let address1Creator = getStr((txId + "_creator_address1")) | |
116 | - | let address2Creator = getStr((txId + "_creator_address2")) | |
117 | - | let address3Creator = getStr((txId + "_creator_address3")) | |
118 | - | let address1CreatorReward = if ((address1Creator == "")) | |
119 | - | then 0 | |
120 | - | else fraction(amount, address1ShareCreator, 100) | |
121 | - | let address2CreatorReward = if ((address2Creator == "")) | |
122 | - | then 0 | |
123 | - | else fraction(amount, address2ShareCreator, 100) | |
124 | - | let address3CreatorReward = if ((address3Creator == "")) | |
125 | - | then 0 | |
126 | - | else fraction(amount, address3ShareCreator, 100) | |
127 | - | let sconexFeeReward = fraction(amount, sconexFeePercentage, 100) | |
128 | - | let sellerReward = ((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - sconexFeeReward) | |
129 | - | let scriptTransferFeeReceiver = [ScriptTransfer(addressFromStringValue(feeReceiver), sconexFeeReward, i.payments[0].assetId)] | |
130 | - | let scriptTransferAddress1 = if ((address1Creator == "")) | |
131 | - | then nil | |
132 | - | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
133 | - | let scriptTransferAddress2 = if ((address2Creator == "")) | |
134 | - | then nil | |
135 | - | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
136 | - | let scriptTransferAddress3 = if ((address3Creator == "")) | |
137 | - | then nil | |
138 | - | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
139 | - | let scriptTransferSeller = if ((seller == "")) | |
140 | - | then nil | |
141 | - | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
142 | - | ((((scriptTransferAddress1 ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferFeeReceiver) ++ scriptTransferSeller) | |
143 | - | } | |
108 | + | func payFeeResell (txId,seller) = if (!(containsElement(allowedDapps, i.caller))) | |
109 | + | then throw("Not allowed") | |
110 | + | else { | |
111 | + | let sconexFeePercentage = 3 | |
112 | + | let amount = value(i.payments[0].amount) | |
113 | + | let assetId = value(i.payments[0].assetId) | |
114 | + | let address1ShareCreator = getInt((txId + "_creator_share1")) | |
115 | + | let address2ShareCreator = getInt((txId + "_creator_share2")) | |
116 | + | let address3ShareCreator = getInt((txId + "_creator_share3")) | |
117 | + | let address1Creator = getStr((txId + "_creator_address1")) | |
118 | + | let address2Creator = getStr((txId + "_creator_address2")) | |
119 | + | let address3Creator = getStr((txId + "_creator_address3")) | |
120 | + | let address1CreatorReward = if ((address1Creator == "")) | |
121 | + | then 0 | |
122 | + | else fraction(amount, address1ShareCreator, 100) | |
123 | + | let address2CreatorReward = if ((address2Creator == "")) | |
124 | + | then 0 | |
125 | + | else fraction(amount, address2ShareCreator, 100) | |
126 | + | let address3CreatorReward = if ((address3Creator == "")) | |
127 | + | then 0 | |
128 | + | else fraction(amount, address3ShareCreator, 100) | |
129 | + | let sconexFeeReward = fraction(amount, sconexFeePercentage, 100) | |
130 | + | let sellerReward = ((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - sconexFeeReward) | |
131 | + | let scriptTransferFeeReceiver = [ScriptTransfer(addressFromStringValue(feeReceiver), sconexFeeReward, i.payments[0].assetId)] | |
132 | + | let scriptTransferAddress1 = if ((address1Creator == "")) | |
133 | + | then nil | |
134 | + | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
135 | + | let scriptTransferAddress2 = if ((address2Creator == "")) | |
136 | + | then nil | |
137 | + | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
138 | + | let scriptTransferAddress3 = if ((address3Creator == "")) | |
139 | + | then nil | |
140 | + | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
141 | + | let scriptTransferSeller = if ((seller == "")) | |
142 | + | then nil | |
143 | + | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
144 | + | ((((scriptTransferAddress1 ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferFeeReceiver) ++ scriptTransferSeller) | |
145 | + | } | |
144 | 146 | ||
145 | 147 | ||
146 | 148 | ||
147 | 149 | @Callable(i) | |
148 | - | func payFee (txId,seller) = { | |
149 | - | let amount = value(i.payments[0].amount) | |
150 | - | let assetId = value(i.payments[0].assetId) | |
151 | - | let address1ShareTeam = getInt((txId + "_team_share1")) | |
152 | - | let address2ShareTeam = getInt((txId + "_team_share2")) | |
153 | - | let address3ShareTeam = getInt((txId + "_team_share3")) | |
154 | - | let address1Team = getStr((txId + "_team_address1")) | |
155 | - | let address2Team = getStr((txId + "_team_address2")) | |
156 | - | let address3Team = getStr((txId + "_team_address3")) | |
157 | - | let address1ShareCreator = getInt((txId + "_creator_address1")) | |
158 | - | let address2ShareCreator = getInt((txId + "_creator_address2")) | |
159 | - | let address3ShareCreator = getInt((txId + "_creator_address3")) | |
160 | - | let address1Creator = getStr((txId + "_creator_address1")) | |
161 | - | let address2Creator = getStr((txId + "_creator_address2")) | |
162 | - | let address3Creator = getStr((txId + "_creator_address3")) | |
163 | - | let address1TeamReward = if ((address1Team == "")) | |
164 | - | then 0 | |
165 | - | else fraction(amount, address1ShareTeam, 100) | |
166 | - | let address2TeamReward = if ((address2Team == "")) | |
167 | - | then 0 | |
168 | - | else fraction(amount, address2ShareTeam, 100) | |
169 | - | let address3TeamReward = if ((address3Team == "")) | |
170 | - | then 0 | |
171 | - | else fraction(amount, address3ShareTeam, 100) | |
172 | - | let address1CreatorReward = if ((address1Creator == "")) | |
173 | - | then 0 | |
174 | - | else fraction(amount, address1ShareCreator, 100) | |
175 | - | let address2CreatorReward = if ((address2Creator == "")) | |
176 | - | then 0 | |
177 | - | else fraction(amount, address2ShareCreator, 100) | |
178 | - | let address3CreatorReward = if ((address3Creator == "")) | |
179 | - | then 0 | |
180 | - | else fraction(amount, address3ShareCreator, 100) | |
181 | - | let scriptTransferAddressTeam1 = if ((address1Team == "")) | |
182 | - | then nil | |
183 | - | else [ScriptTransfer(addressFromStringValue(address1Team), address1TeamReward, i.payments[0].assetId)] | |
184 | - | let scriptTransferAddressTeam2 = if ((address2Team == "")) | |
185 | - | then nil | |
186 | - | else [ScriptTransfer(addressFromStringValue(address2Team), address2TeamReward, i.payments[0].assetId)] | |
187 | - | let scriptTransferAddressTeam3 = if ((address3Team == "")) | |
188 | - | then nil | |
189 | - | else [ScriptTransfer(addressFromStringValue(address3Team), address3TeamReward, i.payments[0].assetId)] | |
190 | - | let scriptTransferAddress1 = if ((address1Creator == "")) | |
191 | - | then nil | |
192 | - | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
193 | - | let scriptTransferAddress2 = if ((address2Creator == "")) | |
194 | - | then nil | |
195 | - | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
196 | - | let scriptTransferAddress3 = if ((address3Creator == "")) | |
197 | - | then nil | |
198 | - | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
199 | - | let sellerReward = ((((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - address1TeamReward) - address2TeamReward) - address3TeamReward) | |
200 | - | let scriptTransferSeller = if ((seller == "")) | |
201 | - | then nil | |
202 | - | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
203 | - | ((((((scriptTransferAddressTeam1 ++ scriptTransferAddressTeam2) ++ scriptTransferAddressTeam3) ++ scriptTransferAddress1) ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferSeller) | |
204 | - | } | |
150 | + | func payFee (txId,seller) = if (!(containsElement(allowedDapps, i.caller))) | |
151 | + | then throw("Not allowed") | |
152 | + | else { | |
153 | + | let amount = value(i.payments[0].amount) | |
154 | + | let assetId = value(i.payments[0].assetId) | |
155 | + | let address1ShareTeam = getInt((txId + "_team_share1")) | |
156 | + | let address2ShareTeam = getInt((txId + "_team_share2")) | |
157 | + | let address3ShareTeam = getInt((txId + "_team_share3")) | |
158 | + | let address1Team = getStr((txId + "_team_address1")) | |
159 | + | let address2Team = getStr((txId + "_team_address2")) | |
160 | + | let address3Team = getStr((txId + "_team_address3")) | |
161 | + | let address1ShareCreator = getInt((txId + "_creator_address1")) | |
162 | + | let address2ShareCreator = getInt((txId + "_creator_address2")) | |
163 | + | let address3ShareCreator = getInt((txId + "_creator_address3")) | |
164 | + | let address1Creator = getStr((txId + "_creator_address1")) | |
165 | + | let address2Creator = getStr((txId + "_creator_address2")) | |
166 | + | let address3Creator = getStr((txId + "_creator_address3")) | |
167 | + | let address1TeamReward = if ((address1Team == "")) | |
168 | + | then 0 | |
169 | + | else fraction(amount, address1ShareTeam, 100) | |
170 | + | let address2TeamReward = if ((address2Team == "")) | |
171 | + | then 0 | |
172 | + | else fraction(amount, address2ShareTeam, 100) | |
173 | + | let address3TeamReward = if ((address3Team == "")) | |
174 | + | then 0 | |
175 | + | else fraction(amount, address3ShareTeam, 100) | |
176 | + | let address1CreatorReward = if ((address1Creator == "")) | |
177 | + | then 0 | |
178 | + | else fraction(amount, address1ShareCreator, 100) | |
179 | + | let address2CreatorReward = if ((address2Creator == "")) | |
180 | + | then 0 | |
181 | + | else fraction(amount, address2ShareCreator, 100) | |
182 | + | let address3CreatorReward = if ((address3Creator == "")) | |
183 | + | then 0 | |
184 | + | else fraction(amount, address3ShareCreator, 100) | |
185 | + | let scriptTransferAddressTeam1 = if ((address1Team == "")) | |
186 | + | then nil | |
187 | + | else [ScriptTransfer(addressFromStringValue(address1Team), address1TeamReward, i.payments[0].assetId)] | |
188 | + | let scriptTransferAddressTeam2 = if ((address2Team == "")) | |
189 | + | then nil | |
190 | + | else [ScriptTransfer(addressFromStringValue(address2Team), address2TeamReward, i.payments[0].assetId)] | |
191 | + | let scriptTransferAddressTeam3 = if ((address3Team == "")) | |
192 | + | then nil | |
193 | + | else [ScriptTransfer(addressFromStringValue(address3Team), address3TeamReward, i.payments[0].assetId)] | |
194 | + | let scriptTransferAddress1 = if ((address1Creator == "")) | |
195 | + | then nil | |
196 | + | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
197 | + | let scriptTransferAddress2 = if ((address2Creator == "")) | |
198 | + | then nil | |
199 | + | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
200 | + | let scriptTransferAddress3 = if ((address3Creator == "")) | |
201 | + | then nil | |
202 | + | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
203 | + | let sellerReward = ((((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - address1TeamReward) - address2TeamReward) - address3TeamReward) | |
204 | + | let scriptTransferSeller = if ((seller == "")) | |
205 | + | then nil | |
206 | + | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
207 | + | ((((((scriptTransferAddressTeam1 ++ scriptTransferAddressTeam2) ++ scriptTransferAddressTeam3) ++ scriptTransferAddress1) ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferSeller) | |
208 | + | } | |
205 | 209 | ||
206 | 210 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let oracleKey = "oracleKey" | |
5 | 5 | ||
6 | 6 | func getStr (key) = match getString(this, key) { | |
7 | 7 | case b: String => | |
8 | 8 | b | |
9 | 9 | case _ => | |
10 | 10 | "" | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getInt (key) = match getInteger(this, key) { | |
15 | 15 | case b: Int => | |
16 | 16 | b | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | let oracle = getStr(oracleKey) | |
23 | 23 | ||
24 | 24 | let oracleFee = value(addressFromString(oracle)) | |
25 | 25 | ||
26 | 26 | let sconexDapp = addressFromString(valueOrErrorMessage(getString(oracleFee, "sconexDapp"), "sconexDapp not found")) | |
27 | 27 | ||
28 | 28 | let feeReceiver = valueOrErrorMessage(getString(oracleFee, "feeReceiver"), "feeReceiver not found") | |
29 | 29 | ||
30 | 30 | let allowedDapps = [sconexDapp] | |
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | 33 | func initDapp (dappKey) = if ((i.caller != this)) | |
34 | 34 | then throw("You cannot do this action") | |
35 | 35 | else if ((oracle != "")) | |
36 | 36 | then throw("oracle already set, you can't override!") | |
37 | 37 | else [StringEntry(oracleKey, dappKey)] | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func teamSplitFee (artId,address1,address2,address3,address1Share,address2Share,address3Share) = if (!(containsElement(allowedDapps, i.caller))) | |
43 | 43 | then throw("Not allowed") | |
44 | 44 | else if ((0 > address1Share)) | |
45 | 45 | then throw("Share 1 can't be negative") | |
46 | 46 | else if (if (if ((address1Share != 0)) | |
47 | 47 | then true | |
48 | 48 | else (address1 != "")) | |
49 | 49 | then !(isDefined(addressFromString(address1))) | |
50 | 50 | else false) | |
51 | 51 | then throw("Address 1 is invalid") | |
52 | 52 | else if ((0 > address2Share)) | |
53 | 53 | then throw("Share 2 can't be negative") | |
54 | 54 | else if (if (if ((address2Share != 0)) | |
55 | 55 | then true | |
56 | 56 | else (address2 != "")) | |
57 | 57 | then !(isDefined(addressFromString(address2))) | |
58 | 58 | else false) | |
59 | 59 | then throw("Address 2 is invalid") | |
60 | 60 | else if ((0 > address3Share)) | |
61 | 61 | then throw("Share 3 can't be negative") | |
62 | 62 | else if (if (if ((address3Share != 0)) | |
63 | 63 | then true | |
64 | 64 | else (address3 != "")) | |
65 | 65 | then !(isDefined(addressFromString(address3))) | |
66 | 66 | else false) | |
67 | 67 | then throw("Address 3 is invalid") | |
68 | 68 | else if ((((address1Share + address2Share) + address3Share) != 15)) | |
69 | 69 | then throw("Sum of shares should be equal to 15") | |
70 | 70 | else [StringEntry((artId + "_team_address1"), address1), StringEntry((artId + "_team_address2"), address2), StringEntry((artId + "_team_address3"), address3), IntegerEntry((artId + "_team_share1"), address1Share), IntegerEntry((artId + "_team_share2"), address2Share), IntegerEntry((artId + "_team_share3"), address3Share)] | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | ||
74 | 74 | @Callable(i) | |
75 | 75 | func creatorSplitFee (artId,address1,address2,address3,address1Share,address2Share,address3Share) = if (!(containsElement(allowedDapps, i.caller))) | |
76 | 76 | then throw("Not allowed") | |
77 | 77 | else if ((0 > address1Share)) | |
78 | 78 | then throw("Share 1 can't be negative") | |
79 | 79 | else if (if (if ((address1Share != 0)) | |
80 | 80 | then true | |
81 | 81 | else (address1 != "")) | |
82 | 82 | then !(isDefined(addressFromString(address1))) | |
83 | 83 | else false) | |
84 | 84 | then throw("Address 1 is invalid") | |
85 | 85 | else if ((0 > address2Share)) | |
86 | 86 | then throw("Share 2 can't be negative") | |
87 | 87 | else if (if (if ((address2Share != 0)) | |
88 | 88 | then true | |
89 | 89 | else (address2 != "")) | |
90 | 90 | then !(isDefined(addressFromString(address2))) | |
91 | 91 | else false) | |
92 | 92 | then throw("Address 2 is invalid") | |
93 | 93 | else if ((0 > address3Share)) | |
94 | 94 | then throw("Share 3 can't be negative") | |
95 | 95 | else if (if (if ((address3Share != 0)) | |
96 | 96 | then true | |
97 | 97 | else (address3 != "")) | |
98 | 98 | then !(isDefined(addressFromString(address3))) | |
99 | 99 | else false) | |
100 | 100 | then throw("Address 3 is invalid") | |
101 | 101 | else if ((((address1Share + address2Share) + address3Share) > 85)) | |
102 | 102 | then throw("Sum of shares should be smaller or equal then 85") | |
103 | 103 | else [StringEntry((artId + "_creator_address1"), address1), StringEntry((artId + "_creator_address2"), address2), StringEntry((artId + "_creator_address3"), address3), IntegerEntry((artId + "_creator_share1"), address1Share), IntegerEntry((artId + "_creator_share2"), address2Share), IntegerEntry((artId + "_creator_share3"), address3Share)] | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | 107 | @Callable(i) | |
108 | - | func payFeeResell (txId,seller) = { | |
109 | - | let sconexFeePercentage = 3 | |
110 | - | let amount = value(i.payments[0].amount) | |
111 | - | let assetId = value(i.payments[0].assetId) | |
112 | - | let address1ShareCreator = getInt((txId + "_creator_share1")) | |
113 | - | let address2ShareCreator = getInt((txId + "_creator_share2")) | |
114 | - | let address3ShareCreator = getInt((txId + "_creator_share3")) | |
115 | - | let address1Creator = getStr((txId + "_creator_address1")) | |
116 | - | let address2Creator = getStr((txId + "_creator_address2")) | |
117 | - | let address3Creator = getStr((txId + "_creator_address3")) | |
118 | - | let address1CreatorReward = if ((address1Creator == "")) | |
119 | - | then 0 | |
120 | - | else fraction(amount, address1ShareCreator, 100) | |
121 | - | let address2CreatorReward = if ((address2Creator == "")) | |
122 | - | then 0 | |
123 | - | else fraction(amount, address2ShareCreator, 100) | |
124 | - | let address3CreatorReward = if ((address3Creator == "")) | |
125 | - | then 0 | |
126 | - | else fraction(amount, address3ShareCreator, 100) | |
127 | - | let sconexFeeReward = fraction(amount, sconexFeePercentage, 100) | |
128 | - | let sellerReward = ((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - sconexFeeReward) | |
129 | - | let scriptTransferFeeReceiver = [ScriptTransfer(addressFromStringValue(feeReceiver), sconexFeeReward, i.payments[0].assetId)] | |
130 | - | let scriptTransferAddress1 = if ((address1Creator == "")) | |
131 | - | then nil | |
132 | - | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
133 | - | let scriptTransferAddress2 = if ((address2Creator == "")) | |
134 | - | then nil | |
135 | - | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
136 | - | let scriptTransferAddress3 = if ((address3Creator == "")) | |
137 | - | then nil | |
138 | - | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
139 | - | let scriptTransferSeller = if ((seller == "")) | |
140 | - | then nil | |
141 | - | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
142 | - | ((((scriptTransferAddress1 ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferFeeReceiver) ++ scriptTransferSeller) | |
143 | - | } | |
108 | + | func payFeeResell (txId,seller) = if (!(containsElement(allowedDapps, i.caller))) | |
109 | + | then throw("Not allowed") | |
110 | + | else { | |
111 | + | let sconexFeePercentage = 3 | |
112 | + | let amount = value(i.payments[0].amount) | |
113 | + | let assetId = value(i.payments[0].assetId) | |
114 | + | let address1ShareCreator = getInt((txId + "_creator_share1")) | |
115 | + | let address2ShareCreator = getInt((txId + "_creator_share2")) | |
116 | + | let address3ShareCreator = getInt((txId + "_creator_share3")) | |
117 | + | let address1Creator = getStr((txId + "_creator_address1")) | |
118 | + | let address2Creator = getStr((txId + "_creator_address2")) | |
119 | + | let address3Creator = getStr((txId + "_creator_address3")) | |
120 | + | let address1CreatorReward = if ((address1Creator == "")) | |
121 | + | then 0 | |
122 | + | else fraction(amount, address1ShareCreator, 100) | |
123 | + | let address2CreatorReward = if ((address2Creator == "")) | |
124 | + | then 0 | |
125 | + | else fraction(amount, address2ShareCreator, 100) | |
126 | + | let address3CreatorReward = if ((address3Creator == "")) | |
127 | + | then 0 | |
128 | + | else fraction(amount, address3ShareCreator, 100) | |
129 | + | let sconexFeeReward = fraction(amount, sconexFeePercentage, 100) | |
130 | + | let sellerReward = ((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - sconexFeeReward) | |
131 | + | let scriptTransferFeeReceiver = [ScriptTransfer(addressFromStringValue(feeReceiver), sconexFeeReward, i.payments[0].assetId)] | |
132 | + | let scriptTransferAddress1 = if ((address1Creator == "")) | |
133 | + | then nil | |
134 | + | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
135 | + | let scriptTransferAddress2 = if ((address2Creator == "")) | |
136 | + | then nil | |
137 | + | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
138 | + | let scriptTransferAddress3 = if ((address3Creator == "")) | |
139 | + | then nil | |
140 | + | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
141 | + | let scriptTransferSeller = if ((seller == "")) | |
142 | + | then nil | |
143 | + | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
144 | + | ((((scriptTransferAddress1 ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferFeeReceiver) ++ scriptTransferSeller) | |
145 | + | } | |
144 | 146 | ||
145 | 147 | ||
146 | 148 | ||
147 | 149 | @Callable(i) | |
148 | - | func payFee (txId,seller) = { | |
149 | - | let amount = value(i.payments[0].amount) | |
150 | - | let assetId = value(i.payments[0].assetId) | |
151 | - | let address1ShareTeam = getInt((txId + "_team_share1")) | |
152 | - | let address2ShareTeam = getInt((txId + "_team_share2")) | |
153 | - | let address3ShareTeam = getInt((txId + "_team_share3")) | |
154 | - | let address1Team = getStr((txId + "_team_address1")) | |
155 | - | let address2Team = getStr((txId + "_team_address2")) | |
156 | - | let address3Team = getStr((txId + "_team_address3")) | |
157 | - | let address1ShareCreator = getInt((txId + "_creator_address1")) | |
158 | - | let address2ShareCreator = getInt((txId + "_creator_address2")) | |
159 | - | let address3ShareCreator = getInt((txId + "_creator_address3")) | |
160 | - | let address1Creator = getStr((txId + "_creator_address1")) | |
161 | - | let address2Creator = getStr((txId + "_creator_address2")) | |
162 | - | let address3Creator = getStr((txId + "_creator_address3")) | |
163 | - | let address1TeamReward = if ((address1Team == "")) | |
164 | - | then 0 | |
165 | - | else fraction(amount, address1ShareTeam, 100) | |
166 | - | let address2TeamReward = if ((address2Team == "")) | |
167 | - | then 0 | |
168 | - | else fraction(amount, address2ShareTeam, 100) | |
169 | - | let address3TeamReward = if ((address3Team == "")) | |
170 | - | then 0 | |
171 | - | else fraction(amount, address3ShareTeam, 100) | |
172 | - | let address1CreatorReward = if ((address1Creator == "")) | |
173 | - | then 0 | |
174 | - | else fraction(amount, address1ShareCreator, 100) | |
175 | - | let address2CreatorReward = if ((address2Creator == "")) | |
176 | - | then 0 | |
177 | - | else fraction(amount, address2ShareCreator, 100) | |
178 | - | let address3CreatorReward = if ((address3Creator == "")) | |
179 | - | then 0 | |
180 | - | else fraction(amount, address3ShareCreator, 100) | |
181 | - | let scriptTransferAddressTeam1 = if ((address1Team == "")) | |
182 | - | then nil | |
183 | - | else [ScriptTransfer(addressFromStringValue(address1Team), address1TeamReward, i.payments[0].assetId)] | |
184 | - | let scriptTransferAddressTeam2 = if ((address2Team == "")) | |
185 | - | then nil | |
186 | - | else [ScriptTransfer(addressFromStringValue(address2Team), address2TeamReward, i.payments[0].assetId)] | |
187 | - | let scriptTransferAddressTeam3 = if ((address3Team == "")) | |
188 | - | then nil | |
189 | - | else [ScriptTransfer(addressFromStringValue(address3Team), address3TeamReward, i.payments[0].assetId)] | |
190 | - | let scriptTransferAddress1 = if ((address1Creator == "")) | |
191 | - | then nil | |
192 | - | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
193 | - | let scriptTransferAddress2 = if ((address2Creator == "")) | |
194 | - | then nil | |
195 | - | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
196 | - | let scriptTransferAddress3 = if ((address3Creator == "")) | |
197 | - | then nil | |
198 | - | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
199 | - | let sellerReward = ((((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - address1TeamReward) - address2TeamReward) - address3TeamReward) | |
200 | - | let scriptTransferSeller = if ((seller == "")) | |
201 | - | then nil | |
202 | - | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
203 | - | ((((((scriptTransferAddressTeam1 ++ scriptTransferAddressTeam2) ++ scriptTransferAddressTeam3) ++ scriptTransferAddress1) ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferSeller) | |
204 | - | } | |
150 | + | func payFee (txId,seller) = if (!(containsElement(allowedDapps, i.caller))) | |
151 | + | then throw("Not allowed") | |
152 | + | else { | |
153 | + | let amount = value(i.payments[0].amount) | |
154 | + | let assetId = value(i.payments[0].assetId) | |
155 | + | let address1ShareTeam = getInt((txId + "_team_share1")) | |
156 | + | let address2ShareTeam = getInt((txId + "_team_share2")) | |
157 | + | let address3ShareTeam = getInt((txId + "_team_share3")) | |
158 | + | let address1Team = getStr((txId + "_team_address1")) | |
159 | + | let address2Team = getStr((txId + "_team_address2")) | |
160 | + | let address3Team = getStr((txId + "_team_address3")) | |
161 | + | let address1ShareCreator = getInt((txId + "_creator_address1")) | |
162 | + | let address2ShareCreator = getInt((txId + "_creator_address2")) | |
163 | + | let address3ShareCreator = getInt((txId + "_creator_address3")) | |
164 | + | let address1Creator = getStr((txId + "_creator_address1")) | |
165 | + | let address2Creator = getStr((txId + "_creator_address2")) | |
166 | + | let address3Creator = getStr((txId + "_creator_address3")) | |
167 | + | let address1TeamReward = if ((address1Team == "")) | |
168 | + | then 0 | |
169 | + | else fraction(amount, address1ShareTeam, 100) | |
170 | + | let address2TeamReward = if ((address2Team == "")) | |
171 | + | then 0 | |
172 | + | else fraction(amount, address2ShareTeam, 100) | |
173 | + | let address3TeamReward = if ((address3Team == "")) | |
174 | + | then 0 | |
175 | + | else fraction(amount, address3ShareTeam, 100) | |
176 | + | let address1CreatorReward = if ((address1Creator == "")) | |
177 | + | then 0 | |
178 | + | else fraction(amount, address1ShareCreator, 100) | |
179 | + | let address2CreatorReward = if ((address2Creator == "")) | |
180 | + | then 0 | |
181 | + | else fraction(amount, address2ShareCreator, 100) | |
182 | + | let address3CreatorReward = if ((address3Creator == "")) | |
183 | + | then 0 | |
184 | + | else fraction(amount, address3ShareCreator, 100) | |
185 | + | let scriptTransferAddressTeam1 = if ((address1Team == "")) | |
186 | + | then nil | |
187 | + | else [ScriptTransfer(addressFromStringValue(address1Team), address1TeamReward, i.payments[0].assetId)] | |
188 | + | let scriptTransferAddressTeam2 = if ((address2Team == "")) | |
189 | + | then nil | |
190 | + | else [ScriptTransfer(addressFromStringValue(address2Team), address2TeamReward, i.payments[0].assetId)] | |
191 | + | let scriptTransferAddressTeam3 = if ((address3Team == "")) | |
192 | + | then nil | |
193 | + | else [ScriptTransfer(addressFromStringValue(address3Team), address3TeamReward, i.payments[0].assetId)] | |
194 | + | let scriptTransferAddress1 = if ((address1Creator == "")) | |
195 | + | then nil | |
196 | + | else [ScriptTransfer(addressFromStringValue(address1Creator), address1CreatorReward, i.payments[0].assetId)] | |
197 | + | let scriptTransferAddress2 = if ((address2Creator == "")) | |
198 | + | then nil | |
199 | + | else [ScriptTransfer(addressFromStringValue(address2Creator), address2CreatorReward, i.payments[0].assetId)] | |
200 | + | let scriptTransferAddress3 = if ((address3Creator == "")) | |
201 | + | then nil | |
202 | + | else [ScriptTransfer(addressFromStringValue(address3Creator), address3CreatorReward, i.payments[0].assetId)] | |
203 | + | let sellerReward = ((((((amount - address1CreatorReward) - address2CreatorReward) - address3CreatorReward) - address1TeamReward) - address2TeamReward) - address3TeamReward) | |
204 | + | let scriptTransferSeller = if ((seller == "")) | |
205 | + | then nil | |
206 | + | else [ScriptTransfer(addressFromStringValue(seller), sellerReward, i.payments[0].assetId)] | |
207 | + | ((((((scriptTransferAddressTeam1 ++ scriptTransferAddressTeam2) ++ scriptTransferAddressTeam3) ++ scriptTransferAddress1) ++ scriptTransferAddress2) ++ scriptTransferAddress3) ++ scriptTransferSeller) | |
208 | + | } | |
205 | 209 | ||
206 | 210 |
github/deemru/w8io/026f985 38.30 ms ◑