ETH Price: $3,895.91 (+0.29%)

Contract

0x95A286Ca0347B3c8DaF06DAD1c4233c95f06c894
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Set Router Admin170850352023-04-20 3:20:59605 days ago1681960859IN
0x95A286Ca...95f06c894
0 ETH0.001574556.24845513

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
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.");
        _;
    }

    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) {
        return _core;
    }

    /// @notice Delegates all transcations to the core contract.
    fallback() external payable {
        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"}]

60a060405234801561001057600080fd5b5060405161053938038061053983398101604081905261002f916100c0565b6001600160a01b0381166100895760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e0000000000000000000000604482015260640160405180910390fd5b60008054336001600160a01b031991821617909155600180549091166001600160a01b0392909216919091179055306080526100f0565b6000602082840312156100d257600080fd5b81516001600160a01b03811681146100e957600080fd5b9392505050565b60805161042f61010a60003960006043015261042f6000f3fe60806040526004361061003f5760003560e01c806341b8c3df146100e8578063800096301461010a5780638fac26ea1461012a578063da4fbe5214610160575b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa15801561009f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c391906103b8565b90503660008037600080366000845af43d6000803e806100e2573d6000fd5b503d6000f35b3480156100f457600080fd5b506101086101033660046103dc565b61017e565b005b34801561011657600080fd5b506101086101253660046103dc565b610295565b34801561013657600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b34801561016c57600080fd5b506001546001600160a01b0316610144565b6000546001600160a01b031633146101dd5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064015b60405180910390fd5b6001600160a01b0381166102335760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e0000000000000000000060448201526064016101d4565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ffb5a1e54454a0fd15517c91a16be1cddee9e8f707e546d3346a2d3e8b5c3eaea906020015b60405180910390a150565b6000546001600160a01b031633146102ef5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016101d4565b6001600160a01b0381166103455760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e000000000000000000000060448201526064016101d4565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fb509f1ef29149e474db3a4776b2b658ad1b70710ceb0a5635a375a4c388eed8e9060200161028a565b6001600160a01b03811681146103b557600080fd5b50565b6000602082840312156103ca57600080fd5b81516103d5816103a0565b9392505050565b6000602082840312156103ee57600080fd5b81356103d5816103a056fea26469706673582212206466e0bd953e41bb6deaff03722dba798defd57f7c4a758a70ae091d2626328c64736f6c63430008130033000000000000000000000000846e0cb2bee96f65f077fa6229445d492a0ea224

Deployed Bytecode

0x60806040526004361061003f5760003560e01c806341b8c3df146100e8578063800096301461010a5780638fac26ea1461012a578063da4fbe5214610160575b60007f00000000000000000000000095a286ca0347b3c8daf06dad1c4233c95f06c8946001600160a01b031663da4fbe526040518163ffffffff1660e01b8152600401602060405180830381865afa15801561009f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100c391906103b8565b90503660008037600080366000845af43d6000803e806100e2573d6000fd5b503d6000f35b3480156100f457600080fd5b506101086101033660046103dc565b61017e565b005b34801561011657600080fd5b506101086101253660046103dc565b610295565b34801561013657600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200160405180910390f35b34801561016c57600080fd5b506001546001600160a01b0316610144565b6000546001600160a01b031633146101dd5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064015b60405180910390fd5b6001600160a01b0381166102335760405162461bcd60e51b815260206004820152601660248201527f496e76616c69642061646d696e20616464726573732e0000000000000000000060448201526064016101d4565b6000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527ffb5a1e54454a0fd15517c91a16be1cddee9e8f707e546d3346a2d3e8b5c3eaea906020015b60405180910390a150565b6000546001600160a01b031633146102ef5760405162461bcd60e51b815260206004820152601760248201527f43616c6c6572206973206e6f7420616e2061646d696e2e00000000000000000060448201526064016101d4565b6001600160a01b0381166103455760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420636f726520616464726573732e000000000000000000000060448201526064016101d4565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0383169081179091556040519081527fb509f1ef29149e474db3a4776b2b658ad1b70710ceb0a5635a375a4c388eed8e9060200161028a565b6001600160a01b03811681146103b557600080fd5b50565b6000602082840312156103ca57600080fd5b81516103d5816103a0565b9392505050565b6000602082840312156103ee57600080fd5b81356103d5816103a056fea26469706673582212206466e0bd953e41bb6deaff03722dba798defd57f7c4a758a70ae091d2626328c64736f6c63430008130033

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

000000000000000000000000846e0cb2bee96f65f077fa6229445d492a0ea224

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

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000846e0cb2bee96f65f077fa6229445d492a0ea224


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
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.