tx · HpwsjFzXKcbZYBkcPm4rQQTxTCuriyUwN3CCXJMmxPE7

3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a:  -0.05000000 Waves

2024.05.08 09:33 [3096827] smart account 3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a > SELF 0.00000000 Waves

{ "type": 13, "id": "HpwsjFzXKcbZYBkcPm4rQQTxTCuriyUwN3CCXJMmxPE7", "fee": 5000000, "feeAssetId": null, "timestamp": 1715150027211, "version": 2, "chainId": 84, "sender": "3N86fBeRNMYj4Lbc7po8PKtrXR2oLQXQB8a", "senderPublicKey": "4uUUD88FFMgtPjui9NEmEstYpUVQNPSLCQw5f8mYHmGz", "proofs": [ "2Qts9UqTo1vcJsksGAzTpUpv3WqGchhnT4h9aC1JngwrwWRgmY31pQg1Kw5S3VRUXyP941RxFjszmx4tECL4ZkUA" ], "script": "base64:BgIECAISAAUADVVTRFRfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA9VU0RUXzJfQVNTRVRfSUQCLDk4RDNwa0t2ZnJYRW5YbVFxS0dXZ3RvR3ZWaDFhVGY0Q1BEdHRxRzljc3VtAA1VU0RDX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAPVVNEQ18yX0FTU0VUX0lEAiw5OEQzcGtLdmZyWEVuWG1RcUtHV2d0b0d2VmgxYVRmNENQRHR0cUc5Y3N1bQAMQkFJX0FTU0VUX0lEAixBeEdLUVJ4S280RjJFYmhyUnE2TjJ0ZExzeHRNbnB6UXNTNFFlbVY2VjFXMQEBaQEDYnV5AAQRV0FWRVNfVVNEVF9PUkFDTEUJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOMVdqaG1GM0V5dXR2cnZ0c2ZzU0xiaG1pTFU4QmMxVG95BBVXQVZFU19VU0RUX09SQUNMRV9LRVk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eSBpbiBXYXZlcywgVVNEQyBvciBVU0RUIQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQZzZW5kZXIFBmFtb3VudAkA2QQBBQxCQUlfQVNTRVRfSUQFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXk48joR", "height": 3096827, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2hFcSy1rFF3XKcJ72rGZcCaRLLNwnXASScwmpAJLtEU1 Next: none Diff:
OldNewDifferences
3838 case _ =>
3939 0
4040 }
41- (fraction(paymentAmount, wavesUsdtPrice, (12 * 100000000)) * 10)
41+ fraction(paymentAmount, wavesUsdtPrice, (12 * 100000))
4242 }
4343 else if ((feeAssetIdString == USDT_ASSET_ID))
4444 then fraction(paymentAmount, 1000, 12)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let USDT_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
55
66 let USDT_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
77
88 let USDC_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
99
1010 let USDC_2_ASSET_ID = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
1111
1212 let BAI_ASSET_ID = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
1313
1414 @Callable(i)
1515 func buy () = {
1616 let WAVES_USDT_ORACLE = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy")
1717 let WAVES_USDT_ORACLE_KEY = "%s%s__price__WAVES-USDT"
1818 let numberOfPayments = size(i.payments)
1919 let paymentAssetId = i.payments[0].assetId
2020 let sender = i.caller
2121 if ((numberOfPayments != 1))
2222 then throw("Payment necessary!")
2323 else {
2424 let payment = i.payments[0]
2525 let feeAssetId = payment.assetId
2626 let feeAssetIdString = match feeAssetId {
2727 case b: ByteVector =>
2828 toBase58String(b)
2929 case _ =>
3030 ""
3131 }
3232 let paymentAmount = payment.amount
3333 let amount = if (!(isDefined(feeAssetId)))
3434 then {
3535 let wavesUsdtPrice = match getInteger(WAVES_USDT_ORACLE, WAVES_USDT_ORACLE_KEY) {
3636 case n: Int =>
3737 n
3838 case _ =>
3939 0
4040 }
41- (fraction(paymentAmount, wavesUsdtPrice, (12 * 100000000)) * 10)
41+ fraction(paymentAmount, wavesUsdtPrice, (12 * 100000))
4242 }
4343 else if ((feeAssetIdString == USDT_ASSET_ID))
4444 then fraction(paymentAmount, 1000, 12)
4545 else if ((feeAssetIdString == USDT_2_ASSET_ID))
4646 then fraction(paymentAmount, 1000, 12)
4747 else if ((feeAssetIdString == USDC_ASSET_ID))
4848 then fraction(paymentAmount, 1000, 12)
4949 else if ((feeAssetIdString == USDC_2_ASSET_ID))
5050 then fraction(paymentAmount, 1000, 12)
5151 else throw("Payment necessary in Waves, USDC or USDT!")
5252 [ScriptTransfer(sender, amount, fromBase58String(BAI_ASSET_ID))]
5353 }
5454 }
5555
5656
5757 @Verifier(tx)
5858 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5959

github/deemru/w8io/026f985 
27.71 ms