Truffle's Migrations bookkeeping contract: it records the number of the last completed migration so a rerun knows where to resume.
Historical Significance
Evidence of tooling rather than of an application: this contract exists because somebody ran a deployment framework instead of sending transactions by hand. Its presence on mainnet dates the point at which Ethereum development had a standard project layout and a migration runner that assumed one.
Context
Truffle was the dominant development framework for Ethereum in 2016 and 2017, and every project it created began with this contract. Copies of it on mainnet mark the deployments that came out of that toolchain.
Key Facts
Description
The bookkeeping contract Truffle deploys before any project contract. It stores the deploying account as owner and a single number, last_completed_migration, which the tool updates through setCompleted after each migration script finishes. Rerunning the migrations reads that number and skips everything already done.
upgrade(newAddress) copies the number into another Migrations contract, so a project can move its bookkeeping without losing its place. Both writes are restricted to the owner, although the restriction is written as a modifier that silently does nothing when the caller is wrong rather than reverting.
It is generated code, identical in every project that used the framework, and it holds no funds and controls nothing.
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
DAO Fork Era
The controversial fork to recover funds from The DAO hack.
Bytecode Overview
Verified Source Available
This contract has verified source code on Etherscan.
Show source code (Solidity)
// Submitted by EthereumHistory (ethereumhistory.com)
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
if (msg.sender == owner) _
}
function Migrations() {
owner = msg.sender;
}
function setCompleted(uint completed) restricted {
last_completed_migration = completed;
}
function upgrade(address new_address) restricted {
Migrations upgraded = Migrations(new_address);
upgraded.setCompleted(last_completed_migration);
}
}External Links
Related contracts
ShapeShift Chain-Split Forwarder
Same eraEarliest ShapeShift on-chain contract (Jul 24, 2016). Simple ETH forwarder with an active flag — routes deposits to target when active and msg.value > 0.
0xa2d5c5...d549deJuly 24, 2016Balance Router
Same eraDAO whitehat balance-conditional router: if EF/whitehat address holds >1M ETH, route to addr1; otherwise route to addr2.
0x6e9ccd...aee851July 25, 2016ShapeShift Chain-Split Receiver
Same eraShapeShift ETH/ETC routing contract (Jul 26, 2016). Forwards ETH to target only when on-chain forked() oracle result matches stored boolean — routing deposits to the correct wallet on each chain post-DAO-fork.
0x3e7756...2e7a25July 26, 2016ShapeShift Chain-Split Receiver
Same eraShapeShift ETH/ETC routing contract (Jul 26, 2016). Twin instance of the ShapeShiftReceiver — identical bytecode, configured for the opposite chain fork state.
0x89afcc...a51456July 26, 2016CanaryV7
Same eraA liveness canary for the Ethereum Alarm Clock, deployed 28 July 2016.
0x6c3abc...4aa180July 28, 2016Association
Same eraThe ethereum.org democracy tutorial: token holders propose a transaction, vote on it for a fixed period, and the contract sends it if it passes.
0x4e4ae7...8a2e3dAugust 5, 2016