tx · 2owPwm4tcM3RUAhRSH2BdGqNzEuMVueBmCZviUCoX7Xw 3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a: -0.05000000 Waves 2024.04.03 08:44 [3046194] smart account 3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a > SELF 0.00000000 Waves
{ "type": 13, "id": "2owPwm4tcM3RUAhRSH2BdGqNzEuMVueBmCZviUCoX7Xw", "fee": 5000000, "feeAssetId": null, "timestamp": 1712123115298, "version": 2, "chainId": 84, "sender": "3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a", "senderPublicKey": "4uUUD88FFMgtPjui9NEmEstYpUVQNPSLCQw5f8mYHmGz", "proofs": [ "5sErHbh3VpTCsU3nbnCCqyrJCaXGunSY8XgyMJ57RwhYBPMSJoVp4WCW1WpeFQBUMfXWPgS5a7L44r7hGMkEwgBg" ], "script": "base64:BgIECAISAAYADVVTRFRfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA9VU0RUXzJfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA1VU0RDX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAPVVNEQ18yX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAMQkFJX0FTU0VUX0lEAixBeEdLUVJ4S280RjJFYmhyUnE2TjJ0ZExzeHRNbnB6UXNTNFFlbVY2VjFXMQELd2hpdGVsaXN0ZWQBB2FkZHJlc3MEByRtYXRjaDAJAJsIAgUEdGhpcwkArAICAgp3aGl0ZWxpc3RfBQdhZGRyZXNzAwkAAQIFByRtYXRjaDACB0Jvb2xlYW4EAWIFByRtYXRjaDAFAWIHAQFp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UX0lECQBoAgUNcGF5bWVudEFtb3VudABkAwkAAAIFEGZlZUFzc2V0SWRTdHJpbmcFDVVTRENfQVNTRVRfSUQJAGgCBQ1wYXltZW50QW1vdW50AGQDCQAAAgUQZmVlQXNzZXRJZFN0cmluZwUPVVNEQ18yX0FTU0VUX0lECQBoAgUNcGF5bWVudEFtb3VudABkCQACAQIpUGF5bWVudCBuZWNlc3NhcnkgaW4gV2F2ZXMsIFVTREMgb3IgVVNEVCEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUGc2VuZGVyBQZhbW91bnQJANkEAQUMQkFJX0FTU0VUX0lEBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5I1qhAg==", "height": 3046194, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 58Ytg4pXNEQmAoVaJJ2rBvpHsdDNaZt7HePkNgx2uvy2 Next: AmryZXF89oZzi6XkVbpD9bXHMrGdBwSWeyG2SS67ZAFw Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let USDT_ASSET_ID = " | |
4 | + | let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
5 | 5 | ||
6 | - | let USDT_2_ASSET_ID = " | |
6 | + | let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
7 | 7 | ||
8 | - | let USDC_ASSET_ID = " | |
8 | + | let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
9 | 9 | ||
10 | - | let USDC_2_ASSET_ID = " | |
10 | + | let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
11 | 11 | ||
12 | - | let BAI_ASSET_ID = " | |
12 | + | let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
13 | 13 | ||
14 | 14 | func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) { | |
15 | 15 | case b: Boolean => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let USDT_ASSET_ID = " | |
4 | + | let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
5 | 5 | ||
6 | - | let USDT_2_ASSET_ID = " | |
6 | + | let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
7 | 7 | ||
8 | - | let USDC_ASSET_ID = " | |
8 | + | let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
9 | 9 | ||
10 | - | let USDC_2_ASSET_ID = " | |
10 | + | let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
11 | 11 | ||
12 | - | let BAI_ASSET_ID = " | |
12 | + | let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
13 | 13 | ||
14 | 14 | func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) { | |
15 | 15 | case b: Boolean => | |
16 | 16 | b | |
17 | 17 | case _ => | |
18 | 18 | false | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | @Callable(i) | |
23 | 23 | func buy () = { | |
24 | 24 | let WAVES_USDT_ORACLE = addressFromStringValue("3PKkojKdd6BBzTf1RXbQVfUDraNFXXHKzQF") | |
25 | 25 | let WAVES_USDT_ORACLE_KEY = "%s%s__price__WAVES-USDT" | |
26 | 26 | let numberOfPayments = size(i.payments) | |
27 | 27 | let paymentAssetId = i.payments[0].assetId | |
28 | 28 | let sender = i.caller | |
29 | 29 | if (!(whitelisted(toString(sender)))) | |
30 | 30 | then throw("Address not whitelisted!") | |
31 | 31 | else if ((numberOfPayments != 1)) | |
32 | 32 | then throw("Payment necessary!") | |
33 | 33 | else { | |
34 | 34 | let payment = i.payments[0] | |
35 | 35 | let feeAssetId = payment.assetId | |
36 | 36 | let feeAssetIdString = match feeAssetId { | |
37 | 37 | case b: ByteVector => | |
38 | 38 | toBase58String(b) | |
39 | 39 | case _ => | |
40 | 40 | "" | |
41 | 41 | } | |
42 | 42 | let paymentAmount = payment.amount | |
43 | 43 | let amount = if (!(isDefined(feeAssetId))) | |
44 | 44 | then { | |
45 | 45 | let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) { | |
46 | 46 | case n: Int => | |
47 | 47 | n | |
48 | 48 | case _ => | |
49 | 49 | 0 | |
50 | 50 | } | |
51 | 51 | (fraction(paymentAmount, wavesUsdtPrice, 100000000) * 100) | |
52 | 52 | } | |
53 | 53 | else if ((feeAssetIdString == USDT_ASSET_ID)) | |
54 | 54 | then (paymentAmount * 100) | |
55 | 55 | else if ((feeAssetIdString == USDT_2_ASSET_ID)) | |
56 | 56 | then (paymentAmount * 100) | |
57 | 57 | else if ((feeAssetIdString == USDC_ASSET_ID)) | |
58 | 58 | then (paymentAmount * 100) | |
59 | 59 | else if ((feeAssetIdString == USDC_2_ASSET_ID)) | |
60 | 60 | then (paymentAmount * 100) | |
61 | 61 | else throw("Payment necessary in Waves, USDC or USDT!") | |
62 | 62 | [ScriptTransfer(sender, amount, fromBase58String(BAI_ASSET_ID))] | |
63 | 63 | } | |
64 | 64 | } | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | @Verifier(tx) | |
68 | 68 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
69 | 69 |
github/deemru/w8io/026f985 18.69 ms ◑