Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
UsdcQuote
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// 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 getLatestPrice(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 * 1e10; } }
{ "optimizer": { "enabled": true, "runs": 200 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
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":"getLatestPrice","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"}]
Contract Creation Code
608060405234801561001057600080fd5b50600080546001600160a01b03191673d74a9bd1c98b2cbab5823107eb2be9c474bee09a179055610279806100466000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c806316345f181461005c5780635880c7eb14610082578063b573b68e146100b5578063c6bbd5a7146100c4578063d0192182146100d7575b600080fd5b61006f61006a3660046101d6565b6100f2565b6040519081526020015b60405180910390f35b61009d73d74a9bd1c98b2cbab5823107eb2be9c474bee09a81565b6040516001600160a01b039091168152602001610079565b61006f670de0b6b3a764000081565b60005461009d906001600160a01b031681565b61009d7329219dd400f2bf60e5a23d13be72b486d403889481565b604080516080810182526001600160a01b0383811682527329219dd400f2bf60e5a23d13be72b486d403889460208301908152670de0b6b3a764000083850190815260006060850181815281549651635e5e6e0f60e01b8152865186166004820152935185166024850152915160448401529051831660648301529390911690635e5e6e0f906084016020604051808303816000875af115801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be91906101ff565b91506101cf826402540be400610218565b9392505050565b6000602082840312156101e857600080fd5b81356001600160a01b03811681146101cf57600080fd5b60006020828403121561021157600080fd5b5051919050565b808202811582820484141761023d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220ee527b37f00cf7fb3d50d2a215f359f0fe959686a8a88f5fcf54ffd173d4a23364736f6c63430008140033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806316345f181461005c5780635880c7eb14610082578063b573b68e146100b5578063c6bbd5a7146100c4578063d0192182146100d7575b600080fd5b61006f61006a3660046101d6565b6100f2565b6040519081526020015b60405180910390f35b61009d73d74a9bd1c98b2cbab5823107eb2be9c474bee09a81565b6040516001600160a01b039091168152602001610079565b61006f670de0b6b3a764000081565b60005461009d906001600160a01b031681565b61009d7329219dd400f2bf60e5a23d13be72b486d403889481565b604080516080810182526001600160a01b0383811682527329219dd400f2bf60e5a23d13be72b486d403889460208301908152670de0b6b3a764000083850190815260006060850181815281549651635e5e6e0f60e01b8152865186166004820152935185166024850152915160448401529051831660648301529390911690635e5e6e0f906084016020604051808303816000875af115801561019a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101be91906101ff565b91506101cf826402540be400610218565b9392505050565b6000602082840312156101e857600080fd5b81356001600160a01b03811681146101cf57600080fd5b60006020828403121561021157600080fd5b5051919050565b808202811582820484141761023d57634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220ee527b37f00cf7fb3d50d2a215f359f0fe959686a8a88f5fcf54ffd173d4a23364736f6c63430008140033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.