tx · GHUr75suPFacRdHFdTxxUrGdvcRBUCgi7Z7QfdfSAdCL

3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK:  -0.00600000 Waves

2022.08.27 23:17 [2203352] smart account 3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK > SELF 0.00000000 Waves

{ "type": 13, "id": "GHUr75suPFacRdHFdTxxUrGdvcRBUCgi7Z7QfdfSAdCL", "fee": 600000, "feeAssetId": null, "timestamp": 1661631461421, "version": 2, "chainId": 84, "sender": "3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK", "senderPublicKey": "HMzDczZUThMMhE2Grm1ZmpN3QNZ9N7CUCYnsqh4utSDJ", "proofs": [ "2VLHepm3qFYNbwD4KPPPe3rY3B4k6EsCs6TDHA5ZVY2sHP83Pj3WbbRhXRP6xhU1uNEV9gNDjipSDbVKpm8iFxxp" ], "script": "base64:BgIYCAISABIAEgMKAQESAwoBARIAEgASABIABgAEdXNkbgEg11KRGPRfT6VehNuJvBkobHB7OMalzc+gLp7N2ofv42AABHVzZGMBIPQcuTcYg4l4Uh6IaJaLWyiuNgmUbeQfgPZEel3eCXgMAAxhZG1pbl93YWxsZXQCIzNOM0RDbmdqaWRpdmtKYlRKd0ZURXZiWVJUZmZDV1ZCTENMAA5hbGZhcmtfdGVzdG5ldAAFAAp2aXJlc19kYXBwARoBVHjn3floRCovnhXY1SHCQGibEg7rsYrFrAENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAgBaQEPYnV5X3VzZG5fdGlja2V0AAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdXNkbgkAAgECH1BsZWFzZSBkZXBvc2l0IFVTRC1OIHRva2VuIG9ubHkEC3VzZXJfY3JlZGl0CQENdHJ5R2V0SW50ZWdlcgEJAKwCAgkArAICAgV1c2Ru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Prev: B61NsM2LhKBSU36wXvVVABFLrQRefJLUhC3ETXyGT2Bi Next: 5Ycjr7zDvSnC97yakyTgq9HZtnVpZWAF6tpM996uvy28 Diff:
OldNewDifferences
2828 let new_user_credit = (user_credit + deposit_amount)
2929 let all_credit = tryGetInteger("usdn_all_credit")
3030 let new_all_credit = (all_credit + deposit_amount)
31- let transaction_block = match transactionHeightById(i.transactionId) {
31+ let transaction_block = match lastBlock.height {
3232 case a: Int =>
3333 a
3434 case _ =>
35- throw("Error block number")
35+ throw("Error! with blochchain height")
3636 }
3737 let res = invoke(Address(vires_dapp), "usdN_stake", nil, [AttachedPayment(usdn, deposit_amount)])
3838 if ((res == res))
39- then {
40- let vires_res = match res {
41- case r: List[Any] =>
42- r
43- case _ =>
44- throw()
45- }
46- if ((vires_res == vires_res))
47- then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
48- else throw("Strict value is not equal to itself.")
49- }
39+ then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
5040 else throw("Strict value is not equal to itself.")
5141 }
5242
6151 let new_user_credit = (user_credit + deposit_amount)
6252 let all_credit = tryGetInteger("usdc_all_credit")
6353 let new_all_credit = (all_credit + deposit_amount)
64- let transaction_block = match transactionHeightById(i.transactionId) {
54+ let transaction_block = match lastBlock.height {
6555 case a: Int =>
6656 a
6757 case _ =>
6959 }
7060 let res = invoke(Address(vires_dapp), "usdC_stake", nil, [AttachedPayment(usdc, deposit_amount)])
7161 if ((res == res))
72- then {
73- let vires_res = match res {
74- case r: List[Any] =>
75- r
76- case _ =>
77- throw("Incorrect invoke result")
78- }
79- if ((vires_res == vires_res))
80- then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
81- else throw("Strict value is not equal to itself.")
82- }
62+ then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
8363 else throw("Strict value is not equal to itself.")
8464 }
8565
9474 let new_user_credit = (user_credit - amount)
9575 let all_credit = tryGetInteger("usdn_all_credit")
9676 let new_all_credit = (all_credit - amount)
97- let transaction_block = match transactionHeightById(i.transactionId) {
77+ let transaction_block = match lastBlock.height {
9878 case a: Int =>
9979 a
10080 case _ =>
10282 }
10383 let res = invoke(Address(vires_dapp), "usdN_cancelStake", [amount], nil)
10484 if ((res == res))
105- then {
106- let vires_res = match res {
107- case r: List[Any] =>
108- r
109- case _ =>
110- throw("Incorrect invoke result")
111- }
112- if ((vires_res == vires_res))
113- then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
114- else throw("Strict value is not equal to itself.")
115- }
85+ then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
11686 else throw("Strict value is not equal to itself.")
11787 }
11888 }
12898 let new_user_credit = (user_credit - amount)
12999 let all_credit = tryGetInteger("usdc_all_credit")
130100 let new_all_credit = (all_credit - amount)
131- let transaction_block = match transactionHeightById(i.transactionId) {
101+ let transaction_block = match lastBlock.height {
132102 case a: Int =>
133103 a
134104 case _ =>
136106 }
137107 let res = invoke(Address(vires_dapp), "usdC_cancelStake", [amount], nil)
138108 if ((res == res))
139- then {
140- let vires_res = match res {
141- case r: List[Any] =>
142- r
143- case _ =>
144- throw("Incorrect invoke result")
145- }
146- if ((vires_res == vires_res))
147- then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
148- else throw("Strict value is not equal to itself.")
149- }
109+ then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
150110 else throw("Strict value is not equal to itself.")
151111 }
152112 }
159119 else {
160120 let usdn_profit_last_block = tryGetInteger("usdn_profit_last_block")
161121 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
162- let transaction_block = match transactionHeightById(i.transactionId) {
122+ let transaction_block = match lastBlock.height {
163123 case a: Int =>
164124 a
165125 case _ =>
195155 else {
196156 let usdc_profit_last_block = tryGetInteger("usdc_profit_last_block")
197157 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
198- let transaction_block = match transactionHeightById(i.transactionId) {
158+ let transaction_block = match lastBlock.height {
199159 case a: Int =>
200160 a
201161 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let usdn = base58'FVXgJ86erBw5GAMeAw1CnYXwQn48BFAEAhRyHPUjbMQB'
55
66 let usdc = base58'HRut8ESAGXxwvsKJky1V96qRtqyXQd4Apq4GY7TE5yGP'
77
88 let admin_wallet = "3N3DCngjidivkJbTJwFTEvbYRTffCWVBLCL"
99
1010 let alfark_testnet = 5
1111
1212 let vires_dapp = base58'3MzwNdM8LQZEPXq3d4uXvxeZGpBwVQXs9RD'
1313
1414 func tryGetInteger (key) = match getInteger(this, key) {
1515 case b: Int =>
1616 b
1717 case _ =>
1818 0
1919 }
2020
2121
2222 @Callable(i)
2323 func buy_usdn_ticket () = if ((i.payments[0].assetId != usdn))
2424 then throw("Please deposit USD-N token only")
2525 else {
2626 let user_credit = tryGetInteger((("usdn_" + toString(i.originCaller)) + "_credit"))
2727 let deposit_amount = i.payments[0].amount
2828 let new_user_credit = (user_credit + deposit_amount)
2929 let all_credit = tryGetInteger("usdn_all_credit")
3030 let new_all_credit = (all_credit + deposit_amount)
31- let transaction_block = match transactionHeightById(i.transactionId) {
31+ let transaction_block = match lastBlock.height {
3232 case a: Int =>
3333 a
3434 case _ =>
35- throw("Error block number")
35+ throw("Error! with blochchain height")
3636 }
3737 let res = invoke(Address(vires_dapp), "usdN_stake", nil, [AttachedPayment(usdn, deposit_amount)])
3838 if ((res == res))
39- then {
40- let vires_res = match res {
41- case r: List[Any] =>
42- r
43- case _ =>
44- throw()
45- }
46- if ((vires_res == vires_res))
47- then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
48- else throw("Strict value is not equal to itself.")
49- }
39+ then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
5040 else throw("Strict value is not equal to itself.")
5141 }
5242
5343
5444
5545 @Callable(i)
5646 func buy_usdc_ticket () = if ((i.payments[0].assetId != usdc))
5747 then throw("Please deposit USD-N token only")
5848 else {
5949 let user_credit = tryGetInteger((("usdc_" + toString(i.originCaller)) + "_credit"))
6050 let deposit_amount = i.payments[0].amount
6151 let new_user_credit = (user_credit + deposit_amount)
6252 let all_credit = tryGetInteger("usdc_all_credit")
6353 let new_all_credit = (all_credit + deposit_amount)
64- let transaction_block = match transactionHeightById(i.transactionId) {
54+ let transaction_block = match lastBlock.height {
6555 case a: Int =>
6656 a
6757 case _ =>
6858 throw("Error block number")
6959 }
7060 let res = invoke(Address(vires_dapp), "usdC_stake", nil, [AttachedPayment(usdc, deposit_amount)])
7161 if ((res == res))
72- then {
73- let vires_res = match res {
74- case r: List[Any] =>
75- r
76- case _ =>
77- throw("Incorrect invoke result")
78- }
79- if ((vires_res == vires_res))
80- then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
81- else throw("Strict value is not equal to itself.")
82- }
62+ then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
8363 else throw("Strict value is not equal to itself.")
8464 }
8565
8666
8767
8868 @Callable(i)
8969 func sell_usdn_ticket (amount) = {
9070 let user_credit = tryGetInteger((("usdn_" + toString(i.originCaller)) + "_credit"))
9171 if ((amount > user_credit))
9272 then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(user_credit)))
9373 else {
9474 let new_user_credit = (user_credit - amount)
9575 let all_credit = tryGetInteger("usdn_all_credit")
9676 let new_all_credit = (all_credit - amount)
97- let transaction_block = match transactionHeightById(i.transactionId) {
77+ let transaction_block = match lastBlock.height {
9878 case a: Int =>
9979 a
10080 case _ =>
10181 throw("Error block number")
10282 }
10383 let res = invoke(Address(vires_dapp), "usdN_cancelStake", [amount], nil)
10484 if ((res == res))
105- then {
106- let vires_res = match res {
107- case r: List[Any] =>
108- r
109- case _ =>
110- throw("Incorrect invoke result")
111- }
112- if ((vires_res == vires_res))
113- then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
114- else throw("Strict value is not equal to itself.")
115- }
85+ then [IntegerEntry((("usdn_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdn_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdn_all_credit", new_all_credit), IntegerEntry("usdn_all_block", transaction_block)]
11686 else throw("Strict value is not equal to itself.")
11787 }
11888 }
11989
12090
12191
12292 @Callable(i)
12393 func sell_usdc_ticket (amount) = {
12494 let user_credit = tryGetInteger((("usdc_" + toString(i.originCaller)) + "_credit"))
12595 if ((amount > user_credit))
12696 then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(user_credit)))
12797 else {
12898 let new_user_credit = (user_credit - amount)
12999 let all_credit = tryGetInteger("usdc_all_credit")
130100 let new_all_credit = (all_credit - amount)
131- let transaction_block = match transactionHeightById(i.transactionId) {
101+ let transaction_block = match lastBlock.height {
132102 case a: Int =>
133103 a
134104 case _ =>
135105 throw("Error block number")
136106 }
137107 let res = invoke(Address(vires_dapp), "usdC_cancelStake", [amount], nil)
138108 if ((res == res))
139- then {
140- let vires_res = match res {
141- case r: List[Any] =>
142- r
143- case _ =>
144- throw("Incorrect invoke result")
145- }
146- if ((vires_res == vires_res))
147- then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
148- else throw("Strict value is not equal to itself.")
149- }
109+ then [IntegerEntry((("usdc_" + toString(i.originCaller)) + "_credit"), new_user_credit), IntegerEntry((("usdc_" + toString(i.originCaller)) + "_block"), transaction_block), IntegerEntry("usdc_all_credit", new_all_credit), IntegerEntry("usdc_all_block", transaction_block)]
150110 else throw("Strict value is not equal to itself.")
151111 }
152112 }
153113
154114
155115
156116 @Callable(i)
157117 func usdn_calc_profit_amount () = if ((toString(i.originCaller) != admin_wallet))
158118 then throw("Sorry! you are not allowed to use this funaction")
159119 else {
160120 let usdn_profit_last_block = tryGetInteger("usdn_profit_last_block")
161121 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
162- let transaction_block = match transactionHeightById(i.transactionId) {
122+ let transaction_block = match lastBlock.height {
163123 case a: Int =>
164124 a
165125 case _ =>
166126 throw("Error block number")
167127 }
168128 let alfark = (transaction_block - usdn_profit_last_block)
169129 if ((alfark_testnet > alfark))
170130 then throw((("Please try again after " + toString((alfark_testnet - alfark))) + " block"))
171131 else {
172132 let usdn_balance = assetBalance(this, usdn)
173133 [IntegerEntry("usdn_profit_last_block", transaction_block), IntegerEntry("usdn_profit_last_amount", usdn_balance)]
174134 }
175135 }
176136
177137
178138
179139 @Callable(i)
180140 func usdn_send_profit_amount () = {
181141 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
182142 if ((0 >= usdn_profit_last_amount))
183143 then throw(("you dont have profit amount " + toString(usdn_profit_last_amount)))
184144 else {
185145 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdn_profit_last_amount, usdn)
186146 [transfer]
187147 }
188148 }
189149
190150
191151
192152 @Callable(i)
193153 func usdc_calc_profit_amount () = if ((toString(i.originCaller) != admin_wallet))
194154 then throw("Sorry! you are not allowed to use this funaction")
195155 else {
196156 let usdc_profit_last_block = tryGetInteger("usdc_profit_last_block")
197157 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
198- let transaction_block = match transactionHeightById(i.transactionId) {
158+ let transaction_block = match lastBlock.height {
199159 case a: Int =>
200160 a
201161 case _ =>
202162 throw("Error block number")
203163 }
204164 let alfark = (transaction_block - usdc_profit_last_block)
205165 if ((alfark_testnet > alfark))
206166 then throw((("Please try again after " + toString((alfark_testnet - alfark))) + " block"))
207167 else {
208168 let usdc_balance = assetBalance(this, usdc)
209169 [IntegerEntry("usdc_profit_last_block", transaction_block), IntegerEntry("usdc_profit_last_amount", usdc_balance)]
210170 }
211171 }
212172
213173
214174
215175 @Callable(i)
216176 func usdc_send_profit_amount () = {
217177 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
218178 if ((0 >= usdc_profit_last_amount))
219179 then throw(("you dont have profit amount " + toString(usdc_profit_last_amount)))
220180 else {
221181 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdc_profit_last_amount, usdc)
222182 [transfer]
223183 }
224184 }
225185
226186
227187 @Verifier(tx)
228188 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
229189

github/deemru/w8io/169f3d6 
37.19 ms