Skip to content
Verified contractPartial

Etheria

Address0x6489fc370c7df314ee0bdfb1fbd185f1bc457d89
Balance

0 ETH

 

Transactions

15

 

Compiler

solc 0.1.3

 

Same code

Only this contract

 

Details

Compiler
solc 0.1.3+commit.028f561d
Language
solidity
Optimization
Yes, 200 runs
License
Not stated
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
314,103
Creation transaction
0x710f516f11…d28010357e

Etheria.sol

// Submitted by EthereumHistory (ethereumhistory.com)
/*

Folder name = NKNVELSC (Non-killable, non-viable, Etheria-like smart contract)

WARNING! This test contract is live on the chain, can't be killed but is FATALLY BUGGED.
______ _____   _   _ _____ _____  ______ _   ___   __
|  _  \  _  | | \ | |  _  |_   _| | ___ \ | | \ \ / /
| | | | | | | |  \| | | | | | |   | |_/ / | | |\ V / 
| | | | | | | | . ` | | | | | |   | ___ \ | | | \ /  
| |/ /\ \_/ / | |\  \ \_/ / | |   | |_/ / |_| | | |  
|___/  \___/  \_| \_/\___/  \_/   \____/ \___/  \_/  
                                                     
There is no wrapper. There is no official support/website. 
Anything you may see for Etheria 0x6489f is a SCAM!
No wrapper or anything else can fix the underlying bug.
Tiles cannot be transferred due to a "==" where a "=" should have been in setOwner.

BUGGED Etheria v0.6
Block 314103 
Sep-30-2015 09:37:11 PM +UTC
0x6489fc370c7df314ee0bdfb1fbd185f1bc457d89

Decription of bug:

It's pretty simple. The setOwner function uses "==" (equals) instead of "=" (assignment) for transferral of tiles to another account.
That is, tiles CANNOT BE TRANSFERRED and are, thus, not NFTs and have no value.

> function setOwner(uint8 x, uint8 y, address newowner)
> {
> 	if(tiles[x][y].owner == msg.sender)
>		tiles[x][y].owner == newowner;
> }

var etheriaAddress = "0x6489fc370c7df314ee0bdfb1fbd185f1bc457d89";
var abi = [
	{"constant":true,"inputs":[],"name":"getElevations","outputs":[{"name":"","type":"uint8[33][33]"}],"type":"function","payable":false,"stateMutability":"view"},
	{"constant":false,"inputs":[{"name":"x","type":"uint8"},{"name":"y","type":"uint8"},{"name":"block","type":"int8[7]"}],"name":"addBlock","outputs":[],"type":"function","payable":true,"stateMutability":"payable"},
	{"constant":false,"inputs":[{"name":"x","type":"uint8"},{"name":"y","type":"uint8"},{"name":"newowner","type":"address"}],"name":"setOwner","outputs":[],"type":"function","payable":true,"stateMutability":"payable"},
	{"constant":false,"inputs":[{"name":"rows","type":"uint8[]"}],"name":"initializeOwners","outputs":[],"type":"function","payable":true,"stateMutability":"payable"},
	{"constant":true,"inputs":[],"name":"getOwners","outputs":[{"name":"","type":"address[33][33]"}],"type":"function","payable":false,"stateMutability":"view"},
	{"constant":true,"inputs":[{"name":"x","type":"uint8"},{"name":"y","type":"uint8"}],"name":"getBlocksForTile","outputs":[{"name":"","type":"int8[]"}],"type":"function","payable":false,"stateMutability":"view"},
	{"constant":true,"inputs":[],"name":"getPrices","outputs":[{"name":"","type":"uint256[33][33]"}],"type":"function","payable":false,"stateMutability":"view"},
	{"constant":false,"inputs":[{"name":"row","type":"uint8"},{"name":"_elevations","type":"uint8[33]"}],"name":"setElevations","outputs":[],"type":"function","payable":true,"stateMutability":"payable"}
];
var etheria = new web3.eth.Contract(abi, etheriaAddress);

Bug proven here: 
https://etherscan.io/tx/0xdc9f13306fc58e6d3553280b9f0bcb64a0fe936566537670ba5eb5c61c6bc1a1
Tried to setOwner of 0,0 and the owner didn't change. Womp womp. 

Exact bytecode match with code below and Solidity 0.1.4 w default optimization (200) (1 compilation)
chain: 0x6060604052361561006c5760e060020a6000350463049b7852811461006e5780631a0cda6f146101905780637d5fec5a14610288578063a0ad10a6146102fe578063a0e67e2b1461035a578063a364c21f1461048a578063bd9a548b146105e3578063d810612b146106f9575b005b610746618820604051908101604052806021905b610420604051908101604052806021905b6000815260200190600190039081610093579050508152602001906001900390816100825750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816100db579050508152602001906001900390816100ca575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610bdc5760018160218110156100025760630201826021811015610002575060038302015460ff1683826021811015610002576020020151836021811015610002575060ff919091166020840290910152600101610123565b6040805160e081810190925261006c9160043591602435916101249190604490600790839083908082843750909450505050506000806001856021811015610002576063020184602181101561000257825460ff1916600190811761ff0019166102001762ff00001916620300001764ffff00000019166464000000001765ff00000000001916656500000000001766ff00000000000019166666000000000000178455600391909102909101600281018054928301808255919450909182908015829011610aaf5782855260208520610aaf9181019083015b80821115610bd057805466ffffffffffffff1916815560010161026a565b61006c60043560243560443533600160a060020a0316600184602181101561000257606302018360218110156100025760030201546101009004600160a060020a031614156102f957600160a060020a03811660018460218110156100025760630201836021811015610002575050505b505050565b6040805160048035908101356020818102848101820190955281845261006c946024949385019291829190850190849080828437509495505050505050610cc454600090819081908190819060ff16600114156107ec576107e4565b610746618820604051908101604052806021905b610420604051908101604052806021905b600081526020019060019003908161037f5790505081526020019060019003908161036e5750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816103c7579050508152602001906001900390816103b6575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610be857600181602181101561000257606302018260218110156100025760030201546101009004600160a060020a03168382602181101561000257602002015183602181101561000257600160a060020a0392909216602092909202015260010161040f565b61078b6004356024356040805160208181018352600080835283518083018086528282528290528085018290528451928301909452808252606084019190915290919080600186602181101561000257606302018560218110156100025760408051608081018252600392909202909201805460ff811683526101009004600160a060020a031660208381019190915260018201548385015260028201805485518184028101840190965280865293949293606086019392879084015b82821015610bf457600084815260208082206040805160e0810182529186015480850b850b83526101008104850b850b83850152620100008104850b850b9183019190915263010000008104840b840b60608301526401000000008104840b840b6080830152650100000000008104840b840b60a083015266010000000000009004830b90920b60c08301529082526001929092019101610547565b610746618820604051908101604052806021905b610420604051908101604052806021905b6000815260200190600190039081610608579050508152602001906001900390816105f75750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816106505790505081526020019060019003908161063f575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610f61576001816021811015610002576063020182602181101561000257600302016001015483826021811015610002576020020151836021811015610002576020020152600101610698565b6040805161042081810190925261006c91600435916104449160249060219083908390808284375090945050505050610cc4546000908190610100900460ff16600114156109b3576109ad565b6040516000826021835b8184101561077b576020840283015161042080838184600060046072f1509050019260010192610750565b9250505091505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600302600f01f1509050019250505060405180910390f35b610cc4805460ff191660011790555b505050505050565b60009450600093505b85518460ff16101561083a576001600060149054906101000a900460ff160360ff1686858151811015610002579060200190602002015160ff161115610907576107e4565b600092505b85518360ff161015610913578583815181101561000257602090810290910101519450600091505b60005460a060020a900460ff908116908316101561095a57600054600160a060020a0316600183602181101561000257606302018660218110156100025760030201805474ffffffffffffffffffffffffffffffffffffffff001916610100929092029190911790556703782dace9d900006001836021811015610002576063020186602181101561000257600302016001015560019190910190610867565b600193909301926107f5565b5060005b60005460a060020a900460ff168110156107d557610cc5816021811015610002576020808204909201549190066101000a900460ff1660001415610994576107e4565b6001610cc5866021811015610002579090602091828204019190066101000a81548160ff021916908302179055506001929092019161083f565b600101610917565b610cc4805461ff0019166101001790555b50505050565b60005460a060020a900460ff908116908516106109cf576109ad565b600091505b60005460a060020a900460ff9081169083161015610a315782826021811015610002576020020151600183602181101561000257606302018560218110156100025760030201805460ff19169091179055600191909101906109d4565b6001610cc7856021811015610002579090602091828204019190066101000a81548160ff02191690830217905550600090505b60005460a060020a900460ff1681101561099c57610cc7816021811015610002576020808204909201549190066101000a900460ff1660001415610aa7576109ad565b600101610a64565b50505050600282018054829190600019810190811015610002575080546000918252602082209254920160001901805460f860020a93830b840284900460ff199190911617808255845461010090819004840b85028590040261ff0019919091161780825584546201000090819004840b85028590040262ff00001991909116178082558454630100000090819004840b85028590040263ff000000199190911617808255845464010000000090819004840b85028590040264ff0000000019919091161780825584546501000000000090819004840b85028590040265ff0000000000199190911617808255845466010000000000009081900490930b84029390930490910266ff00000000000019929092169190911790555050505050565b5090565b509092915050565b60019190910190610107565b600191909101906103f3565b50505091525090935060009150505b826060015151600702811015610c615760078281815401915081815481835581811511610cd657601f016020900481601f01602090048360005260206000209182019101610cd691905b80821115610bd05760008155600101610c4d565b815460408051602083810282018101909252828152918491830182828015610cc657602002820191906000526020600020906000905b825461010083900a900460000b815260206001928301818104948501949093039092029101808411610c975790505b5050505050935050505092915050565b505050508260600151818151811015610002579060200190602002015160000151828281548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160200151828260010181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160400151828260020181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160600151828260030181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160800151828260040181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160a00151828260050181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160c00151828260060181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508060010190508050610c03565b6001919091019061067c56
compiled:6060604052361561006c5760e060020a6000350463049b7852811461006e5780631a0cda6f146101905780637d5fec5a14610288578063a0ad10a6146102fe578063a0e67e2b1461035a578063a364c21f1461048a578063bd9a548b146105e3578063d810612b146106f9575b005b610746618820604051908101604052806021905b610420604051908101604052806021905b6000815260200190600190039081610093579050508152602001906001900390816100825750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816100db579050508152602001906001900390816100ca575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610bdc5760018160218110156100025760630201826021811015610002575060038302015460ff1683826021811015610002576020020151836021811015610002575060ff919091166020840290910152600101610123565b6040805160e081810190925261006c9160043591602435916101249190604490600790839083908082843750909450505050506000806001856021811015610002576063020184602181101561000257825460ff1916600190811761ff0019166102001762ff00001916620300001764ffff00000019166464000000001765ff00000000001916656500000000001766ff00000000000019166666000000000000178455600391909102909101600281018054928301808255919450909182908015829011610aaf5782855260208520610aaf9181019083015b80821115610bd057805466ffffffffffffff1916815560010161026a565b61006c60043560243560443533600160a060020a0316600184602181101561000257606302018360218110156100025760030201546101009004600160a060020a031614156102f957600160a060020a03811660018460218110156100025760630201836021811015610002575050505b505050565b6040805160048035908101356020818102848101820190955281845261006c946024949385019291829190850190849080828437509495505050505050610cc454600090819081908190819060ff16600114156107ec576107e4565b610746618820604051908101604052806021905b610420604051908101604052806021905b600081526020019060019003908161037f5790505081526020019060019003908161036e5750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816103c7579050508152602001906001900390816103b6575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610be857600181602181101561000257606302018260218110156100025760030201546101009004600160a060020a03168382602181101561000257602002015183602181101561000257600160a060020a0392909216602092909202015260010161040f565b61078b6004356024356040805160208181018352600080835283518083018086528282528290528085018290528451928301909452808252606084019190915290919080600186602181101561000257606302018560218110156100025760408051608081018252600392909202909201805460ff811683526101009004600160a060020a031660208381019190915260018201548385015260028201805485518184028101840190965280865293949293606086019392879084015b82821015610bf457600084815260208082206040805160e0810182529186015480850b850b83526101008104850b850b83850152620100008104850b850b9183019190915263010000008104840b840b60608301526401000000008104840b840b6080830152650100000000008104840b840b60a083015266010000000000009004830b90920b60c08301529082526001929092019101610547565b610746618820604051908101604052806021905b610420604051908101604052806021905b6000815260200190600190039081610608579050508152602001906001900390816105f75750506040805161882081019091526021815b610420604051908101604052806021905b60008152602001906001900390816106505790505081526020019060019003908161063f575060009050805b60005460a060020a900460ff9081169083161015610bd4575060005b60005460a060020a900460ff9081169082161015610f61576001816021811015610002576063020182602181101561000257600302016001015483826021811015610002576020020151836021811015610002576020020152600101610698565b6040805161042081810190925261006c91600435916104449160249060219083908390808284375090945050505050610cc4546000908190610100900460ff16600114156109b3576109ad565b6040516000826021835b8184101561077b576020840283015161042080838184600060046072f1509050019260010192610750565b9250505091505060405180910390f35b60405180806020018281038252838181518152602001915080519060200190602002808383829060006004602084601f0104600302600f01f1509050019250505060405180910390f35b610cc4805460ff191660011790555b505050505050565b60009450600093505b85518460ff16101561083a576001600060149054906101000a900460ff160360ff1686858151811015610002579060200190602002015160ff161115610907576107e4565b600092505b85518360ff161015610913578583815181101561000257602090810290910101519450600091505b60005460a060020a900460ff908116908316101561095a57600054600160a060020a0316600183602181101561000257606302018660218110156100025760030201805474ffffffffffffffffffffffffffffffffffffffff001916610100929092029190911790556703782dace9d900006001836021811015610002576063020186602181101561000257600302016001015560019190910190610867565b600193909301926107f5565b5060005b60005460a060020a900460ff168110156107d557610cc5816021811015610002576020808204909201549190066101000a900460ff1660001415610994576107e4565b6001610cc5866021811015610002579090602091828204019190066101000a81548160ff021916908302179055506001929092019161083f565b600101610917565b610cc4805461ff0019166101001790555b50505050565b60005460a060020a900460ff908116908516106109cf576109ad565b600091505b60005460a060020a900460ff9081169083161015610a315782826021811015610002576020020151600183602181101561000257606302018560218110156100025760030201805460ff19169091179055600191909101906109d4565b6001610cc7856021811015610002579090602091828204019190066101000a81548160ff02191690830217905550600090505b60005460a060020a900460ff1681101561099c57610cc7816021811015610002576020808204909201549190066101000a900460ff1660001415610aa7576109ad565b600101610a64565b50505050600282018054829190600019810190811015610002575080546000918252602082209254920160001901805460f860020a93830b840284900460ff199190911617808255845461010090819004840b85028590040261ff0019919091161780825584546201000090819004840b85028590040262ff00001991909116178082558454630100000090819004840b85028590040263ff000000199190911617808255845464010000000090819004840b85028590040264ff0000000019919091161780825584546501000000000090819004840b85028590040265ff0000000000199190911617808255845466010000000000009081900490930b84029390930490910266ff00000000000019929092169190911790555050505050565b5090565b509092915050565b60019190910190610107565b600191909101906103f3565b50505091525090935060009150505b826060015151600702811015610c615760078281815401915081815481835581811511610cd657601f016020900481601f01602090048360005260206000209182019101610cd691905b80821115610bd05760008155600101610c4d565b815460408051602083810282018101909252828152918491830182828015610cc657602002820191906000526020600020906000905b825461010083900a900460000b815260206001928301818104948501949093039092029101808411610c975790505b5050505050935050505092915050565b505050508260600151818151811015610002579060200190602002015160000151828281548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160200151828260010181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160400151828260020181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160600151828260030181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160800151828260040181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160a00151828260050181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508260600151818151811015610002579060200190602002015160c00151828260060181548110156100025790600052602060002090602091828204019190066101000a81548160ff021916908360f860020a9081020402179055508060010190508050610c03565b6001919091019061067c56


*/

//import "mortal"; // this was an available include for old versions of Solidity and is equivalent to the following two lines
contract owned{function owned(){owner = msg.sender;}modifier onlyowner(){if(msg.sender==owner)_}address owner;}
contract mortal is owned {function kill() { if (msg.sender == owner) suicide(owner); }}

contract Etheria { // note that I forgot to add "is mortal" to the contract declaration, which is why this contract is unkillable. Doh!
	
    address creator;
    uint8 mapsize = 33;
    Tile[33][33] tiles;
    bool ownersinitialized = false;
    bool elevationsinitialized = false;
    bool[33] ownerrowsinitialized;
    bool[33] elevationrowsinitialized;
    
    // TODO: 
    // 3. Mouseover
    // 4. Block locations & colors
    
    struct Tile 
    {
    	uint8 elevation;
    	address owner;
    	uint price; // 0 = not for sale. 0-4700000000000000000000 wei (approx) (0-4700 ether)
    	Block[] blocks;
    }
    
    struct Block 
    {
    	int8 which;
    	int8 x;
    	int8 y;
    	int8 z; // Note: We'll add 127 (*NOT 128*) on client. If z=-1 after that, block has not yet been placed.
    	
    	int8 r;	// NOTE: 
    	int8 g; // We'll add 128 to each of these values on the client side to get 0-255 values
    	int8 b; // That way, we can return an array of int8s to describe all blocks in a tile all at once
    }
    
    function Etheria() 
    {
        creator = msg.sender;
        for(uint8 x = 0; x < mapsize; x++)
        {
        	ownerrowsinitialized[x] = false;
        	elevationrowsinitialized[x] = false;
        }	
    }
    
    function initializeOwners(uint8[] rows)
    {
    	if(ownersinitialized == true) // can only initialize map ownership once
    		return;
    	
    	uint8 row = 0;
        for(uint8 a = 0; a < rows.length; a++)
    	{	
    		if(rows[a] > (mapsize-1))
    			return; // error. None of the provided row indexes should be > mapsize-1
    	}
    	for(uint8 y = 0; y < rows.length; y++)
    	{	
    		row = rows[y];
    		for(uint8 x = 0; x < mapsize; x++)
    		{
    			tiles[x][row].owner = creator;
    			tiles[x][row].price = 250000000000000000; //.25 eth
    		}
    		ownerrowsinitialized[row] = true;
    	}
    	
    	for(uint r = 0; r < mapsize; r++)
    	{
    		if(ownerrowsinitialized[r] == false) // at least one row is not yet initialized. Return.
    			return;
    	}	
    	ownersinitialized = true;
    }
    
    function setElevations(uint8 row, uint8[33] _elevations)
    {
    	if(elevationsinitialized == true)
    		return;
    	
    	if(row >= mapsize) // this row index is out of bounds.
    		return; 
    	
    	for(uint8 x = 0; x < mapsize; x++)
    		tiles[x][row].elevation = _elevations[x]; 
    	elevationrowsinitialized[row] = true;
    	
    	for(uint r = 0; r < mapsize; r++)
    	{
    		if(elevationrowsinitialized[r] == false) // at least one row is not yet initialized. Return.
    			return;
    	}	
    	elevationsinitialized = true;
    }
    
    function addBlock(uint8 x, uint8 y, int8[7] block)
    {
    	Tile current = tiles[x][y];
    	Block newblock;
    	newblock.which = 1;
    	newblock.x = 2;
    	newblock.y = 3;
    	newblock.z = 0;
    	newblock.r = 100;
    	newblock.g = 101;
    	newblock.b = 102;
    	current.blocks.length+=1;
    	current.blocks[current.blocks.length-1] = newblock;
    }
    
    function setOwner(uint8 x, uint8 y, address newowner)
    {
    	if(tiles[x][y].owner == msg.sender)
    		tiles[x][y].owner == newowner;  // this is the bugged line. If this were an "=" instead, this would be a semi-viable 33x33 contract from Sept 30, 2015.
    }
    
    function getElevations() constant returns (uint8[33][33])
    {
        uint8[33][33] memory elevations;
        for(uint8 y = 0; y < mapsize; y++)
        {
        	for(uint8 x = 0; x < mapsize; x++)
        	{
        		elevations[x][y] = tiles[x][y].elevation; 
        	}	
        }	
    	return elevations;
    }
    
    function getOwners() constant returns(address[33][33])
    {
        address[33][33] memory owners;
        for(uint8 y = 0; y < mapsize; y++)
        {
        	for(uint8 x = 0; x < mapsize; x++)
        	{
        		owners[x][y] = tiles[x][y].owner; 
        	}	
        }	
    	return owners;
    }
    
    function getBlocksForTile(uint8 x, uint8 y) constant returns (int8[])
    {
    	Tile memory currenttile = tiles[x][y];
    	int8[] blockarray;
    	uint i = 0;
    	while(i < currenttile.blocks.length * 7)
    	{
    	    blockarray.length += 7;
    		blockarray[i] = currenttile.blocks[i].which;
    		blockarray[i+1] = currenttile.blocks[i].x;
    		blockarray[i+2] = currenttile.blocks[i].y;
    		blockarray[i+3] = currenttile.blocks[i].z;
    		blockarray[i+4] = currenttile.blocks[i].r;
    		blockarray[i+5] = currenttile.blocks[i].g;
    		blockarray[i+6] = currenttile.blocks[i].b;
    		i = i + 1;
    	}	
    	return blockarray;
    }
    
    function getPrices() constant returns(uint[33][33])
    {
        uint[33][33] memory prices;
        for(uint8 y = 0; y < mapsize; y++)
        {
        	for(uint8 x = 0; x < mapsize; x++)
        	{
        		prices[x][y] = tiles[x][y].price; 
        	}	
        }	
    	return prices;
    }
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.