tx · EiHK8PHhSRW8C4DMrmEBGLZEWvpNUQ7anvZfcSQPcDCS

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01400000 Waves

2021.12.27 14:11 [1852582] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "EiHK8PHhSRW8C4DMrmEBGLZEWvpNUQ7anvZfcSQPcDCS", "fee": 1400000, "feeAssetId": null, "timestamp": 1640603589807, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "B6ZrJfwryKwiKfTHJyfp18Bx7nfEQVy1VCR98JeVZzevcjDLmrLmxKE68wvgU3mnPmADdSQkHRTGAV3DQHSJYjt" ], "script": "base64:AAIEAAAAAAAAABcIAhIFCgMICAgSABIAEgASABIECgIICAAAAAsAAAAADmtleUJ1eVVMVVNSYXRlAgAAAA1idXlfVUxVU19yYXRlAAAAABxrZXlCdXlVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB1idXlfVUxVU19yYXRlX3NjYWxlX2RlbGltaXRlcgAAAAAPa2V5U2VsbFVMVVNSYXRlAgAAAA5zZWxsX1VMVVNfcmF0ZQAAAAAda2V5U2VsbFVMVVNSYXRlU2NhbGVEZWxpbWl0ZXICAAAAHnNlbGxfVUxVU19yYXRlX3NjYWxlX2RlbGltaXRlcgAAAAANa2V5TWFrZU5GVEZlZQIAAAAQa2V5X21ha2VfTkZUX2ZlZQAAAAANa2V5Q29tbWlzc2lvbgIAAAAKY29tbWlzc2lvbgAAAAAba2V5Q29tbWlzc2lvblNjYWxlRGVsaW1pdGVyAgAAABpjb21taXNzaW9uX3NjYWxlX2RlbGltaXRlcgAAAAAEVVNETgEAAAAgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEAAAAABFVMVVMBAAAAIDYKzN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IBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAApORlRhc3NldElkBQAAAANuaWwJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAQcmVjaXBpZW50QWRkcmVzcwUAAAAXYW1vdW50V2l0aG91dENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAARY29tbWlzc2lvbkFkZHJlc3MFAAAAEGFtb3VudENvbW1pc3Npb24FAAAACnBtdEFzc2V0SWQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAA5hbW91bnRDYXNoYmFjawUAAAAEVUxVUwUAAAADbmlsAAAAAPb4coA=", "height": 1852582, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EBCjkdcdvxCWGWfusJiMxMVR1KbwPDU5eQ2FMvEdyfjg Next: F1FsW4rDkF41sWwBUBtAE8vYPgjugEzp8W8YJVDGAPMd Diff:
OldNewDifferences
1515
1616 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
1717
18-let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
18+let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
1919
20-let ULUS = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig'
20+let ULUS = base58'4dxZue8KoEhMVzN6CxA2tuLqfSqiU67oyX8npds3FS9G'
2121
2222 let assetId = USDN
2323
24+let commissionAddress = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW')
25+
2426 @Callable(i)
2527 func makeNFT (name,description,productId) = {
26- let $t010971172 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27- let pmtAmount = $t010971172._1
28- let pmtAssetId = $t010971172._2
28+ let $t010121087 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29+ let pmtAmount = $t010121087._1
30+ let pmtAssetId = $t010121087._2
2931 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3032 if ((pmtAssetId != assetId))
3133 then throw("Asset must be USDN only")
3638 else {
3739 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
3840 let newAssetId = calculateAssetId(newAsset)
39-[newAsset, StringEntry(productId, toBase58String(newAssetId))]
41+[newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)]
4042 }
4143 }
4244
6466
6567 @Callable(i)
6668 func buyULUS () = {
67- let $t031233198 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
68- let pmtAmount = $t031233198._1
69- let pmtAssetId = $t031233198._2
69+ let $t031023177 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70+ let pmtAmount = $t031023177._1
71+ let pmtAssetId = $t031023177._2
7072 if ((pmtAssetId != assetId))
7173 then throw("Asset must be USDN only")
7274 else {
8284
8385 @Callable(i)
8486 func sellULUS () = {
85- let $t038523927 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
86- let pmtAmount = $t038523927._1
87- let pmtAssetId = $t038523927._2
87+ let $t038313906 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88+ let pmtAmount = $t038313906._1
89+ let pmtAssetId = $t038313906._2
8890 if ((pmtAssetId != ULUS))
8991 then throw("Asset must be ULUS only")
9092 else {
101103 @Callable(i)
102104 func makePayment (recipient,productId) = {
103105 let recipientAddress = addressFromStringValue(recipient)
104- let $t046804755 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
105- let pmtAmount = $t046804755._1
106- let pmtAssetId = $t046804755._2
106+ let $t046594734 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
107+ let pmtAmount = $t046594734._1
108+ let pmtAssetId = $t046594734._2
107109 if (if ((pmtAssetId != USDN))
108110 then (pmtAssetId != ULUS)
109111 else false)
120122 if (isDefined(getString(this, productId)))
121123 then {
122124 let NFTassetId = fromBase58String(getStringValue(this, productId))
123-[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
125+[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
124126 }
125- else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
127+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
126128 }
127129 }
128130
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
18-let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
18+let USDN = base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p'
1919
20-let ULUS = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig'
20+let ULUS = base58'4dxZue8KoEhMVzN6CxA2tuLqfSqiU67oyX8npds3FS9G'
2121
2222 let assetId = USDN
2323
24+let commissionAddress = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW')
25+
2426 @Callable(i)
2527 func makeNFT (name,description,productId) = {
26- let $t010971172 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27- let pmtAmount = $t010971172._1
28- let pmtAssetId = $t010971172._2
28+ let $t010121087 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
29+ let pmtAmount = $t010121087._1
30+ let pmtAssetId = $t010121087._2
2931 let makeNFTfee = getIntegerValue(this, keyMakeNFTFee)
3032 if ((pmtAssetId != assetId))
3133 then throw("Asset must be USDN only")
3234 else if ((makeNFTfee > pmtAmount))
3335 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3436 else if (isDefined(getString(this, productId)))
3537 then throw("NFT for this productId is already issued.")
3638 else {
3739 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0)
3840 let newAssetId = calculateAssetId(newAsset)
39-[newAsset, StringEntry(productId, toBase58String(newAssetId))]
41+[newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)]
4042 }
4143 }
4244
4345
4446
4547 @Callable(i)
4648 func setParams () = if ((i.caller != this))
4749 then throw("Only the DApp itself can call this function")
4850 else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)]
4951
5052
5153
5254 @Callable(i)
5355 func clearOldParams () = if ((i.caller != this))
5456 then throw("Only the DApp itself can call this function")
5557 else {
5658 let keyBuyUWORLDRate = "buy_UWORLD_rate"
5759 let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter"
5860 let keySellUWORLDRate = "sell_UWORLD_rate"
5961 let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter"
6062 [DeleteEntry(keyBuyUWORLDRate), DeleteEntry(keyBuyUWORLDRateScaleDelimiter), DeleteEntry(keySellUWORLDRate), DeleteEntry(keySellUWORLDRateScaleDelimiter)]
6163 }
6264
6365
6466
6567 @Callable(i)
6668 func buyULUS () = {
67- let $t031233198 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
68- let pmtAmount = $t031233198._1
69- let pmtAssetId = $t031233198._2
69+ let $t031023177 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
70+ let pmtAmount = $t031023177._1
71+ let pmtAssetId = $t031023177._2
7072 if ((pmtAssetId != assetId))
7173 then throw("Asset must be USDN only")
7274 else {
7375 let exchangeRate = getIntegerValue(this, keyBuyULUSRate)
7476 let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter)
7577 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
7678 let amountWithoutCommission = amountToPay
7779 [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)]
7880 }
7981 }
8082
8183
8284
8385 @Callable(i)
8486 func sellULUS () = {
85- let $t038523927 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
86- let pmtAmount = $t038523927._1
87- let pmtAssetId = $t038523927._2
87+ let $t038313906 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
88+ let pmtAmount = $t038313906._1
89+ let pmtAssetId = $t038313906._2
8890 if ((pmtAssetId != ULUS))
8991 then throw("Asset must be ULUS only")
9092 else {
9193 let exchangeRate = getIntegerValue(this, keySellULUSRate)
9294 let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter)
9395 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
9496 let amountWithoutCommission = amountToPay
9597 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
9698 }
9799 }
98100
99101
100102
101103 @Callable(i)
102104 func makePayment (recipient,productId) = {
103105 let recipientAddress = addressFromStringValue(recipient)
104- let $t046804755 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
105- let pmtAmount = $t046804755._1
106- let pmtAssetId = $t046804755._2
106+ let $t046594734 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
107+ let pmtAmount = $t046594734._1
108+ let pmtAssetId = $t046594734._2
107109 if (if ((pmtAssetId != USDN))
108110 then (pmtAssetId != ULUS)
109111 else false)
110112 then throw("Asset must be only USDN or ULUS")
111113 else {
112114 let commission = getIntegerValue(this, keyCommission)
113115 let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter)
114116 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
115117 let amountWithoutCommission = (pmtAmount - amountCommission)
116118 let assetDivider = if ((pmtAssetId == USDN))
117119 then 1000000
118120 else 1000
119121 let amountCashback = fraction(pmtAmount, 100, assetDivider)
120122 if (isDefined(getString(this, productId)))
121123 then {
122124 let NFTassetId = fromBase58String(getStringValue(this, productId))
123-[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
125+[ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)]
124126 }
125- else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
127+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)]
126128 }
127129 }
128130
129131

github/deemru/w8io/169f3d6 
60.99 ms