ETH Price: $3,031.99 (+3.94%)
Gas: 9.11 Gwei

Contract

0xE05131D0186D8e3C1611354064baF0D9128293dA
 

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

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
175183362023-06-20 3:48:35508 days ago1687232915  Contract Creation0 ETH
Loading...
Loading

Minimal Proxy Contract for 0x93befc3b8258bfd12d9cbc7e8eff5b6ac8b51606

Contract Name:
BatcherV2

Compiler Version
v0.8.18+commit.87f61d96

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, None license
/**
 *Submitted for verification at Etherscan.io on 2023-06-25
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;

struct TransactionData {
	address target;
	bytes data;
	uint256 value;
}

contract BatcherV2 {
	// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1167.md
    address private immutable original;
    bytes32 private byteCode;
	uint n;
	address private immutable deployer;
	
	constructor(uint _n) {
        original = address(this);
		deployer = msg.sender;
		createProxies(_n);
	}

	function createProxies(uint _n) internal {
		bytes memory miniProxy = bytes.concat(bytes20(0x3D602d80600A3D3981F3363d3d373d3D3D363d73), bytes20(address(this)), bytes15(0x5af43d82803e903d91602b57fd5bf3));
        byteCode = keccak256(abi.encodePacked(miniProxy));  
		address proxy;
		uint oldN = n;
		for(uint i=0; i<_n; i++) {
	        bytes32 salt = keccak256(abi.encodePacked(msg.sender, i+oldN));
			assembly {
	            proxy := create2(0, add(miniProxy, 32), mload(miniProxy), salt)
			}
			require(proxy != address(0), "Failed to deploy contract.");
		}
		// update n
		n = oldN + _n;
	} 

	function callback(TransactionData calldata txData) external {
		require(msg.sender == original, "Only original can call this function.");
		(bool success, ) = txData.target.call{value: txData.value}(txData.data);
	}

    function proxyFor(address sender, uint i) public view returns (address proxy) {
        bytes32 salt = keccak256(abi.encodePacked(sender, i));
        proxy = address(uint160(uint(keccak256(abi.encodePacked(
                hex'ff',
                address(this),
                salt,
                byteCode
            )))));
    }

	// increase proxy count
	function increase(uint _n) external {
		require(msg.sender == deployer, "Only deployer can call this function.");
		createProxies(_n);
	}

	function execute(uint _start, uint _count, TransactionData[] memory txs) external {
		require(msg.sender == deployer, "Only deployer can call this function.");
		for(uint i=_start; i<_start+_count; i++) {
			address proxy = proxyFor(msg.sender, i);
			for (uint j=0; j<txs.length; j++) {
				TransactionData memory txData = txs[j];
				BatcherV2(proxy).callback(txData);
			}
		}
	}

}

Contract ABI

[{"inputs":[{"internalType":"uint256","name":"_n","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct TransactionData","name":"txData","type":"tuple"}],"name":"callback","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_start","type":"uint256"},{"internalType":"uint256","name":"_count","type":"uint256"},{"components":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct TransactionData[]","name":"txs","type":"tuple[]"}],"name":"execute","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_n","type":"uint256"}],"name":"increase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"i","type":"uint256"}],"name":"proxyFor","outputs":[{"internalType":"address","name":"proxy","type":"address"}],"stateMutability":"view","type":"function"}]

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.