tx · 5emWUxBihcyW95P7kp2WXAWTSQYqjA6R2F7eS2KYmrtM

3MsfzTgF7FjCGw7bzBUF8rYDG5rjaAQr6Mw:  -0.01400000 Waves

2023.02.21 16:36 [2459479] smart account 3MsfzTgF7FjCGw7bzBUF8rYDG5rjaAQr6Mw > SELF 0.00000000 Waves

{ "type": 13, "id": "5emWUxBihcyW95P7kp2WXAWTSQYqjA6R2F7eS2KYmrtM", "fee": 1400000, "feeAssetId": null, "timestamp": 1676986506343, "version": 2, "chainId": 84, "sender": "3MsfzTgF7FjCGw7bzBUF8rYDG5rjaAQr6Mw", "senderPublicKey": "9hqVMottRorL2RAj5L1Jt8LHtHtJgz46ZQJ6Vvr3bUs2", "proofs": [ "24Xrwg4WwYevKHZ5z19gdJysp2tWFncngT3Zob7vtVQX2ezXwmgKKfa6mmbfJFpxA8PxfzrV8FKmQEvKb2Y5KgV8" ], "script": "base64:BgIzCAISBQoDCAgBEgQKAgEIEgQKAgEYEgMKAQgSAwoBCBIAEgASAwoBCBIECgIBARIDCgEIGwAJU0VQQVJBVE9SAgJfXwAIS0VZX0lOSVQCBElOSVQADEtFWV9NVUxUSVNJRwIITVVMVElTSUcACktFWV9TVEFUVVMCBlNUQVRVUwAKS0VZX01JTlRFUgIGTUlOVEVSAAlLRVlfQVNTRVQCBUFTU0VUABdLRVlfU1BPTlNPUlNISVBfTUFOQUdFUgITU1BPTlNPUlNISVBfTUFOQUdFUgAHTUFYX0lOVAD//////////38BEF92YWxpZGF0ZUFkZHJlc3MCCGFkZHJlc3NfBGVycl8EByRtYXRjaDAJAKYIAQUIYWRkcmVzc18DCQABAgUHJG1hdGNoMAIHQWRkcmVzcwQBYQUHJG1hdGNoMAYJAAIBBQRlcnJfAQ5fdmFsaWRhdGVBc3NldAIIYXNzZXRJZF8EZXJyXwQHJG1hdGNoMAkA7AcBCQDZBAEFCGFzc2V0SWRfAwkAAQIFByRtYXRjaDACBUFzc2V0BAFhBQckbWF0Y2gwBgkAAgEFBGVycl8B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nIJAJQKAgkBDV9zYXZlTXVsdGlzaWcBCQERQGV4dHJOYXRpdmUoMTA2MikBBQltdWx0aXNpZ18FBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAckbWF0Y2gwCQCiCAEFDEtFWV9NVUxUSVNJRwMJAAECBQckbWF0Y2gwAgZTdHJpbmcECG11bHRpc2lnBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCG11bHRpc2lnCQC5CQIJAMwIAgUKS0VZX1NUQVRVUwkAzAgCCQClCAEFBHRoaXMJAMwIAgkA2AQBCAUCdHgCaWQFA25pbAUJU0VQQVJBVE9SBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleeGfu0U=", "height": 2459479, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DiyLy7pbQmv6rGCMR9BrcUKcju6r4Kco8Q9vgiVBo1Sq Next: AZCc9kyAKttbeKGtdFGaKR1Q4ug72cqPfvCECk4SUPuU Diff:
OldNewDifferences
99
1010 let KEY_STATUS = "STATUS"
1111
12-let KEY_PAUSED = "PAUSED"
12+let KEY_MINTER = "MINTER"
1313
14-let KEY_PAUSER = "PAUSER"
14+let KEY_ASSET = "ASSET"
1515
16-let KEY_ADAPTER = "ADAPTER"
17-
18-let FUNC_TAKE_TOKENS = "takeTokens"
16+let KEY_SPONSORSHIP_MANAGER = "SPONSORSHIP_MANAGER"
1917
2018 let MAX_INT = 9223372036854775807
2119
2220 func _validateAddress (address_,err_) = match addressFromString(address_) {
2321 case a: Address =>
22+ true
23+ case _ =>
24+ throw(err_)
25+}
26+
27+
28+func _validateAsset (assetId_,err_) = match assetInfo(fromBase58String(assetId_)) {
29+ case a: Asset =>
2430 true
2531 case _ =>
2632 throw(err_)
4551 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
4652
4753
48-func _loadPause () = match getBoolean(KEY_PAUSED) {
49- case a: Boolean =>
50- a
51- case _ =>
52- false
53-}
54-
55-
56-func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)]
57-
58-
59-func _loadPauser () = match getString(KEY_PAUSER) {
60- case a: String =>
61- addressFromStringValue(a)
62- case _ =>
63- Address(base58'')
64-}
65-
66-
67-func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))]
68-
69-
7054 func _loadMultisig () = match getString(KEY_MULTISIG) {
7155 case a: String =>
7256 addressFromStringValue(a)
7862 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
7963
8064
81-func _loadAdapter (executionChainId_) = match getString(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR)) {
65+func _loadMinter (minter_) = match getBoolean(makeString([KEY_MINTER, toString(minter_)], SEPARATOR)) {
66+ case a: Boolean =>
67+ a
68+ case _ =>
69+ false
70+}
71+
72+
73+func _saveMinter (minter_,val_) = [BooleanEntry(makeString([KEY_MINTER, toString(minter_)], SEPARATOR), val_)]
74+
75+
76+func _loadAsset () = match getString(KEY_ASSET) {
77+ case a: String =>
78+ fromBase58String(a)
79+ case _ =>
80+ base58''
81+}
82+
83+
84+func _saveAsset (assetId_) = [StringEntry(KEY_ASSET, toBase58String(assetId_))]
85+
86+
87+func _loadSponsorshipManager () = match getString(KEY_SPONSORSHIP_MANAGER) {
8288 case a: String =>
8389 addressFromStringValue(a)
8490 case _ =>
8692 }
8793
8894
89-func _saveAdapter (executionChainId_,adapter_) = [StringEntry(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR), toString(adapter_))]
95+func _saveSponsorshipManager (manager_) = [StringEntry(KEY_SPONSORSHIP_MANAGER, toString(manager_))]
96+
97+
98+func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
99+ then throw("_whenMultisigSet: revert")
100+ else true
90101
91102
92103 func _onlyThisContract (caller_) = if ((caller_ != this))
94105 else true
95106
96107
97-func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
98- then throw("_whenMultisigSet: revert")
108+func _onlyMinter (caller_) = if (!(_loadMinter(caller_)))
109+ then throw("_onlyMinter: revert")
110+ else true
111+
112+
113+func _onlySponsorshipManager (caller_) = if ((caller_ != _loadSponsorshipManager()))
114+ then throw("_onlySponsorshipManager: revert")
99115 else true
100116
101117
109125 else true
110126
111127
112-func _whenNotPaused () = if (_loadPause())
113- then throw("_whenNotPaused: revert")
114- else true
115-
116-
117-func _whenPaused () = if (!(_loadPause()))
118- then throw("_whenPaused: revert")
119- else true
120-
121-
122-func _onlyPauser (caller_) = if ((caller_ != _loadPauser()))
123- then throw("_onlyPauser: revert")
124- else true
125-
126-
127128 @Callable(i)
128-func init () = {
129- let err = if (if (_onlyThisContract(i.caller))
129+func init (tokenName_,tokenDescr_,tokenDecimals_) = {
130+ let err = if (if (if (if (if (_onlyThisContract(i.caller))
130131 then _whenNotInitialized()
131132 else false)
132133 then _whenMultisigSet()
134+ else false)
135+ then _validateInt(size(tokenName_), 4, 16, "init: invalid token name")
136+ else false)
137+ then _validateInt(size(tokenDescr_), 0, 255, "init: invalid token description")
138+ else false)
139+ then _validateInt(tokenDecimals_, 0, 8, "init: invalid decimals")
133140 else false
134141 if ((err == err))
135- then $Tuple2(_saveInit(true), unit)
142+ then {
143+ let issue = Issue(tokenName_, tokenDescr_, 0, tokenDecimals_, true)
144+ let assetId = calculateAssetId(issue)
145+ $Tuple2(((_saveInit(true) ++ _saveAsset(assetId)) ++ [issue]), unit)
146+ }
136147 else throw("Strict value is not equal to itself.")
137148 }
138149
139150
140151
141152 @Callable(i)
142-func setAdapter (executionChainId_,adapter_) = {
143- let err = if (if (if (_onlyThisContract(i.caller))
144- then _whenInitialized()
153+func mint (amount_,recipient_) = {
154+ let err = if (if (if (_whenInitialized())
155+ then _onlyMinter(i.caller)
145156 else false)
146- then _validateInt(executionChainId_, 0, MAX_INT, "setAdapter: invalid executionChainId")
157+ then _validateInt(amount_, 0, MAX_INT, "mint: invalid amount")
147158 else false)
148- then _validateAddress(adapter_, "setAdapter: invalid adapter")
159+ then _validateAddress(recipient_, "mint: invalid recipient")
149160 else false
150161 if ((err == err))
151- then $Tuple2(_saveAdapter(executionChainId_, addressFromStringValue(adapter_)), unit)
162+ then {
163+ let asset = _loadAsset()
164+ $Tuple2([Reissue(asset, amount_, true), ScriptTransfer(addressFromStringValue(recipient_), amount_, asset)], unit)
165+ }
152166 else throw("Strict value is not equal to itself.")
153167 }
154168
155169
156170
157171 @Callable(i)
158-func takeTokens (executionChainId_,assetContract_,amount_,recipient_,gaslessReward_,referrer_) = {
159- let adapter = _loadAdapter(executionChainId_)
160- let invocation = invoke(adapter, FUNC_TAKE_TOKENS, [executionChainId_, assetContract_, amount_, recipient_, gaslessReward_, referrer_], nil)
161- if ((invocation == invocation))
162- then $Tuple2(nil, unit)
172+func mintMany (amount_,recipients_) = {
173+ let err = if (if (_whenInitialized())
174+ then _onlyMinter(i.caller)
175+ else false)
176+ then _validateInt(amount_, 0, MAX_INT, "mint: invalid amount")
177+ else false
178+ if ((err == err))
179+ then {
180+ let asset = _loadAsset()
181+ func foldfunc (acc_,elem_) = (acc_ :+ ScriptTransfer(addressFromStringValue(elem_), amount_, asset))
182+
183+ let actions = {
184+ let $l = recipients_
185+ let $s = size($l)
186+ let $acc0 = nil
187+ func $f0_1 ($a,$i) = if (($i >= $s))
188+ then $a
189+ else foldfunc($a, $l[$i])
190+
191+ func $f0_2 ($a,$i) = if (($i >= $s))
192+ then $a
193+ else throw("List size exceeds 51")
194+
195+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51)
196+ }
197+ $Tuple2(([Reissue(asset, (amount_ * size(recipients_)), true)] ++ actions), unit)
198+ }
199+ else throw("Strict value is not equal to itself.")
200+ }
201+
202+
203+
204+@Callable(i)
205+func addMinter (minter_) = {
206+ let err = if (if (_onlyThisContract(i.caller))
207+ then _whenInitialized()
208+ else false)
209+ then _validateAddress(minter_, "init: invalid minter")
210+ else false
211+ if ((err == err))
212+ then $Tuple2(_saveMinter(addressFromStringValue(minter_), true), unit)
213+ else throw("Strict value is not equal to itself.")
214+ }
215+
216+
217+
218+@Callable(i)
219+func removeMinter (minter_) = {
220+ let err = if (if (_onlyThisContract(i.caller))
221+ then _whenInitialized()
222+ else false)
223+ then _validateAddress(minter_, "init: invalid minter")
224+ else false
225+ if ((err == err))
226+ then $Tuple2(_saveMinter(addressFromStringValue(minter_), false), unit)
227+ else throw("Strict value is not equal to itself.")
228+ }
229+
230+
231+
232+@Callable(i)
233+func getAssetId () = $Tuple2(nil, _loadAsset())
234+
235+
236+
237+@Callable(i)
238+func getDecimals () = {
239+ let decimals = match assetInfo(_loadAsset()) {
240+ case a: Asset =>
241+ a.decimals
242+ case _ =>
243+ throw("getDecimals: revert")
244+ }
245+ $Tuple2(nil, decimals)
246+ }
247+
248+
249+
250+@Callable(i)
251+func setSponsorshipManager (manager_) = {
252+ let err = if (_onlyThisContract(i.caller))
253+ then _validateAddress(manager_, "setSponsorshipManager: invalid manager")
254+ else false
255+ if ((err == err))
256+ then $Tuple2(_saveSponsorshipManager(addressFromStringValue(manager_)), unit)
257+ else throw("Strict value is not equal to itself.")
258+ }
259+
260+
261+
262+@Callable(i)
263+func updateSponsorship (minSponsoredAssetFee_,wavesRequiredAmount_) = {
264+ let err = if (if (_onlySponsorshipManager(i.caller))
265+ then _validateInt(minSponsoredAssetFee_, 0, MAX_INT, "updateSponsorship: invalid sponsor fee")
266+ else false)
267+ then _validateInt(wavesRequiredAmount_, 0, MAX_INT, "updateSponsorship: invalid waves required amount")
268+ else false
269+ if ((err == err))
270+ then {
271+ let sponsorAsset = _loadAsset()
272+ let sponsorAmount = assetBalance(this, sponsorAsset)
273+ let minSponsoredAssetFee = if ((minSponsoredAssetFee_ == 0))
274+ then unit
275+ else minSponsoredAssetFee_
276+ let actions = if ((wavesBalance(this).regular > wavesRequiredAmount_))
277+ then [ScriptTransfer(i.caller, (wavesBalance(this).regular - wavesRequiredAmount_), unit)]
278+ else nil
279+ $Tuple2((actions ++ [ScriptTransfer(i.caller, sponsorAmount, sponsorAsset), SponsorFee(sponsorAsset, minSponsoredAssetFee)]), sponsorAmount)
280+ }
163281 else throw("Strict value is not equal to itself.")
164282 }
165283
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEPARATOR = "__"
55
66 let KEY_INIT = "INIT"
77
88 let KEY_MULTISIG = "MULTISIG"
99
1010 let KEY_STATUS = "STATUS"
1111
12-let KEY_PAUSED = "PAUSED"
12+let KEY_MINTER = "MINTER"
1313
14-let KEY_PAUSER = "PAUSER"
14+let KEY_ASSET = "ASSET"
1515
16-let KEY_ADAPTER = "ADAPTER"
17-
18-let FUNC_TAKE_TOKENS = "takeTokens"
16+let KEY_SPONSORSHIP_MANAGER = "SPONSORSHIP_MANAGER"
1917
2018 let MAX_INT = 9223372036854775807
2119
2220 func _validateAddress (address_,err_) = match addressFromString(address_) {
2321 case a: Address =>
22+ true
23+ case _ =>
24+ throw(err_)
25+}
26+
27+
28+func _validateAsset (assetId_,err_) = match assetInfo(fromBase58String(assetId_)) {
29+ case a: Asset =>
2430 true
2531 case _ =>
2632 throw(err_)
2733 }
2834
2935
3036 func _validateInt (val_,lowerBoundary_,upperBoundary_,err_) = if (if ((lowerBoundary_ > val_))
3137 then true
3238 else (val_ > upperBoundary_))
3339 then throw(err_)
3440 else true
3541
3642
3743 func _loadInit () = match getBoolean(KEY_INIT) {
3844 case a: Boolean =>
3945 a
4046 case _ =>
4147 false
4248 }
4349
4450
4551 func _saveInit (isInit_) = [BooleanEntry(KEY_INIT, isInit_)]
4652
4753
48-func _loadPause () = match getBoolean(KEY_PAUSED) {
49- case a: Boolean =>
50- a
51- case _ =>
52- false
53-}
54-
55-
56-func _savePause (isPaused_) = [BooleanEntry(KEY_PAUSED, isPaused_)]
57-
58-
59-func _loadPauser () = match getString(KEY_PAUSER) {
60- case a: String =>
61- addressFromStringValue(a)
62- case _ =>
63- Address(base58'')
64-}
65-
66-
67-func _savePauser (pauser_) = [StringEntry(KEY_PAUSER, toString(pauser_))]
68-
69-
7054 func _loadMultisig () = match getString(KEY_MULTISIG) {
7155 case a: String =>
7256 addressFromStringValue(a)
7357 case _ =>
7458 Address(base58'')
7559 }
7660
7761
7862 func _saveMultisig (multisig_) = [StringEntry(KEY_MULTISIG, toString(multisig_))]
7963
8064
81-func _loadAdapter (executionChainId_) = match getString(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR)) {
65+func _loadMinter (minter_) = match getBoolean(makeString([KEY_MINTER, toString(minter_)], SEPARATOR)) {
66+ case a: Boolean =>
67+ a
68+ case _ =>
69+ false
70+}
71+
72+
73+func _saveMinter (minter_,val_) = [BooleanEntry(makeString([KEY_MINTER, toString(minter_)], SEPARATOR), val_)]
74+
75+
76+func _loadAsset () = match getString(KEY_ASSET) {
77+ case a: String =>
78+ fromBase58String(a)
79+ case _ =>
80+ base58''
81+}
82+
83+
84+func _saveAsset (assetId_) = [StringEntry(KEY_ASSET, toBase58String(assetId_))]
85+
86+
87+func _loadSponsorshipManager () = match getString(KEY_SPONSORSHIP_MANAGER) {
8288 case a: String =>
8389 addressFromStringValue(a)
8490 case _ =>
8591 Address(base58'')
8692 }
8793
8894
89-func _saveAdapter (executionChainId_,adapter_) = [StringEntry(makeString([KEY_ADAPTER, toString(executionChainId_)], SEPARATOR), toString(adapter_))]
95+func _saveSponsorshipManager (manager_) = [StringEntry(KEY_SPONSORSHIP_MANAGER, toString(manager_))]
96+
97+
98+func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
99+ then throw("_whenMultisigSet: revert")
100+ else true
90101
91102
92103 func _onlyThisContract (caller_) = if ((caller_ != this))
93104 then throw("_onlyThisContract: revert")
94105 else true
95106
96107
97-func _whenMultisigSet () = if ((_loadMultisig() == Address(base58'')))
98- then throw("_whenMultisigSet: revert")
108+func _onlyMinter (caller_) = if (!(_loadMinter(caller_)))
109+ then throw("_onlyMinter: revert")
110+ else true
111+
112+
113+func _onlySponsorshipManager (caller_) = if ((caller_ != _loadSponsorshipManager()))
114+ then throw("_onlySponsorshipManager: revert")
99115 else true
100116
101117
102118 func _whenNotInitialized () = if (_loadInit())
103119 then throw("_whenNotInitialized: revert")
104120 else true
105121
106122
107123 func _whenInitialized () = if (!(_loadInit()))
108124 then throw("_whenInitialized: revert")
109125 else true
110126
111127
112-func _whenNotPaused () = if (_loadPause())
113- then throw("_whenNotPaused: revert")
114- else true
115-
116-
117-func _whenPaused () = if (!(_loadPause()))
118- then throw("_whenPaused: revert")
119- else true
120-
121-
122-func _onlyPauser (caller_) = if ((caller_ != _loadPauser()))
123- then throw("_onlyPauser: revert")
124- else true
125-
126-
127128 @Callable(i)
128-func init () = {
129- let err = if (if (_onlyThisContract(i.caller))
129+func init (tokenName_,tokenDescr_,tokenDecimals_) = {
130+ let err = if (if (if (if (if (_onlyThisContract(i.caller))
130131 then _whenNotInitialized()
131132 else false)
132133 then _whenMultisigSet()
134+ else false)
135+ then _validateInt(size(tokenName_), 4, 16, "init: invalid token name")
136+ else false)
137+ then _validateInt(size(tokenDescr_), 0, 255, "init: invalid token description")
138+ else false)
139+ then _validateInt(tokenDecimals_, 0, 8, "init: invalid decimals")
133140 else false
134141 if ((err == err))
135- then $Tuple2(_saveInit(true), unit)
142+ then {
143+ let issue = Issue(tokenName_, tokenDescr_, 0, tokenDecimals_, true)
144+ let assetId = calculateAssetId(issue)
145+ $Tuple2(((_saveInit(true) ++ _saveAsset(assetId)) ++ [issue]), unit)
146+ }
136147 else throw("Strict value is not equal to itself.")
137148 }
138149
139150
140151
141152 @Callable(i)
142-func setAdapter (executionChainId_,adapter_) = {
143- let err = if (if (if (_onlyThisContract(i.caller))
144- then _whenInitialized()
153+func mint (amount_,recipient_) = {
154+ let err = if (if (if (_whenInitialized())
155+ then _onlyMinter(i.caller)
145156 else false)
146- then _validateInt(executionChainId_, 0, MAX_INT, "setAdapter: invalid executionChainId")
157+ then _validateInt(amount_, 0, MAX_INT, "mint: invalid amount")
147158 else false)
148- then _validateAddress(adapter_, "setAdapter: invalid adapter")
159+ then _validateAddress(recipient_, "mint: invalid recipient")
149160 else false
150161 if ((err == err))
151- then $Tuple2(_saveAdapter(executionChainId_, addressFromStringValue(adapter_)), unit)
162+ then {
163+ let asset = _loadAsset()
164+ $Tuple2([Reissue(asset, amount_, true), ScriptTransfer(addressFromStringValue(recipient_), amount_, asset)], unit)
165+ }
152166 else throw("Strict value is not equal to itself.")
153167 }
154168
155169
156170
157171 @Callable(i)
158-func takeTokens (executionChainId_,assetContract_,amount_,recipient_,gaslessReward_,referrer_) = {
159- let adapter = _loadAdapter(executionChainId_)
160- let invocation = invoke(adapter, FUNC_TAKE_TOKENS, [executionChainId_, assetContract_, amount_, recipient_, gaslessReward_, referrer_], nil)
161- if ((invocation == invocation))
162- then $Tuple2(nil, unit)
172+func mintMany (amount_,recipients_) = {
173+ let err = if (if (_whenInitialized())
174+ then _onlyMinter(i.caller)
175+ else false)
176+ then _validateInt(amount_, 0, MAX_INT, "mint: invalid amount")
177+ else false
178+ if ((err == err))
179+ then {
180+ let asset = _loadAsset()
181+ func foldfunc (acc_,elem_) = (acc_ :+ ScriptTransfer(addressFromStringValue(elem_), amount_, asset))
182+
183+ let actions = {
184+ let $l = recipients_
185+ let $s = size($l)
186+ let $acc0 = nil
187+ func $f0_1 ($a,$i) = if (($i >= $s))
188+ then $a
189+ else foldfunc($a, $l[$i])
190+
191+ func $f0_2 ($a,$i) = if (($i >= $s))
192+ then $a
193+ else throw("List size exceeds 51")
194+
195+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51)
196+ }
197+ $Tuple2(([Reissue(asset, (amount_ * size(recipients_)), true)] ++ actions), unit)
198+ }
199+ else throw("Strict value is not equal to itself.")
200+ }
201+
202+
203+
204+@Callable(i)
205+func addMinter (minter_) = {
206+ let err = if (if (_onlyThisContract(i.caller))
207+ then _whenInitialized()
208+ else false)
209+ then _validateAddress(minter_, "init: invalid minter")
210+ else false
211+ if ((err == err))
212+ then $Tuple2(_saveMinter(addressFromStringValue(minter_), true), unit)
213+ else throw("Strict value is not equal to itself.")
214+ }
215+
216+
217+
218+@Callable(i)
219+func removeMinter (minter_) = {
220+ let err = if (if (_onlyThisContract(i.caller))
221+ then _whenInitialized()
222+ else false)
223+ then _validateAddress(minter_, "init: invalid minter")
224+ else false
225+ if ((err == err))
226+ then $Tuple2(_saveMinter(addressFromStringValue(minter_), false), unit)
227+ else throw("Strict value is not equal to itself.")
228+ }
229+
230+
231+
232+@Callable(i)
233+func getAssetId () = $Tuple2(nil, _loadAsset())
234+
235+
236+
237+@Callable(i)
238+func getDecimals () = {
239+ let decimals = match assetInfo(_loadAsset()) {
240+ case a: Asset =>
241+ a.decimals
242+ case _ =>
243+ throw("getDecimals: revert")
244+ }
245+ $Tuple2(nil, decimals)
246+ }
247+
248+
249+
250+@Callable(i)
251+func setSponsorshipManager (manager_) = {
252+ let err = if (_onlyThisContract(i.caller))
253+ then _validateAddress(manager_, "setSponsorshipManager: invalid manager")
254+ else false
255+ if ((err == err))
256+ then $Tuple2(_saveSponsorshipManager(addressFromStringValue(manager_)), unit)
257+ else throw("Strict value is not equal to itself.")
258+ }
259+
260+
261+
262+@Callable(i)
263+func updateSponsorship (minSponsoredAssetFee_,wavesRequiredAmount_) = {
264+ let err = if (if (_onlySponsorshipManager(i.caller))
265+ then _validateInt(minSponsoredAssetFee_, 0, MAX_INT, "updateSponsorship: invalid sponsor fee")
266+ else false)
267+ then _validateInt(wavesRequiredAmount_, 0, MAX_INT, "updateSponsorship: invalid waves required amount")
268+ else false
269+ if ((err == err))
270+ then {
271+ let sponsorAsset = _loadAsset()
272+ let sponsorAmount = assetBalance(this, sponsorAsset)
273+ let minSponsoredAssetFee = if ((minSponsoredAssetFee_ == 0))
274+ then unit
275+ else minSponsoredAssetFee_
276+ let actions = if ((wavesBalance(this).regular > wavesRequiredAmount_))
277+ then [ScriptTransfer(i.caller, (wavesBalance(this).regular - wavesRequiredAmount_), unit)]
278+ else nil
279+ $Tuple2((actions ++ [ScriptTransfer(i.caller, sponsorAmount, sponsorAsset), SponsorFee(sponsorAsset, minSponsoredAssetFee)]), sponsorAmount)
280+ }
163281 else throw("Strict value is not equal to itself.")
164282 }
165283
166284
167285
168286 @Callable(i)
169287 func setMultisig (multisig_) = {
170288 let err = if (_onlyThisContract(i.caller))
171289 then _validateAddress(multisig_, "setMultisig: invalid multisig")
172290 else false
173291 if ((err == err))
174292 then $Tuple2(_saveMultisig(addressFromStringValue(multisig_)), unit)
175293 else throw("Strict value is not equal to itself.")
176294 }
177295
178296
179297 @Verifier(tx)
180298 func verify () = match getString(KEY_MULTISIG) {
181299 case multisig: String =>
182300 valueOrElse(getBoolean(addressFromStringValue(multisig), makeString([KEY_STATUS, toString(this), toBase58String(tx.id)], SEPARATOR)), false)
183301 case _ =>
184302 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
185303 }
186304

github/deemru/w8io/169f3d6 
47.68 ms