tx · 3PwhYwTiWQRuBEWj3rTXqpixvu5mxYG2F2kU4Y5pjbfd

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2022.01.06 16:29 [1867100] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "3PwhYwTiWQRuBEWj3rTXqpixvu5mxYG2F2kU4Y5pjbfd", "fee": 1000000, "feeAssetId": null, "timestamp": 1641475752210, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "UFgmRi6gUbmajGv4xvFgGy5URgQKedtS79ySiCZBKGbXmHyTssb6ikjFHm2ztnPwtav8SroaxzjAhBsV4Wpzum8" ], "script": "base64:AAIFAAAAAAAAABgIAhIFCgMICAgSABIAEgASABIFCgMICAgAAAALAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACBcOT9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AAApORlRhc3NldElkCQACWQAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAACXByb2R1Y3RJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABByZWNpcGllbnRBZGRyZXNzBQAAABdhbW91bnRXaXRob3V0Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFjb21taXNzaW9uQWRkcmVzcwUAAAAQYW1vdW50Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmFtb3VudENhc2hiYWNrBQAAAARVTFVTCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAKTkZUYXNzZXRJZAUAAAADbmlsCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWNvbW1pc3Npb25BZGRyZXNzBQAAABBhbW91bnRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAABwW40r", "height": 1867100, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CKng7NpEX9NphT1zT6CV3dH66qQsPUf74TxaGBq4mqX6 Next: 4EXfZQoYMogS7GGYi6bCDg6c2yvG4yWihuDJSjZqivna Diff:
OldNewDifferences
2323
2424 let commissionAddress = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW')
2525
26-let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
27-
2826 @Callable(i)
2927 func makeNFT (name,description,productId) = {
30- let $t010861161 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
31- let pmtAmount = $t010861161._1
32- let pmtAssetId = $t010861161._2
28+ let $t010141089 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29+ let pmtAmount = $t010141089._1
30+ let pmtAssetId = $t010141089._2
3331 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3432 if ((pmtAssetId != assetId))
3533 then throw("Asset must be USDN only")
6866
6967 @Callable(i)
7068 func buyULUS () = {
71- let $t031763251 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
72- let pmtAmount = $t031763251._1
73- let pmtAssetId = $t031763251._2
69+ let $t031043179 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70+ let pmtAmount = $t031043179._1
71+ let pmtAssetId = $t031043179._2
7472 if ((pmtAssetId != assetId))
7573 then throw("Asset must be USDN only")
7674 else {
8684
8785 @Callable(i)
8886 func sellULUS () = {
89- let $t039053980 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90- let pmtAmount = $t039053980._1
91- let pmtAssetId = $t039053980._2
87+ let $t038333908 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88+ let pmtAmount = $t038333908._1
89+ let pmtAssetId = $t038333908._2
9290 if ((pmtAssetId != ULUS))
9391 then throw("Asset must be ULUS only")
9492 else {
105103 @Callable(i)
106104 func makePayment (recipient,productId,backendSignature) = {
107105 let recipientAddress = addressFromStringValue(recipient)
108- let $t047674842 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
109- let pmtAmount = $t047674842._1
110- let pmtAssetId = $t047674842._2
106+ let $t046914766 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
107+ let pmtAmount = $t046914766._1
108+ let pmtAssetId = $t046914766._2
111109 let backendProof = makeString([toString(this), toString(pmtAmount)], ";")
110+ let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
112111 if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
113112 then throw(("Invalid proof from backend =" + backendProof))
114113 else if (if ((pmtAssetId != USDN))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyBuyULUSRate = "buy_ULUS_rate"
55
66 let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter"
77
88 let keySellULUSRate = "sell_ULUS_rate"
99
1010 let keySellULUSRateScaleDelimiter = "sell_ULUS_rate_scale_delimiter"
1111
1212 let keyMakeNFTFee = "key_make_NFT_fee"
1313
1414 let keyCommission = "commission"
1515
1616 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
1717
1818 let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
1919
2020 let ULUS = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig'
2121
2222 let assetId = USDN
2323
2424 let commissionAddress = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW')
2525
26-let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
27-
2826 @Callable(i)
2927 func makeNFT (name,description,productId) = {
30- let $t010861161 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
31- let pmtAmount = $t010861161._1
32- let pmtAssetId = $t010861161._2
28+ let $t010141089 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29+ let pmtAmount = $t010141089._1
30+ let pmtAssetId = $t010141089._2
3331 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3432 if ((pmtAssetId != assetId))
3533 then throw("Asset must be USDN only")
3634 else if ((makeNFTfee > pmtAmount))
3735 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3836 else if (isDefined(getString(this, productId)))
3937 then throw("NFT for this productId is already issued.")
4038 else {
4139 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
4240 let newAssetId = calculateAssetId(newAsset)
4341 [newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)]
4442 }
4543 }
4644
4745
4846
4947 @Callable(i)
5048 func setParams () = if ((i.caller != this))
5149 then throw("Only the DApp itself can call this function")
5250 else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
5351
5452
5553
5654 @Callable(i)
5755 func clearOldParams () = if ((i.caller != this))
5856 then throw("Only the DApp itself can call this function")
5957 else {
6058 let keyBuyUWORLDRate = "buy_UWORLD_rate"
6159 let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
6260 let keySellUWORLDRate = "sell_UWORLD_rate"
6361 let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
6462 [DeleteEntry(keyBuyUWORLDRate), DeleteEntry(keyBuyUWORLDRateScaleDelimiter), DeleteEntry(keySellUWORLDRate), DeleteEntry(keySellUWORLDRateScaleDelimiter)]
6563 }
6664
6765
6866
6967 @Callable(i)
7068 func buyULUS () = {
71- let $t031763251 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
72- let pmtAmount = $t031763251._1
73- let pmtAssetId = $t031763251._2
69+ let $t031043179 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70+ let pmtAmount = $t031043179._1
71+ let pmtAssetId = $t031043179._2
7472 if ((pmtAssetId != assetId))
7573 then throw("Asset must be USDN only")
7674 else {
7775 let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
7876 let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
7977 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
8078 let amountWithoutCommission = amountToPay
8179 [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
8280 }
8381 }
8482
8583
8684
8785 @Callable(i)
8886 func sellULUS () = {
89- let $t039053980 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90- let pmtAmount = $t039053980._1
91- let pmtAssetId = $t039053980._2
87+ let $t038333908 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88+ let pmtAmount = $t038333908._1
89+ let pmtAssetId = $t038333908._2
9290 if ((pmtAssetId != ULUS))
9391 then throw("Asset must be ULUS only")
9492 else {
9593 let exchangeRate = getIntegerValue(this, keySellULUSRate)
9694 let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
9795 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
9896 let amountWithoutCommission = amountToPay
9997 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
10098 }
10199 }
102100
103101
104102
105103 @Callable(i)
106104 func makePayment (recipient,productId,backendSignature) = {
107105 let recipientAddress = addressFromStringValue(recipient)
108- let $t047674842 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
109- let pmtAmount = $t047674842._1
110- let pmtAssetId = $t047674842._2
106+ let $t046914766 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
107+ let pmtAmount = $t046914766._1
108+ let pmtAssetId = $t046914766._2
111109 let backendProof = makeString([toString(this), toString(pmtAmount)], ";")
110+ let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
112111 if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
113112 then throw(("Invalid proof from backend =" + backendProof))
114113 else if (if ((pmtAssetId != USDN))
115114 then (pmtAssetId != ULUS)
116115 else false)
117116 then throw("Asset must be only USDN or ULUS")
118117 else {
119118 let commission = getIntegerValue(this, keyCommission)
120119 let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
121120 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
122121 let amountWithoutCommission = (pmtAmount - amountCommission)
123122 let assetDivider = if ((pmtAssetId == USDN))
124123 then 1000000
125124 else 1000
126125 let amountCashback = fraction(pmtAmount, 100, assetDivider)
127126 if (isDefined(getString(this, productId)))
128127 then {
129128 let NFTassetId = fromBase58String(getStringValue(this, productId))
130129 [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
131130 }
132131 else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
133132 }
134133 }
135134
136135

github/deemru/w8io/026f985 
92.85 ms