Description:
ERC20 token contract with Factory capabilities. Standard implementation for fungible tokens on Ethereum.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"contracts/BundleExecutor.sol": {
"content": "//SPDX-License-Identifier: UNLICENSED\r
pragma solidity 0.6.12;\r
\r
pragma experimental ABIEncoderV2;\r
\r
interface IERC20 {\r
event Approval(address indexed owner, address indexed spender, uint value);\r
event Transfer(address indexed from, address indexed to, uint value);\r
\r
function name() external view returns (string memory);\r
function symbol() external view returns (string memory);\r
function decimals() external view returns (uint8);\r
function totalSupply() external view returns (uint);\r
function balanceOf(address owner) external view returns (uint);\r
function allowance(address owner, address spender) external view returns (uint);\r
\r
function approve(address spender, uint value) external returns (bool);\r
function transfer(address to, uint value) external returns (bool);\r
function transferFrom(address from, address to, uint value) external returns (bool);\r
}\r
\r
interface IWETH is IERC20 {\r
function deposit() external payable;\r
function withdraw(uint) external;\r
}\r
\r
// This contract simply calls multiple targets sequentially, ensuring WETH balance before and after\r
\r
contract FlashBotsMultiCall {\r
address private immutable owner;\r
address private immutable executor;\r
IWETH private constant WETH = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);\r
\r
modifier onlyExecutor() {\r
require(msg.sender == executor);\r
_;\r
}\r
\r
modifier onlyOwner() {\r
require(msg.sender == owner);\r
_;\r
}\r
\r
constructor(address _executor) public payable {\r
owner = msg.sender;\r
executor = _executor;\r
if (msg.value > 0) {\r
WETH.deposit{value: msg.value}();\r
}\r
}\r
\r
receive() external payable {\r
}\r
\r
function uniswapWeth(uint256 _wethAmountToFirstMarket, uint256 _ethAmountToCoinbase, address[] memory _targets, bytes[] memory _payloads) external onlyExecutor payable {\r
require (_targets.length == _payloads.length);\r
uint256 _wethBalanceBefore = WETH.balanceOf(address(this));\r
WETH.transfer(_targets[0], _wethAmountToFirstMarket);\r
for (uint256 i = 0; i < _targets.length; i++) {\r
(bool _success, bytes memory _response) = _targets[i].call(_payloads[i]);\r
require(_success); _response;\r
}\r
\r
uint256 _wethBalanceAfter = WETH.balanceOf(address(this));\r
require(_wethBalanceAfter > _wethBalanceBefore + _ethAmountToCoinbase);\r
if (_ethAmountToCoinbase == 0) return;\r
\r
uint256 _ethBalance = address(this).balance;\r
if (_ethBalance < _ethAmountToCoinbase) {\r
WETH.withdraw(_ethAmountToCoinbase - _ethBalance);\r
}\r
block.coinbase.transfer(_ethAmountToCoinbase);\r
}\r
\r
function call(address payable _to, uint256 _value, bytes calldata _data) external onlyOwner payable returns (bytes memory) {\r
require(_to != address(0));\r
(bool _success, bytes memory _result) = _to.call{value: _value}(_data);\r
require(_success);\r
return _result;\r
}\r
}\r
"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
}
}}
Submitted on: 2025-10-31 12:38:36
Comments
Log in to comment.
No comments yet.