[{"data":1,"prerenderedAt":25},["ShallowReactive",2],{"blog-content-en-what-is-a-smart-contract":3},{"slug":4,"title":5,"excerpt":6,"description":7,"bodyHtml":8,"faqItems":9},"what-is-a-smart-contract","What Is a Smart Contract? The Code That Moves Money","A smart contract is a program deployed to a blockchain that holds and moves funds by fixed rules, verified by every node, with no one in the loop. How they work on EVM, Solana and TON, when they can change, why bugs cost real money — and how the WATS Hot Wallet uses an ERC-4337 paymaster contract to charge fees in one token.","Smart contracts explained: deterministic on-chain code that holds and moves funds, EVM vs Solana vs TON models, tokens as contracts, upgradeable proxies, the limits of audits, and how the WATS Hot Wallet's ERC-4337 paymaster charges every fee in ATS instead of each chain's native gas.","\u003Cblockquote>\u003Cp>\u003Cstrong>A smart contract\u003C\u002Fstrong> is a program deployed to a blockchain that holds and moves funds according to fixed rules, executing deterministically — the same input always produces the same result — while every node on the network verifies that execution, with no company or clerk in the loop. Nearly everything you do on-chain is one: tokens, swaps, lending markets, and the approvals that let a protocol move your balance. Because the code \u003Cem>is\u003C\u002Fem> the counterparty, it cannot be persuaded or appealed, which is also why a flaw is a drained vault rather than a support ticket. EVM chains call them smart contracts, Solana calls them programs, and TON models even your wallet as a contract, but the mechanism is the same everywhere. Wallets are built on them too: the \u003Ca href=\"\u002Fhot-wallet\">WATS Hot Wallet\u003C\u002Fa> uses an ERC-4337 paymaster contract on EVM chains, and the equivalent fee-payer on Solana and TON, so every fee is charged in one token, ATS, instead of each chain's native gas coin.\u003C\u002Fp>\u003C\u002Fblockquote>\n\u003Ch2>The code that moves money\u003C\u002Fh2>\n\u003Cp>A \u003Cstrong>smart contract\u003C\u002Fstrong> is a program deployed to a blockchain that holds and moves funds according to fixed rules. Once deployed, it executes deterministically — the same input always produces the same result — and every node on the network verifies that execution, with no company or clerk in the loop. Tokens, swaps and lending markets are all smart contracts: code that is, itself, the counterparty.\u003C\u002Fp>\n\u003Cp>That last phrase is the important one. When you use a bank, an institution owes you something and a legal system backs the claim. When you use a smart contract, the code is the whole agreement — it cannot be persuaded, and it cannot be appealed. That property is what makes \u003Ca href=\"\u002Fblog\u002Fwhat-is-web3\">Web3\u003C\u002Fa> possible, and it is also what makes its failures so unforgiving.\u003C\u002Fp>\n\n\u003Ch2>A vending machine — the honest version\u003C\u002Fh2>\n\u003Cp>The classic analogy says a smart contract is a vending machine: insert a coin, receive a snack, no shopkeeper required. The rules \u003Cem>are\u003C\u002Fem> the service. That part is accurate, and it captures determinism well — the machine cannot decide it dislikes you today.\u003C\u002Fp>\n\u003Cp>Here is what the analogy hides. Anyone can deploy a machine, and no inspector checks it before it starts taking coins — a contract can be wrong, or deliberately hostile, from day one. The machine also holds real money: pools and lending markets keep user funds inside the contract itself, so a flaw is not a jammed snack but a drained vault. And unlike vending machines, contracts call each other. That composability is the superpower behind \u003Ca href=\"\u002Fblog\u002Fwhat-is-defi\">DeFi\u003C\u002Fa> — and it means one broken machine can pull down every machine wired to it.\u003C\u002Fp>\n\n\u003Ch2>What do you interact with every day?\u003C\u002Fh2>\n\u003Cp>If you have used crypto at all, you have used smart contracts — usually several per transaction:\u003C\u002Fp>\n\u003Cul>\n\u003Cli>\u003Cstrong>Tokens are contracts.\u003C\u002Fstrong> An ERC-20 \"balance\" is not coins sitting in your wallet; it is an entry in the token contract's internal ledger, a mapping of addresses to amounts. Sending tokens means asking that contract to update two entries.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Swaps are contracts.\u003C\u002Fstrong> A DEX pool is a contract that holds two tokens and prices trades by formula — no order book, no trading desk on the other side.\u003C\u002Fli>\n\u003Cli>\u003Cstrong>Approvals are you configuring a contract.\u003C\u002Fstrong> Before a DEX can move your tokens, you tell the token contract how much it may take — an allowance recorded on-chain. Because that permission outlives the trade, it deserves understanding; \u003Ca href=\"\u002Fblog\u002Ftoken-approvals-and-permit-explained\">token approvals and Permit\u003C\u002Fa> covers exactly what you are granting.\u003C\u002Fli>\n\u003C\u002Ful>\n\u003Cp>On some chains even your wallet is a contract — which brings us to how the big ecosystems differ.\u003C\u002Fp>\n\n\u003Ch2>How do EVM, Solana and TON contracts differ?\u003C\u002Fh2>\n\u003Cp>The idea is the same everywhere — deterministic code verified by the network — but the architecture differs in ways you can feel as a user.\u003C\u002Fp>\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth>EVM chains\u003C\u002Fth>\u003Cth>Solana\u003C\u002Fth>\u003Cth>TON\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Cth>Usual name\u003C\u002Fth>\u003Ctd>Smart contracts\u003C\u002Ftd>\u003Ctd>Programs\u003C\u002Ftd>\u003Ctd>Contracts (actors)\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Cth>Where state lives\u003C\u002Fth>\u003Ctd>Code and storage together at one address\u003C\u002Ftd>\u003Ctd>Code in the program; state in separate accounts passed into each transaction\u003C\u002Ftd>\u003Ctd>Each contract holds its own state and talks to others via asynchronous messages\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Cth>Token model\u003C\u002Fth>\u003Ctd>One ERC-20 contract records every holder's balance\u003C\u002Ftd>\u003Ctd>The SPL token program manages per-holder token accounts\u003C\u002Ftd>\u003Ctd>Each holder's jetton balance lives in its own small child contract\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Cth>Upgradeable by default?\u003C\u002Fth>\u003Ctd>No — bytecode is immutable unless a proxy is used\u003C\u002Ftd>\u003Ctd>Yes — until the upgrade authority is revoked\u003C\u002Ftd>\u003Ctd>Only if the contract's own code allows it\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\u003Cp>TON takes the model furthest: everything on the chain, including your wallet, is a contract exchanging messages with other contracts.\u003C\u002Fp>\n\n\u003Ch2>Can a smart contract be changed after it's deployed?\u003C\u002Fh2>\n\u003Cp>On EVM chains, deployed bytecode itself cannot be edited. But much of what you interact with sits behind a \u003Cstrong>proxy\u003C\u002Fstrong>: you call a fixed address, which forwards every call to a separate implementation contract — and an admin can point the proxy at new code. Your address stays the same; the rules behind it do not have to.\u003C\u002Fp>\n\u003Cp>So \"immutable\" is really a question about keys. Who holds the upgrade authority — a multisig of team members, a timelock that forces a public delay, a governance vote, or nobody, because it was burned and the code is final? Neither answer is automatically right: upgradeability lets teams patch bugs, and it also means the agreement can change underneath you. In practice, many large protocols sit in the middle — upgradeable, but behind timelocks and multisigs.\u003C\u002Fp>\n\n\u003Ch2>Why do smart contract bugs matter so much?\u003C\u002Fh2>\n\u003Cp>Because the code is the counterparty, a bug is not a support ticket — it is an open door with money behind it. There is no fraud department to reverse the transfer and, on most chains, no one with the power to pause reality while the door stands open.\u003C\u002Fp>\n\u003Cp>The pattern is as old as the technology. In 2016, a reentrancy bug in The DAO — an early Ethereum investment contract — let an attacker drain a large share of its funds, and the fallout was severe enough that Ethereum hard-forked to undo it, splitting off Ethereum Classic in the process. Bridge contracts, which hold locked tokens for entire ecosystems, have produced some of the largest losses in crypto history for the same underlying reason: enormous value, guarded only by code.\u003C\u002Fp>\n\n\u003Ch2>Do audits make a contract safe?\u003C\u002Fh2>\n\u003Cp>Safer — not safe. An audit is a paid review by security engineers of one version of the code at one point in time. It catches known bug classes and sloppy patterns; it does not prove the code correct, cover future upgrades, or account for how the contract behaves when composed with protocols the auditors never saw. Well-audited protocols have been exploited anyway.\u003C\u002Fp>\n\u003Cp>The practical reading for a user: prefer contracts that are audited \u003Cem>and\u003C\u002Fem> battle-tested by time and value, treat unaudited new contracts as experiments, keep token approvals tight, and never deposit more than the counterparty's code has earned.\u003C\u002Fp>\n\n\u003Ch2>How WATS fits in\u003C\u002Fh2>\n\u003Cp>In the \u003Ca href=\"\u002Fhot-wallet\">WATS Hot Wallet\u003C\u002Fa>, smart-contract rails are the fee model itself: every transaction you sign — a transfer, a contract call — is charged in one token, ATS, instead of the chain's native gas, via an ERC-4337 paymaster on EVM and an equivalent fee-payer\u002Frelayer on Solana and TON. ATS is a LayerZero OFT, so a single balance works across EVM, Solana and TON, and collected ATS is burned from 100M toward a 30M floor. It stays non-custodial — you hold your keys, and WATS never holds a key — and WATS is the first and only wallet to combine ERC-4337 + OFT single-token fees, charged instead of native gas, with that burn.\u003C\u002Fp>\n\u003Cp>Smart contracts are not an exotic corner of crypto — they are what you sign every time you move a token, and the code on the other side is the only thing standing between your funds and whoever wrote it. Two things stay in your control: what you approve, and where your keys live. Review \u003Ca href=\"\u002Fblog\u002Ftoken-approvals-and-permit-explained\">approvals\u003C\u002Fa> before you grant them and size every deposit to what the code has earned — then keep the key side yours by signing from a wallet that cannot move funds on your behalf. The \u003Ca href=\"\u002Fhot-wallet\">WATS Hot Wallet\u003C\u002Fa> is exactly that across all eight chains it covers — Ethereum, Arbitrum, Optimism, Base, Polygon, BNB Chain, Solana and TON — with the user holding the keys and WATS never holding one, and with the fee side running on the same technology this post describes: an ERC-4337 paymaster contract that charges in ATS instead of each chain's native gas.\u003C\u002Fp>",[10,13,16,19,22],{"q":11,"a":12},"Are tokens really smart contracts?","Yes. On EVM chains an ERC-20 token is a contract whose storage maps addresses to balances — your tokens are entries in that ledger, not objects in your wallet. On Solana the SPL token program manages per-holder token accounts, and on TON each holder's jetton balance lives in its own small child contract. In every case, transferring tokens means asking a program to update its records.",{"q":14,"a":15},"Can a smart contract be changed after deployment?","Sometimes. On EVM chains deployed bytecode is immutable, but many projects use a proxy: users call a fixed address that forwards to an implementation contract an admin can replace. Solana programs are upgradeable by default until the upgrade authority is revoked. So the real question is who controls the upgrade keys — a multisig, a timelock, a governance vote, or nobody. Check that before trusting an immutability claim.",{"q":17,"a":18},"Are audited smart contracts safe to use?","Safer, not safe. An audit is a point-in-time review of one version of the code; it catches known bug classes but does not prove correctness, cover later upgrades, or test every interaction with other protocols. Well-audited contracts have still been exploited. Treat audits as one signal among several — alongside time in production, value secured, and how much power the admin keys hold — and size your exposure accordingly.",{"q":20,"a":21},"Do I need the chain's native coin to interact with a smart contract?","Usually yes — the network settles gas in its own coin, so a wallet with zero ETH cannot call an Ethereum contract no matter what tokens it holds. A paymaster, which is itself a smart contract, changes that, and the WATS Hot Wallet is a concrete example: it uses an ERC-4337 paymaster on Ethereum, Arbitrum, Optimism, Base, Polygon and BNB Chain, and the equivalent fee-payer on Solana and TON, so every fee is charged in one token, ATS, while the network still receives its native gas underneath. Because ATS is a LayerZero OFT, a single balance covers all eight chains, so there is no per-chain gas float to keep topped up. It is not a discount — the block space costs the same, only the token that pays for it changes.",{"q":23,"a":24},"Does using smart contracts mean giving up control of my funds?","No. Calling a contract is you signing an instruction with your own key, and the contract can only ever do what that signature and any standing token approvals permit — which is why keeping approvals tight matters more than any audit badge. What matters most is that the key stays yours: the WATS Hot Wallet is fully non-custodial, so the user holds the keys and WATS never holds a key, and the WATS NFC Metal Card stores no private keys either — it tap-authenticates to keys that live in the WATS apps. The real risk you take on is the contract's code and the allowances you granted it, not the wallet you signed from.",1786059328042]