APE Price: $1.26 (+7.35%)

Contract

0x95A286Ca0347B3c8DaF06DAD1c4233c95f06c894

Overview

APE Balance

Apechain LogoApechain LogoApechain Logo0 APE

APE 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:
CoreRouter

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 500 runs

Other Settings:
default evmVersion
File 1 of 1 : CoreRouter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

/// @title Cyan Wallet Core Router - A Cyan wallet's core router.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
contract CoreRouter {
    address payable private immutable _this;
    address private _admin;
    address private _core;

    event SetRouterAdmin(address admin);
    event SetCore(address core);

    modifier onlyAdmin() {
        require(_admin == msg.sender, "Caller is not an admin.");
        _;
    }

    /// @notice Prevents non delegatecall into the modified method
    modifier onlyDelegateCall() {
        require(address(this) != _this, "Cannot be called directly.");
        _;
    }

    constructor(address core) {
        require(core != address(0x0), "Invalid core address.");

        _admin = msg.sender;
        _core = core;
        _this = payable(address(this));
    }

    /// @notice Changes the admin of the router.
    /// @param admin Address of the new admin.
    function setRouterAdmin(address admin) external onlyAdmin {
        require(admin != address(0x0), "Invalid admin address.");

        _admin = admin;
        emit SetRouterAdmin(admin);
    }

    /// @notice Returns an admin address of the router.
    /// @return Address of the current admin.
    function getRouterAdmin() external view returns (address) {
        return _admin;
    }

    /// @notice Changes the address of the core contract.
    ///     Note: Changing the core address will affect to all wallets.
    /// @param core Address of the new core contract.
    function setCore(address core) external onlyAdmin {
        require(core != address(0x0), "Invalid core address.");

        _core = core;
        emit SetCore(core);
    }

    /// @notice Returns the address of the core contract.
    /// @return Address of the current core contract.
    function getCore() external view returns (address) {
        if (_this == address(this)) {
            return _core;
        } else {
            return CoreRouter(_this).getCore();
        }
    }

    /// @notice Delegates all transcations to the core contract.
    fallback() external payable onlyDelegateCall {
        address core = CoreRouter(_this).getCore();
        assembly {
            calldatacopy(0, 0, calldatasize())
            let success := delegatecall(gas(), core, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            if eq(success, 0) {
                revert(0, returndatasize())
            }
            return(0, returndatasize())
        }
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 500
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"core","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"core","type":"address"}],"name":"SetCore","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"}],"name":"SetRouterAdmin","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"getCore","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRouterAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"core","type":"address"}],"name":"setCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"setRouterAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60a060405234801561001057600080fd5b5060405161068538038061068583398101604081905261002f916100c0565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e0000000000000000000000604482015260640160405180910390fd5b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055306080526100f0565b6000602082840312156100d257600080fd5b81516001600160a01b03811681146100e957600080fd5b9392505050565b60805161056761011e6000396000818160490152818160c001528181610414015261045301526105676000f3fe60806040526004361061003f5760003560e01c806341b8c3df1461016557806380009630146101875780638fac26ea146101a7578063da4fbe52146101dd575b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036100bc5760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c6564206469726563746c792e00000000000060448201526064015b60405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa15801561011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014091906104f0565b90503660008037600080366000845af43d6000803e8061015f573d6000fd5b503d6000f35b34801561017157600080fd5b50610185610180366004610514565b6101f2565b005b34801561019357600080fd5b506101856101a2366004610514565b610304565b3480156101b357600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b3480156101e957600080fd5b506101c161040f565b6000546001600160a01b0316331461024c5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016100b3565b6001600160a01b0381166102a25760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e0000000000000000000060448201526064016100b3565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ffb5a1e54454a0fd15517c91a16be1cddee9e8f707e546d3346a2d3e8b5c3eaea906020015b60405180910390a150565b6000546001600160a01b0316331461035e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016100b3565b6001600160a01b0381166103b45760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e000000000000000000000060448201526064016100b3565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fb509f1ef29149e474db3a4776b2b658ad1b70710ceb0a5635a375a4c388eed8e906020016102f9565b6000307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03160361045157506001546001600160a01b031690565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d391906104f0565b905090565b6001600160a01b03811681146104ed57600080fd5b50565b60006020828403121561050257600080fd5b815161050d816104d8565b9392505050565b60006020828403121561052657600080fd5b813561050d816104d856fea2646970667358221220060878a6b57389a94b25379f18b10d3660232960833dd877d396d8b6d889ffef64736f6c634300081300330000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069

Deployed Bytecode

0x60806040526004361061003f5760003560e01c806341b8c3df1461016557806380009630146101875780638fac26ea146101a7578063da4fbe52146101dd575b6001600160a01b037f00000000000000000000000095a286ca0347b3c8daf06dad1c4233c95f06c8941630036100bc5760405162461bcd60e51b815260206004820152601a60248201527f43616e6e6f742062652063616c6c6564206469726563746c792e00000000000060448201526064015b60405180910390fd5b60007f00000000000000000000000095a286ca0347b3c8daf06dad1c4233c95f06c8946001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa15801561011c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061014091906104f0565b90503660008037600080366000845af43d6000803e8061015f573d6000fd5b503d6000f35b34801561017157600080fd5b50610185610180366004610514565b6101f2565b005b34801561019357600080fd5b506101856101a2366004610514565b610304565b3480156101b357600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b3480156101e957600080fd5b506101c161040f565b6000546001600160a01b0316331461024c5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016100b3565b6001600160a01b0381166102a25760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e0000000000000000000060448201526064016100b3565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ffb5a1e54454a0fd15517c91a16be1cddee9e8f707e546d3346a2d3e8b5c3eaea906020015b60405180910390a150565b6000546001600160a01b0316331461035e5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016100b3565b6001600160a01b0381166103b45760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e000000000000000000000060448201526064016100b3565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fb509f1ef29149e474db3a4776b2b658ad1b70710ceb0a5635a375a4c388eed8e906020016102f9565b6000307f00000000000000000000000095a286ca0347b3c8daf06dad1c4233c95f06c8946001600160a01b03160361045157506001546001600160a01b031690565b7f00000000000000000000000095a286ca0347b3c8daf06dad1c4233c95f06c8946001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d391906104f0565b905090565b6001600160a01b03811681146104ed57600080fd5b50565b60006020828403121561050257600080fd5b815161050d816104d8565b9392505050565b60006020828403121561052657600080fd5b813561050d816104d856fea2646970667358221220060878a6b57389a94b25379f18b10d3660232960833dd877d396d8b6d889ffef64736f6c63430008130033

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

0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069

-----Decoded View---------------
Arg [0] : core (address): 0x2bB8CBF6a38F4945d275B108b1a94cb10bcfD069

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000002bb8cbf6a38f4945d275b108b1a94cb10bcfd069


Block Transaction Difficulty 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.