Insights

How to Vet a Smart Contract Before You Send It Funds

To vet a smart contract, confirm that the verified source matches the code deployed on-chain, then find out who can change it, pause it or move funds after you deposit. An audit report is one input and covers only the code version it reviewed. Finish by testing a small deposit and withdrawal before you commit real money.

TL;DR:

  • Unverified source is a hard no. If the block explorer shows no verified code, skip the contract. Verified source still does not mean safe code.
  • Admin power decides your risk. Check for proxy upgrades, single-wallet owners, missing timelocks and uncapped fee or mint functions.
  • Audits expire. A report covers one commit. If the contract was upgraded afterward, the audit reviewed different code.
  • Test the exit. Deposit and withdraw a small amount first, and approve exact token amounts instead of unlimited ones.
  • You may not need a contract. For plain crypto payments, a payment gateway removes custom contract risk entirely.

Table of Contents

How to Vet a Smart Contract: Four Checks Before You Deposit

Vetting comes down to four questions, asked in order. Does the published source match what is deployed? Who can change the contract or take the money? What did the auditors review? Does a small real transaction behave the way the documentation says?

The OWASP Smart Contract Top 10 lists access control failures and reentrancy among its vulnerability classes. You can check both without writing code, because they show up as visible admin functions and as external calls ahead of balance updates. If you are a founder deciding whether this work belongs in-house or with an outside advisor, our breakdown of what a consultant for startups does and costs covers that decision.

You cannot prove a contract is safe. You can prove it is unsafe, or find that the risk sits with a few people holding keys. We would walk away from any contract that fails the first two checks, however good the yield looks.

Four checks before you deposit: 1. Match source to deployment; 2. Find who holds the keys; 3. Check what auditors reviewed; 4. Run a small real transaction

Step One: Confirm the Code You Read Is the Code That Runs

Open the contract address on Etherscan or the equivalent explorer for your chain and look for the green check on the Contract tab. That check means the submitted source compiles to the same bytecode that is deployed. Without verified source, you are trusting a black box. Our rule has no exceptions: unverified means no deposit.

Verified does not mean harmless. Once you have the source, read the functions an owner can call:

  • Mint and burn. An uncapped mint lets the owner create tokens and dilute you to zero.
  • Fee setters. A setFee or setTax function with no upper bound lets the owner set a 100% sell tax after you buy. That is the standard honeypot mechanism.
  • Pause and blacklist. These are legitimate in regulated stablecoins. In a yield vault they mean someone can freeze your exit.
  • Withdraw-all functions. Any owner-only function that moves user balances to an arbitrary address deserves a hard look at who holds that owner role.
  • Copied libraries. Compare imports against the standard OpenZeppelin implementations. A lightly modified ERC-20 is a bigger flag than an unmodified one, because the modification is where the trick lives.

Step Two: Find Who Holds the Keys, Because That Is Your Real Counterparty

A hand turning a brass key in a steel lockbox while another person watches.

Most of your risk sits in whoever can call the privileged functions. On Etherscan, a "Read as Proxy" or "Write as Proxy" option means the contract is a proxy, and its logic can be swapped for different code at any time.

Under EIP-1967, a proxy stores its implementation address at slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc. Read that one slot and you know which code actually runs.

The EIP-1967 standard defines that location so wallets and explorers can find it. Foundry's cast storage command reads any slot directly if you want to check the explorer's work.

Next, look up who controls the admin role, and compare what you find against this table.

Check Where to look Red flag
Owner or admin address Read functions: owner(), admin() A single externally owned wallet
Upgradeability "Read as Proxy" tab, EIP-1967 slot Proxy with no timelock
Timelock Admin address is a timelock contract Upgrades take effect immediately
Multisig Admin address is a multisig wallet Fewer than 3 signers, or all signers share one entity
Fee and mint caps Source code, setter functions No upper bound in the code
Renounced ownership owner() returns the zero address Claimed renounced, but a proxy admin still exists

We would not deposit meaningful funds into an upgradeable contract controlled by one wallet, whatever the audit says. A multisig with a timelock of at least 48 hours gives you time to exit before a malicious upgrade lands. Shorter delays are common and worth treating as a warning.

An audit is a time-boxed review of a specific commit of specific files. Think of a building inspection that covered the kitchen and skipped the roof.

  • Scope. Check the report's scope section. Are the proxy, the admin contracts and the oracle integrations in it, or only the core logic?
  • Commit hash. The report names the code version it reviewed. Compare it to the deployed version.
  • Finding status. Look for high or critical findings marked "acknowledged" instead of "fixed." Acknowledged means the team read it and left the issue in place.
  • Date. A report from before the latest upgrade covers old code.
  • Number of reviewers. Two independent reviews catch more than one. A single audit from an unnamed firm is closer to marketing than assurance.

Pro Tip: Open the proxy's event log on the explorer and filter for Upgraded events. If the implementation address changed after the audit date, the audit does not cover the code running today. The count of upgrades also tells you how often the team changes live code, and a contract that has been upgraded six times in three months is still being debugged with user funds.

Step Four: Test With Money You Can Lose, and Test the Exit First

Before you deposit at full size, run a round trip with a small amount. Deposit, check that your balance or receipt token appears, withdraw, and confirm the funds return. Many scams let you in easily and fail only on exit.

For larger positions, simulate first. Foundry's anvil can fork mainnet state onto your own machine, so you can run the exact deposit and withdraw calls with no real funds at risk. The Foundry docs cover forking in a few pages.

Two habits protect you after the contract passes:

  • Approve exact amounts. Most interfaces default to an unlimited token approval. Set the approval to the amount you are depositing, and revoke it afterward.
  • Check withdrawal limits. Some contracts cap withdrawals per day or add a delay. Know the number before you need your money back.

Can You Create Your Own Smart Contract, and Is Solidity Hard?

Yes. You can create your own smart contract today for free on a test network. Faucets hand out test tokens, and a basic token contract is a few dozen lines. Deploying to mainnet costs gas, which varies with network demand and contract size.

Solidity is not hard to learn. The Solidity documentation describes it as influenced by C++, Python and JavaScript, so a developer with any of those can write a working contract within weeks. Writing a safe one takes far longer, because the language has traps with no equivalent in ordinary web development: reentrancy, storage layout in upgradeable proxies, and the fact that a deployed bug cannot be patched quietly.

We advise inheriting audited building blocks and never writing your own custody logic. A contract that holds other people's money should be reviewed by someone who did not write it.

Is XRP a smart contract? No. XRP is the native asset of the XRP Ledger. The XRP Ledger documentation describes built-in features like escrow, handled as protocol transaction types instead of code you deploy. Vetting there means reading the ledger's rules and the issuer's controls, not a contract's source.

The Downsides of Smart Contracts You Should Price In

A smart contract does exactly what its code says. The Ethereum documentation on smart contracts notes that they are programs stored on-chain that run when conditions are met. That strength is also the source of most of the risk:

  • Immutability cuts both ways. A bug stays live until someone ships a fix, if a fix is even possible. The 2016 attack on The DAO drained about 3.6 million ETH through a reentrancy flaw.
  • Upgrade keys reintroduce trust. The fix for immutability is an admin who can change the code, and now you trust that admin.
  • Oracle dependence. Contracts that read prices from outside the chain inherit the weakness of that data feed.
  • Legal ambiguity. Code executing is not the same as an enforceable agreement in your jurisdiction. Get a lawyer's view for anything large.
  • Cost. Gas fees, audit fees and monitoring add up, and for many business problems they exceed the benefit.

Cost decides more projects than people admit. See blockchain use cases that actually work for where contracts earn their cost. If your goal is simply to get paid in crypto, you probably do not need a custom contract, and crypto payments explained walks through the options with less risk.

Get a Second Set of Eyes on Crypto Exposure Before You Fund a Contract

The risk in this article sits with decisions leadership makes: how much to put into a contract, who signs off, and what happens if the admin key is compromised. ActUpon works on that layer through its crypto and blockchain advisory. We walk your team through the four checks on a live contract, write them into treasury policy, and tell you plainly when the better answer is no contract at all. If you only need to accept payments, Myntli, our hosted BTCPay Server, avoids contract risk entirely.

Fees are tied to agreed, measurable results, and we set scope and price with you before work starts, so we have no public rate card to quote. We are not a code auditing firm and we will not certify a contract as safe. For anything holding material funds, hire an independent auditor and a lawyer as well.

Frequently Asked Questions

What is the fastest way to vet a smart contract?

Open the address on a block explorer and confirm the source is verified. Then check whether it is a proxy and who controls the admin role. Those two steps take about ten minutes and eliminate most of the worst contracts.

Can I create my own smart contract?

Yes. You can write and deploy one on a test network for free using faucet tokens, and deploying to mainnet costs gas. For anything that holds other people's funds, have an independent party review it before launch.

Is Solidity difficult to learn?

The syntax is approachable if you know JavaScript, Python or C++. The difficulty is security: reentrancy, upgrade storage layouts and the fact that deployed code is hard to patch.

Is XRP a smart contract?

No. XRP is the native asset of the XRP Ledger, not a deployed contract. The ledger handles features like escrow through built-in transaction types instead of user-deployed code.

What are the downsides of smart contracts?

Bugs are hard to fix once deployed, upgrade keys reintroduce trust in an admin, and price oracles can be manipulated. Legal enforceability varies by jurisdiction, and gas and audit costs can outweigh the benefit for simple use cases.

Sources

ActUpon

Want a number moved, not a report written?

We agree one measurable target with you, do the work, and get paid when the number moves. Not before.