ETH Price: $1,582.88 (-0.52%)

Contract

0xd2536605c6cbA9562856fc937DB410dB39e71d37
 

Overview

ETH Balance

0 ETH

ETH 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:
ZeroDevWithdrawalHelper

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
shanghai EvmVersion
File 1 of 2 : ZeroDevWithdrawalHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

/**
 * @title ZeroDevWithdrawalHelper
 * @notice This contract helps users to manually transfer USDB out of their ZeroDev smart accounts
 * @author predict.fun protocol team
 */
contract ZeroDevWithdrawalHelper {
    address public constant USDB = 0x4300000000000000000000000000000000000003;

    /**
     * @notice Encodes a USDB transfer calldata
     *
     * @param to The address to transfer the USDB to
     * @param amount The amount of USDB to transfer
     *
     * @return userOpCalldata The encoded user operation calldata
     */
    function encodeUSDBTransfer(address to, uint256 amount) external pure returns (bytes memory userOpCalldata) {
        bytes memory callData = abi.encode(to, amount);
        userOpCalldata = abi.encodePacked(USDB, uint256(0), IERC20.transfer.selector, callData);
    }

    /**
     * @notice Encodes an ETH transfer calldata
     *
     * @param to The address to transfer ETH to
     * @param amount The amount of ETH to transfer
     *
     * @return userOpCalldata The encoded user operation calldata
     */
    function encodeETHTransfer(address to, uint256 amount) external pure returns (bytes memory userOpCalldata) {
        userOpCalldata = abi.encodePacked(to, amount, bytes4(0), "");
    }
}

File 2 of 2 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

Settings
{
  "remappings": [
    "@chainlink/=node_modules/@chainlink/",
    "@ensdomains/=node_modules/@ensdomains/",
    "@eth-optimism/=node_modules/@eth-optimism/",
    "@openzeppelin/=node_modules/@openzeppelin/",
    "eth-gas-reporter/=node_modules/eth-gas-reporter/",
    "forge-std/=lib/forge-std/src/",
    "hardhat/=node_modules/hardhat/",
    "solmate/=node_modules/solmate/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs",
    "appendCBOR": true
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "shanghai",
  "viaIR": true,
  "libraries": {}
}

Contract Security Audit

Contract ABI

API
[{"inputs":[],"name":"USDB","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"encodeETHTransfer","outputs":[{"internalType":"bytes","name":"userOpCalldata","type":"bytes"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"encodeUSDBTransfer","outputs":[{"internalType":"bytes","name":"userOpCalldata","type":"bytes"}],"stateMutability":"pure","type":"function"}]

6080806040523461001657610236908161001b8239f35b5f80fdfe60806040908082526004361015610014575f80fd5b5f3560e01c90816331a0edec1461015257508063899304b6146100985763a8518f701461003f575f80fd5b34610094576100909061005136610171565b825160609290921b6bffffffffffffffffffffffff1916602083015260348201525f60548201526038815290610086826101e4565b51918291826101b8565b0390f35b5f80fd5b5034610094576101096100aa36610171565b83516001600160a01b0390921660208301908152828501919091528382526100d1826101e4565b8351600360601b604360f81b0160208201525f603482015263a9059cbb60e01b60548201529151919283929182906058850190610197565b8101036038810182526077601f1991011681019181831067ffffffffffffffff84111761013e578291826100909252826101b8565b634e487b7160e01b5f52604160045260245ffd5b34610094575f366003190112610094576003604360981b018152602090f35b6040906003190112610094576004356001600160a01b0381168103610094579060243590565b5f5b8381106101a85750505f910152565b8181015183820152602001610199565b604091602082526101d88151809281602086015260208686019101610197565b601f01601f1916010190565b6060810190811067ffffffffffffffff82111761013e5760405256fea2646970667358221220779a091156f71d4118041bdfeed206c7ae391b7d22f8c7953513f8a9a67b7da164736f6c63430008180033

Deployed Bytecode

0x60806040908082526004361015610014575f80fd5b5f3560e01c90816331a0edec1461015257508063899304b6146100985763a8518f701461003f575f80fd5b34610094576100909061005136610171565b825160609290921b6bffffffffffffffffffffffff1916602083015260348201525f60548201526038815290610086826101e4565b51918291826101b8565b0390f35b5f80fd5b5034610094576101096100aa36610171565b83516001600160a01b0390921660208301908152828501919091528382526100d1826101e4565b8351600360601b604360f81b0160208201525f603482015263a9059cbb60e01b60548201529151919283929182906058850190610197565b8101036038810182526077601f1991011681019181831067ffffffffffffffff84111761013e578291826100909252826101b8565b634e487b7160e01b5f52604160045260245ffd5b34610094575f366003190112610094576003604360981b018152602090f35b6040906003190112610094576004356001600160a01b0381168103610094579060243590565b5f5b8381106101a85750505f910152565b8181015183820152602001610199565b604091602082526101d88151809281602086015260208686019101610197565b601f01601f1916010190565b6060810190811067ffffffffffffffff82111761013e5760405256fea2646970667358221220779a091156f71d4118041bdfeed206c7ae391b7d22f8c7953513f8a9a67b7da164736f6c63430008180033

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

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.