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