APE Price: $0.94 (+4.26%)

Contract

0xb0E0D011833473DB41Dc042F879112a6a9DcaCDf

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:
DefaultModule

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 500 runs

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

import "../interfaces/core/IModule.sol";
import "../helpers/Utils.sol";

/// @title Cyan Wallet Default Module - Forwards all transactions.
/// @author Bulgantamir Gankhuyag - <[email protected]>
/// @author Naranbayar Uuganbayar - <[email protected]>
contract DefaultModule is IModule {
    /// @inheritdoc IModule
    function handleTransaction(
        address to,
        uint256 value,
        bytes memory data
    ) external payable override returns (bytes memory) {
        return Utils._execute(to, value, data);
    }
}

File 2 of 3 : Utils.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;

library Utils {
    /// @notice Executes a transaction to the given address.
    /// @param to Target address.
    /// @param value Native token value to be sent to the address.
    /// @param data Data to be sent to the address.
    /// @return result Result of the transaciton.
    function _execute(
        address to,
        uint256 value,
        bytes memory data
    ) internal returns (bytes memory result) {
        assembly {
            let success := call(gas(), to, value, add(data, 0x20), mload(data), 0, 0)

            mstore(result, returndatasize())
            returndatacopy(add(result, 0x20), 0, returndatasize())

            if eq(success, 0) {
                revert(add(result, 0x20), returndatasize())
            }
        }
    }

    /// @notice Recover signer address from signature.
    /// @param signedHash Arbitrary length data signed on the behalf of the wallet.
    /// @param signature Signature byte array associated with signedHash.
    /// @return Recovered signer address.
    function recoverSigner(bytes32 signedHash, bytes memory signature) internal pure returns (address) {
        uint8 v;
        bytes32 r;
        bytes32 s;
        // we jump 32 (0x20) as the first slot of bytes contains the length
        // we jump 65 (0x41) per signature
        // for v we load 32 bytes ending with v (the first 31 come from s) then apply a mask
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }
        require(v == 27 || v == 28, "Bad v value in signature.");

        address recoveredAddress = ecrecover(signedHash, v, r, s);
        require(recoveredAddress != address(0), "ecrecover returned 0.");
        return recoveredAddress;
    }

    /// @notice Helper method to parse the function selector from data.
    /// @param data Any data to be parsed, mostly calldata of transaction.
    /// @return result Parsed function sighash.
    function parseFunctionSelector(bytes memory data) internal pure returns (bytes4 result) {
        require(data.length >= 4, "Invalid data.");
        assembly {
            result := mload(add(data, 0x20))
        }
    }

    /// @notice Parse uint256 from given data.
    /// @param data Any data to be parsed, mostly calldata of transaction.
    /// @param position Position in the data.
    /// @return result Uint256 parsed from given data.
    function getUint256At(bytes memory data, uint8 position) internal pure returns (uint256 result) {
        assembly {
            result := mload(add(data, add(position, 0x20)))
        }
    }
}

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

interface IModule {
    /// @notice Executes given transaction data to given address.
    /// @param to Target contract address.
    /// @param value Value of the given transaction.
    /// @param data Calldata of the transaction.
    /// @return Result of the execution.
    function handleTransaction(
        address to,
        uint256 value,
        bytes calldata data
    ) external payable returns (bytes memory);
}

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":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"handleTransaction","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"}]

608060405234801561001057600080fd5b5061020f806100206000396000f3fe60806040526004361061001e5760003560e01c8063ab6a377b14610023575b600080fd5b6100366100313660046100a5565b61004c565b604051610043919061018b565b60405180910390f35b6060610059848484610061565b949350505050565b606060008083516020850186885af13d82523d6000602084013e80610087573d60208301fd5b509392505050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156100ba57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146100de57600080fd5b925060208401359150604084013567ffffffffffffffff8082111561010257600080fd5b818601915086601f83011261011657600080fd5b8135818111156101285761012861008f565b604051601f8201601f19908116603f011681019083821181831017156101505761015061008f565b8160405282815289602084870101111561016957600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b600060208083528351808285015260005b818110156101b85785810183015185820160400152820161019c565b506000604082860101526040601f19601f830116850101925050509291505056fea2646970667358221220327a400014ddb13a8e5a0c1c354c3003677d4cb897254cd0add378cddd82487264736f6c63430008130033

Deployed Bytecode

0x60806040526004361061001e5760003560e01c8063ab6a377b14610023575b600080fd5b6100366100313660046100a5565b61004c565b604051610043919061018b565b60405180910390f35b6060610059848484610061565b949350505050565b606060008083516020850186885af13d82523d6000602084013e80610087573d60208301fd5b509392505050565b634e487b7160e01b600052604160045260246000fd5b6000806000606084860312156100ba57600080fd5b833573ffffffffffffffffffffffffffffffffffffffff811681146100de57600080fd5b925060208401359150604084013567ffffffffffffffff8082111561010257600080fd5b818601915086601f83011261011657600080fd5b8135818111156101285761012861008f565b604051601f8201601f19908116603f011681019083821181831017156101505761015061008f565b8160405282815289602084870101111561016957600080fd5b8260208601602083013760006020848301015280955050505050509250925092565b600060208083528351808285015260005b818110156101b85785810183015185820160400152820161019c565b506000604082860101526040601f19601f830116850101925050509291505056fea2646970667358221220327a400014ddb13a8e5a0c1c354c3003677d4cb897254cd0add378cddd82487264736f6c63430008130033

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.