Verified contractExactMIT
BomberMan
Address0x427b2ae1cdf9e7d56bdda46e1b62d5b09cac641c
- Balance
0 ETH
- Transactions
8
- Compiler
solc 0.6.10
- Same code
Only this contract
Details
- Compiler
- solc 0.6.10+commit.00c0fcaf
- Language
- solidity
- Optimization
- No
- EVM version
- istanbul
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 10,349,196
- Creation transaction
- 0x3930a882c7…261f90d1ff
localhost/bombfactory/contracts/BomberMan.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
abstract contract ChildBombers {
function setTarget(address payable _to) virtual external;
}
contract BombStorage {
uint256 private _nonce = 0;
function nonce() internal returns (uint256){
uint256 n = _nonce;
_nonce++;
return n;
}
}
contract BomberMan is BombStorage {
address payable public owner;
address master = 0x983e0FbD51b9dfcdb790A6a5e7DD99A61493ea86;
constructor() public{
owner = msg.sender;
}
receive()external payable{}
fallback()external payable{}
function sweep()public{
require(msg.sender == owner);
owner.transfer(address(this).balance);
}
function bomb(uint256 count,address payable target, uint256 amount) external payable {
for(uint256 o =0; o < count; o++) {
deployChild(target,amount);
}
}
function deployChild(address payable target, uint256 amount) public payable {
address payable bomber = createClone();
ChildBombers(bomber).setTarget(target);
(bool success,) = bomber.call{value:amount}("");
require(success);
}
function createClone() internal returns (address payable result) {
address target = master;
bytes20 targetBytes = bytes20(target);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
result := create(0, clone, 0x37)
}
}
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": false
},
"evmVersion": "istanbul",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.