Smart Contract
A smart contract is a program deployed at an address on a blockchain that holds its own state and assets and executes predefined rules automatically whenever a transaction calls it.
A smart contract is a program deployed at an address on a blockchain that holds its own state and assets and executes predefined rules automatically whenever a transaction calls it.
How it works
A developer writes the contract, compiles it, and deploys it in a transaction that assigns it a permanent contract address. On Ethereum, contracts are usually written in Solidity and compiled to bytecode for the Ethereum Virtual Machine (EVM). When a user or another contract calls one of its functions, every validating node runs the same code against the same state and reaches the same result. The caller pays gas for the computation. A call either completes fully or reverts with no change to state.
Contracts can hold tokens and call other contracts, which is how onchain financial products are built. Uniswap v2 pools are contracts that price swaps with a constant-product rule, x × y = k. A pool holding 100 ETH and 200,000 USDC has k = 100 × 200,000 = 20,000,000. Aave's lending contracts liquidate a borrower's collateral when the position's health factor drops below 1. BlackRock's BUIDL fund issues shares as a token contract that permits transfers only between allowlisted wallets. Whether code can change after deployment is a design choice. Some systems use an upgradeable proxy controlled by an admin key or governance vote. Others deploy immutable code.
Why it matters
For an institution, a smart contract can act as counterparty, custodian and settlement engine at once, so its code and permissions define the actual terms of any position held through it. The main failure mode is that bugs are publicly exploitable and transfers are generally irreversible. In 2016 an attacker drained about 3.6 million ETH from The DAO through a reentrancy flaw. Upgrade keys, oracle inputs and dependencies on other contracts add further risk, and an audit does not remove any of them. Identifying exactly which contract represents an asset is a prerequisite for reporting and risk work, covered in Digital Asset Identifier vs Contract Address.
Related terms
- Contract address
- Gas
- Oracle
- ERC-20 token standard
- Upgradeable proxy
- Decentralized exchange (DEX)
Frequently asked questions
Is a smart contract legally binding?
Not by itself. A smart contract is code that executes on a blockchain. Whether it creates enforceable legal obligations depends on the surrounding legal agreements and the jurisdiction.
Can a smart contract be changed after deployment?
Only if it was designed to be. Upgradeable contracts use a proxy pattern controlled by an admin key or governance. Immutable contracts cannot be altered, so any bug stays in place.
What blockchains support smart contracts?
Ethereum and EVM-compatible chains such as Arbitrum, Base and BNB Chain support them, as do Solana and others. Bitcoin's scripting language supports only limited contract logic.
See the data behind this post. Browse the decoded dataset catalogue, or read What Is Onchain Data Normalization? for how the records are put together.
Allium provides onchain data infrastructure. Companies named in this article may be Allium customers, prospects or commercial counterparties. The authors and other Allium personnel may hold positions in the assets discussed. This article is informational only and is not investment, legal or tax advice. Data and information last reviewed: November 27, 2026.