tx · HNFiK4DVdTF96inySdDf3SUpqc7PaxCi1KpSFAk6QyJd

3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a:  -0.05000000 Waves

2024.05.07 08:49 [3095351] smart account 3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a > SELF 0.00000000 Waves

{ "type": 13, "id": "HNFiK4DVdTF96inySdDf3SUpqc7PaxCi1KpSFAk6QyJd", "fee": 5000000, "feeAssetId": null, "timestamp": 1715061044470, "version": 2, "chainId": 84, "sender": "3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a", "senderPublicKey": "4uUUD88FFMgtPjui9NEmEstYpUVQNPSLCQw5f8mYHmGz", "proofs": [ "4szi7aTUZSnJGXyKMsCMeANfdJJVYh1ByVryH9211fWPWsU4tabW3HihKFzHVTWyQ4BhYvVvxppcDbWQ4GYq6Ag9" ], "script": "base64:BgIECAISAAUADVVTRFRfQVNTRVRfSUQCLEc1V1dXenpWc1dSeXpHZjMyeG9qYm5mcDdnWGJXcmdxSlQ4UmNWV0VmTG1DAA9VU0RUXzJfQVNTRVRfSUQCLDl3YzNMWE5BNFRFQnNYeUt0b0xFOW1yYkREN1dNSFh2WHJDalp2YWJMQXNpAA1VU0RDX0FTU0VUX0lEAiwzYXlIM1BoV01raEZzeVNzVVZjQzhCdkZmMVF5eEdCNUJadVRQeVZ0bVA0dgAPVVNEQ18yX0FTU0VUX0lEAixIR2dhYlRxVVM4V3RWRlVKemZtclRETWdFY2NKdVpMQlBoRmdRRnh2bnNvVwAMQkFJX0FTU0VUX0lEAiwyZmR6eUh2WEdDcWF6MVhBOG05Zm9kZW1tUDlnaVZCY3BlNEpxOUY2M29GTAEBaQEDYnV5AAQRV0FWRVNfVVNEVF9PUkFDTEUJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNQS2tvaktkZDZCQnpUZjFSWGJRVmZVRHJhTkZYWEhLelFGBBVXQVZFU19VU0RUX09SQUNMRV9LRVkCFyVzJXNfX3ByaWNlX19X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4gV2F2ZXMsIFVTREMgb3IgVVNEVCEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUGc2VuZGVyBQZhbW91bnQJANkEAQUMQkFJX0FTU0VUX0lEBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5jU60bg==", "height": 3095351, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AmryZXF89oZzi6XkVbpD9bXHMrGdBwSWeyG2SS67ZAFw Next: F8Sh4zvnU2i9wMHFHgMM9dubtRcFqHrbMvSSahRgK8j8 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
4+let USDT_ASSET_ID = "G5WWWzzVsWRyzGf32xojbnfp7gXbWrgqJT8RcVWEfLmC"
55
6-let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
6+let USDT_2_ASSET_ID = "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi"
77
8-let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
8+let USDC_ASSET_ID = "3ayH3PhWMkhFsySsUVcC8BvFf1QyxGB5BZuTPyVtmP4v"
99
10-let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
10+let USDC_2_ASSET_ID = "HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW"
1111
12-let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
13-
14-func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) {
15- case b: Boolean =>
16- b
17- case _ =>
18- false
19-}
20-
12+let BAI_ASSET_ID = "2fdzyHvXGCqaz1XA8m9fodemmP9giVBcpe4Jq9F63oFL"
2113
2214 @Callable(i)
2315 func buy () = {
24- let WAVES_USDT_ORACLE = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy")
16+ let WAVES_USDT_ORACLE = addressFromStringValue("3PKkojKdd6BBzTf1RXbQVfUDraNFXXHKzQF")
2517 let WAVES_USDT_ORACLE_KEY = "%s%s__price__WAVES-USDT"
2618 let numberOfPayments = size(i.payments)
2719 let paymentAssetId = i.payments[0].assetId
2820 let sender = i.caller
29- if (!(whitelisted(toString(sender))))
30- then throw("Address not whitelisted!")
31- else if ((numberOfPayments != 1))
32- then throw("Payment necessary!")
33- else {
34- let payment = i.payments[0]
35- let feeAssetId = payment.assetId
36- let feeAssetIdString = match feeAssetId {
37- case b: ByteVector =>
38- toBase58String(b)
39- case _ =>
40- ""
41- }
42- let paymentAmount = payment.amount
43- let amount = if (!(isDefined(feeAssetId)))
44- then {
45- let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
46- case n: Int =>
47- n
48- case _ =>
49- 0
50- }
51- (fraction(paymentAmount, wavesUsdtPrice, 100000000) * 100)
52- }
53- else if ((feeAssetIdString == USDT_ASSET_ID))
54- then (paymentAmount * 100)
55- else if ((feeAssetIdString == USDT_2_ASSET_ID))
56- then (paymentAmount * 100)
57- else if ((feeAssetIdString == USDC_ASSET_ID))
58- then (paymentAmount * 100)
59- else if ((feeAssetIdString == USDC_2_ASSET_ID))
60- then (paymentAmount * 100)
61- else throw("Payment necessary in Waves, USDC or USDT!")
21+ if ((numberOfPayments != 1))
22+ then throw("Payment necessary!")
23+ else {
24+ let payment = i.payments[0]
25+ let feeAssetId = payment.assetId
26+ let feeAssetIdString = match feeAssetId {
27+ case b: ByteVector =>
28+ toBase58String(b)
29+ case _ =>
30+ ""
31+ }
32+ let paymentAmount = payment.amount
33+ let amount = if (!(isDefined(feeAssetId)))
34+ then {
35+ let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
36+ case n: Int =>
37+ n
38+ case _ =>
39+ 0
40+ }
41+ (fraction((12 * paymentAmount), wavesUsdtPrice, 100000000) * 10)
42+ }
43+ else if ((feeAssetIdString == USDT_ASSET_ID))
44+ then fraction(paymentAmount, 1000, 12)
45+ else if ((feeAssetIdString == USDT_2_ASSET_ID))
46+ then fraction(paymentAmount, 1000, 12)
47+ else if ((feeAssetIdString == USDC_ASSET_ID))
48+ then fraction(paymentAmount, 1000, 12)
49+ else if ((feeAssetIdString == USDC_2_ASSET_ID))
50+ then fraction(paymentAmount, 1000, 12)
51+ else throw("Payment necessary in Waves, USDC or USDT!")
6252 [ScriptTransfer(sender, amount, fromBase58String(BAI_ASSET_ID))]
63- }
53+ }
6454 }
6555
6656
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
4+let USDT_ASSET_ID = "G5WWWzzVsWRyzGf32xojbnfp7gXbWrgqJT8RcVWEfLmC"
55
6-let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
6+let USDT_2_ASSET_ID = "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi"
77
8-let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
8+let USDC_ASSET_ID = "3ayH3PhWMkhFsySsUVcC8BvFf1QyxGB5BZuTPyVtmP4v"
99
10-let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
10+let USDC_2_ASSET_ID = "HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW"
1111
12-let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
13-
14-func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) {
15- case b: Boolean =>
16- b
17- case _ =>
18- false
19-}
20-
12+let BAI_ASSET_ID = "2fdzyHvXGCqaz1XA8m9fodemmP9giVBcpe4Jq9F63oFL"
2113
2214 @Callable(i)
2315 func buy () = {
24- let WAVES_USDT_ORACLE = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy")
16+ let WAVES_USDT_ORACLE = addressFromStringValue("3PKkojKdd6BBzTf1RXbQVfUDraNFXXHKzQF")
2517 let WAVES_USDT_ORACLE_KEY = "%s%s__price__WAVES-USDT"
2618 let numberOfPayments = size(i.payments)
2719 let paymentAssetId = i.payments[0].assetId
2820 let sender = i.caller
29- if (!(whitelisted(toString(sender))))
30- then throw("Address not whitelisted!")
31- else if ((numberOfPayments != 1))
32- then throw("Payment necessary!")
33- else {
34- let payment = i.payments[0]
35- let feeAssetId = payment.assetId
36- let feeAssetIdString = match feeAssetId {
37- case b: ByteVector =>
38- toBase58String(b)
39- case _ =>
40- ""
41- }
42- let paymentAmount = payment.amount
43- let amount = if (!(isDefined(feeAssetId)))
44- then {
45- let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
46- case n: Int =>
47- n
48- case _ =>
49- 0
50- }
51- (fraction(paymentAmount, wavesUsdtPrice, 100000000) * 100)
52- }
53- else if ((feeAssetIdString == USDT_ASSET_ID))
54- then (paymentAmount * 100)
55- else if ((feeAssetIdString == USDT_2_ASSET_ID))
56- then (paymentAmount * 100)
57- else if ((feeAssetIdString == USDC_ASSET_ID))
58- then (paymentAmount * 100)
59- else if ((feeAssetIdString == USDC_2_ASSET_ID))
60- then (paymentAmount * 100)
61- else throw("Payment necessary in Waves, USDC or USDT!")
21+ if ((numberOfPayments != 1))
22+ then throw("Payment necessary!")
23+ else {
24+ let payment = i.payments[0]
25+ let feeAssetId = payment.assetId
26+ let feeAssetIdString = match feeAssetId {
27+ case b: ByteVector =>
28+ toBase58String(b)
29+ case _ =>
30+ ""
31+ }
32+ let paymentAmount = payment.amount
33+ let amount = if (!(isDefined(feeAssetId)))
34+ then {
35+ let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
36+ case n: Int =>
37+ n
38+ case _ =>
39+ 0
40+ }
41+ (fraction((12 * paymentAmount), wavesUsdtPrice, 100000000) * 10)
42+ }
43+ else if ((feeAssetIdString == USDT_ASSET_ID))
44+ then fraction(paymentAmount, 1000, 12)
45+ else if ((feeAssetIdString == USDT_2_ASSET_ID))
46+ then fraction(paymentAmount, 1000, 12)
47+ else if ((feeAssetIdString == USDC_ASSET_ID))
48+ then fraction(paymentAmount, 1000, 12)
49+ else if ((feeAssetIdString == USDC_2_ASSET_ID))
50+ then fraction(paymentAmount, 1000, 12)
51+ else throw("Payment necessary in Waves, USDC or USDT!")
6252 [ScriptTransfer(sender, amount, fromBase58String(BAI_ASSET_ID))]
63- }
53+ }
6454 }
6555
6656
6757 @Verifier(tx)
6858 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6959

github/deemru/w8io/026f985 
22.17 ms