ETH Price: $1,966.23 (-0.62%)
 

Overview

ETH Balance

0 ETH

ETH Value

$0.00

More Info

Private Name Tags

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Unpause1457740192025-12-31 2:06:5566 days ago1767146815IN
0xC3BFEF41...9B24411dD
0 ETH0.0000027635410.10000057
Transfer Ownersh...1457432392025-12-30 9:00:5567 days ago1767085255IN
0xC3BFEF41...9B24411dD
0 ETH0.0000000035010.0001007
Pause1454314102025-12-23 3:46:3774 days ago1766461597IN
0xC3BFEF41...9B24411dD
0 ETH0.0000000474150.00200101
Pause1454313802025-12-23 3:45:3774 days ago1766461537IN
0xC3BFEF41...9B24411dD
0 ETH0.0000000556820.00200102
Transfer Ownersh...1454309602025-12-23 3:31:3774 days ago1766460697IN
0xC3BFEF41...9B24411dD
0 ETH0.0000000517330.00200151

Advanced mode:
Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ForTest

Compiler Version
v0.8.28+commit.7893614a

Optimization Enabled:
Yes with 888888 runs

Other Settings:
london EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

/**
 * @title ForTest
 * @notice 一个简单的特权合约,支持暂停功能和特权地址转移
 * @dev 标准不可升级合约
 */
contract ForTest {
    // ============ State Variables ============

    /// @notice 特权地址(管理员)
    address public owner;

    /// @notice 合约是否暂停
    bool public paused;

    // ============ Events ============

    /// @notice 特权地址转移事件
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /// @notice 合约暂停事件
    event Paused(address indexed account);

    /// @notice 合约恢复事件
    event Unpaused(address indexed account);

    // ============ Errors ============

    /// @notice 非特权地址调用
    error NotOwner();

    /// @notice 合约已暂停
    error ContractPaused();

    /// @notice 合约未暂停
    error ContractNotPaused();

    /// @notice 无效地址
    error InvalidAddress();

    // ============ Modifiers ============

    /// @notice 仅特权地址可调用
    modifier onlyOwner() {
        if (msg.sender != owner) revert NotOwner();
        _;
    }

    /// @notice 仅在合约未暂停时可调用
    modifier whenNotPaused() {
        if (paused) revert ContractPaused();
        _;
    }

    /// @notice 仅在合约暂停时可调用
    modifier whenPaused() {
        if (!paused) revert ContractNotPaused();
        _;
    }

    // ============ Constructor ============

    /// @notice 构造函数,初始化合约
    /// @param _owner 初始特权地址
    constructor(address _owner) {
        if (_owner == address(0)) revert InvalidAddress();

        owner = _owner;
        emit OwnershipTransferred(address(0), _owner);
    }

    // ============ Owner Functions ============

    /// @notice 暂停合约
    /// @dev 仅特权地址可调用,且合约必须未暂停
    function pause() external onlyOwner whenNotPaused {
        paused = true;
        emit Paused(msg.sender);
    }

    /// @notice 恢复合约
    /// @dev 仅特权地址可调用,且合约必须已暂停
    function unpause() external onlyOwner whenPaused {
        paused = false;
        emit Unpaused(msg.sender);
    }

    /// @notice 转移特权地址
    /// @dev 仅特权地址可调用
    /// @param newOwner 新特权地址
    function transferOwnership(address newOwner) external onlyOwner {
        if (newOwner == address(0)) revert InvalidAddress();
        address oldOwner = owner;
        owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }

    /// @notice 放弃特权地址
    /// @dev 仅特权地址可调用,此操作不可逆
    function renounceOwnership() external onlyOwner {
        address oldOwner = owner;
        owner = address(0);
        emit OwnershipTransferred(oldOwner, address(0));
    }
}

Settings
{
  "remappings": [
    "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    "@uniswap/v3-periphery/=lib/v3-periphery/",
    "@layerzerolabs/solidity-examples/=lib/solidity-examples/",
    "ds-test/=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/",
    "openzeppelin/=lib/openzeppelin-contracts/contracts/",
    "solidity-examples/=lib/solidity-examples/contracts/",
    "v3-periphery/=lib/v3-periphery/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 888888
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "viaIR": false
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ContractNotPaused","type":"error"},{"inputs":[],"name":"ContractPaused","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"NotOwner","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052348015600f57600080fd5b5060405161064c38038061064c833981016040819052602c91609f565b6001600160a01b03811660525760405163e6c4247b60e01b815260040160405180910390fd5b600080546001600160a01b0319166001600160a01b03831690811782556040519091907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35060cd565b60006020828403121560b057600080fd5b81516001600160a01b038116811460c657600080fd5b9392505050565b610570806100dc6000396000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80638456cb59116100505780638456cb59146100c35780638da5cb5b146100cb578063f2fde38b1461011057600080fd5b80633f4ba83a146100775780635c975abb14610081578063715018a6146100bb575b600080fd5b61007f610123565b005b6000546100a69074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020015b60405180910390f35b61007f61021a565b61007f6102db565b6000546100eb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b2565b61007f61011e3660046104fd565b6103ea565b60005473ffffffffffffffffffffffffffffffffffffffff163314610174576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005474010000000000000000000000000000000000000000900460ff166101c8576040517fdcdde9dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16815560405133917f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa91a2565b60005473ffffffffffffffffffffffffffffffffffffffff16331461026b576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000008116825560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a350565b60005473ffffffffffffffffffffffffffffffffffffffff16331461032c576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005474010000000000000000000000000000000000000000900460ff1615610381576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017815560405133917f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891a2565b60005473ffffffffffffffffffffffffffffffffffffffff16331461043b576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116610488576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561050f57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461053357600080fd5b939250505056fea26469706673582212202969c62c37de2832286b75f17e19741a695dde3b1161886e68be88564ce60b9464736f6c634300081c0033000000000000000000000000399efa78cacd7784751cd9fbf2523edf9efdf6ad

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100725760003560e01c80638456cb59116100505780638456cb59146100c35780638da5cb5b146100cb578063f2fde38b1461011057600080fd5b80633f4ba83a146100775780635c975abb14610081578063715018a6146100bb575b600080fd5b61007f610123565b005b6000546100a69074010000000000000000000000000000000000000000900460ff1681565b60405190151581526020015b60405180910390f35b61007f61021a565b61007f6102db565b6000546100eb9073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b2565b61007f61011e3660046104fd565b6103ea565b60005473ffffffffffffffffffffffffffffffffffffffff163314610174576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005474010000000000000000000000000000000000000000900460ff166101c8576040517fdcdde9dd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16815560405133917f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa91a2565b60005473ffffffffffffffffffffffffffffffffffffffff16331461026b576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000008116825560405173ffffffffffffffffffffffffffffffffffffffff909116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a350565b60005473ffffffffffffffffffffffffffffffffffffffff16331461032c576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60005474010000000000000000000000000000000000000000900460ff1615610381576040517fab35696f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff167401000000000000000000000000000000000000000017815560405133917f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25891a2565b60005473ffffffffffffffffffffffffffffffffffffffff16331461043b576040517f30cd747100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116610488576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60006020828403121561050f57600080fd5b813573ffffffffffffffffffffffffffffffffffffffff8116811461053357600080fd5b939250505056fea26469706673582212202969c62c37de2832286b75f17e19741a695dde3b1161886e68be88564ce60b9464736f6c634300081c0033

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

000000000000000000000000399efa78cacd7784751cd9fbf2523edf9efdf6ad

-----Decoded View---------------
Arg [0] : _owner (address): 0x399EfA78cAcD7784751CD9FBf2523eDf9EFDf6Ad

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000399efa78cacd7784751cd9fbf2523edf9efdf6ad


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ 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.