tx · smYedfZSApFd3DSZSYdY6MjHjZimL9qJfpeac59cPW7

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2021.07.13 02:18 [1611031] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "smYedfZSApFd3DSZSYdY6MjHjZimL9qJfpeac59cPW7", "fee": 1000000, "feeAssetId": null, "timestamp": 1626131777092, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "5CcY5pjLFtrwWybihJhQrQCsZjtB2sY6qSH5K1AhbB8LGuDWVCQJXeV9oc4G7D9aqxj6g64BKsHQjDU3ymUMqMGq" ], "script": "base64:AAIEAAAAAAAAABUIAhIFCgMICAgSABIAEgASBAoCCAgAAAAKAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACD+I8+AbqmFdbZV0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ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAAAWL5sg", "height": 1611031, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2H7QemUsbWYtKziR3hQsd3fRKB31VK4gsyq71DjbfQGN Next: 2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let keyBuyUWORLDRate = "buy_UWORLD_rate"
4+let keyBuyULUSRate = "buy_ULUS_rate"
55
6-let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
6+let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter"
77
8-let keySellUWORLDRate = "sell_UWORLD_rate"
8+let keySellULUSRate = "sell_ULUS_rate"
99
10-let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
10+let keySellULUSRateScaleDelimiter = "sell_ULUS_rate_scale_delimiter"
1111
1212 let keyMakeNFTFee = "key_make_NFT_fee"
1313
1717
1818 let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
1919
20-let UWORLD = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
20+let ULUS = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
2121
2222 let assetId = USDN
2323
2424 @Callable(i)
2525 func makeNFT (name,description,productId) = {
26- let $t011141189 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27- let pmtAmount = $t011141189._1
28- let pmtAssetId = $t011141189._2
26+ let $t010971172 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27+ let pmtAmount = $t010971172._1
28+ let pmtAssetId = $t010971172._2
2929 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3030 if ((pmtAssetId != assetId))
3131 then throw("Asset must be USDN only")
4545 @Callable(i)
4646 func setParams () = if ((i.caller != this))
4747 then throw("Only the DApp itself can call this function")
48- else [IntegerEntry(keyBuyUWORLDRate, 150000), IntegerEntry(keyBuyUWORLDRateScaleDelimiter, 1000), IntegerEntry(keySellUWORLDRate, 100000), IntegerEntry(keySellUWORLDRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
48+ else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
4949
5050
5151
5252 @Callable(i)
53-func buyUWORLD () = {
54- let $t025972672 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
55- let pmtAmount = $t025972672._1
56- let pmtAssetId = $t025972672._2
53+func buyULUS () = {
54+ let $t025562631 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
55+ let pmtAmount = $t025562631._1
56+ let pmtAssetId = $t025562631._2
5757 if ((pmtAssetId != assetId))
5858 then throw("Asset must be USDN only")
5959 else {
60- let exchangeRate = getIntegerValue(this, keyBuyUWORLDRate)
61- let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyUWORLDRateScaleDelimiter)
60+ let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
61+ let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
6262 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
6363 let amountWithoutCommission = amountToPay
64-[ScriptTransfer(i.caller, amountWithoutCommission, UWORLD)]
64+[ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
6565 }
6666 }
6767
6868
6969
7070 @Callable(i)
71-func sellUWORLD () = {
72- let $t033343409 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73- let pmtAmount = $t033343409._1
74- let pmtAssetId = $t033343409._2
75- if ((pmtAssetId != UWORLD))
76- then throw("Asset must be UWORLD only")
71+func sellULUS () = {
72+ let $t032853360 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73+ let pmtAmount = $t032853360._1
74+ let pmtAssetId = $t032853360._2
75+ if ((pmtAssetId != ULUS))
76+ then throw("Asset must be ULUS only")
7777 else {
78- let exchangeRate = getIntegerValue(this, keySellUWORLDRate)
79- let exchangeRateScaleDelimiter = getIntegerValue(this, keySellUWORLDRateScaleDelimiter)
78+ let exchangeRate = getIntegerValue(this, keySellULUSRate)
79+ let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
8080 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
8181 let amountWithoutCommission = amountToPay
8282 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
8888 @Callable(i)
8989 func makePayment (recipient,productId) = {
9090 let recipientAddress = addressFromStringValue(recipient)
91- let $t041704245 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
92- let pmtAmount = $t041704245._1
93- let pmtAssetId = $t041704245._2
91+ let $t041134188 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
92+ let pmtAmount = $t041134188._1
93+ let pmtAssetId = $t041134188._2
9494 if ((pmtAssetId != assetId))
9595 then throw("Asset must be USDN only")
9696 else {
102102 if (isDefined(getString(this, productId)))
103103 then {
104104 let NFTassetId = fromBase58String(getStringValue(this, productId))
105-[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
105+[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
106106 }
107- else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, UWORLD)]
107+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
108108 }
109109 }
110110
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let keyBuyUWORLDRate = "buy_UWORLD_rate"
4+let keyBuyULUSRate = "buy_ULUS_rate"
55
6-let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
6+let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter"
77
8-let keySellUWORLDRate = "sell_UWORLD_rate"
8+let keySellULUSRate = "sell_ULUS_rate"
99
10-let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
10+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
20-let UWORLD = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
20+let ULUS = base58'J74E8AHdZobVSkA3YboiRrxFUs4odMVxK8tGMg6QXA1n'
2121
2222 let assetId = USDN
2323
2424 @Callable(i)
2525 func makeNFT (name,description,productId) = {
26- let $t011141189 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27- let pmtAmount = $t011141189._1
28- let pmtAssetId = $t011141189._2
26+ let $t010971172 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27+ let pmtAmount = $t010971172._1
28+ let pmtAssetId = $t010971172._2
2929 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3030 if ((pmtAssetId != assetId))
3131 then throw("Asset must be USDN only")
3232 else if ((makeNFTfee > pmtAmount))
3333 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3434 else if (isDefined(getString(this, productId)))
3535 then throw("NFT for this productId is already issued.")
3636 else {
3737 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
3838 let newAssetId = calculateAssetId(newAsset)
3939 [newAsset, StringEntry(productId, toBase58String(newAssetId))]
4040 }
4141 }
4242
4343
4444
4545 @Callable(i)
4646 func setParams () = if ((i.caller != this))
4747 then throw("Only the DApp itself can call this function")
48- else [IntegerEntry(keyBuyUWORLDRate, 150000), IntegerEntry(keyBuyUWORLDRateScaleDelimiter, 1000), IntegerEntry(keySellUWORLDRate, 100000), IntegerEntry(keySellUWORLDRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
48+ else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
4949
5050
5151
5252 @Callable(i)
53-func buyUWORLD () = {
54- let $t025972672 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
55- let pmtAmount = $t025972672._1
56- let pmtAssetId = $t025972672._2
53+func buyULUS () = {
54+ let $t025562631 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
55+ let pmtAmount = $t025562631._1
56+ let pmtAssetId = $t025562631._2
5757 if ((pmtAssetId != assetId))
5858 then throw("Asset must be USDN only")
5959 else {
60- let exchangeRate = getIntegerValue(this, keyBuyUWORLDRate)
61- let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyUWORLDRateScaleDelimiter)
60+ let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
61+ let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
6262 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
6363 let amountWithoutCommission = amountToPay
64-[ScriptTransfer(i.caller, amountWithoutCommission, UWORLD)]
64+[ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
6565 }
6666 }
6767
6868
6969
7070 @Callable(i)
71-func sellUWORLD () = {
72- let $t033343409 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73- let pmtAmount = $t033343409._1
74- let pmtAssetId = $t033343409._2
75- if ((pmtAssetId != UWORLD))
76- then throw("Asset must be UWORLD only")
71+func sellULUS () = {
72+ let $t032853360 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73+ let pmtAmount = $t032853360._1
74+ let pmtAssetId = $t032853360._2
75+ if ((pmtAssetId != ULUS))
76+ then throw("Asset must be ULUS only")
7777 else {
78- let exchangeRate = getIntegerValue(this, keySellUWORLDRate)
79- let exchangeRateScaleDelimiter = getIntegerValue(this, keySellUWORLDRateScaleDelimiter)
78+ let exchangeRate = getIntegerValue(this, keySellULUSRate)
79+ let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
8080 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
8181 let amountWithoutCommission = amountToPay
8282 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
8383 }
8484 }
8585
8686
8787
8888 @Callable(i)
8989 func makePayment (recipient,productId) = {
9090 let recipientAddress = addressFromStringValue(recipient)
91- let $t041704245 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
92- let pmtAmount = $t041704245._1
93- let pmtAssetId = $t041704245._2
91+ let $t041134188 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
92+ let pmtAmount = $t041134188._1
93+ let pmtAssetId = $t041134188._2
9494 if ((pmtAssetId != assetId))
9595 then throw("Asset must be USDN only")
9696 else {
9797 let commission = getIntegerValue(this, keyCommission)
9898 let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
9999 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
100100 let amountWithoutCommission = (pmtAmount - amountCommission)
101101 let amountCashback = fraction(pmtAmount, 100, 1000000)
102102 if (isDefined(getString(this, productId)))
103103 then {
104104 let NFTassetId = fromBase58String(getStringValue(this, productId))
105-[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
105+[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
106106 }
107- else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, UWORLD)]
107+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
108108 }
109109 }
110110
111111

github/deemru/w8io/169f3d6 
65.50 ms