Back to Home

ArrayPasser

program
0xc8c2ed93af09...8d9d527e9057
FrontierContract #1,694Exact Bytecode MatchEdit this contract
Deployed September 30, 2015 (10 years ago)Block 313,141

A tutorial contract testing fixed-size array passing as function parameters in Solidity.

Key Facts

Deployer
Cyrus Adkisson(0xcf684D...AD1Bac)
Deployment Block
313,141
Deployment Date
Sep 30, 2015, 04:47 PM
Code Size
1.3 KB
Gas at Deploy
396,809
Transactions by Year
20151

Description

A tutorial contract from Cyrus Adkisson's solidity-baby-steps series (contract #47) that tests passing fixed-size arrays as parameters to Solidity functions. Explores how arrays are encoded in calldata and how they can be received and processed by contract functions.

Deployed twice on September 30, 2015. Part of a series of contracts (#47) testing different data passing mechanisms including arrays, bytes32, and strings.

Source Verified

SolidityExact bytecode match(1,339 bytes)
Compiler: soljson

Exact creation bytecode match. Author Cyrus Adkisson published source at https://github.com/cyrusadkisson/solidity-baby-steps/blob/master/contracts/47_array_passer.sol. Batch-matched against 357 deploy TXs from deployer 0xcf684dfb8304729355b58315e8019b1aa2ad1bac.

Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: program

Frontier Era

The initial release of Ethereum. A bare-bones implementation for technical users.

Block span: 01,149,999
July 30, 2015March 14, 2016

Bytecode Overview

Opcodes1,339
Unique Opcodes76
Jump Instructions45
Storage Operations17

Verified Source Available

Source verified through compiler archaeology and exact bytecode matching.

View Verification Proof
Show source code (Solidity)
import "mortal";

// contract Descriptor {
    
// 	function getDescription() constant returns (uint16[3]){	
// 		uint16[3] somevar;
// 		return somevar;
// 	}
// }

contract ArrayPasser is mortal {

    address creator;
    
    /***
     * 1. Declare a 3x3 map of Tiles
     ***/
    uint8 mapsize = 3;
    Tile[3][3] tiles; 

    struct Tile 
    {
        /***
         * 2. A tile is comprised of the owner, elevation and a pointer to a 
         *      contract that explains what the tile looks like
         ****/
        uint8 elevation;
        //Descriptor descriptor;
    }
    
    /***
     * 3. Upon construction, initialize the internal map elevations.
     *      The Descriptors start uninitialized.
     ***/
    function ArrayPasser(uint8[9] incmap) 
    {
        creator = msg.sender;
        uint8 counter = 0;
        for(uint8 y = 0; y < mapsize; y++)
       	{
           	for(uint8 x = 0; x < mapsize; x++)
           	{
           		tiles[x][y].elevation = incmap[counter]; 
           		counter = counter + 1;
           	}	
        }	
    }
   
    /***
     * 4. After contract mined, check the map elevations
     ***/
    function getElevations() constant returns (uint8[3][3])
    {
        uint8[3][3] 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;
    }
}

External Links