tx · 2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01000000 Waves

2021.07.13 02:19 [1611032] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "2GAS8qHCS21MCFuvVwgaLDZUKbyZgJViYmonVrwNM1LG", "fee": 1000000, "feeAssetId": null, "timestamp": 1626131957340, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "2APDDS1D5xh64AaKXRdmg586C4k6qvLe3HWXxT4AkkRngeGVkwkru3C8iUpRMqgZ2LdccuF6gAXbLcmAPctryp12" ], "script": "base64:AAIEAAAAAAAAABUIAhIFCgMICAgSABIAEgASBAoCCAgAAAAKAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACD+I8+AbqmFdbZ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uc2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAAdhc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAAAWL5sg", "height": 1611032, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: smYedfZSApFd3DSZSYdY6MjHjZimL9qJfpeac59cPW7 Next: BLqg4XdSr1MqZirMZDmj61NdjdWAnnZGMWV3hynpTyZL Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
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 @Callable(i)
2525 func makeNFT (name,description,productId) = {
2626 let $t010971172 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
2727 let pmtAmount = $t010971172._1
2828 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")
4848 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)
5353 func buyULUS () = {
5454 let $t025562631 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
5555 let pmtAmount = $t025562631._1
5656 let pmtAssetId = $t025562631._2
5757 if ((pmtAssetId != assetId))
5858 then throw("Asset must be USDN only")
5959 else {
6060 let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
6161 let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
6262 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
6363 let amountWithoutCommission = amountToPay
6464 [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
6565 }
6666 }
6767
6868
6969
7070 @Callable(i)
7171 func sellULUS () = {
7272 let $t032853360 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
7373 let pmtAmount = $t032853360._1
7474 let pmtAssetId = $t032853360._2
7575 if ((pmtAssetId != ULUS))
7676 then throw("Asset must be ULUS only")
7777 else {
7878 let exchangeRate = getIntegerValue(this, keySellULUSRate)
7979 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)
9191 let $t041134188 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
9292 let pmtAmount = $t041134188._1
9393 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))
105105 [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
106106 }
107107 else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
108108 }
109109 }
110110
111111

github/deemru/w8io/026f985 
26.24 ms