S Price: $0.601619 (-0.69%)

Contract

0x4394A41F9b274d7A71912d681388cc9Cc596DDe1

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:
AggregatorConnector

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

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

import {
    ILiquidityConnector,
    AddLiquidityParams,
    RemoveLiquidityParams,
    SwapParams,
    GetAmountOutParams
} from "contracts/interfaces/ILiquidityConnector.sol";

struct AggregatorExtraData {
    bytes data;
}

contract AggregatorConnector is ILiquidityConnector {
    error AggregatorSwapFailed(bytes error);
    error NotImplemented();

    address public immutable router;

    constructor(
        address router_
    ) {
        router = router_;
    }

    function addLiquidity(
        AddLiquidityParams memory
    ) external payable override {
        revert NotImplemented();
    }

    function removeLiquidity(
        RemoveLiquidityParams memory
    ) external pure override {
        revert NotImplemented();
    }

    function swapExactTokensForTokens(
        SwapParams memory swap
    ) external payable override {
        AggregatorExtraData memory extraData =
            abi.decode(swap.extraData, (AggregatorExtraData));
        (bool success, bytes memory error) = router.call(extraData.data);
        if (!success) {
            revert AggregatorSwapFailed(error);
        }
    }

    function getAmountOut(
        GetAmountOutParams memory
    ) external pure override returns (uint256) {
        revert NotImplemented();
    }
}

File 2 of 3 : ILiquidityConnector.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {
    AddLiquidityParams,
    RemoveLiquidityParams,
    SwapParams,
    GetAmountOutParams
} from "contracts/structs/LiquidityStructs.sol";

interface ILiquidityConnector {
    function addLiquidity(
        AddLiquidityParams memory addLiquidityParams
    ) external payable;

    function removeLiquidity(
        RemoveLiquidityParams memory removeLiquidityParams
    ) external;

    function swapExactTokensForTokens(
        SwapParams memory swap
    ) external payable;

    function getAmountOut(
        GetAmountOutParams memory getAmountOutParams
    ) external view returns (uint256);
}

File 3 of 3 : LiquidityStructs.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

struct AddLiquidityParams {
    address router;
    address lpToken;
    address[] tokens;
    uint256[] desiredAmounts;
    uint256[] minAmounts;
    bytes extraData;
}

struct RemoveLiquidityParams {
    address router;
    address lpToken;
    address[] tokens;
    uint256 lpAmountIn;
    uint256[] minAmountsOut;
    bytes extraData;
}

struct SwapParams {
    address router;
    uint256 amountIn;
    uint256 minAmountOut;
    address tokenIn;
    bytes extraData;
}

struct GetAmountOutParams {
    address router;
    address lpToken;
    address tokenIn;
    address tokenOut;
    uint256 amountIn;
}

Settings
{
  "remappings": [
    "solmate/=lib/solmate/src/",
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@uniswap/v3-periphery/=lib/v3-periphery/",
    "@uniswap/v3-core/=lib/v3-core/",
    "@morpho-blue/=lib/morpho-blue/src/",
    "ds-test/=lib/solmate/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "morpho-blue/=lib/morpho-blue/",
    "openzeppelin-contracts/=lib/openzeppelin-contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "paris",
  "viaIR": false,
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"router_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"error","type":"bytes"}],"name":"AggregatorSwapFailed","type":"error"},{"inputs":[],"name":"NotImplemented","type":"error"},{"inputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"desiredAmounts","type":"uint256[]"},{"internalType":"uint256[]","name":"minAmounts","type":"uint256[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct AddLiquidityParams","name":"","type":"tuple"}],"name":"addLiquidity","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"address","name":"tokenOut","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"}],"internalType":"struct GetAmountOutParams","name":"","type":"tuple"}],"name":"getAmountOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"lpToken","type":"address"},{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256","name":"lpAmountIn","type":"uint256"},{"internalType":"uint256[]","name":"minAmountsOut","type":"uint256[]"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct RemoveLiquidityParams","name":"","type":"tuple"}],"name":"removeLiquidity","outputs":[],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"router","type":"address"},{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"uint256","name":"minAmountOut","type":"uint256"},{"internalType":"address","name":"tokenIn","type":"address"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct SwapParams","name":"swap","type":"tuple"}],"name":"swapExactTokensForTokens","outputs":[],"stateMutability":"payable","type":"function"}]

60a060405234801561001057600080fd5b506040516108e33803806108e383398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516108526100916000396000818160b6015261016601526108526000f3fe60806040526004361061004a5760003560e01c80630fdc253c1461004f57806341d07dc014610082578063f887ea40146100a4578063fb986deb146100f0578063ff781feb146100fe575b600080fd5b34801561005b57600080fd5b5061006f61006a3660046102e8565b610111565b6040519081526020015b60405180910390f35b34801561008e57600080fd5b506100a261009d3660046104be565b61012c565b005b3480156100b057600080fd5b506100d87f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610079565b6100a261009d36600461059f565b6100a261010c36600461065b565b610145565b600060405163d623472560e01b815260040160405180910390fd5b60405163d623472560e01b815260040160405180910390fd5b6000816080015180602001905181019061015f9190610722565b90506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031683600001516040516101a091906107cd565b6000604051808303816000865af19150503d80600081146101dd576040519150601f19603f3d011682016040523d82523d6000602084013e6101e2565b606091505b509150915081610210578060405163bf91046160e01b815260040161020791906107e9565b60405180910390fd5b50505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561024f5761024f610216565b60405290565b60405160c0810167ffffffffffffffff8111828210171561024f5761024f610216565b6040516020810167ffffffffffffffff8111828210171561024f5761024f610216565b604051601f8201601f1916810167ffffffffffffffff811182821017156102c4576102c4610216565b604052919050565b80356001600160a01b03811681146102e357600080fd5b919050565b600060a082840312156102fa57600080fd5b61030261022c565b61030b836102cc565b8152610319602084016102cc565b602082015261032a604084016102cc565b604082015261033b606084016102cc565b6060820152608083013560808201528091505092915050565b600067ffffffffffffffff82111561036e5761036e610216565b5060051b60200190565b600082601f83011261038957600080fd5b8135602061039e61039983610354565b61029b565b82815260059290921b840181019181810190868411156103bd57600080fd5b8286015b848110156103df576103d2816102cc565b83529183019183016103c1565b509695505050505050565b600082601f8301126103fb57600080fd5b8135602061040b61039983610354565b82815260059290921b8401810191818101908684111561042a57600080fd5b8286015b848110156103df578035835291830191830161042e565b600067ffffffffffffffff82111561045f5761045f610216565b50601f01601f191660200190565b600082601f83011261047e57600080fd5b813561048c61039982610445565b8181528460208386010111156104a157600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156104d057600080fd5b813567ffffffffffffffff808211156104e857600080fd5b9083019060c082860312156104fc57600080fd5b610504610255565b61050d836102cc565b815261051b602084016102cc565b602082015260408301358281111561053257600080fd5b61053e87828601610378565b6040830152506060830135606082015260808301358281111561056057600080fd5b61056c878286016103ea565b60808301525060a08301358281111561058457600080fd5b6105908782860161046d565b60a08301525095945050505050565b6000602082840312156105b157600080fd5b813567ffffffffffffffff808211156105c957600080fd5b9083019060c082860312156105dd57600080fd5b6105e5610255565b6105ee836102cc565b81526105fc602084016102cc565b602082015260408301358281111561061357600080fd5b61061f87828601610378565b60408301525060608301358281111561063757600080fd5b610643878286016103ea565b60608301525060808301358281111561056057600080fd5b60006020828403121561066d57600080fd5b813567ffffffffffffffff8082111561068557600080fd5b9083019060a0828603121561069957600080fd5b6106a161022c565b6106aa836102cc565b815260208301356020820152604083013560408201526106cc606084016102cc565b60608201526080830135828111156106e357600080fd5b6106ef8782860161046d565b60808301525095945050505050565b60005b83811015610719578181015183820152602001610701565b50506000910152565b60006020828403121561073457600080fd5b815167ffffffffffffffff8082111561074c57600080fd5b908301906020828603121561076057600080fd5b610768610278565b82518281111561077757600080fd5b80840193505085601f84011261078c57600080fd5b8251915061079c61039983610445565b8281528660208486010111156107b157600080fd5b6107c28360208301602087016106fe565b815295945050505050565b600082516107df8184602087016106fe565b9190910192915050565b60208152600082518060208401526108088160408501602087016106fe565b601f01601f1916919091016040019291505056fea2646970667358221220b1b0da9187b55cfdbb5b30155d7a525f76ffac2d56e74a63055fb3a320a6aedf64736f6c63430008130033000000000000000000000000ac041df48df9791b0654f1dbbf2cc8450c5f2e9d

Deployed Bytecode

0x60806040526004361061004a5760003560e01c80630fdc253c1461004f57806341d07dc014610082578063f887ea40146100a4578063fb986deb146100f0578063ff781feb146100fe575b600080fd5b34801561005b57600080fd5b5061006f61006a3660046102e8565b610111565b6040519081526020015b60405180910390f35b34801561008e57600080fd5b506100a261009d3660046104be565b61012c565b005b3480156100b057600080fd5b506100d87f000000000000000000000000ac041df48df9791b0654f1dbbf2cc8450c5f2e9d81565b6040516001600160a01b039091168152602001610079565b6100a261009d36600461059f565b6100a261010c36600461065b565b610145565b600060405163d623472560e01b815260040160405180910390fd5b60405163d623472560e01b815260040160405180910390fd5b6000816080015180602001905181019061015f9190610722565b90506000807f000000000000000000000000ac041df48df9791b0654f1dbbf2cc8450c5f2e9d6001600160a01b031683600001516040516101a091906107cd565b6000604051808303816000865af19150503d80600081146101dd576040519150601f19603f3d011682016040523d82523d6000602084013e6101e2565b606091505b509150915081610210578060405163bf91046160e01b815260040161020791906107e9565b60405180910390fd5b50505050565b634e487b7160e01b600052604160045260246000fd5b60405160a0810167ffffffffffffffff8111828210171561024f5761024f610216565b60405290565b60405160c0810167ffffffffffffffff8111828210171561024f5761024f610216565b6040516020810167ffffffffffffffff8111828210171561024f5761024f610216565b604051601f8201601f1916810167ffffffffffffffff811182821017156102c4576102c4610216565b604052919050565b80356001600160a01b03811681146102e357600080fd5b919050565b600060a082840312156102fa57600080fd5b61030261022c565b61030b836102cc565b8152610319602084016102cc565b602082015261032a604084016102cc565b604082015261033b606084016102cc565b6060820152608083013560808201528091505092915050565b600067ffffffffffffffff82111561036e5761036e610216565b5060051b60200190565b600082601f83011261038957600080fd5b8135602061039e61039983610354565b61029b565b82815260059290921b840181019181810190868411156103bd57600080fd5b8286015b848110156103df576103d2816102cc565b83529183019183016103c1565b509695505050505050565b600082601f8301126103fb57600080fd5b8135602061040b61039983610354565b82815260059290921b8401810191818101908684111561042a57600080fd5b8286015b848110156103df578035835291830191830161042e565b600067ffffffffffffffff82111561045f5761045f610216565b50601f01601f191660200190565b600082601f83011261047e57600080fd5b813561048c61039982610445565b8181528460208386010111156104a157600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156104d057600080fd5b813567ffffffffffffffff808211156104e857600080fd5b9083019060c082860312156104fc57600080fd5b610504610255565b61050d836102cc565b815261051b602084016102cc565b602082015260408301358281111561053257600080fd5b61053e87828601610378565b6040830152506060830135606082015260808301358281111561056057600080fd5b61056c878286016103ea565b60808301525060a08301358281111561058457600080fd5b6105908782860161046d565b60a08301525095945050505050565b6000602082840312156105b157600080fd5b813567ffffffffffffffff808211156105c957600080fd5b9083019060c082860312156105dd57600080fd5b6105e5610255565b6105ee836102cc565b81526105fc602084016102cc565b602082015260408301358281111561061357600080fd5b61061f87828601610378565b60408301525060608301358281111561063757600080fd5b610643878286016103ea565b60608301525060808301358281111561056057600080fd5b60006020828403121561066d57600080fd5b813567ffffffffffffffff8082111561068557600080fd5b9083019060a0828603121561069957600080fd5b6106a161022c565b6106aa836102cc565b815260208301356020820152604083013560408201526106cc606084016102cc565b60608201526080830135828111156106e357600080fd5b6106ef8782860161046d565b60808301525095945050505050565b60005b83811015610719578181015183820152602001610701565b50506000910152565b60006020828403121561073457600080fd5b815167ffffffffffffffff8082111561074c57600080fd5b908301906020828603121561076057600080fd5b610768610278565b82518281111561077757600080fd5b80840193505085601f84011261078c57600080fd5b8251915061079c61039983610445565b8281528660208486010111156107b157600080fd5b6107c28360208301602087016106fe565b815295945050505050565b600082516107df8184602087016106fe565b9190910192915050565b60208152600082518060208401526108088160408501602087016106fe565b601f01601f1916919091016040019291505056fea2646970667358221220b1b0da9187b55cfdbb5b30155d7a525f76ffac2d56e74a63055fb3a320a6aedf64736f6c63430008130033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000ac041df48df9791b0654f1dbbf2cc8450c5f2e9d

-----Decoded View---------------
Arg [0] : router_ (address): 0xaC041Df48dF9791B0654f1Dbbf2CC8450C5f2e9D

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000ac041df48df9791b0654f1dbbf2cc8450c5f2e9d


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.