You have probably read the line on a dashboard or in a set of docs: this runs on smart contracts. It sounds like a promise. The rules are in code, the code is on-chain, so nothing can go wrong in the background.
Part of that is true. A smart contract does take a person out of one step of the process. It also puts something else in that person's place, and what that is matters more than the label.
This piece stays vendor-neutral until its last section. It explains what a smart contract is, what its code can guarantee and what it leaves open. Once you can tell the two apart, the phrase becomes something you can check.
Key Takeaways
- A smart contract is a program with its own address and stored data on a blockchain, and it runs only when a transaction calls it.
- The code applies the same rules to every caller, in public, and each run leaves a record anyone can read.
- Whoever holds upgrade or admin rights can change what a contract does, so those keys matter as much as the code.
- A contract cannot check the outside data it is fed; the chain only records which value it used.
- A bug in the code runs exactly as written, just like every other line.
What a Smart Contract Is
A smart contract is a piece of code stored on a blockchain at its own address. Next to the code sits the contract's state: the data it keeps between calls, such as balances, settings or a list of who is allowed to do what. Code and state together are the contract.
Nobody runs it on a server they control. When you send a transaction to the contract's address, the network executes the code. In most designs, every node that processes the transaction runs the same instructions on the same inputs and checks that it reaches the same result. That shared check is why the result is accepted. Not because one company says so.
The name misleads twice. The code is not smart. It cannot weigh a situation or make an exception for you. And it is not a contract in the everyday sense of an agreement between people. Think of a vending machine instead. The right input goes in, a fixed rule runs, the matching output comes out. Nobody behind the counter decides.
That rigidity is the whole idea. It is also the source of every limit discussed below.
How a Contract Runs: Deploy, Call, Record
A contract's life starts with deployment. Someone sends a transaction that carries the compiled code, the network stores it, and from then on the contract has an address. That address is how you find it, call it and check it.
After that, a contract is passive. It does nothing until a transaction or another contract calls one of its functions.
A call names the function and passes in the inputs, such as an amount and a recipient. The code checks its conditions and updates its state if they are met. In most designs, a call that fails a check is rejected as a whole. Either everything happens, or nothing does.
Each call also costs a gas fee; how that fee is set is covered in our guide to how gas fees work.
A contract can also emit events. An event is a short log entry the code writes when something specific happens: a deposit arrived, a setting changed, a payment went out. Events do not change what the contract does. They exist so that people and tools outside the chain can follow along.
Put together, a call leaves three traces you can inspect: the transaction, the change in state and any events. Our guide to reading on-chain data with a block explorer shows where each one appears. You do not have to take a summary on faith. The record is there to read.
What Code Can Guarantee
A few things genuinely follow from the code itself. They are real, and narrower than the marketing around them.
The same rules apply to every caller. A contract does not know whether you are a large account or a small one unless its code asks. If the code refuses a withdrawal above a limit, it refuses it for everyone, every time, for as long as that code stays in place. Not usually. Every time.
The rules can be read before you rely on them. Deployed code is public, and when the team publishes the matching source code, anyone can see what a function does before calling it. You may never read it yourself. Someone can. That alone changes the incentives for whoever wrote it.
No one in the middle can quietly change the outcome of a single call. There is no back office that approves or blocks one particular transaction by hand, unless the code itself contains a function for that. That last clause matters. The next section returns to it.
And there is a record afterwards. Every call, every state change and every event stays in the chain's history. You can check what happened, when and in which order.
| What the code guarantees | What it leaves open |
|---|---|
| The same rules run for every caller | Who can change those rules later |
| The rules can be read before you rely on them | Whether the data the rules use is correct |
| Each run leaves a public record | Whether the rules were written correctly |
Who Can Change the Rules: Upgrades and Admin Rights
"The code cannot be changed" is true for some contracts and false for others. Which one you are dealing with is a design choice the team made. It can be the most important fact about the contract.
Some contracts are immutable. Once deployed, their code stays exactly as it is. If a problem turns up, the only fix is a new contract at a new address, and users have to move to it.
Others are upgradeable. One way to build this is a proxy: you interact with one fixed address, and that address forwards each call to a separate logic contract that holds the actual code. Swap the logic contract and the behavior changes, while the address you use stays the same.
Even without upgrades, a contract can carry special functions that only certain addresses may call: pausing it, changing a fee or a limit, adding or removing allowed users, moving funds in an emergency. Such rights can be sensible. A pause can stop damage while a bug is fixed. Admin rights are rules about people. The code enforces who may use them. It says nothing about how carefully the keys are held or how the holders will act.
That makes the key itself the question. Can one person upgrade or pause the contract, or does it take several people to agree? Is there a delay between an announced change and the moment it takes effect, so users can react? A setup in which several key holders must approve can be built with a multisig; our explainer on how a multisig wallet works covers that piece.
Where Contracts Get Their Data: Oracles and Inputs
A contract can only see what is on its own chain. It can read its own state, the state of other contracts on the same network and the inputs of the call in front of it. It cannot open a website, look up a price on an exchange or confirm that something happened in the real world.
When a contract needs outside information, such as a price, someone has to bring it on-chain. A service that does this is called an oracle. The oracle writes the value into a contract, and other contracts read it from there. Our comparison of what happens on-chain and off-chain explains where that hand-over sits.
Here is the limit that matters. The chain proves which value a contract used and when. It does not prove that the value was right. If the feed is late, wrong or manipulated, the contract still acts on it, exactly as written. Code cannot tell a correct price from a bad one when both arrive in the expected format.
The same holds for other contracts it depends on. A contract that calls another one inherits that contract's behavior, including its upgrades and admin rights.
When the Code Itself Is Wrong
"Runs as written" cuts both ways. If the code contains a mistake, the network executes the mistake as faithfully as everything else. A rounding error, a missing check or a function the wrong address can call will not be caught by the chain. The chain does not know what the authors meant. It only knows what they wrote.
Public code makes this sharper. Anyone can read a deployed contract, including people looking for a flaw to exploit. And once a faulty call has moved funds, there is no general undo button.
That is the reason outside code reviews exist. A smart contract audit is a structured review of the code by people outside the team, written up as a report. It is useful evidence about one version of the code, and narrower than the word suggests. What an audit checks, how to read the report and where its coverage ends is explained in our guide to what a smart contract audit does and doesn't prove.
Three Questions to Ask About Any Contract
You do not need to read code to use any of this. You need three questions, and the patience to get an answer to each before you rely on a contract with your money.
- Can anyone change it? Find out whether the contract is upgradeable, which admin functions it has and who holds the keys to them: one person or several, with or without a delay.
- Where does its data come from? If the contract reacts to prices or other outside information, ask which oracle supplies them and what happens if that feed fails.
- What if the code is wrong? Ask whether the code was reviewed, which version the review covered and whether that version is the one running today.
All three start with the same step: knowing which contracts you are actually dealing with. A claim that something runs on smart contracts can only be checked once the contracts are named. The same goes for a prop firm that moves funds through contracts: the code is part of the deal. For a longer look at how on-chain records are checked, see transparency and on-chain proofs.
The same three questions work for any platform you are considering.
Conclusion
A smart contract does not remove trust. It moves it. Instead of trusting a back office to apply the rules fairly, you trust the people who wrote the code, the people who can change it and the sources that feed it data. That can be a better deal, because each of those parts can be named and checked. It is only better if someone actually checks them.
So the choice in front of you is not whether a product uses smart contracts. It is whether you know who holds the keys, where the data comes from and which code is running today. If you cannot answer those three, the phrase is still just a phrase.
FAQ
Can a smart contract act on its own, for example at a set time?
No. A contract only runs when a transaction calls it. Nothing inside the chain wakes it up. If something should happen at a certain time, such as a payment at the end of a period, someone has to send the call: a user, the team or an automated service set up for that job. If nobody calls, nothing happens.
Does a smart contract hold money?
It can. A contract's address can hold a balance just like a wallet address, and its code decides how that balance may leave. That is the point of using one: funds move only under the conditions written into its functions. It is also the risk, because a flaw in those functions applies to everything the contract holds.
What is the difference between a smart contract and a wallet?
In the usual setup, a wallet address is controlled by a private key: whoever holds the key can sign transactions from it. A contract address has no private key of its own; its code controls it. Our explainer on what a wallet address is covers the key-based side. A multisig can be built as a contract that works like a shared wallet.
Is a contract on one blockchain also on the others?
No. A contract lives on the network where it was deployed. The same code can be deployed on another network, but that creates a separate contract with its own address, its own state and possibly different admin settings. When a platform names a contract, check which network the address belongs to before you draw conclusions from it.
Is an immutable contract safer than an upgradeable one?
Not automatically. An immutable contract removes the risk that someone changes the rules after you start relying on them. It also removes the option to fix a bug. An upgradeable contract can be repaired, but only by whoever holds the upgrade rights. Each design moves the risk to a different place; neither removes it. What matters is that you know which one you are using.