tx · AQL6ZWm8ZTqQTt3n821DVYkPYMooH4y8bcSDs6GoA3vD

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01400000 Waves

2021.05.19 02:52 [1531803] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "AQL6ZWm8ZTqQTt3n821DVYkPYMooH4y8bcSDs6GoA3vD", "fee": 1400000, "feeAssetId": null, "timestamp": 1621381970168, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "56uXaBpLwDhoLRSwvnqHyLNU9wqUKqGSNWPr7tkjU8REpsooj2McFZi6vUcX5wag4DV4Ju6TUHqtUeUgMPMQkUEd" ], "script": "base64:AAIEAAAAAAAAABkIAhIFCgMICAgSBAoCAQESABIAEgQKAggIAAAACgAAAAAPa2V5RXhjaGFuZ2VSYXRlAgAAAA1leGNoYW5nZV9yYXRlAAAAAB1rZXlFeGNoYW5nZVJhdGVTY2FsZURlbGltaXRlcgIAAAAdZXhjaGFuZ2VfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAAZVV09STEQBAAAAIFw5P18I1L4GAMZe978MAfIh+BM42SxhQKId1T0PstxdAAAAAAdhc3NldElkBQAAAARVU0ROAAAAAApjb21taXNzaW9uAAAAAAAAAHUwAAAAABhjb21taXNzaW9uU2NhbGVEZWxpbWl0ZXIAAAAAAAAPQkAAAAAACm1ha2VORlRmZWUAAAAAAAAHoSAAAAAFAAAAAWkBAAAAB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llbnRBZGRyZXNzBQAAAA5hbW91bnRDYXNoYmFjawUAAAAGVVdPUkxECQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABlVXT1JMRAUAAAADbmlsAAAAAOdVtZA=", "height": 1531803, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 91CsdXtbeQHMztpYnZhp3XaYbogqXCxGR12YEtKmDh9o Next: 89nPJifB1jkjboZ8cuba1sms6BbasLPyJzpcXrDHsRqS Diff:
OldNewDifferences
1919
2020 let commissionScaleDelimiter = 1000000
2121
22+let makeNFTfee = 500000
23+
24+@Callable(i)
25+func makeNFT (name,description,productId) = {
26+ let $t0863938 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27+ let pmtAmount = $t0863938._1
28+ let pmtAssetId = $t0863938._2
29+ if ((pmtAssetId != assetId))
30+ then throw("Asset must be USDN only")
31+ else if ((makeNFTfee > pmtAmount))
32+ then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
33+ else if (isDefined(getString(this, productId)))
34+ then throw("NFT for this productId is already issued.")
35+ else {
36+ let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, true, unit, 0)
37+ let newAssetId = calculateAssetId(newAsset)
38+[newAsset, StringEntry(productId, toBase58String(newAssetId))]
39+ }
40+ }
41+
42+
43+
2244 @Callable(i)
2345 func setParams (exchangeRate,exchangeRateScaleDelimiter) = if ((i.caller != this))
2446 then throw("Only the DApp itself can call this function")
2850
2951 @Callable(i)
3052 func buyUWORLD () = {
31- let $t012311306 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
32- let pmtAmount = $t012311306._1
33- let pmtAssetId = $t012311306._2
53+ let $t019282003 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
54+ let pmtAmount = $t019282003._1
55+ let pmtAssetId = $t019282003._2
3456 if ((pmtAssetId != assetId))
3557 then throw("Asset must be USDN only")
3658 else {
4769
4870 @Callable(i)
4971 func sellUWORLD () = {
50- let $t019642039 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
51- let pmtAmount = $t019642039._1
52- let pmtAssetId = $t019642039._2
72+ let $t026612736 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73+ let pmtAmount = $t026612736._1
74+ let pmtAssetId = $t026612736._2
5375 if ((pmtAssetId != UWORLD))
5476 then throw("Asset must be UWORLD only")
5577 else {
6587
6688
6789 @Callable(i)
68-func makePayment (recipient) = {
90+func makePayment (recipient,productId) = {
6991 let recipientAddress = addressFromStringValue(recipient)
70- let $t027752850 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
71- let pmtAmount = $t027752850._1
72- let pmtAssetId = $t027752850._2
92+ let $t034913566 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
93+ let pmtAmount = $t034913566._1
94+ let pmtAssetId = $t034913566._2
7395 if ((pmtAssetId != assetId))
7496 then throw("Asset must be USDN only")
7597 else {
7698 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
7799 let amountWithoutCommission = (pmtAmount - amountCommission)
78100 let amountCashback = fraction(pmtAmount, 10, 100)
79-[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
101+ let NFTassetId = fromBase58String(getStringValue(this, productId))
102+ if (isDefined(NFTassetId))
103+ then [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
104+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
80105 }
81106 }
82107
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyExchangeRate = "exchange_rate"
55
66 let keyExchangeRateScaleDelimiter = "exchange_rate_scale_delimiter"
77
88 let keyCommission = "commission"
99
1010 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
1111
1212 let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg'
1313
1414 let UWORLD = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig'
1515
1616 let assetId = USDN
1717
1818 let commission = 30000
1919
2020 let commissionScaleDelimiter = 1000000
2121
22+let makeNFTfee = 500000
23+
24+@Callable(i)
25+func makeNFT (name,description,productId) = {
26+ let $t0863938 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
27+ let pmtAmount = $t0863938._1
28+ let pmtAssetId = $t0863938._2
29+ if ((pmtAssetId != assetId))
30+ then throw("Asset must be USDN only")
31+ else if ((makeNFTfee > pmtAmount))
32+ then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
33+ else if (isDefined(getString(this, productId)))
34+ then throw("NFT for this productId is already issued.")
35+ else {
36+ let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, true, unit, 0)
37+ let newAssetId = calculateAssetId(newAsset)
38+[newAsset, StringEntry(productId, toBase58String(newAssetId))]
39+ }
40+ }
41+
42+
43+
2244 @Callable(i)
2345 func setParams (exchangeRate,exchangeRateScaleDelimiter) = if ((i.caller != this))
2446 then throw("Only the DApp itself can call this function")
2547 else [IntegerEntry(keyExchangeRate, exchangeRate), IntegerEntry(keyExchangeRateScaleDelimiter, exchangeRateScaleDelimiter), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter)]
2648
2749
2850
2951 @Callable(i)
3052 func buyUWORLD () = {
31- let $t012311306 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
32- let pmtAmount = $t012311306._1
33- let pmtAssetId = $t012311306._2
53+ let $t019282003 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
54+ let pmtAmount = $t019282003._1
55+ let pmtAssetId = $t019282003._2
3456 if ((pmtAssetId != assetId))
3557 then throw("Asset must be USDN only")
3658 else {
3759 let exchangeRate = getIntegerValue(this, keyExchangeRate)
3860 let exchangeRateScaleDelimiter = getIntegerValue(this, keyExchangeRateScaleDelimiter)
3961 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
4062 let amountCommission = fraction(amountToPay, commission, commissionScaleDelimiter)
4163 let amountWithoutCommission = (amountToPay - amountCommission)
4264 [ScriptTransfer(i.caller, amountWithoutCommission, UWORLD)]
4365 }
4466 }
4567
4668
4769
4870 @Callable(i)
4971 func sellUWORLD () = {
50- let $t019642039 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
51- let pmtAmount = $t019642039._1
52- let pmtAssetId = $t019642039._2
72+ let $t026612736 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
73+ let pmtAmount = $t026612736._1
74+ let pmtAssetId = $t026612736._2
5375 if ((pmtAssetId != UWORLD))
5476 then throw("Asset must be UWORLD only")
5577 else {
5678 let exchangeRate = getIntegerValue(this, keyExchangeRate)
5779 let exchangeRateScaleDelimiter = getIntegerValue(this, keyExchangeRateScaleDelimiter)
5880 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
5981 let amountCommission = fraction(amountToPay, commission, commissionScaleDelimiter)
6082 let amountWithoutCommission = (amountToPay - amountCommission)
6183 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
6284 }
6385 }
6486
6587
6688
6789 @Callable(i)
68-func makePayment (recipient) = {
90+func makePayment (recipient,productId) = {
6991 let recipientAddress = addressFromStringValue(recipient)
70- let $t027752850 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
71- let pmtAmount = $t027752850._1
72- let pmtAssetId = $t027752850._2
92+ let $t034913566 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
93+ let pmtAmount = $t034913566._1
94+ let pmtAssetId = $t034913566._2
7395 if ((pmtAssetId != assetId))
7496 then throw("Asset must be USDN only")
7597 else {
7698 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
7799 let amountWithoutCommission = (pmtAmount - amountCommission)
78100 let amountCashback = fraction(pmtAmount, 10, 100)
79-[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
101+ let NFTassetId = fromBase58String(getStringValue(this, productId))
102+ if (isDefined(NFTassetId))
103+ then [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
104+ else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
80105 }
81106 }
82107
83108

github/deemru/w8io/026f985 
41.40 ms