A tutorial contract testing two-dimensional array support in early Solidity.
Historical Significance
An early mainnet test of two-dimensional array support in Solidity, deployed during a period when array handling was still evolving in the language.
Context
Deployed in September 2015 during the Frontier era. Multi-dimensional arrays in Solidity were new and their behavior was being actively explored by early developers.
Key Facts
Description
A tutorial contract from Cyrus Adkisson's solidity-baby-steps series testing two-dimensional array functionality. Creates a 2D array of uint8 values, populates it with test data, and provides getter functions to read individual elements.
Part of the numbered tutorial progression (contract #55) exploring more advanced data structures in Solidity. Cyrus deployed multiple iterations of this contract as he experimented with 2D array syntax and access patterns.
Source Verified
Exact creation bytecode match. Author Cyrus Adkisson published source at https://github.com/cyrusadkisson/solidity-baby-steps/blob/master/contracts/55_2D_array.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.
Frontier Era
The initial release of Ethereum. A bare-bones implementation for technical users.
Bytecode Overview
Verified Source Available
Source verified through compiler archaeology and exact bytecode matching.
View Verification ProofShow source code (Solidity)
contract TwoD {
address creator;
uint8 arraylength = 10;
uint8[10][10] integers; // compiler says this line can't yet know about arraylength variable in the line above
function TwoD()
{
creator = msg.sender;
uint8 x = 0;
uint8 y = 0;
while(y < arraylength)
{
x = 0;
while(x < arraylength)
{
integers[x][y] = arraylength*y + x; // row 0: 0, 1 row 1: 2, 3
x++;
}
y++;
}
}
function getValue(uint8 x, uint8 y) constant returns (uint8)
{
return integers[x][y];
}
/**********
Standard kill() function to recover funds
**********/
function kill()
{
if (msg.sender == creator)
{
suicide(creator); // kills this contract and sends remaining funds back to creator
}
}
}External Links
Related contracts
GetBalance
Same deployerCyrus Adkisson experimental getter (Sep 2015) exposing the ether balance of a hardcoded address via getMyBalance(). Verified byte-for-byte with soljson v0.1.1.
0x759ad4...239a87August 26, 2015Pong (minimal)
Same deployerA minimal Pong contract with an int8 getter/setter and owner-only selfdestruct. Simpler predecessor to the tutorial Pong at 0x3a0cc907.
0x4f8791...ef366fSeptember 4, 2015Ping
Same deployerInter-contract communication tutorial. Ping calls Pong to retrieve a value, demonstrating cross-contract function calls in Solidity.
0xd2478e...543d24September 5, 2015Ping
Same deployerInter-contract communication tutorial. Ping calls Pong to retrieve a value, demonstrating cross-contract function calls in Solidity.
0xac5ab2...2996ddSeptember 5, 2015Ping
Same deployerInter-contract communication tutorial. Ping calls Pong to retrieve a value, demonstrating cross-contract function calls in Solidity.
0x657849...71a047September 5, 2015ArrayRR
Same deployerA tutorial contract testing array passing and returning in Solidity function calls.
0x64c159...2b9f2dSeptember 12, 2015