Latest 5 from a total of 5 transactions
Latest 1 internal transaction
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 15940509 | 360 days ago | Contract Creation | 0 FRAX |
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
CreateMyTokenBatchExecutor
Compiler Version
v0.8.28+commit.7893614a
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import { LibZip } from "@solady/utils/LibZip.sol";
/**
* @title CreateMyToken Batch Executor
* @author CreateMyToken (https://www.createmytoken.com/)
* @dev Batch Executor is able to interact with multiple modules in a single transaction, enabling
* complex contract deployment and initialization strategies. Supports calldata compression.
*/
contract CreateMyTokenBatchExecutor {
struct CallDispatch {
bool allowFailure;
address target;
uint256 value;
bytes data;
}
struct CallResult {
bool success;
bytes data;
}
/*
** Errors
*/
error BatchExecutor__CallFailed(uint256 i, bytes returnData);
error BatchExecutor__ValueMismatch();
function batchExecute(CallDispatch[] calldata calls) external payable returns (CallResult[] memory results) {
uint256 valueAccumulator;
uint256 length = calls.length;
results = new CallResult[](length);
for (uint256 i = 0; i < length; i++) {
CallDispatch calldata call = calls[i];
CallResult memory result = results[i];
valueAccumulator += call.value;
(result.success, result.data) = call.target.call{ value: call.value }(call.data);
if (!result.success && !call.allowFailure) {
revert BatchExecutor__CallFailed(i, result.data);
}
}
require(msg.value == valueAccumulator, BatchExecutor__ValueMismatch());
}
fallback() external payable {
LibZip.cdFallback();
}
receive() external payable {}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Library for compressing and decompressing bytes.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/LibZip.sol)
/// @author Calldata compression by clabby (https://github.com/clabby/op-kompressor)
/// @author FastLZ by ariya (https://github.com/ariya/FastLZ)
///
/// @dev Note:
/// The accompanying solady.js library includes implementations of
/// FastLZ and calldata operations for convenience.
library LibZip {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* FAST LZ OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// LZ77 implementation based on FastLZ.
// Equivalent to level 1 compression and decompression at the following commit:
// https://github.com/ariya/FastLZ/commit/344eb4025f9ae866ebf7a2ec48850f7113a97a42
// Decompression is backwards compatible.
/// @dev Returns the compressed `data`.
function flzCompress(bytes memory data) internal pure returns (bytes memory result) {
/// @solidity memory-safe-assembly
assembly {
function ms8(d_, v_) -> _d {
mstore8(d_, v_)
_d := add(d_, 1)
}
function u24(p_) -> _u {
_u := mload(p_)
_u := or(shl(16, byte(2, _u)), or(shl(8, byte(1, _u)), byte(0, _u)))
}
function cmp(p_, q_, e_) -> _l {
for { e_ := sub(e_, q_) } lt(_l, e_) { _l := add(_l, 1) } {
e_ := mul(iszero(byte(0, xor(mload(add(p_, _l)), mload(add(q_, _l))))), e_)
}
}
function literals(runs_, src_, dest_) -> _o {
for { _o := dest_ } iszero(lt(runs_, 0x20)) { runs_ := sub(runs_, 0x20) } {
mstore(ms8(_o, 31), mload(src_))
_o := add(_o, 0x21)
src_ := add(src_, 0x20)
}
if iszero(runs_) { leave }
mstore(ms8(_o, sub(runs_, 1)), mload(src_))
_o := add(1, add(_o, runs_))
}
function mt(l_, d_, o_) -> _o {
for { d_ := sub(d_, 1) } iszero(lt(l_, 263)) { l_ := sub(l_, 262) } {
o_ := ms8(ms8(ms8(o_, add(224, shr(8, d_))), 253), and(0xff, d_))
}
if iszero(lt(l_, 7)) {
_o := ms8(ms8(ms8(o_, add(224, shr(8, d_))), sub(l_, 7)), and(0xff, d_))
leave
}
_o := ms8(ms8(o_, add(shl(5, l_), shr(8, d_))), and(0xff, d_))
}
function setHash(i_, v_) {
let p_ := add(mload(0x40), shl(2, i_))
mstore(p_, xor(mload(p_), shl(224, xor(shr(224, mload(p_)), v_))))
}
function getHash(i_) -> _h {
_h := shr(224, mload(add(mload(0x40), shl(2, i_))))
}
function hash(v_) -> _r {
_r := and(shr(19, mul(2654435769, v_)), 0x1fff)
}
function setNextHash(ip_, ipStart_) -> _ip {
setHash(hash(u24(ip_)), sub(ip_, ipStart_))
_ip := add(ip_, 1)
}
result := mload(0x40)
calldatacopy(result, calldatasize(), 0x8000) // Zeroize the hashmap.
let op := add(result, 0x8000)
let a := add(data, 0x20)
let ipStart := a
let ipLimit := sub(add(ipStart, mload(data)), 13)
for { let ip := add(2, a) } lt(ip, ipLimit) {} {
let r := 0
let d := 0
for {} 1 {} {
let s := u24(ip)
let h := hash(s)
r := add(ipStart, getHash(h))
setHash(h, sub(ip, ipStart))
d := sub(ip, r)
if iszero(lt(ip, ipLimit)) { break }
ip := add(ip, 1)
if iszero(gt(d, 0x1fff)) { if eq(s, u24(r)) { break } }
}
if iszero(lt(ip, ipLimit)) { break }
ip := sub(ip, 1)
if gt(ip, a) { op := literals(sub(ip, a), a, op) }
let l := cmp(add(r, 3), add(ip, 3), add(ipLimit, 9))
op := mt(l, d, op)
ip := setNextHash(setNextHash(add(ip, l), ipStart), ipStart)
a := ip
}
// Copy the result to compact the memory, overwriting the hashmap.
let end := sub(literals(sub(add(ipStart, mload(data)), a), a, op), 0x7fe0)
let o := add(result, 0x20)
mstore(result, sub(end, o)) // Store the length.
for {} iszero(gt(o, end)) { o := add(o, 0x20) } { mstore(o, mload(add(o, 0x7fe0))) }
mstore(end, 0) // Zeroize the slot after the string.
mstore(0x40, add(end, 0x20)) // Allocate the memory.
}
}
/// @dev Returns the decompressed `data`.
function flzDecompress(bytes memory data) internal pure returns (bytes memory result) {
/// @solidity memory-safe-assembly
assembly {
result := mload(0x40)
let op := add(result, 0x20)
let end := add(add(data, 0x20), mload(data))
for { data := add(data, 0x20) } lt(data, end) {} {
let w := mload(data)
let c := byte(0, w)
let t := shr(5, c)
if iszero(t) {
mstore(op, mload(add(data, 1)))
data := add(data, add(2, c))
op := add(op, add(1, c))
continue
}
for {
let g := eq(t, 7)
let l := add(2, xor(t, mul(g, xor(t, add(7, byte(1, w)))))) // M
let s := add(add(shl(8, and(0x1f, c)), byte(add(1, g), w)), 1) // R
let r := sub(op, s)
let f := xor(s, mul(gt(s, 0x20), xor(s, 0x20)))
let j := 0
} 1 {} {
mstore(add(op, j), mload(add(r, j)))
j := add(j, f)
if lt(j, l) { continue }
data := add(data, add(2, g))
op := add(op, l)
break
}
}
mstore(result, sub(op, add(result, 0x20))) // Store the length.
mstore(op, 0) // Zeroize the slot after the string.
mstore(0x40, add(op, 0x20)) // Allocate the memory.
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CALLDATA OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
// Calldata compression and decompression using selective run length encoding:
// - Sequences of 0x00 (up to 128 consecutive).
// - Sequences of 0xff (up to 32 consecutive).
//
// A run length encoded block consists of two bytes:
// (0) 0x00
// (1) A control byte with the following bit layout:
// - [7] `0: 0x00, 1: 0xff`.
// - [0..6] `runLength - 1`.
//
// The first 4 bytes are bitwise negated so that the compressed calldata
// can be dispatched into the `fallback` and `receive` functions.
/// @dev Returns the compressed `data`.
function cdCompress(bytes memory data) internal pure returns (bytes memory result) {
/// @solidity memory-safe-assembly
assembly {
function rle(v_, o_, d_) -> _o, _d {
mstore(o_, shl(240, or(and(0xff, add(d_, 0xff)), and(0x80, v_))))
_o := add(o_, 2)
}
result := mload(0x40)
let o := add(result, 0x20)
let z := 0 // Number of consecutive 0x00.
let y := 0 // Number of consecutive 0xff.
for { let end := add(data, mload(data)) } iszero(eq(data, end)) {} {
data := add(data, 1)
let c := byte(31, mload(data))
if iszero(c) {
if y { o, y := rle(0xff, o, y) }
z := add(z, 1)
if eq(z, 0x80) { o, z := rle(0x00, o, 0x80) }
continue
}
if eq(c, 0xff) {
if z { o, z := rle(0x00, o, z) }
y := add(y, 1)
if eq(y, 0x20) { o, y := rle(0xff, o, 0x20) }
continue
}
if y { o, y := rle(0xff, o, y) }
if z { o, z := rle(0x00, o, z) }
mstore8(o, c)
o := add(o, 1)
}
if y { o, y := rle(0xff, o, y) }
if z { o, z := rle(0x00, o, z) }
// Bitwise negate the first 4 bytes.
mstore(add(result, 4), not(mload(add(result, 4))))
mstore(result, sub(o, add(result, 0x20))) // Store the length.
mstore(o, 0) // Zeroize the slot after the string.
mstore(0x40, add(o, 0x20)) // Allocate the memory.
}
}
/// @dev Returns the decompressed `data`.
function cdDecompress(bytes memory data) internal pure returns (bytes memory result) {
/// @solidity memory-safe-assembly
assembly {
if mload(data) {
result := mload(0x40)
let o := add(result, 0x20)
let s := add(data, 4)
let v := mload(s)
let end := add(data, mload(data))
mstore(s, not(v)) // Bitwise negate the first 4 bytes.
for {} lt(data, end) {} {
data := add(data, 1)
let c := byte(31, mload(data))
if iszero(c) {
data := add(data, 1)
let d := byte(31, mload(data))
// Fill with either 0xff or 0x00.
mstore(o, not(0))
if iszero(gt(d, 0x7f)) { calldatacopy(o, calldatasize(), add(d, 1)) }
o := add(o, add(and(d, 0x7f), 1))
continue
}
mstore8(o, c)
o := add(o, 1)
}
mstore(s, v) // Restore the first 4 bytes.
mstore(result, sub(o, add(result, 0x20))) // Store the length.
mstore(o, 0) // Zeroize the slot after the string.
mstore(0x40, add(o, 0x20)) // Allocate the memory.
}
}
}
/// @dev To be called in the `fallback` function.
/// ```
/// fallback() external payable { LibZip.cdFallback(); }
/// receive() external payable {} // Silence compiler warning to add a `receive` function.
/// ```
/// For efficiency, this function will directly return the results, terminating the context.
/// If called internally, it must be called at the end of the function.
function cdFallback() internal {
assembly {
if iszero(calldatasize()) { return(calldatasize(), calldatasize()) }
let o := 0
let f := not(3) // For negating the first 4 bytes.
for { let i := 0 } lt(i, calldatasize()) {} {
let c := byte(0, xor(add(i, f), calldataload(i)))
i := add(i, 1)
if iszero(c) {
let d := byte(0, xor(add(i, f), calldataload(i)))
i := add(i, 1)
// Fill with either 0xff or 0x00.
mstore(o, not(0))
if iszero(gt(d, 0x7f)) { calldatacopy(o, calldatasize(), add(d, 1)) }
o := add(o, add(and(d, 0x7f), 1))
continue
}
mstore8(o, c)
o := add(o, 1)
}
let success := delegatecall(gas(), address(), 0x00, o, codesize(), 0x00)
returndatacopy(0x00, 0x00, returndatasize())
if iszero(success) { revert(0x00, returndatasize()) }
return(0x00, returndatasize())
}
}
}{
"remappings": [
"forge-std/=node_modules/forge-std/src/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@solady/=node_modules/solady/src/",
"@src/=contracts/",
"@vendor/=contracts/vendor/",
"@superchain/=contracts/superchain/",
"solady/=node_modules/solady/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "none",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": true,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"uint256","name":"i","type":"uint256"},{"internalType":"bytes","name":"returnData","type":"bytes"}],"name":"BatchExecutor__CallFailed","type":"error"},{"inputs":[],"name":"BatchExecutor__ValueMismatch","type":"error"},{"stateMutability":"payable","type":"fallback"},{"inputs":[{"components":[{"internalType":"bool","name":"allowFailure","type":"bool"},{"internalType":"address","name":"target","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CreateMyTokenBatchExecutor.CallDispatch[]","name":"calls","type":"tuple[]"}],"name":"batchExecute","outputs":[{"components":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct CreateMyTokenBatchExecutor.CallResult[]","name":"results","type":"tuple[]"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608080604052346015576104da908161001b8239f35b600080fdfe60806040526004361015610015575b3661043c57005b60003560e01c6341708d280361000e57602036600319011261017b5760043567ffffffffffffffff811161017b573660238201121561017b5780600401359067ffffffffffffffff821161017b576024810190602436918460051b01011161017b576000906100838361028d565b9260005b8181106100ad576100a98561009d863414610424565b604051918291826101c1565b0390f35b6100b881838561030e565b6100c28287610335565b519061013061012c6000806100dc6040860135809b610349565b996100e96020870161036c565b906100f76060880188610380565b9190610108604051809481936103b3565b03925af1936101266101186103c1565b602083019081529515158252565b51151590565b1590565b9081610167575b506101455750600101610087565b51604051639976f4ab60e01b8152918291610163916004840161040a565b0390fd5b610175915061012c906103fd565b38610137565b600080fd5b919082519283825260005b8481106101ac575050826000602080949584010152601f8019910116010190565b8060208092840101518282860101520161018b565b602081016020825282518091526040820191602060408360051b8301019401926000915b8383106101f457505050505090565b9091929394602080610225600193603f198682030187526040838b5180511515845201519181858201520190610180565b970193019301919392906101e5565b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f1916820167ffffffffffffffff81118382101761027057604052565b610234565b67ffffffffffffffff81116102705760051b60200190565b9061029f61029a83610275565b61024a565b82815280926102b0601f1991610275565b0160005b8181106102c057505050565b60405190604082019180831067ffffffffffffffff8411176102705760209260405260008152606083820152828286010152016102b4565b634e487b7160e01b600052603260045260246000fd5b91908110156103305760051b81013590607e198136030182121561017b570190565b6102f8565b80518210156103305760209160051b010190565b9190820180921161035657565b634e487b7160e01b600052601160045260246000fd5b356001600160a01b038116810361017b5790565b903590601e198136030182121561017b570180359067ffffffffffffffff821161017b5760200191813603831361017b57565b908092918237016000815290565b3d156103f8573d9067ffffffffffffffff8211610270576103eb601f8301601f191660200161024a565b9182523d6000602084013e565b606090565b35801515810361017b5790565b604090610421939281528160208201520190610180565b90565b1561042b57565b63ac17749960e01b60005260046000fd5b36156104c9576000805b8091368210156104ac576001820191600319810190351860001a80156104755760019293508153015b90610446565b5060001981526002830192600192607f916002190190351860001a818111156104a1575b16010161046f565b838101368437610499565b600090389082305af43d6000803e156104c4573d6000f35b3d6000fd5b3636f3fea164736f6c634300081c000a
Deployed Bytecode
0x60806040526004361015610015575b3661043c57005b60003560e01c6341708d280361000e57602036600319011261017b5760043567ffffffffffffffff811161017b573660238201121561017b5780600401359067ffffffffffffffff821161017b576024810190602436918460051b01011161017b576000906100838361028d565b9260005b8181106100ad576100a98561009d863414610424565b604051918291826101c1565b0390f35b6100b881838561030e565b6100c28287610335565b519061013061012c6000806100dc6040860135809b610349565b996100e96020870161036c565b906100f76060880188610380565b9190610108604051809481936103b3565b03925af1936101266101186103c1565b602083019081529515158252565b51151590565b1590565b9081610167575b506101455750600101610087565b51604051639976f4ab60e01b8152918291610163916004840161040a565b0390fd5b610175915061012c906103fd565b38610137565b600080fd5b919082519283825260005b8481106101ac575050826000602080949584010152601f8019910116010190565b8060208092840101518282860101520161018b565b602081016020825282518091526040820191602060408360051b8301019401926000915b8383106101f457505050505090565b9091929394602080610225600193603f198682030187526040838b5180511515845201519181858201520190610180565b970193019301919392906101e5565b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f1916820167ffffffffffffffff81118382101761027057604052565b610234565b67ffffffffffffffff81116102705760051b60200190565b9061029f61029a83610275565b61024a565b82815280926102b0601f1991610275565b0160005b8181106102c057505050565b60405190604082019180831067ffffffffffffffff8411176102705760209260405260008152606083820152828286010152016102b4565b634e487b7160e01b600052603260045260246000fd5b91908110156103305760051b81013590607e198136030182121561017b570190565b6102f8565b80518210156103305760209160051b010190565b9190820180921161035657565b634e487b7160e01b600052601160045260246000fd5b356001600160a01b038116810361017b5790565b903590601e198136030182121561017b570180359067ffffffffffffffff821161017b5760200191813603831361017b57565b908092918237016000815290565b3d156103f8573d9067ffffffffffffffff8211610270576103eb601f8301601f191660200161024a565b9182523d6000602084013e565b606090565b35801515810361017b5790565b604090610421939281528160208201520190610180565b90565b1561042b57565b63ac17749960e01b60005260046000fd5b36156104c9576000805b8091368210156104ac576001820191600319810190351860001a80156104755760019293508153015b90610446565b5060001981526002830192600192607f916002190190351860001a818111156104a1575b16010161046f565b838101368437610499565b600090389082305af43d6000803e156104c4573d6000f35b3d6000fd5b3636f3fea164736f6c634300081c000a
Deployed Bytecode Sourcemap
411:1238:0:-:0;;;;;;;;;-1:-1:-1;411:1238:0;1586:6;411:1238;;;;;;;;;;;;;-1:-1:-1;;411:1238:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;993:24;;;;:::i;:::-;1033:13;411:1238;1048:10;;;;;;411:1238;1473:9;1465:70;1473:9;;:29;1465:70;:::i;:::-;411:1238;;;;;;;:::i;:::-;;;;1060:3;1108:8;;;;;:::i;:::-;1157:10;;;;:::i;:::-;;1202;1325:15;411:1238;;1202:10;1182:30;411:1238;1202:10;;411:1238;1182:30;;;:::i;:::-;1259:11;;411:1238;1259:11;;;:::i;:::-;1297:9;;;;;;;:::i;:::-;411:1238;;;;;;;;;;:::i;:::-;1259:48;;;;;1227:80;1259:48;;:::i;:::-;411:1238;1244:11;;1227:80;;;411:1238;;;;;;1227:80;411:1238;;;;;;1325:15;;411:1238;1325:15;:37;;;;1060:3;1321:124;;;1060:3;411:1238;;1033:13;;1321:124;1418:11;411:1238;;-1:-1:-1;;;1389:41:0;;411:1238;;;1389:41;;411:1238;1389:41;;;:::i;:::-;;;;1325:37;1344:18;1345:17;;;;;:::i;1344:18::-;1325:37;;;411:1238;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;411:1238:0;;;;;;;;;;;;;;:::o;:::-;;:::i;:::-;;;;;;;;;;;:::o;:::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;;;:::i;:::-;;-1:-1:-1;411:1238:0;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;411:1238:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;:::i;:::-;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;411:1238:0;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;-1:-1:-1;;411:1238:0;;;;:::i;:::-;;;;;-1:-1:-1;411:1238:0;;;;:::o;:::-;;;:::o;:::-;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;:::i;:::-;;:::o;:::-;;;;:::o;:::-;;;;;;;;;11192:1134:1;11233:1087;;;;;;;;;;;;;;;;;;;-1:-1:-1;;11233:1087:1;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;11233:1087:1;;;;;;;;;;-1:-1:-1;;11233:1087:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Swarm Source
none://164736f6c634300081c000a
Loading...
Loading
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.