S Price: $0.519658 (+3.00%)

Contract

0x9a34b3810d422373bA5128FfEe880235003f5cAC

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Admin143864782025-03-18 6:41:114 days ago1742280071IN
0x9a34b381...5003f5cAC
0 S0.0015379155
Set Implementati...131679482025-03-12 2:58:1810 days ago1741748298IN
0x9a34b381...5003f5cAC
0 S0.0025914355

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

Contract Source Code Verified (Exact Match)

Contract Name:
Swapper

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
File 1 of 4 : Swapper.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;

import './SwapperStorage.sol';

contract Swapper is SwapperStorage {

    fallback() external payable {
        address imp = implementation;
        assembly {
            calldatacopy(0, 0, calldatasize())
            let result := delegatecall(gas(), imp, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch result
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }

    receive() external payable {}

}

File 2 of 4 : SwapperStorage.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;

import '../../utils/Admin.sol';
import '../../utils/Implementation.sol';

abstract contract SwapperStorage is Admin, Implementation {

    // tokenBX => base swapper, address(1) is reserved for ETH
    mapping(address => address) public baseSwappers;

    // tokenBX => oracleId
    mapping(address => bytes32) public oracleIds;

    // tokenBX => maxSlippageRatio
    mapping(address => uint256) public maxSlippageRatios;

}

File 3 of 4 : Admin.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;

abstract contract Admin {

    error OnlyAdmin();

    event NewAdmin(address newAdmin);

    address public admin;

    modifier _onlyAdmin_() {
        if (msg.sender != admin) {
            revert OnlyAdmin();
        }
        _;
    }

    constructor () {
        admin = msg.sender;
        emit NewAdmin(admin);
    }

    /**
     * @notice Set a new admin for the contract.
     * @dev This function allows the current admin to assign a new admin address without performing any explicit verification.
     *      It's the current admin's responsibility to ensure that the 'newAdmin' address is correct and secure.
     * @param newAdmin The address of the new admin.
     */
    function setAdmin(address newAdmin) external _onlyAdmin_ {
        admin = newAdmin;
        emit NewAdmin(newAdmin);
    }

}

File 4 of 4 : Implementation.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.8.0 <0.9.0;

import './Admin.sol';

abstract contract Implementation is Admin {

    event NewImplementation(address newImplementation);

    address public implementation;

    // @notice Set a new implementation address for the contract
    function setImplementation(address newImplementation) external _onlyAdmin_ {
        implementation = newImplementation;
        emit NewImplementation(newImplementation);
    }

}

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":[],"name":"OnlyAdmin","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newImplementation","type":"address"}],"name":"NewImplementation","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"baseSwappers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxSlippageRatios","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"oracleIds","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"setImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50600080546001600160a01b031916339081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c9060200160405180910390a1610347806100686000396000f3fe6080604052600436106100745760003560e01c8063704b6c021161004e578063704b6c021461015b57806378bf9d4e1461017b578063d784d426146101a8578063f851a440146101c85761007b565b80632a63ac5c146100ad57806331fe80bb146101005780635c60da1b1461013b5761007b565b3661007b57005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100a6573d6000f35b3d6000fd5b005b3480156100b957600080fd5b506100e36100c83660046102e1565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010c57600080fd5b5061012d61011b3660046102e1565b60036020526000908152604090205481565b6040519081526020016100f7565b34801561014757600080fd5b506001546100e3906001600160a01b031681565b34801561016757600080fd5b506100ab6101763660046102e1565b6101e8565b34801561018757600080fd5b5061012d6101963660046102e1565b60046020526000908152604090205481565b3480156101b457600080fd5b506100ab6101c33660046102e1565b610268565b3480156101d457600080fd5b506000546100e3906001600160a01b031681565b6000546001600160a01b0316331461021357604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461029357604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c4099060200161025d565b6000602082840312156102f357600080fd5b81356001600160a01b038116811461030a57600080fd5b939250505056fea2646970667358221220072b474bc4292a9933cefb8ae3485e6f812a3b483a70a75a497c0079be5ef11664736f6c63430008140033

Deployed Bytecode

0x6080604052600436106100745760003560e01c8063704b6c021161004e578063704b6c021461015b57806378bf9d4e1461017b578063d784d426146101a8578063f851a440146101c85761007b565b80632a63ac5c146100ad57806331fe80bb146101005780635c60da1b1461013b5761007b565b3661007b57005b6001546001600160a01b03163660008037600080366000845af43d6000803e8080156100a6573d6000f35b3d6000fd5b005b3480156100b957600080fd5b506100e36100c83660046102e1565b6002602052600090815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561010c57600080fd5b5061012d61011b3660046102e1565b60036020526000908152604090205481565b6040519081526020016100f7565b34801561014757600080fd5b506001546100e3906001600160a01b031681565b34801561016757600080fd5b506100ab6101763660046102e1565b6101e8565b34801561018757600080fd5b5061012d6101963660046102e1565b60046020526000908152604090205481565b3480156101b457600080fd5b506100ab6101c33660046102e1565b610268565b3480156101d457600080fd5b506000546100e3906001600160a01b031681565b6000546001600160a01b0316331461021357604051634755657960e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c906020015b60405180910390a150565b6000546001600160a01b0316331461029357604051634755657960e01b815260040160405180910390fd5b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f6b70829fcbe4891157f7a7496f9870927de3c8237adbe9cd39bae09b7382c4099060200161025d565b6000602082840312156102f357600080fd5b81356001600160a01b038116811461030a57600080fd5b939250505056fea2646970667358221220072b474bc4292a9933cefb8ae3485e6f812a3b483a70a75a497c0079be5ef11664736f6c63430008140033

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
[ Download: CSV Export  ]

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.