tx · EFMPutkFyawyxsurPLWad866b5VPayCm7WN9BDraFg6Q

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2022.01.07 14:59 [1868449] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "EFMPutkFyawyxsurPLWad866b5VPayCm7WN9BDraFg6Q", "fee": 1000000, "feeAssetId": null, "timestamp": 1641556790374, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "2ksLBBnaiZzaRTSRc6T8LUKYXAxVZbonmULBHZja7s1kkpke1m8R2b3BBUyG7hkFXo1DRHZp5HYon1dYeEUBn7Xa" ], "script": "base64:AAIFAAAAAAAAABkIAhIFCgMICAgSABIAEgASABIGCgQICAgIAAAACwAAAAAOa2V5QnV5VUxVU1JhdGUCAAAADWJ1eV9VTFVTX3JhdGUAAAAAHGtleUJ1eVVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHWJ1eV9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA9rZXlTZWxsVUxVU1JhdGUCAAAADnNlbGxfVUxVU19yYXRlAAAAAB1rZXlTZWxsVUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAec2VsbF9VTFVTX3JhdGVfc2NhbGVfZGVsaW1pdGVyAAAAAA1rZXlNYWtlTkZURmVlAgAAABBrZXlfbWFrZV9ORlRfZmVlAAAAAA1rZXlDb21taXNzaW9uAgAAAApjb21taXNzaW9uAAAAABtrZXlDb21taXNzaW9uU2NhbGVEZWxpbWl0ZXICAAAAGmNvbW1pc3Npb25fc2NhbGVfZGVsaW1pdGVyAAAAAARVU0ROAQAAACDksHLEGjv+8PYJNtljDWFsUYAqeC0sRtfKUlc+urlUoQAAAAAEVUxVUwEAAAAg/iPPgG6phXW2VdD7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nNmZXIAAAADBQAAABByZWNpcGllbnRBZGRyZXNzBQAAABdhbW91bnRXaXRob3V0Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAABFjb21taXNzaW9uQWRkcmVzcwUAAAAQYW1vdW50Q29tbWlzc2lvbgUAAAAKcG10QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmFtb3VudENhc2hiYWNrBQAAAARVTFVTBQAAAANuaWwAAAAAT8ydSg==", "height": 1868449, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 29uojWUsLLkNEvyoz1uS22s4A9avS5FNwyopDWNSe3T4 Next: G4BGVGmznT5tcvD3rCyMRkwzU9YALQNTD4jnASdENsGn Diff:
OldNewDifferences
111111 let currentTs = lastBlock.timestamp
112112 if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
113113 then throw("Invalid proof from backend.")
114- else if ((toInt(toBytes(backendTimestamp)) != currentTs))
115- then throw(((((("Date cannot be in the past " + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(toInt(toBytes(backendTimestamp)))))
114+ else if ((parseIntValue(backendTimestamp) != currentTs))
115+ then throw(((((("Date cannot be in the past " + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(parseIntValue(backendTimestamp))))
116116 else if (if ((pmtAssetId != USDN))
117117 then (pmtAssetId != ULUS)
118118 else false)
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'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
2121
2222 let assetId = USDN
2323
2424 let commissionAddress = Address(base58'3N1yGG2mA3gTLxReAh84njeRvCBzvUbCccg')
2525
2626 @Callable(i)
2727 func makeNFT (name,description,productId) = {
2828 let $t011201195 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
2929 let pmtAmount = $t011201195._1
3030 let pmtAssetId = $t011201195._2
3131 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3232 if ((pmtAssetId != assetId))
3333 then throw("Asset must be USDN only")
3434 else if ((makeNFTfee > pmtAmount))
3535 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3636 else if (isDefined(getString(this, productId)))
3737 then throw("NFT for this productId is already issued.")
3838 else {
3939 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
4040 let newAssetId = calculateAssetId(newAsset)
4141 [newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)]
4242 }
4343 }
4444
4545
4646
4747 @Callable(i)
4848 func setParams () = if ((i.caller != this))
4949 then throw("Only the DApp itself can call this function")
5050 else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
5151
5252
5353
5454 @Callable(i)
5555 func clearOldParams () = if ((i.caller != this))
5656 then throw("Only the DApp itself can call this function")
5757 else {
5858 let keyBuyUWORLDRate = "buy_UWORLD_rate"
5959 let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
6060 let keySellUWORLDRate = "sell_UWORLD_rate"
6161 let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
6262 [DeleteEntry(keyBuyUWORLDRate), DeleteEntry(keyBuyUWORLDRateScaleDelimiter), DeleteEntry(keySellUWORLDRate), DeleteEntry(keySellUWORLDRateScaleDelimiter)]
6363 }
6464
6565
6666
6767 @Callable(i)
6868 func buyULUS () = {
6969 let $t032103285 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
7070 let pmtAmount = $t032103285._1
7171 let pmtAssetId = $t032103285._2
7272 if ((pmtAssetId != assetId))
7373 then throw("Asset must be USDN only")
7474 else {
7575 let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
7676 let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
7777 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
7878 let amountWithoutCommission = amountToPay
7979 [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
8080 }
8181 }
8282
8383
8484
8585 @Callable(i)
8686 func sellULUS () = {
8787 let $t039394014 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
8888 let pmtAmount = $t039394014._1
8989 let pmtAssetId = $t039394014._2
9090 if ((pmtAssetId != ULUS))
9191 then throw("Asset must be ULUS only")
9292 else {
9393 let exchangeRate = getIntegerValue(this, keySellULUSRate)
9494 let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
9595 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
9696 let amountWithoutCommission = amountToPay
9797 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
9898 }
9999 }
100100
101101
102102
103103 @Callable(i)
104104 func makePayment (recipient,productId,backendSignature,backendTimestamp) = {
105105 let recipientAddress = addressFromStringValue(recipient)
106106 let $t048234898 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
107107 let pmtAmount = $t048234898._1
108108 let pmtAssetId = $t048234898._2
109109 let backendProof = (makeString([toString(this), backendTimestamp, toString(pmtAmount)], ";") + ";")
110110 let backendPubKey = base58'5fJ73uaebbc12bwCegVoRZgNKfn4BqpH8NB8Rs2NpBmg'
111111 let currentTs = lastBlock.timestamp
112112 if (!(sigVerify_8Kb(toBytes(backendProof), fromBase58String(backendSignature), backendPubKey)))
113113 then throw("Invalid proof from backend.")
114- else if ((toInt(toBytes(backendTimestamp)) != currentTs))
115- then throw(((((("Date cannot be in the past " + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(toInt(toBytes(backendTimestamp)))))
114+ else if ((parseIntValue(backendTimestamp) != currentTs))
115+ then throw(((((("Date cannot be in the past " + toString(currentTs)) + " ") + backendTimestamp) + " ") + toString(parseIntValue(backendTimestamp))))
116116 else if (if ((pmtAssetId != USDN))
117117 then (pmtAssetId != ULUS)
118118 else false)
119119 then throw("Asset must be only USDN or ULUS")
120120 else {
121121 let commission = getIntegerValue(this, keyCommission)
122122 let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
123123 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
124124 let amountWithoutCommission = (pmtAmount - amountCommission)
125125 let assetDivider = if ((pmtAssetId == USDN))
126126 then 1000000
127127 else 1000
128128 let amountCashback = fraction(pmtAmount, 100, assetDivider)
129129 if (isDefined(getString(this, productId)))
130130 then {
131131 let NFTassetId = fromBase58String(getStringValue(this, productId))
132132 [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
133133 }
134134 else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
135135 }
136136 }
137137
138138

github/deemru/w8io/026f985 
50.76 ms