tx · 89nPJifB1jkjboZ8cuba1sms6BbasLPyJzpcXrDHsRqS

3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id:  -0.01400000 Waves

2021.05.19 15:17 [1532544] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves

{ "type": 13, "id": "89nPJifB1jkjboZ8cuba1sms6BbasLPyJzpcXrDHsRqS", "fee": 1400000, "feeAssetId": null, "timestamp": 1621426669803, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "3EYPg4tMZmqhdPJ1ecbr28ZqSeS3QMYtirZN59WbbYmKqhtkzwpbnjrLrVgffrXDjmkeavsuBKKhqpRY1SR8t1Zf" ], "script": "base64:AAIEAAAAAAAAABkIAhIFCgMICAgSBAoCAQESABIAEgQKAggIAAAACgAAAAAPa2V5RXhjaGFuZ2VSYXRlAgAAAA1leGNoYW5nZV9yYXRlAAAAAB1rZXlFeGNoYW5nZVJhdGVTY2FsZURlbGltaXRlcgIAAAAdZXhjaGFuZ2VfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAAZVV09STEQBAAAAIFw5P18I1L4GAMZe978MAfIh+BM42SxhQKId1T0PstxdAAAAAAdhc3NldElkBQAAAARVU0ROAAAAAApjb21taXNzaW9uAAAAAAAAAHUwAAAAABhjb21taXNzaW9uU2NhbGVEZWxpbWl0ZXIAAAAAAAAPQkAAAAAACm1ha2VORlRmZWUAAAAAAAAHoSAAAAAFAAAAAWkBAAAAB21ha2V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AAAwUAAAAQcmVjaXBpZW50QWRkcmVzcwUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABlVXT1JMRAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAADmFtb3VudENhc2hiYWNrBQAAAAZVV09STEQFAAAAA25pbAAAAACMSmrS", "height": 1532544, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AQL6ZWm8ZTqQTt3n821DVYkPYMooH4y8bcSDs6GoA3vD Next: BK7R1AQkZxZy2wzVvBz2hJhT5pJHheV5SNfJ7pcV5Jv9 Diff:
OldNewDifferences
9898 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
9999 let amountWithoutCommission = (pmtAmount - amountCommission)
100100 let amountCashback = fraction(pmtAmount, 10, 100)
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)]
101+ if (isDefined(getString(this, productId)))
102+ then {
103+ let NFTassetId = fromBase58String(getStringValue(this, productId))
104+[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
105+ }
104106 else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
105107 }
106108 }
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
2222 let makeNFTfee = 500000
2323
2424 @Callable(i)
2525 func makeNFT (name,description,productId) = {
2626 let $t0863938 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
2727 let pmtAmount = $t0863938._1
2828 let pmtAssetId = $t0863938._2
2929 if ((pmtAssetId != assetId))
3030 then throw("Asset must be USDN only")
3131 else if ((makeNFTfee > pmtAmount))
3232 then throw(("Fee for make NFT token is " + toString(makeNFTfee)))
3333 else if (isDefined(getString(this, productId)))
3434 then throw("NFT for this productId is already issued.")
3535 else {
3636 let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, true, unit, 0)
3737 let newAssetId = calculateAssetId(newAsset)
3838 [newAsset, StringEntry(productId, toBase58String(newAssetId))]
3939 }
4040 }
4141
4242
4343
4444 @Callable(i)
4545 func setParams (exchangeRate,exchangeRateScaleDelimiter) = if ((i.caller != this))
4646 then throw("Only the DApp itself can call this function")
4747 else [IntegerEntry(keyExchangeRate, exchangeRate), IntegerEntry(keyExchangeRateScaleDelimiter, exchangeRateScaleDelimiter), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter)]
4848
4949
5050
5151 @Callable(i)
5252 func buyUWORLD () = {
5353 let $t019282003 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
5454 let pmtAmount = $t019282003._1
5555 let pmtAssetId = $t019282003._2
5656 if ((pmtAssetId != assetId))
5757 then throw("Asset must be USDN only")
5858 else {
5959 let exchangeRate = getIntegerValue(this, keyExchangeRate)
6060 let exchangeRateScaleDelimiter = getIntegerValue(this, keyExchangeRateScaleDelimiter)
6161 let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate)
6262 let amountCommission = fraction(amountToPay, commission, commissionScaleDelimiter)
6363 let amountWithoutCommission = (amountToPay - amountCommission)
6464 [ScriptTransfer(i.caller, amountWithoutCommission, UWORLD)]
6565 }
6666 }
6767
6868
6969
7070 @Callable(i)
7171 func sellUWORLD () = {
7272 let $t026612736 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
7373 let pmtAmount = $t026612736._1
7474 let pmtAssetId = $t026612736._2
7575 if ((pmtAssetId != UWORLD))
7676 then throw("Asset must be UWORLD only")
7777 else {
7878 let exchangeRate = getIntegerValue(this, keyExchangeRate)
7979 let exchangeRateScaleDelimiter = getIntegerValue(this, keyExchangeRateScaleDelimiter)
8080 let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter)
8181 let amountCommission = fraction(amountToPay, commission, commissionScaleDelimiter)
8282 let amountWithoutCommission = (amountToPay - amountCommission)
8383 [ScriptTransfer(i.caller, amountWithoutCommission, USDN)]
8484 }
8585 }
8686
8787
8888
8989 @Callable(i)
9090 func makePayment (recipient,productId) = {
9191 let recipientAddress = addressFromStringValue(recipient)
9292 let $t034913566 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
9393 let pmtAmount = $t034913566._1
9494 let pmtAssetId = $t034913566._2
9595 if ((pmtAssetId != assetId))
9696 then throw("Asset must be USDN only")
9797 else {
9898 let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter)
9999 let amountWithoutCommission = (pmtAmount - amountCommission)
100100 let amountCashback = fraction(pmtAmount, 10, 100)
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)]
101+ if (isDefined(getString(this, productId)))
102+ then {
103+ let NFTassetId = fromBase58String(getStringValue(this, productId))
104+[ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD), ScriptTransfer(i.caller, 1, NFTassetId)]
105+ }
104106 else [ScriptTransfer(recipientAddress, amountWithoutCommission, assetId), ScriptTransfer(recipientAddress, amountCashback, UWORLD), ScriptTransfer(i.caller, amountCashback, UWORLD)]
105107 }
106108 }
107109
108110

github/deemru/w8io/026f985 
42.66 ms