Address Contract Partially Verified
Address
0x02E582682AA7b4DCc3f7574c468ef61B29545404
Balance
0.000351505 ETH
Nonce
1
Code Size
3530 bytes
Creator
0x1337a4aE...79dE at tx 0x61aafd16...ac1a71
Indexed Transactions
0
Contract Bytecode
3530 bytes
0x60806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663011d07c08114610163578063066e47481461018a57806312065fe0146101a5578063158ef93e146101ba5780631fa45291146101e3578063229824c41461020457806329730ea4146102225780633bc0461a1461022c57806356f2fc8914610244578063674a15741461026557806372909e28146102865780639655e4b01461029e5780639b7c288f146102b35780639ca423b3146102d4578063a2fb98fa14610311578063b1084ce214610326578063b3c104691461033b578063c123a65814610343578063c27d15801461034e578063dc46a76d14610363578063dce5c5a914610384578063dee86dfb14610399578063e1bc048e146103ae578063e3e10762146103c3578063e9639c80146103db578063f23ca012146103e6578063facf55e6146103ee575b600080fd5b34801561016f57600080fd5b50610178610403565b60408051918252519081900360200190f35b34801561019657600080fd5b5061017860043560243561043d565b3480156101b157600080fd5b50610178610453565b3480156101c657600080fd5b506101cf610458565b604080519115158252519081900360200190f35b3480156101ef57600080fd5b50610178600160a060020a0360043516610461565b34801561021057600080fd5b50610178600435602435604435610473565b61022a6104c0565b005b34801561023857600080fd5b506101786004356105a0565b34801561025057600080fd5b5061022a600160a060020a03600435166105ca565b34801561027157600080fd5b50610178600160a060020a036004351661079d565b34801561029257600080fd5b506101786004356107af565b3480156102aa57600080fd5b5061022a6107c8565b3480156102bf57600080fd5b50610178600160a060020a036004351661090c565b3480156102e057600080fd5b506102f5600160a060020a036004351661091e565b60408051600160a060020a039092168252519081900360200190f35b34801561031d57600080fd5b50610178610939565b34801561033257600080fd5b506102f561093f565b61022a610953565b61022a600435610a09565b34801561035a57600080fd5b50610178610a50565b34801561036f57600080fd5b50610178600160a060020a0360043516610a56565b34801561039057600080fd5b50610178610ab9565b3480156103a557600080fd5b50610178610abf565b3480156103ba57600080fd5b50610178610ac5565b3480156103cf57600080fd5b50610178600435610acb565b61022a600435610ad8565b61022a610b1f565b3480156103fa57600080fd5b50610178610d07565b60003361043761041282610a56565b600160a060020a0383166000908152600960205260409020549063ffffffff610d1a16565b91505090565b600061044c8383600554610473565b9392505050565b303190565b60075460ff1681565b60086020526000908152604090205481565b60006104b861048460025484610d34565b6104b36003546104a86104ad61049c6002548a610d34565b6104a86003548c610d34565b610d1a565b89610d5f565b610d5f565b949350505050565b6007546000908190819060ff1615156104d857600080fd5b3392503491506104f2826104ed303182610d76565b61043d565b905061050d610500826105a0565b829063ffffffff610d7616565b6007549091506101009004600160a060020a03166108fc61052d846105a0565b6040518115909202916000818181858888f19350505050158015610555573d6000803e3d6000fd5b50600160a060020a03831660009081526009602052604090205461057f908263ffffffff610d1a16565b600160a060020a039093166000908152600960205260409020929092555050565b60006105c460646105b884600463ffffffff610d3416565b9063ffffffff610d5f16565b92915050565b6007546000908190819060ff1615156105e257600080fd5b336000818152600b6020526040902054909350600160a060020a03161580156106265750600160a060020a038084166000818152600b602052604090205490911614155b1561066757600160a060020a038381166000908152600b60205260409020805473ffffffffffffffffffffffffffffffffffffffff19169186169190911790555b61066f610403565b915061068660005483610d5f90919063ffffffff16565b600160a060020a0384166000908152600860205260409020549091506106b2908263ffffffff610d1a16565b600160a060020a0380851660009081526008602081815260408084209590955560098152848320839055600a8152848320429055600b81528483205490931682529091529081205411156107715761074861071483601463ffffffff610d5f16565b600160a060020a038086166000908152600b602090815260408083205490931682526009905220549063ffffffff610d1a16565b600160a060020a038085166000908152600b602090815260408083205490931682526009905220555b61079461078583600a63ffffffff610d5f16565b6005549063ffffffff610d1a16565b60055550505050565b60096020526000908152604090205481565b60006105c48260055430600160a060020a031631610473565b60075460009081908190819060ff1615156107e257600080fd5b3393506107ed610403565b92506107f8836107af565b9150610803826105a0565b3360009081526008602052604090205490915061083a9060039061082e90600463ffffffff610d5f16565b9063ffffffff610d3416565b600160a060020a03851660009081526008602090815260408083209390935560098152828220829055600a90522042905560055461087e908463ffffffff610d1a16565b600555600754604051610100909104600160a060020a0316906108fc8315029083906000818181858888f193505050501580156108bf573d6000803e3d6000fd5b50600160a060020a0384166108fc6108dd848463ffffffff610d7616565b6040518115909202916000818181858888f19350505050158015610905573d6000803e3d6000fd5b5050505050565b600a6020526000908152604090205481565b600b60205260009081526040902054600160a060020a031681565b60015481565b6007546101009004600160a060020a031681565b60075460009060ff16151561096757600080fd5b66083e0717e10000341461097a57600080fd5b506007546040513391600160a060020a0361010090910416903480156108fc02916000818181858888f193505050501580156109ba573d6000803e3d6000fd5b50600160a060020a038116600090815260086020526040902054156109de57600080fd5b600160a060020a03166000908152600a60209081526040808320429055600154600890925290912055565b60075460ff161515610a1a57600080fd5b6040805182815290517f3147849c558a35f2a927ebc18cce35d3813af4ebf4925ddeeeab719519d82ae09181900360200190a150565b60065490565b60008054600160a060020a0383168252600a60205260408220548291610a8c91610a8790429063ffffffff610d7616565b610d88565b600160a060020a03841660009081526008602052604090205490915061044c90829063ffffffff610d3416565b60065481565b60055481565b60005481565b60006105c482303161043d565b6007546101009004600160a060020a03163314610af457600080fd5b60055415610b0157600080fd5b6007805460ff191660011790556005819055610b1c34610a09565b50565b600080600080600080600080600760009054906101000a900460ff161515610b4657600080fd5b600754600654610100909104600160a060020a031698509650610b7a610b6d88600a610d5f565b889063ffffffff610d1a16565b6006819055341015610b8b57600080fd5b600654610b9f90349063ffffffff610d7616565b9550610bbb60146105b889600654610d7690919063ffffffff16565b9450610bce85600a63ffffffff610d3416565b9350610be185600963ffffffff610d3416565b9250339150610c0686610bfa898763ffffffff610d1a16565b9063ffffffff610d1a16565b60078054600160a060020a038086166101000274ffffffffffffffffffffffffffffffffffffffff00199092169190911790915560405191925089169082156108fc029083906000818181858888f19350505050158015610c6b573d6000803e3d6000fd5b50600454604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610ca6573d6000803e3d6000fd5b50610cb083610a09565b60065460408051600160a060020a03808c1682528516602082015280820192909252517fe3c92bbeaece52e6f6ebe1a86aeedffbf3300057e46d25594ccc88a8cf1fbe0a9181900360600190a15050505050505050565b3360009081526008602052604090205490565b600082820183811015610d2957fe5b8091505b5092915050565b600080831515610d475760009150610d2d565b50828202828482811515610d5757fe5b0414610d2957fe5b6000808284811515610d6d57fe5b04949350505050565b600082821115610d8257fe5b50900390565b6000818310610d97578161044c565b50909190505600a165627a7a723058202e9b4bac8d9131fd841d80d36a43f12470225ae5585f3a4de7d9601f48ee53180029
Verified Source Code Partial Match
Compiler: v0.4.24+commit.e67f0147
EVM: byzantium
Optimization: Yes (200 runs)
CloneWars.sol 237 lines
pragma solidity ^0.4.24;
/* You've seen all of this before. Here are the differences.
// A. A quarter of your clones die when you sell ideas. Market saturation, y'see?
// B. You can "become" Norsefire and take the dev fees, since he's involved in everything.
// B. 1. The Norsefire boon is a hot potato. If someone else buys it off you, you profit.
// B. 2. When Norsefire flips, we actually send him 5% of the increase. You receive 50%, the contract receives the other 45%.
// C. You get your 'free' clones for 0.00232 Ether, because throwbaaaaaack.
// D. Referral rates have been dropped to 5% instead of 20%. The referral target must have bought in.
// E. The generation rate of ideas have been halved, as a sign of my opinion of the community at large.
// F. God knows this will probably be successful in spite of myself.
*/
contract CloneWars {
using SafeMath for uint;
/* Event */
event MarketBoost(
uint amountSent
);
event NorsefireSwitch(
address from,
address to,
uint price
);
/* Constants */
uint256 public clones_to_create_one_idea = 2 days;
uint256 public starting_clones = 232;
uint256 PSN = 10000;
uint256 PSNH = 5000;
address actualNorse = 0x4F4eBF556CFDc21c3424F85ff6572C77c514Fcae;
/* Variables */
uint256 public marketIdeas;
uint256 public norsefirePrice;
bool public initialized;
address public currentNorsefire;
mapping (address => uint256) public arrayOfClones;
mapping (address => uint256) public claimedIdeas;
mapping (address => uint256) public lastDeploy;
mapping (address => address) public referrals;
constructor () public {
initialized = false;
norsefirePrice = 0.1 ether;
currentNorsefire = 0x1337a4aEfd5ec486E6e97b1d0aE055FAC8D879dE;
}
function becomeNorsefire() public payable {
require(initialized);
address oldNorseAddr = currentNorsefire;
uint oldNorsePrice = norsefirePrice;
norsefirePrice = oldNorsePrice.add(oldNorsePrice.div(10));
require(msg.value >= norsefirePrice);
uint excess = msg.value.sub(norsefirePrice);
uint diffFivePct = (norsefirePrice.sub(oldNorsePrice)).div(20);
uint flipPrize = diffFivePct.mul(10);
uint marketBoost = diffFivePct.mul(9);
address _newNorse = msg.sender;
uint _toRefund = (oldNorsePrice.add(flipPrize)).add(excess);
currentNorsefire = _newNorse;
oldNorseAddr.transfer(_toRefund);
actualNorse.transfer(diffFivePct);
boostCloneMarket(marketBoost);
emit NorsefireSwitch(oldNorseAddr, _newNorse, norsefirePrice);
}
function boostCloneMarket(uint _eth) public payable {
require(initialized);
emit MarketBoost(_eth);
}
function deployIdeas(address ref) public{
require(initialized);
address _deployer = msg.sender;
if(referrals[_deployer] == 0 && referrals[_deployer] != _deployer){
referrals[_deployer]=ref;
}
uint256 myIdeas = getMyIdeas();
uint256 newIdeas = myIdeas.div(clones_to_create_one_idea);
arrayOfClones[_deployer] = arrayOfClones[_deployer].add(newIdeas);
claimedIdeas[_deployer] = 0;
lastDeploy[_deployer] = now;
// Send referral ideas: dropped to 5% instead of 20% to reduce inflation.
if (arrayOfClones[referrals[_deployer]] > 0)
{
claimedIdeas[referrals[_deployer]] = claimedIdeas[referrals[_deployer]].add(myIdeas.div(20));
}
// Boost market to minimise idea hoarding
marketIdeas = marketIdeas.add(myIdeas.div(10));
}
function sellIdeas() public {
require(initialized);
address _caller = msg.sender;
uint256 hasIdeas = getMyIdeas();
uint256 ideaValue = calculateIdeaSell(hasIdeas);
uint256 fee = devFee(ideaValue);
// Destroy a quarter the owner's clones when selling ideas thanks to market saturation.
arrayOfClones[_caller] = (arrayOfClones[msg.sender].div(4)).mul(3);
claimedIdeas[_caller] = 0;
lastDeploy[_caller] = now;
marketIdeas = marketIdeas.add(hasIdeas);
currentNorsefire.transfer(fee);
_caller.transfer(ideaValue.sub(fee));
}
function buyIdeas() public payable{
require(initialized);
address _buyer = msg.sender;
uint _sent = msg.value;
uint256 ideasBought = calculateIdeaBuy(_sent, SafeMath.sub(address(this).balance,_sent));
ideasBought = ideasBought.sub(devFee(ideasBought));
currentNorsefire.transfer(devFee(_sent));
claimedIdeas[_buyer] = claimedIdeas[_buyer].add(ideasBought);
}
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
}
function calculateIdeaSell(uint256 _ideas) public view returns(uint256){
return calculateTrade(_ideas,marketIdeas,address(this).balance);
}
function calculateIdeaBuy(uint256 eth,uint256 _balance) public view returns(uint256){
return calculateTrade(eth, _balance, marketIdeas);
}
function calculateIdeaBuySimple(uint256 eth) public view returns(uint256){
return calculateIdeaBuy(eth,address(this).balance);
}
function devFee(uint256 amount) public pure returns(uint256){
return amount.mul(4).div(100);
}
function releaseTheOriginal(uint256 _ideas) public payable {
require(msg.sender == currentNorsefire);
require(marketIdeas == 0);
initialized = true;
marketIdeas = _ideas;
boostCloneMarket(msg.value);
}
function hijackClones() public payable{
require(initialized);
require(msg.value==0.00232 ether); // Throwback to the OG.
address _caller = msg.sender;
currentNorsefire.transfer(msg.value); // The current Norsefire gets this regitration
require(arrayOfClones[_caller]==0);
lastDeploy[_caller] = now;
arrayOfClones[_caller] = starting_clones;
}
function getBalance() public view returns(uint256){
return address(this).balance;
}
function getMyClones() public view returns(uint256){
return arrayOfClones[msg.sender];
}
function getNorsefirePrice() public view returns(uint256){
return norsefirePrice;
}
function getMyIdeas() public view returns(uint256){
address _caller = msg.sender;
return claimedIdeas[_caller].add(getIdeasSinceLastDeploy(_caller));
}
function getIdeasSinceLastDeploy(address adr) public view returns(uint256){
uint256 secondsPassed=min(clones_to_create_one_idea, now.sub(lastDeploy[adr]));
return secondsPassed.mul(arrayOfClones[adr]);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return a < b ? a : b;
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
Read Contract
arrayOfClones 0x1fa45291 → uint256
calculateIdeaBuy 0x066e4748 → uint256
calculateIdeaBuySimple 0xe3e10762 → uint256
calculateIdeaSell 0x72909e28 → uint256
calculateTrade 0x229824c4 → uint256
claimedIdeas 0x674a1574 → uint256
clones_to_create_one_idea 0xe1bc048e → uint256
currentNorsefire 0xb1084ce2 → address
devFee 0x3bc0461a → uint256
getBalance 0x12065fe0 → uint256
getIdeasSinceLastDeploy 0xdc46a76d → uint256
getMyClones 0xfacf55e6 → uint256
getMyIdeas 0x011d07c0 → uint256
getNorsefirePrice 0xc27d1580 → uint256
initialized 0x158ef93e → bool
lastDeploy 0x9b7c288f → uint256
marketIdeas 0xdee86dfb → uint256
norsefirePrice 0xdce5c5a9 → uint256
referrals 0x9ca423b3 → address
starting_clones 0xa2fb98fa → uint256
Write Contract 7 functions
These functions modify contract state and require a wallet transaction to execute.
becomeNorsefire 0xf23ca012
No parameters
boostCloneMarket 0xc123a658
uint256 _eth
buyIdeas 0x29730ea4
No parameters
deployIdeas 0x56f2fc89
address ref
hijackClones 0xb3c10469
No parameters
releaseTheOriginal 0xe9639c80
uint256 _ideas
sellIdeas 0x9655e4b0
No parameters
Recent Transactions
No transactions found for this address