Sonic Blaze Testnet

Contract

0x0649EEe0941082dEF4f3bBa1eCCd5D02Bb629Ec0

Overview

S Balance

Sonic Blaze LogoSonic Blaze LogoSonic Blaze Logo0 S

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

Similar Match Source Code
This contract matches the deployed Bytecode of the Source Code for Contract 0x91e01eFf...fceceA351
The constructor portion of the code might be different and could alter the actual behaviour of the contract

Contract Name:
AuctionManager

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : AuctionManager.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./libraries/DataTypes.sol";

contract AuctionManager is Ownable {
    address public swapExecutor;
    mapping(uint256 => DataTypes.Auction) public auctions;
    uint256 auctionDuration;

    event AuctionCreated(uint256 indexed orderId);
    event AuctionFinalized(
        uint256 indexed orderId, 
        address indexed winner,
        bytes strategy
    );

    constructor(address _swapExecutor, uint256 _auctionDuration) Ownable(msg.sender) {
        swapExecutor = _swapExecutor;
        auctionDuration = _auctionDuration;
    }

    function createAuction(uint256 orderId) public {
        require(msg.sender == swapExecutor, "Unauthorized");
        require(!auctions[orderId].finalized, "Auction exists");

        auctions[orderId] = DataTypes.Auction({
            orderId: orderId,
            winner: address(0),
            strategy: "",
            finalized: false,
            endTime: block.timestamp + auctionDuration
        });

        emit AuctionCreated(orderId);
    }

    function finalizeAuction(
        uint256 orderId,
        address winner,
        bytes calldata strategy
    ) external onlyOwner {
        DataTypes.Auction storage auction = auctions[orderId];
        require(!auction.finalized, "Already finalized");
        require(block.timestamp >= auction.endTime, "Auction not ended");
        
        auction.winner = winner;
        auction.strategy = strategy;
        auction.finalized = true;

        emit AuctionFinalized(orderId, winner, strategy);
    }

    function setAuctionDuration(uint256 _newAuctionDuration) external onlyOwner {
        auctionDuration = _newAuctionDuration;
    }

    function setSwapExecutor(address _newSwapExecutor) external onlyOwner {
        swapExecutor = _newSwapExecutor;
    }
}

File 2 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 4 : DataTypes.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

library DataTypes {
    struct Solver {
        address solverAddress;
        uint256 deposit;
        bool isActive;
    }

    struct Order {
        address creator;
        address sourceToken;
        uint256 sourceAmount;
        address targetToken;
        uint256 minTargetAmount;
        // uint256 deadline;
        bool executed;
    }

    struct Auction {
        uint256 orderId;
        address winner;
        bytes strategy;
        bool finalized;
        uint256 endTime;
    }
}

File 4 of 4 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/=lib/openzeppelin-contracts/",
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/",
    "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/",
    "forge-std/=lib/forge-std/src/",
    "halmos-cheatcodes/=lib/openzeppelin-contracts/lib/halmos-cheatcodes/src/",
    "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": "cancun",
  "viaIR": false,
  "libraries": {}
}

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_swapExecutor","type":"address"},{"internalType":"uint256","name":"_auctionDuration","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"AuctionCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"orderId","type":"uint256"},{"indexed":true,"internalType":"address","name":"winner","type":"address"},{"indexed":false,"internalType":"bytes","name":"strategy","type":"bytes"}],"name":"AuctionFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"auctions","outputs":[{"internalType":"uint256","name":"orderId","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"bytes","name":"strategy","type":"bytes"},{"internalType":"bool","name":"finalized","type":"bool"},{"internalType":"uint256","name":"endTime","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderId","type":"uint256"}],"name":"createAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"orderId","type":"uint256"},{"internalType":"address","name":"winner","type":"address"},{"internalType":"bytes","name":"strategy","type":"bytes"}],"name":"finalizeAuction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newAuctionDuration","type":"uint256"}],"name":"setAuctionDuration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newSwapExecutor","type":"address"}],"name":"setSwapExecutor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapExecutor","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Deployed Bytecode

0x608060405234801561000f575f80fd5b5060043610610090575f3560e01c80638da5cb5b116100635780638da5cb5b14610109578063a497e67414610119578063ce2aaacd1461012c578063d5563f311461013f578063f2fde38b14610152575f80fd5b8063571a26a0146100945780636a0706db146100c1578063715018a6146100d657806384fcec46146100de575b5f80fd5b6100a76100a23660046105e4565b610165565b6040516100b89594939291906105fb565b60405180910390f35b6100d46100cf366004610671565b610228565b005b6100d4610252565b6001546100f1906001600160a01b031681565b6040516001600160a01b0390911681526020016100b8565b5f546001600160a01b03166100f1565b6100d46101273660046105e4565b610265565b6100d461013a366004610691565b610272565b6100d461014d3660046105e4565b6103a7565b6100d4610160366004610671565b61052c565b600260208190525f918252604090912080546001820154928201805491936001600160a01b0316929161019790610711565b80601f01602080910402602001604051908101604052809291908181526020018280546101c390610711565b801561020e5780601f106101e55761010080835404028352916020019161020e565b820191905f5260205f20905b8154815290600101906020018083116101f157829003601f168201915b505050506003830154600490930154919260ff1691905085565b610230610569565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b61025a610569565b6102635f610595565b565b61026d610569565b600355565b61027a610569565b5f848152600260205260409020600381015460ff16156102d55760405162461bcd60e51b8152602060048201526011602482015270105b1c9958591e48199a5b985b1a5e9959607a1b60448201526064015b60405180910390fd5b806004015442101561031d5760405162461bcd60e51b8152602060048201526011602482015270105d58dd1a5bdb881b9bdd08195b991959607a1b60448201526064016102cc565b6001810180546001600160a01b0319166001600160a01b038616179055600281016103498385836107a9565b5060038101805460ff191660011790556040516001600160a01b0385169086907fab2eccbf3f05934ff0354e47633dc017f5886636aa4a40ee933aa4be45a619f3906103989087908790610863565b60405180910390a35050505050565b6001546001600160a01b031633146103f05760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b60448201526064016102cc565b5f8181526002602052604090206003015460ff16156104425760405162461bcd60e51b815260206004820152600e60248201526d41756374696f6e2065786973747360901b60448201526064016102cc565b6040518060a001604052808281526020015f6001600160a01b0316815260200160405180602001604052805f81525081526020015f151581526020016003544261048c9190610891565b90525f8281526002602081815260409283902084518155908401516001820180546001600160a01b0319166001600160a01b0390921691909117905591830151908201906104da90826108b6565b50606082015160038201805460ff191691151591909117905560809091015160049091015560405181907f7e0e356457a92dacd3760ddf327a24dd226c6ca01b2cc41a7fd6f28469c7ab9b905f90a250565b610534610569565b6001600160a01b03811661055d57604051631e4fbdf760e01b81525f60048201526024016102cc565b61056681610595565b50565b5f546001600160a01b031633146102635760405163118cdaa760e01b81523360048201526024016102cc565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f602082840312156105f4575f80fd5b5035919050565b85815260018060a01b038516602082015260a060408201525f84518060a0840152806020870160c085015e5f60c0828501015260c0601f19601f83011684010191505083151560608301528260808301529695505050505050565b80356001600160a01b038116811461066c575f80fd5b919050565b5f60208284031215610681575f80fd5b61068a82610656565b9392505050565b5f805f80606085870312156106a4575f80fd5b843593506106b460208601610656565b9250604085013567ffffffffffffffff808211156106d0575f80fd5b818701915087601f8301126106e3575f80fd5b8135818111156106f1575f80fd5b886020828501011115610702575f80fd5b95989497505060200194505050565b600181811c9082168061072557607f821691505b60208210810361074357634e487b7160e01b5f52602260045260245ffd5b50919050565b634e487b7160e01b5f52604160045260245ffd5b601f8211156107a457805f5260205f20601f840160051c810160208510156107825750805b601f840160051c820191505b818110156107a1575f815560010161078e565b50505b505050565b67ffffffffffffffff8311156107c1576107c1610749565b6107d5836107cf8354610711565b8361075d565b5f601f841160018114610806575f85156107ef5750838201355b5f19600387901b1c1916600186901b1783556107a1565b5f83815260208120601f198716915b828110156108355786850135825560209485019460019092019101610815565b5086821015610851575f1960f88860031b161c19848701351681555b505060018560011b0183555050505050565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b808201808211156108b057634e487b7160e01b5f52601160045260245ffd5b92915050565b815167ffffffffffffffff8111156108d0576108d0610749565b6108e4816108de8454610711565b8461075d565b602080601f831160018114610917575f84156109005750858301515b5f19600386901b1c1916600185901b17855561096e565b5f85815260208120601f198616915b8281101561094557888601518255948401946001909101908401610926565b508582101561096257878501515f19600388901b60f8161c191681555b505060018460011b0185555b50505050505056fea2646970667358221220ace05472a5f86093f227c84daa7b0eb82db1e7c264789cca437a7f5770de0e7b64736f6c63430008190033

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.