S Price: $0.569846 (-4.54%)

Contract

0x304Fdf53CA87F52ecC7A4454C15035dCb2442817

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
UsdcQuote

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 1 : swapx_pricefeed.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

interface IQuoter {
    struct QuoteExactInputSingleParams {
        address tokenIn;
        address tokenOut;
        uint256 amountIn;
        uint160 limitSqrtPrice;
    }

    function quoteExactInputSingle(
        QuoteExactInputSingleParams calldata params
    ) external returns (uint256 amountOut);
}

contract UsdcQuote {
    // The Quoter contract implementing quoteExactInputSingle
    address public constant QUOTER_ADDRESS = 0xd74a9Bd1C98B2CbaB5823107eb2BE9C474bEe09A; 
    
    // Hard-coded output token address:
    address public constant TOKEN_OUT_ADDRESS = 0x29219dd400f2Bf60E5a23d13Be72B486D4038894;

    // Hard-coded amountIn = 1 * 10^18
    uint256 public constant AMOUNT_IN = 1000000000000000000;

    IQuoter public quoter;

    constructor() {
        // Initialize the quoter interface
        quoter = IQuoter(QUOTER_ADDRESS);
    }

    /**
     * @dev Calls the quoter contract's `quoteExactInputSingle`
     *      with tokenOut set to TOKEN_OUT_ADDRESS and amountIn set to 1e18.
     *
     * @param tokenIn    The address of the input token
     * @return amountOut The quoted amount of TOKEN_OUT_ADDRESS received
     */
    function getQuoteFixedSingle(address tokenIn) external returns (uint256 amountOut) 
    {
        // Prepare the params struct
        IQuoter.QuoteExactInputSingleParams memory params = IQuoter.QuoteExactInputSingleParams({
            tokenIn: tokenIn,
            tokenOut: TOKEN_OUT_ADDRESS, 
            amountIn: AMOUNT_IN,
            limitSqrtPrice: 0
        });

        // Call the quoter contract and return the amountOut
        amountOut = quoter.quoteExactInputSingle(params);
        return amountOut;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AMOUNT_IN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"QUOTER_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_OUT_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenIn","type":"address"}],"name":"getQuoteFixedSingle","outputs":[{"internalType":"uint256","name":"amountOut","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"quoter","outputs":[{"internalType":"contract IQuoter","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600080546001600160a01b03191673d74a9bd1c98b2cbab5823107eb2be9c474bee09a17905561023d806100466000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80635880c7eb1461005c578063b573b68e14610094578063c6bbd5a7146100b1578063c8aa5b96146100c4578063d0192182146100d7575b600080fd5b61007773d74a9bd1c98b2cbab5823107eb2be9c474bee09a81565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a3670de0b6b3a764000081565b60405190815260200161008b565b600054610077906001600160a01b031681565b6100a36100d23660046101c5565b6100f2565b6100777329219dd400f2bf60e5a23d13be72b486d403889481565b604080516080810182526001600160a01b0383811682527329219dd400f2bf60e5a23d13be72b486d403889460208301908152670de0b6b3a764000083850190815260006060850181815281549651635e5e6e0f60e01b8152865186166004820152935185166024850152915160448401529051831660648301529390911690635e5e6e0f906084016020604051808303816000875af115801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be91906101ee565b9392505050565b6000602082840312156101d757600080fd5b81356001600160a01b03811681146101be57600080fd5b60006020828403121561020057600080fd5b505191905056fea26469706673582212202a25c90772c77371109a35cd59f52eb5c877d0bb1d07e951575c9540dee7ef7f64736f6c63430008140033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100575760003560e01c80635880c7eb1461005c578063b573b68e14610094578063c6bbd5a7146100b1578063c8aa5b96146100c4578063d0192182146100d7575b600080fd5b61007773d74a9bd1c98b2cbab5823107eb2be9c474bee09a81565b6040516001600160a01b0390911681526020015b60405180910390f35b6100a3670de0b6b3a764000081565b60405190815260200161008b565b600054610077906001600160a01b031681565b6100a36100d23660046101c5565b6100f2565b6100777329219dd400f2bf60e5a23d13be72b486d403889481565b604080516080810182526001600160a01b0383811682527329219dd400f2bf60e5a23d13be72b486d403889460208301908152670de0b6b3a764000083850190815260006060850181815281549651635e5e6e0f60e01b8152865186166004820152935185166024850152915160448401529051831660648301529390911690635e5e6e0f906084016020604051808303816000875af115801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be91906101ee565b9392505050565b6000602082840312156101d757600080fd5b81356001600160a01b03811681146101be57600080fd5b60006020828403121561020057600080fd5b505191905056fea26469706673582212202a25c90772c77371109a35cd59f52eb5c877d0bb1d07e951575c9540dee7ef7f64736f6c63430008140033

Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.