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:BgIECAISAAYADVVTRFRfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA9VU0RUXzJfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA1VU0RDX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAPVVNEQ18yX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAMQkFJX0FTU0VUX0lEAixBeEdLUVJ4S280RjJFYmhyUnE2TjJ0ZExzeHRNbnB6UXNTNFFlbVY2VjFXMQELd2hpdGVsaXN0ZWQBB2FkZHJlc3MEByRtYXRjaDAJAJsIAgUEdGhpcwkArAICAgp3aGl0ZWxpc3RfBQdhZGRyZXNzAwkAAQIFByRtYXRjaDACB0Jvb2xlYW4EAWIFByRtYXRjaDAFAWIHAQF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VUX0lECQBoAgUNcGF5bWVudEFtb3VudABkAwkAAAIFEGZlZUFzc2V0SWRTdHJpbmcFDVVTRENfQVNTRVRfSUQJAGgCBQ1wYXltZW50QW1vdW50AGQDCQAAAgUQZmVlQXNzZXRJZFN0cmluZwUPVVNEQ18yX0FTU0VUX0lECQBoAgUNcGF5bWVudEFtb3VudABkCQACAQIpUGF5bWVudCBuZWNlc3NhcnkgaW4gV2F2ZXMsIFVTREMgb3IgVVNEVCEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwUGc2VuZGVyBQZhbW91bnQJANkEAQUMQkFJX0FTU0VUX0lEBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5I1qhAg==", "height": 3046194, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 58Ytg4pXNEQmAoVaJJ2rBvpHsdDNaZt7HePkNgx2uvy2 Next: AmryZXF89oZzi6XkVbpD9bXHMrGdBwSWeyG2SS67ZAFw Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let USDT_ASSET_ID = "G5WWWzzVsWRyzGf32xojbnfp7gXbWrgqJT8RcVWEfLmC"
4+let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
55
6-let USDT_2_ASSET_ID = "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi"
6+let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
77
8-let USDC_ASSET_ID = "3ayH3PhWMkhFsySsUVcC8BvFf1QyxGB5BZuTPyVtmP4v"
8+let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
99
10-let USDC_2_ASSET_ID = "HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW"
10+let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
1111
12-let BAI_ASSET_ID = "2fdzyHvXGCqaz1XA8m9fodemmP9giVBcpe4Jq9F63oFL"
12+let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
1313
1414 func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) {
1515 case b: Boolean =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let USDT_ASSET_ID = "G5WWWzzVsWRyzGf32xojbnfp7gXbWrgqJT8RcVWEfLmC"
4+let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
55
6-let USDT_2_ASSET_ID = "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi"
6+let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
77
8-let USDC_ASSET_ID = "3ayH3PhWMkhFsySsUVcC8BvFf1QyxGB5BZuTPyVtmP4v"
8+let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
99
10-let USDC_2_ASSET_ID = "HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW"
10+let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
1111
12-let BAI_ASSET_ID = "2fdzyHvXGCqaz1XA8m9fodemmP9giVBcpe4Jq9F63oFL"
12+let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
1313
1414 func whitelisted (address) = match getBoolean(this, ("whitelist_" + address)) {
1515 case b: Boolean =>
1616 b
1717 case _ =>
1818 false
1919 }
2020
2121
2222 @Callable(i)
2323 func buy () = {
2424 let WAVES_USDT_ORACLE = addressFromStringValue("3PKkojKdd6BBzTf1RXbQVfUDraNFXXHKzQF")
2525 let WAVES_USDT_ORACLE_KEY = "%s%s__price__WAVES-USDT"
2626 let numberOfPayments = size(i.payments)
2727 let paymentAssetId = i.payments[0].assetId
2828 let sender = i.caller
2929 if (!(whitelisted(toString(sender))))
3030 then throw("Address not whitelisted!")
3131 else if ((numberOfPayments != 1))
3232 then throw("Payment necessary!")
3333 else {
3434 let payment = i.payments[0]
3535 let feeAssetId = payment.assetId
3636 let feeAssetIdString = match feeAssetId {
3737 case b: ByteVector =>
3838 toBase58String(b)
3939 case _ =>
4040 ""
4141 }
4242 let paymentAmount = payment.amount
4343 let amount = if (!(isDefined(feeAssetId)))
4444 then {
4545 let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
4646 case n: Int =>
4747 n
4848 case _ =>
4949 0
5050 }
5151 (fraction(paymentAmount, wavesUsdtPrice, 100000000) * 100)
5252 }
5353 else if ((feeAssetIdString == USDT_ASSET_ID))
5454 then (paymentAmount * 100)
5555 else if ((feeAssetIdString == USDT_2_ASSET_ID))
5656 then (paymentAmount * 100)
5757 else if ((feeAssetIdString == USDC_ASSET_ID))
5858 then (paymentAmount * 100)
5959 else if ((feeAssetIdString == USDC_2_ASSET_ID))
6060 then (paymentAmount * 100)
6161 else throw("Payment necessary in Waves, USDC or USDT!")
6262 [ScriptTransfer(sender, amount, fromBase58String(BAI_ASSET_ID))]
6363 }
6464 }
6565
6666
6767 @Verifier(tx)
6868 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6969

github/deemru/w8io/026f985 
46.22 ms