tx · q2mezakhwMyHjX4mQfxXkDnE24AWPdMETjuQzKwBTeG

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2022.01.08 21:22 [1870281] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "q2mezakhwMyHjX4mQfxXkDnE24AWPdMETjuQzKwBTeG", "fee": 1000000, "feeAssetId": null, "timestamp": 1641666144731, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "4MXg1fTpUsqpVQAbnUKxRYjAVBFwnVkzNqEDJTyaEaYL4KPPSMvDsC5dUVJTToU8g4j95nzowzLiRUJgR8bi4qUh" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAgSABIAEgASABIGCgQICAgIAAAADAAAAAADU0VQAgAAAAJfXwAAAAAOa2V5QnV5VUxVU1JhdGUCAAAADWJ1eV9VTFVTX3JhdGUAAAAAHGtleUJ1eVVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHWJ1eV9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA9rZXlTZWxsVUxVU1JhdGUCAAAADnNlbGxfVUxVU19yYXRlAAAAAB1rZXlTZWxsVUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAec2VsbF9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA1rZXlNYWtlTkZURmVlAgAAABBrZXlfbWFrZV9ORlRfZmVlAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAARVU0ROAQAAACDksHLEGjv+8PYJNtljDWFsUYAqeC0sRtfKUlc+urlUoQAAAAAEVUx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taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAApORlRhc3NldElkBQAAAANuaWwJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAQcmVjaXBpZW50QWRkcmVzcwUAAAAXYW1vdW50V2l0aG91dENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARY29tbWlzc2lvbkFkZHJlc3MFAAAAEGFtb3VudENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5hbW91bnRDYXNoYmFjawUAAAAEVUxVUwUAAAADbmlsAAAAAGJdduo=", "height": 1870281, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B1BGE8NhjVhfXrhBiFPnXLiN91XEvocbdXrqS5qxNPo7 Next: 58ouMaKk9Xw3KBtW1MBWL4m2cEoMgGJS2YmtLjVdHzJv Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let SEP = "__"
5+
46 let keyBuyULUSRate = "buy_ULUS_rate"
57
68 let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter"
2527
2628 @Callable(i)
2729 func makeNFT (name,description,productId) = {
28- let $t011201195 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29- let pmtAmount = $t011201195._1
30- let pmtAssetId = $t011201195._2
30+ let $t011931268 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
31+ let pmtAmount = $t011931268._1
32+ let pmtAssetId = $t011931268._2
3133 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3234 if ((pmtAssetId != assetId))
3335 then throw("Asset must be USDN only")
6668
6769 @Callable(i)
6870 func buyULUS () = {
69- let $t032103285 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70- let pmtAmount = $t032103285._1
71- let pmtAssetId = $t032103285._2
71+ let $t032833358 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
72+ let pmtAmount = $t032833358._1
73+ let pmtAssetId = $t032833358._2
7274 if ((pmtAssetId != assetId))
7375 then throw("Asset must be USDN only")
7476 else {
8486
8587 @Callable(i)
8688 func sellULUS () = {
87- let $t039394014 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88- let pmtAmount = $t039394014._1
89- let pmtAssetId = $t039394014._2
89+ let $t040124087 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90+ let pmtAmount = $t040124087._1
91+ let pmtAssetId = $t040124087._2
9092 if ((pmtAssetId != ULUS))
9193 then throw("Asset must be ULUS only")
9294 else {
104106 func makePayment (recipient,productId,backendSignature,backendTimestamp) = {
105107 let currentTs = lastBlock.timestamp
106108 let recipientAddress = addressFromStringValue(recipient)
107- let $t048584933 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108- let pmtAmount = $t048584933._1
109- let pmtAssetId = $t048584933._2
109+ let $t049315006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
110+ let pmtAmount = $t049315006._1
111+ let pmtAssetId = $t049315006._2
110112 let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111113 let backendProof = (makeString([toString(this), backendTimestamp, toString(pmtAmount)], ";") + ";")
112- let NFTasset = fromBase58String(getStringValue(this, productId))
113- let nftbalance = assetBalance(this, NFTasset)
114- if ((1 == 1))
115- then throw(("NFT Balance = " + toString(nftbalance)))
116- else if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
117- then throw("Invalid proof from backend.")
118- else if (((currentTs - parseIntValue(backendTimestamp)) > ((1000 * 60) * 15)))
119- then throw(((((("The signature is expired. Repeat the operation again." + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(((currentTs - parseIntValue(backendTimestamp)) / (1000 * 60)))))
120- else if (if ((pmtAssetId != USDN))
121- then (pmtAssetId != ULUS)
122- else false)
123- then throw("Asset must be only USDN or ULUS")
124- else {
125- let commission = getIntegerValue(this, keyCommission)
126- let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
127- let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
128- let amountWithoutCommission = (pmtAmount - amountCommission)
129- let assetDivider = if ((pmtAssetId == USDN))
130- then 1000000
131- else 1000
132- let amountCashback = fraction(pmtAmount, 100, assetDivider)
133- if (isDefined(getString(this, productId)))
134- then {
135- let NFTassetId = fromBase58String(getStringValue(this, productId))
136-[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
137- }
138- else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
139- }
114+ if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
115+ then throw("Invalid proof from backend.")
116+ else if (((currentTs - parseIntValue(backendTimestamp)) > ((1000 * 60) * 15)))
117+ then throw("The signature is expired. Repeat the operation again.")
118+ else if (if ((pmtAssetId != USDN))
119+ then (pmtAssetId != ULUS)
120+ else false)
121+ then throw("Asset must be only USDN or ULUS")
122+ else {
123+ let commission = getIntegerValue(this, keyCommission)
124+ let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
125+ let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
126+ let amountWithoutCommission = (pmtAmount - amountCommission)
127+ let assetDivider = if ((pmtAssetId == USDN))
128+ then 1000000
129+ else 1000
130+ let amountCashback = fraction(pmtAmount, 100, assetDivider)
131+ if (isDefined(getString(this, productId)))
132+ then {
133+ let NFTassetId = fromBase58String(getStringValue(this, productId))
134+ let NFTbalance = assetBalance(this, NFTassetId)
135+ if ((NFTbalance == 0))
136+ then throw("NFTAsset doesn't exist.")
137+ else {
138+ let NFTinfo = value(assetInfo(NFTassetId)).description
139+ if ((1 == 1))
140+ then throw(("NFTAsset doesn't exist. balance=" + NFTinfo))
141+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
142+ }
143+ }
144+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
145+ }
140146 }
141147
142148
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let SEP = "__"
5+
46 let keyBuyULUSRate = "buy_ULUS_rate"
57
68 let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter"
79
810 let keySellULUSRate = "sell_ULUS_rate"
911
1012 let keySellULUSRateScaleDelimiter = "sell_ULUS_rate_scale_delimiter"
1113
1214 let keyMakeNFTFee = "key_make_NFT_fee"
1315
1416 let keyCommission = "commission"
1517
1618 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
1719
1820 let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
1921
2022 let ULUS = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
2123
2224 let assetId = USDN
2325
2426 let commissionAddress = Address(base58'3N1yGG2mA3gTLxReAh84njeRvCBzvUbCccg')
2527
2628 @Callable(i)
2729 func makeNFT (name,description,productId) = {
28- let $t011201195 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29- let pmtAmount = $t011201195._1
30- let pmtAssetId = $t011201195._2
30+ let $t011931268 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
31+ let pmtAmount = $t011931268._1
32+ let pmtAssetId = $t011931268._2
3133 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3234 if ((pmtAssetId != assetId))
3335 then throw("Asset must be USDN only")
3436 else if ((makeNFTfee > pmtAmount))
3537 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3638 else if (isDefined(getString(this, productId)))
3739 then throw("NFT for this productId is already issued.")
3840 else {
3941 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
4042 let newAssetId = calculateAssetId(newAsset)
4143 [newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)]
4244 }
4345 }
4446
4547
4648
4749 @Callable(i)
4850 func setParams () = if ((i.caller != this))
4951 then throw("Only the DApp itself can call this function")
5052 else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
5153
5254
5355
5456 @Callable(i)
5557 func clearOldParams () = if ((i.caller != this))
5658 then throw("Only the DApp itself can call this function")
5759 else {
5860 let keyBuyUWORLDRate = "buy_UWORLD_rate"
5961 let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
6062 let keySellUWORLDRate = "sell_UWORLD_rate"
6163 let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
6264 [DeleteEntry(keyBuyUWORLDRate), DeleteEntry(keyBuyUWORLDRateScaleDelimiter), DeleteEntry(keySellUWORLDRate), DeleteEntry(keySellUWORLDRateScaleDelimiter)]
6365 }
6466
6567
6668
6769 @Callable(i)
6870 func buyULUS () = {
69- let $t032103285 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70- let pmtAmount = $t032103285._1
71- let pmtAssetId = $t032103285._2
71+ let $t032833358 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
72+ let pmtAmount = $t032833358._1
73+ let pmtAssetId = $t032833358._2
7274 if ((pmtAssetId != assetId))
7375 then throw("Asset must be USDN only")
7476 else {
7577 let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
7678 let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
7779 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
7880 let amountWithoutCommission = amountToPay
7981 [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
8082 }
8183 }
8284
8385
8486
8587 @Callable(i)
8688 func sellULUS () = {
87- let $t039394014 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88- let pmtAmount = $t039394014._1
89- let pmtAssetId = $t039394014._2
89+ let $t040124087 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
90+ let pmtAmount = $t040124087._1
91+ let pmtAssetId = $t040124087._2
9092 if ((pmtAssetId != ULUS))
9193 then throw("Asset must be ULUS only")
9294 else {
9395 let exchangeRate = getIntegerValue(this, keySellULUSRate)
9496 let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
9597 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
9698 let amountWithoutCommission = amountToPay
9799 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
98100 }
99101 }
100102
101103
102104
103105 @Callable(i)
104106 func makePayment (recipient,productId,backendSignature,backendTimestamp) = {
105107 let currentTs = lastBlock.timestamp
106108 let recipientAddress = addressFromStringValue(recipient)
107- let $t048584933 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
108- let pmtAmount = $t048584933._1
109- let pmtAssetId = $t048584933._2
109+ let $t049315006 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
110+ let pmtAmount = $t049315006._1
111+ let pmtAssetId = $t049315006._2
110112 let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111113 let backendProof = (makeString([toString(this), backendTimestamp, toString(pmtAmount)], ";") + ";")
112- let NFTasset = fromBase58String(getStringValue(this, productId))
113- let nftbalance = assetBalance(this, NFTasset)
114- if ((1 == 1))
115- then throw(("NFT Balance = " + toString(nftbalance)))
116- else if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
117- then throw("Invalid proof from backend.")
118- else if (((currentTs - parseIntValue(backendTimestamp)) > ((1000 * 60) * 15)))
119- then throw(((((("The signature is expired. Repeat the operation again." + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(((currentTs - parseIntValue(backendTimestamp)) / (1000 * 60)))))
120- else if (if ((pmtAssetId != USDN))
121- then (pmtAssetId != ULUS)
122- else false)
123- then throw("Asset must be only USDN or ULUS")
124- else {
125- let commission = getIntegerValue(this, keyCommission)
126- let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
127- let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
128- let amountWithoutCommission = (pmtAmount - amountCommission)
129- let assetDivider = if ((pmtAssetId == USDN))
130- then 1000000
131- else 1000
132- let amountCashback = fraction(pmtAmount, 100, assetDivider)
133- if (isDefined(getString(this, productId)))
134- then {
135- let NFTassetId = fromBase58String(getStringValue(this, productId))
136-[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
137- }
138- else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
139- }
114+ if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
115+ then throw("Invalid proof from backend.")
116+ else if (((currentTs - parseIntValue(backendTimestamp)) > ((1000 * 60) * 15)))
117+ then throw("The signature is expired. Repeat the operation again.")
118+ else if (if ((pmtAssetId != USDN))
119+ then (pmtAssetId != ULUS)
120+ else false)
121+ then throw("Asset must be only USDN or ULUS")
122+ else {
123+ let commission = getIntegerValue(this, keyCommission)
124+ let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
125+ let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
126+ let amountWithoutCommission = (pmtAmount - amountCommission)
127+ let assetDivider = if ((pmtAssetId == USDN))
128+ then 1000000
129+ else 1000
130+ let amountCashback = fraction(pmtAmount, 100, assetDivider)
131+ if (isDefined(getString(this, productId)))
132+ then {
133+ let NFTassetId = fromBase58String(getStringValue(this, productId))
134+ let NFTbalance = assetBalance(this, NFTassetId)
135+ if ((NFTbalance == 0))
136+ then throw("NFTAsset doesn't exist.")
137+ else {
138+ let NFTinfo = value(assetInfo(NFTassetId)).description
139+ if ((1 == 1))
140+ then throw(("NFTAsset doesn't exist. balance=" + NFTinfo))
141+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
142+ }
143+ }
144+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
145+ }
140146 }
141147
142148

github/deemru/w8io/026f985 
62.14 ms