tx · B61NsM2LhKBSU36wXvVVABFLrQRefJLUhC3ETXyGT2Bi

3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK:  -0.00700000 Waves

2022.08.27 23:16 [2203351] smart account 3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK > SELF 0.00000000 Waves

{ "type": 13, "id": "B61NsM2LhKBSU36wXvVVABFLrQRefJLUhC3ETXyGT2Bi", "fee": 700000, "feeAssetId": null, "timestamp": 1661631407349, "version": 2, "chainId": 84, "sender": "3NA2sejUzEcL7Gg8WfhrcqxP22fHk2SS9pK", "senderPublicKey": "HMzDczZUThMMhE2Grm1ZmpN3QNZ9N7CUCYnsqh4utSDJ", "proofs": [ "3UjfkWT8mRonzmmBXb7swKCJVjxdEQCWNd8mAP1ie6iqcL8qgYZGUDKMUUBUaHsDCT58BcoMxXpwX6awrKBp2ykD" ], "script": "base64:BgIYCAISABIAEgMKAQESAwoBARIAEgASABIABgAEdXNkbgEg11KRGPRfT6VehNuJvBkobHB7OMalzc+gLp7N2ofv42AABHVzZGMBIPQcuTcYg4l4Uh6IaJaLWyiuNgmUbeQfgPZEel3eCXgMAAxhZG1pbl93YWxsZXQCIzNOM0RDbmdqaWRpdmtKYlRKd0ZURXZiWVJUZmZDV1ZCTENMAA5hbGZhcmtfdGVzdG5ldAAFAAp2aXJlc19kYXBwARoBVHjn3floRCovnhXY1SHCQGibEg7rsYrFrAENdHJ5R2V0SW50ZWdlcgEDa2V5BAckbWF0Y2gwCQCaCAIFBHRoaXMFA2tleQMJAAECBQckbWF0Y2gwAgNJbnQEAWIFByRtYXRjaDAFAWIAAAgBaQEPYnV5X3VzZG5fdGlja2V0AAMJAQIhPQIICQCRAwIIBQFpCHBheW1lbnRzAAAHYXNzZXRJZAUEdXNkbgkAAgECH1BsZWFzZSBkZXBvc2l0IFVTRC1OIHRva2VuIG9ubHkEC3VzZXJfY3JlZGl0CQENdHJ5R2V0SW50ZWdlcgEJAKwCAgkArAICAgV1c2RuXwkApQ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QCkAwEJAGUCBQ5hbGZhcmtfdGVzdG5ldAUGYWxmYXJrAgYgYmxvY2sEDHVzZGNfYmFsYW5jZQkA8AcCBQR0aGlzBQR1c2RjCQDMCAIJAQxJbnRlZ2VyRW50cnkCAhZ1c2RjX3Byb2ZpdF9sYXN0X2Jsb2NrBRF0cmFuc2FjdGlvbl9ibG9jawkAzAgCCQEMSW50ZWdlckVudHJ5AgIXdXNkY19wcm9maXRfbGFzdF9hbW91bnQFDHVzZGNfYmFsYW5jZQUDbmlsAWkBF3VzZGNfc2VuZF9wcm9maXRfYW1vdW50AAQXdXNkY19wcm9maXRfbGFzdF9hbW91bnQJAQ10cnlHZXRJbnRlZ2VyAQIXdXNkY19wcm9maXRfbGFzdF9hbW91bnQDCQBnAgAABRd1c2RjX3Byb2ZpdF9sYXN0X2Ftb3VudAkAAgEJAKwCAgIceW91IGRvbnQgaGF2ZSBwcm9maXQgYW1vdW50IAkApAMBBRd1c2RjX3Byb2ZpdF9sYXN0X2Ftb3VudAQIdHJhbnNmZXIJAQ5TY3JpcHRUcmFuc2ZlcgMJARFAZXh0ck5hdGl2ZSgxMDYyKQEFDGFkbWluX3dhbGxldAUXdXNkY19wcm9maXRfbGFzdF9hbW91bnQFBHVzZGMJAMwIAgUIdHJhbnNmZXIFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXktXhFB", "height": 2203351, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BdxWrYCnJJezNwhL7WGAjXUKWAWLuV23ZzPPHkUHNjpf Next: GHUr75suPFacRdHFdTxxUrGdvcRBUCgi7Z7QfdfSAdCL 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 lastBlock.height {
31+ let transaction_block = match transactionHeightById(i.transactionId) {
3232 case a: Int =>
3333 a
3434 case _ =>
35- throw("Error! with blochchain height")
35+ throw("Error block number")
3636 }
3737 let res = invoke(Address(vires_dapp), "usdN_stake", nil, [AttachedPayment(usdn, deposit_amount)])
3838 if ((res == res))
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)]
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+ }
4050 else throw("Strict value is not equal to itself.")
4151 }
4252
5161 let new_user_credit = (user_credit + deposit_amount)
5262 let all_credit = tryGetInteger("usdc_all_credit")
5363 let new_all_credit = (all_credit + deposit_amount)
54- let transaction_block = match lastBlock.height {
64+ let transaction_block = match transactionHeightById(i.transactionId) {
5565 case a: Int =>
5666 a
5767 case _ =>
5969 }
6070 let res = invoke(Address(vires_dapp), "usdC_stake", nil, [AttachedPayment(usdc, deposit_amount)])
6171 if ((res == res))
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)]
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+ }
6383 else throw("Strict value is not equal to itself.")
6484 }
6585
6686
6787
6888 @Callable(i)
69-func sell_usdn_ticket (user_amount) = {
70- let amount = match user_amount {
71- case int: Int =>
72- int
73- case _ =>
74- 0
75- }
89+func sell_usdn_ticket (amount) = {
7690 let user_credit = tryGetInteger((("usdn_" + toString(i.originCaller)) + "_credit"))
7791 if ((amount > user_credit))
7892 then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(user_credit)))
8094 let new_user_credit = (user_credit - amount)
8195 let all_credit = tryGetInteger("usdn_all_credit")
8296 let new_all_credit = (all_credit - amount)
83- let transaction_block = match lastBlock.height {
97+ let transaction_block = match transactionHeightById(i.transactionId) {
8498 case a: Int =>
8599 a
86100 case _ =>
88102 }
89103 let res = invoke(Address(vires_dapp), "usdN_cancelStake", [amount], nil)
90104 if ((res == res))
91- 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)]
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+ }
92116 else throw("Strict value is not equal to itself.")
93117 }
94118 }
104128 let new_user_credit = (user_credit - amount)
105129 let all_credit = tryGetInteger("usdc_all_credit")
106130 let new_all_credit = (all_credit - amount)
107- let transaction_block = match lastBlock.height {
131+ let transaction_block = match transactionHeightById(i.transactionId) {
108132 case a: Int =>
109133 a
110134 case _ =>
112136 }
113137 let res = invoke(Address(vires_dapp), "usdC_cancelStake", [amount], nil)
114138 if ((res == res))
115- 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)]
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+ }
116150 else throw("Strict value is not equal to itself.")
117151 }
118152 }
125159 else {
126160 let usdn_profit_last_block = tryGetInteger("usdn_profit_last_block")
127161 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
128- let transaction_block = match lastBlock.height {
162+ let transaction_block = match transactionHeightById(i.transactionId) {
129163 case a: Int =>
130164 a
131165 case _ =>
149183 then throw(("you dont have profit amount " + toString(usdn_profit_last_amount)))
150184 else {
151185 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdn_profit_last_amount, usdn)
152-[IntegerEntry("usdn_profit_last_amount", 0), transfer]
186+[transfer]
153187 }
154188 }
155189
161195 else {
162196 let usdc_profit_last_block = tryGetInteger("usdc_profit_last_block")
163197 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
164- let transaction_block = match lastBlock.height {
198+ let transaction_block = match transactionHeightById(i.transactionId) {
165199 case a: Int =>
166200 a
167201 case _ =>
185219 then throw(("you dont have profit amount " + toString(usdc_profit_last_amount)))
186220 else {
187221 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdc_profit_last_amount, usdc)
188-[IntegerEntry("usdn_profit_last_amount", 0), transfer]
222+[transfer]
189223 }
190224 }
191225
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 lastBlock.height {
31+ let transaction_block = match transactionHeightById(i.transactionId) {
3232 case a: Int =>
3333 a
3434 case _ =>
35- throw("Error! with blochchain height")
35+ throw("Error block number")
3636 }
3737 let res = invoke(Address(vires_dapp), "usdN_stake", nil, [AttachedPayment(usdn, deposit_amount)])
3838 if ((res == res))
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)]
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+ }
4050 else throw("Strict value is not equal to itself.")
4151 }
4252
4353
4454
4555 @Callable(i)
4656 func buy_usdc_ticket () = if ((i.payments[0].assetId != usdc))
4757 then throw("Please deposit USD-N token only")
4858 else {
4959 let user_credit = tryGetInteger((("usdc_" + toString(i.originCaller)) + "_credit"))
5060 let deposit_amount = i.payments[0].amount
5161 let new_user_credit = (user_credit + deposit_amount)
5262 let all_credit = tryGetInteger("usdc_all_credit")
5363 let new_all_credit = (all_credit + deposit_amount)
54- let transaction_block = match lastBlock.height {
64+ let transaction_block = match transactionHeightById(i.transactionId) {
5565 case a: Int =>
5666 a
5767 case _ =>
5868 throw("Error block number")
5969 }
6070 let res = invoke(Address(vires_dapp), "usdC_stake", nil, [AttachedPayment(usdc, deposit_amount)])
6171 if ((res == res))
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)]
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+ }
6383 else throw("Strict value is not equal to itself.")
6484 }
6585
6686
6787
6888 @Callable(i)
69-func sell_usdn_ticket (user_amount) = {
70- let amount = match user_amount {
71- case int: Int =>
72- int
73- case _ =>
74- 0
75- }
89+func sell_usdn_ticket (amount) = {
7690 let user_credit = tryGetInteger((("usdn_" + toString(i.originCaller)) + "_credit"))
7791 if ((amount > user_credit))
7892 then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(user_credit)))
7993 else {
8094 let new_user_credit = (user_credit - amount)
8195 let all_credit = tryGetInteger("usdn_all_credit")
8296 let new_all_credit = (all_credit - amount)
83- let transaction_block = match lastBlock.height {
97+ let transaction_block = match transactionHeightById(i.transactionId) {
8498 case a: Int =>
8599 a
86100 case _ =>
87101 throw("Error block number")
88102 }
89103 let res = invoke(Address(vires_dapp), "usdN_cancelStake", [amount], nil)
90104 if ((res == res))
91- 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)]
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+ }
92116 else throw("Strict value is not equal to itself.")
93117 }
94118 }
95119
96120
97121
98122 @Callable(i)
99123 func sell_usdc_ticket (amount) = {
100124 let user_credit = tryGetInteger((("usdc_" + toString(i.originCaller)) + "_credit"))
101125 if ((amount > user_credit))
102126 then throw(("sorry you can't withdraw this amount, because u=you have only " + toString(user_credit)))
103127 else {
104128 let new_user_credit = (user_credit - amount)
105129 let all_credit = tryGetInteger("usdc_all_credit")
106130 let new_all_credit = (all_credit - amount)
107- let transaction_block = match lastBlock.height {
131+ let transaction_block = match transactionHeightById(i.transactionId) {
108132 case a: Int =>
109133 a
110134 case _ =>
111135 throw("Error block number")
112136 }
113137 let res = invoke(Address(vires_dapp), "usdC_cancelStake", [amount], nil)
114138 if ((res == res))
115- 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)]
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+ }
116150 else throw("Strict value is not equal to itself.")
117151 }
118152 }
119153
120154
121155
122156 @Callable(i)
123157 func usdn_calc_profit_amount () = if ((toString(i.originCaller) != admin_wallet))
124158 then throw("Sorry! you are not allowed to use this funaction")
125159 else {
126160 let usdn_profit_last_block = tryGetInteger("usdn_profit_last_block")
127161 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
128- let transaction_block = match lastBlock.height {
162+ let transaction_block = match transactionHeightById(i.transactionId) {
129163 case a: Int =>
130164 a
131165 case _ =>
132166 throw("Error block number")
133167 }
134168 let alfark = (transaction_block - usdn_profit_last_block)
135169 if ((alfark_testnet > alfark))
136170 then throw((("Please try again after " + toString((alfark_testnet - alfark))) + " block"))
137171 else {
138172 let usdn_balance = assetBalance(this, usdn)
139173 [IntegerEntry("usdn_profit_last_block", transaction_block), IntegerEntry("usdn_profit_last_amount", usdn_balance)]
140174 }
141175 }
142176
143177
144178
145179 @Callable(i)
146180 func usdn_send_profit_amount () = {
147181 let usdn_profit_last_amount = tryGetInteger("usdn_profit_last_amount")
148182 if ((0 >= usdn_profit_last_amount))
149183 then throw(("you dont have profit amount " + toString(usdn_profit_last_amount)))
150184 else {
151185 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdn_profit_last_amount, usdn)
152-[IntegerEntry("usdn_profit_last_amount", 0), transfer]
186+[transfer]
153187 }
154188 }
155189
156190
157191
158192 @Callable(i)
159193 func usdc_calc_profit_amount () = if ((toString(i.originCaller) != admin_wallet))
160194 then throw("Sorry! you are not allowed to use this funaction")
161195 else {
162196 let usdc_profit_last_block = tryGetInteger("usdc_profit_last_block")
163197 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
164- let transaction_block = match lastBlock.height {
198+ let transaction_block = match transactionHeightById(i.transactionId) {
165199 case a: Int =>
166200 a
167201 case _ =>
168202 throw("Error block number")
169203 }
170204 let alfark = (transaction_block - usdc_profit_last_block)
171205 if ((alfark_testnet > alfark))
172206 then throw((("Please try again after " + toString((alfark_testnet - alfark))) + " block"))
173207 else {
174208 let usdc_balance = assetBalance(this, usdc)
175209 [IntegerEntry("usdc_profit_last_block", transaction_block), IntegerEntry("usdc_profit_last_amount", usdc_balance)]
176210 }
177211 }
178212
179213
180214
181215 @Callable(i)
182216 func usdc_send_profit_amount () = {
183217 let usdc_profit_last_amount = tryGetInteger("usdc_profit_last_amount")
184218 if ((0 >= usdc_profit_last_amount))
185219 then throw(("you dont have profit amount " + toString(usdc_profit_last_amount)))
186220 else {
187221 let transfer = ScriptTransfer(addressFromStringValue(admin_wallet), usdc_profit_last_amount, usdc)
188-[IntegerEntry("usdn_profit_last_amount", 0), transfer]
222+[transfer]
189223 }
190224 }
191225
192226
193227 @Verifier(tx)
194228 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
195229

github/deemru/w8io/169f3d6 
588.22 ms