Skip to content
Verified contractPartial

GatlingGun

Address0xf350cee89eaf784d18d07a00607edbd37e5e0bd7
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.4.25

 

Same code

3 more contracts

 

Details

Compiler
solc 0.4.25+commit.59dbf8f1
Language
solidity
Optimization
No
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
8,902,555
Creation transaction
0x4d805bbc3c…b16b2eb691

DeployGatlingGun.sol

// Recovered by EthereumHistory (ethereumhistory.com) -sw
pragma solidity ^0.4.25;


contract GatlingGun {

	event Authorized(address wallet);
	event Unauthorized(address wallet);
	event NewOwner(address wallet);

	address public owner;

	string public version;

	mapping(address => bool) public authorized;

	constructor(address _owner, string _version) public {
		version = _version;
		owner = _owner;
		emit NewOwner(_owner);
		authorized[_owner] = true;
		emit Authorized(_owner);
	}

	modifier onlyOwner() {
		require(msg.sender == owner);
		_;
	}

	modifier onlyAuthorized() {
		require(authorized[msg.sender]);
		_;
	}

	function setOwner(address wallet) public onlyOwner {
		owner = wallet;
		emit NewOwner(wallet);
	}

	function authorize(address wallet) public onlyOwner {
		authorized[wallet] = true;
		emit Authorized(wallet);
	}

	function unauthorize(address wallet) public onlyOwner {
		authorized[wallet] = false;
		emit Unauthorized(wallet);
	}

	function fire(bytes, address[] targets, uint256[] lengths, uint256[] values) public onlyAuthorized {
		require(targets.length == lengths.length);
		require(targets.length == values.length);
		uint256 payloadMemoryLocation;
		assembly {
			payloadMemoryLocation := mload(0x40)

			let payloadLengthLocation := add(4, calldataload(4))
			let payloadLength := calldataload(payloadLengthLocation)
			let payloadLocation := add(32, payloadLengthLocation)

			calldatacopy(payloadMemoryLocation, payloadLocation, payloadLength)
			mstore(0x40, add(payloadMemoryLocation, payloadLength))
		}
		bool success;
		uint256 offset = 0;
		for(uint256 i = 0; i < targets.length; i++){
			address target = targets[i];
			uint256 limit = lengths[i];
			uint256 value = values[i];
			assembly {
				success := call(
					gas,
					target,
					value,
					add(payloadMemoryLocation, offset),
					limit,
					0,
					0
				)
			}
			require(success);
			offset += limit;
		}
	}

	function deploy(bytes, uint256 value) public onlyAuthorized returns(address){
		address newContract;
		assembly {
			let payloadMemoryLocation := mload(0x40)

			let payloadLengthLocation := add(4, calldataload(4))
			let payloadLength := calldataload(payloadLengthLocation)
			let payloadLocation := add(32, payloadLengthLocation)

			calldatacopy(payloadMemoryLocation, payloadLocation, payloadLength)
			mstore(0x40, add(payloadMemoryLocation, payloadLength))

			newContract := create (
				value,
				payloadMemoryLocation,
				payloadLength
			)
		}
		require(newContract != address(0x0));
		return newContract;
	}

	function tokenFallback(address, uint, bytes) public pure { }

	function() payable public { }
}

contract DeployGatlingGun {

	string public version = "0.4";

	event NewGunDeployed(address gunAddress, address indexed ownerAddress);

	constructor () public {}

	function deployGatlingGun (address _owner) public {
		emit NewGunDeployed(new GatlingGun(_owner, version), _owner);
	}
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.