tx · F1FsW4rDkF41sWwBUBtAE8vYPgjugEzp8W8YJVDGAPMd 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id: -0.01000000 Waves 2022.01.06 14:10 [1866971] smart account 3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id > SELF 0.00000000 Waves
{ "type": 13, "id": "F1FsW4rDkF41sWwBUBtAE8vYPgjugEzp8W8YJVDGAPMd", "fee": 1000000, "feeAssetId": null, "timestamp": 1641467430014, "version": 2, "chainId": 84, "sender": "3NADYuG3G91PrmsrRqQfyeDCf2Pi53UV5id", "senderPublicKey": "8agr5kfwDL7NLuMetvciXCcd9TcDKZhRwYZPPTAShaCC", "proofs": [ "5iUzyA3bGWmBvpyp9zD8FhbqDJNFEoiRKBBq4tkMBYPpcgcSMWAvn2B452jCkariFegFEYGyNhhzdBKNXvGkByUi" ], "script": "base64:AAIEAAAAAAAAABgIAhIFCgMICAgSABIAEgASABIFCgMICAgAAAALAAAAAA5rZXlCdXlVTFVTUmF0ZQIAAAANYnV5X1VMVVNfcmF0ZQAAAAAca2V5QnV5VUxVU1JhdGVTY2FsZURlbGltaXRlcgIAAAAdYnV5X1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAAD2tleVNlbGxVTFVTUmF0ZQIAAAAOc2VsbF9VTFVTX3JhdGUAAAAAHWtleVNlbGxVTFVTUmF0ZVNjYWxlRGVsaW1pdGVyAgAAAB5zZWxsX1VMVVNfcmF0ZV9zY2FsZV9kZWxpbWl0ZXIAAAAADWtleU1ha2VORlRGZWUCAAAAEGtleV9tYWtlX05GVF9mZWUAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAABFVTRE4BAAAAIOSwcsQaO/7w9gk22WMNYWxRgCp4LSxG18pSVz66uVShAAAAAARVTFVTAQAAACBcOT9fCNS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AAARVTFVTCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAAAQUAAAAKTkZUYXNzZXRJZAUAAAADbmlsCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEHJlY2lwaWVudEFkZHJlc3MFAAAAF2Ftb3VudFdpdGhvdXRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEWNvbW1pc3Npb25BZGRyZXNzBQAAABBhbW91bnRDb21taXNzaW9uBQAAAApwbXRBc3NldElkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOYW1vdW50Q2FzaGJhY2sFAAAABFVMVVMFAAAAA25pbAAAAABDJ9Jf", "height": 1866971, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EiHK8PHhSRW8C4DMrmEBGLZEWvpNUQ7anvZfcSQPcDCS Next: CQ624XhFv88hV4RQHSUWcoFa3Np6mbgkZNVwn7txiLRS Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
17 | 17 | ||
18 | - | let USDN = base58' | |
18 | + | let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg' | |
19 | 19 | ||
20 | - | let ULUS = base58' | |
20 | + | let ULUS = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig' | |
21 | 21 | ||
22 | 22 | let assetId = USDN | |
23 | 23 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(i) | |
104 | - | func makePayment (recipient,productId) = { | |
104 | + | func makePayment (recipient,productId,proof) = { | |
105 | 105 | let recipientAddress = addressFromStringValue(recipient) | |
106 | - | let $ | |
107 | - | let pmtAmount = $ | |
108 | - | let pmtAssetId = $ | |
106 | + | let $t046744749 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
107 | + | let pmtAmount = $t046744749._1 | |
108 | + | let pmtAssetId = $t046744749._2 | |
109 | 109 | if (if ((pmtAssetId != USDN)) | |
110 | 110 | then (pmtAssetId != ULUS) | |
111 | 111 | else false) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyBuyULUSRate = "buy_ULUS_rate" | |
5 | 5 | ||
6 | 6 | let keyBuyULUSRateScaleDelimiter = "buy_ULUS_rate_scale_delimiter" | |
7 | 7 | ||
8 | 8 | let keySellULUSRate = "sell_ULUS_rate" | |
9 | 9 | ||
10 | 10 | let keySellULUSRateScaleDelimiter = "sell_ULUS_rate_scale_delimiter" | |
11 | 11 | ||
12 | 12 | let keyMakeNFTFee = "key_make_NFT_fee" | |
13 | 13 | ||
14 | 14 | let keyCommission = "commission" | |
15 | 15 | ||
16 | 16 | let keyCommissionScaleDelimiter = "commission_scale_delimiter" | |
17 | 17 | ||
18 | - | let USDN = base58' | |
18 | + | let USDN = base58'GPi1Q6QVgUmuomtThbim81hBYBEUWyf5BVmE4Tnd3sNg' | |
19 | 19 | ||
20 | - | let ULUS = base58' | |
20 | + | let ULUS = base58'7D191wpwpSs4WanizHWgiRhAYhCGkmpop4h3NzUQreig' | |
21 | 21 | ||
22 | 22 | let assetId = USDN | |
23 | 23 | ||
24 | 24 | let commissionAddress = Address(base58'3P9pCG7EBbhAkTxJQkwp6oTyc12zghXGUBW') | |
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | 27 | func makeNFT (name,description,productId) = { | |
28 | 28 | let $t010121087 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
29 | 29 | let pmtAmount = $t010121087._1 | |
30 | 30 | let pmtAssetId = $t010121087._2 | |
31 | 31 | let makeNFTfee = getIntegerValue(this, keyMakeNFTFee) | |
32 | 32 | if ((pmtAssetId != assetId)) | |
33 | 33 | then throw("Asset must be USDN only") | |
34 | 34 | else if ((makeNFTfee > pmtAmount)) | |
35 | 35 | then throw(("Fee for make NFT token is " + toString(makeNFTfee))) | |
36 | 36 | else if (isDefined(getString(this, productId))) | |
37 | 37 | then throw("NFT for this productId is already issued.") | |
38 | 38 | else { | |
39 | 39 | let newAsset = Issue(name, (((description + "[") + productId) + "]"), 1, 0, false, unit, 0) | |
40 | 40 | let newAssetId = calculateAssetId(newAsset) | |
41 | 41 | [newAsset, StringEntry(productId, toBase58String(newAssetId)), ScriptTransfer(commissionAddress, pmtAmount, pmtAssetId)] | |
42 | 42 | } | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func setParams () = if ((i.caller != this)) | |
49 | 49 | then throw("Only the DApp itself can call this function") | |
50 | 50 | else [IntegerEntry(keyBuyULUSRate, 150000), IntegerEntry(keyBuyULUSRateScaleDelimiter, 1000), IntegerEntry(keySellULUSRate, 100000), IntegerEntry(keySellULUSRateScaleDelimiter, 1000), IntegerEntry(keyCommission, 30000), IntegerEntry(keyCommissionScaleDelimiter, 1000000), IntegerEntry(keyMakeNFTFee, 1000000)] | |
51 | 51 | ||
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func clearOldParams () = if ((i.caller != this)) | |
56 | 56 | then throw("Only the DApp itself can call this function") | |
57 | 57 | else { | |
58 | 58 | let keyBuyUWORLDRate = "buy_UWORLD_rate" | |
59 | 59 | let keyBuyUWORLDRateScaleDelimiter = "buy_UWORLD_rate_scale_delimiter" | |
60 | 60 | let keySellUWORLDRate = "sell_UWORLD_rate" | |
61 | 61 | let keySellUWORLDRateScaleDelimiter = "sell_UWORLD_rate_scale_delimiter" | |
62 | 62 | [DeleteEntry(keyBuyUWORLDRate), DeleteEntry(keyBuyUWORLDRateScaleDelimiter), DeleteEntry(keySellUWORLDRate), DeleteEntry(keySellUWORLDRateScaleDelimiter)] | |
63 | 63 | } | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Callable(i) | |
68 | 68 | func buyULUS () = { | |
69 | 69 | let $t031023177 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
70 | 70 | let pmtAmount = $t031023177._1 | |
71 | 71 | let pmtAssetId = $t031023177._2 | |
72 | 72 | if ((pmtAssetId != assetId)) | |
73 | 73 | then throw("Asset must be USDN only") | |
74 | 74 | else { | |
75 | 75 | let exchangeRate = getIntegerValue(this, keyBuyULUSRate) | |
76 | 76 | let exchangeRateScaleDelimiter = getIntegerValue(this, keyBuyULUSRateScaleDelimiter) | |
77 | 77 | let amountToPay = fraction(pmtAmount, exchangeRateScaleDelimiter, exchangeRate) | |
78 | 78 | let amountWithoutCommission = amountToPay | |
79 | 79 | [ScriptTransfer(i.caller, amountWithoutCommission, ULUS)] | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | 86 | func sellULUS () = { | |
87 | 87 | let $t038313906 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
88 | 88 | let pmtAmount = $t038313906._1 | |
89 | 89 | let pmtAssetId = $t038313906._2 | |
90 | 90 | if ((pmtAssetId != ULUS)) | |
91 | 91 | then throw("Asset must be ULUS only") | |
92 | 92 | else { | |
93 | 93 | let exchangeRate = getIntegerValue(this, keySellULUSRate) | |
94 | 94 | let exchangeRateScaleDelimiter = getIntegerValue(this, keySellULUSRateScaleDelimiter) | |
95 | 95 | let amountToPay = fraction(pmtAmount, exchangeRate, exchangeRateScaleDelimiter) | |
96 | 96 | let amountWithoutCommission = amountToPay | |
97 | 97 | [ScriptTransfer(i.caller, amountWithoutCommission, USDN)] | |
98 | 98 | } | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | ||
103 | 103 | @Callable(i) | |
104 | - | func makePayment (recipient,productId) = { | |
104 | + | func makePayment (recipient,productId,proof) = { | |
105 | 105 | let recipientAddress = addressFromStringValue(recipient) | |
106 | - | let $ | |
107 | - | let pmtAmount = $ | |
108 | - | let pmtAssetId = $ | |
106 | + | let $t046744749 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
107 | + | let pmtAmount = $t046744749._1 | |
108 | + | let pmtAssetId = $t046744749._2 | |
109 | 109 | if (if ((pmtAssetId != USDN)) | |
110 | 110 | then (pmtAssetId != ULUS) | |
111 | 111 | else false) | |
112 | 112 | then throw("Asset must be only USDN or ULUS") | |
113 | 113 | else { | |
114 | 114 | let commission = getIntegerValue(this, keyCommission) | |
115 | 115 | let commissionScaleDelimiter = getIntegerValue(this, keyCommissionScaleDelimiter) | |
116 | 116 | let amountCommission = fraction(pmtAmount, commission, commissionScaleDelimiter) | |
117 | 117 | let amountWithoutCommission = (pmtAmount - amountCommission) | |
118 | 118 | let assetDivider = if ((pmtAssetId == USDN)) | |
119 | 119 | then 1000000 | |
120 | 120 | else 1000 | |
121 | 121 | let amountCashback = fraction(pmtAmount, 100, assetDivider) | |
122 | 122 | if (isDefined(getString(this, productId))) | |
123 | 123 | then { | |
124 | 124 | let NFTassetId = fromBase58String(getStringValue(this, productId)) | |
125 | 125 | [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS), ScriptTransfer(i.caller, 1, NFTassetId)] | |
126 | 126 | } | |
127 | 127 | else [ScriptTransfer(recipientAddress, amountWithoutCommission, pmtAssetId), ScriptTransfer(commissionAddress, amountCommission, pmtAssetId), ScriptTransfer(i.caller, amountCashback, ULUS)] | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 |
github/deemru/w8io/026f985 55.35 ms ◑