Other
How Smart Contract Development and Auditing Work on Ethereum and TON for Business
Businesses are increasingly moving payments and access rights onto the blockchain. That is why a single incorrect operator in the code can turn into direct financial losses for a modern company.
A smart contract audit reduces this risk. It shows where the logic fails and where an attacker could withdraw funds or block the protocol.
For DeFi services, tokens, NFT platforms, and Telegram Mini Apps on Ethereum and TON, code review is no longer just an ordinary “option.” The reason is that users and investors expect a public security report before a project goes live.
A smart contract audit should be understood not only as bug hunting, but also as a check of how well the code matches the product’s business logic and tokenomics.
For Ethereum, the audit primarily focuses on Solidity contracts in the EVM environment, where it is important to account for gas limits, the architecture of standard ERC-20 and ERC-721 interfaces, and the specifics of DeFi mechanics.
On TON, a contract operates in an asynchronous model:
messages are passed between addresses;
each operation requires payment for storage and execution;
an improperly designed scenario may execute only partially if gas runs out.
That is why smart contract audits here pay more attention to error handling and refunding excess funds.
The typical lifecycle of a contract looks like this:
The development team, together with analysts, defines requirements and scenarios, documenting roles, limits, and financial flows.
Architects design the contract model and determine which parts are responsible for the token, data storage, reward distribution, and how these elements interact with one another on the Ethereum or TON network.
Development is carried out, unit tests are performed, and an internal review is conducted.
An external smart contract audit is conducted, providing an outside view of the project, revealing non-obvious vulnerabilities and logical inconsistencies.
In FreeBlock’s cases involving DeFi protocols and crypto wallets, this cycle is structured to minimize technical debt. Development and audit preparation are done within a single stack. Fixes reach production quickly.
When creating contracts for Ethereum, FreeBlock developers design them with future smart contract audits in mind.
First, they choose the appropriate standards. This may be the classic ERC-20 for a utility token, the extended ERC-777, or NFT standards ERC-721/1155 if the product requires unique assets.
Next, they think through the role system. They define who can mint, burn, pause the contract, change parameters, and how these rights are distributed between the owner, multisig, and DAO.
At the code level, the team implements protection against common DeFi vulnerabilities, such as re-entrancy, incorrect balance checks, and rounding errors. The developer also covers functions with tests for edge cases so that the smart contract audit proceeds predictably across all key scenarios.
For a developer, the practical minimum looks like this: set up a local testnet, write unit tests in Hardhat or Foundry, run static analysis (for example, Slither), and then prepare comments and documentation for the contract’s public methods.
On TON, a contract constantly interacts with messages and stores its balance directly at its own address. That is why its architecture is initially designed to account for the asynchronous nature of the network.
When the FreeBlock team designs logic for TON smart contract audits, specialists separately account for handling unexpected responses, repeated messages, insufficient gas to complete a chain of actions, and the need to carefully manage balances in contract accounts.
If we take the example of a wallet or a DeFi module on TON, the developer must explicitly define what happens if an external call fails. Will the funds be returned, will they be sent to a separate “safe” address, and how will the user learn about the failure?
At the audit preparation stage, this logic is reflected in tests on the TON network and is also modeled through scenarios with artificially limited gas and invalid input data.
When the code and initial tests are ready, the audit begins:
Auditors study the architecture, tokenomics, and contract interaction schemes to understand how the system is supposed to work at the business level.
They connect automated tools — static analysis tools (Slither, Mythril), as well as generative testing frameworks such as Echidna, which help quickly identify suspicious patterns and edge states.
They conduct a manual smart contract audit, during which specialists review critical sections line by line — management functions, fund distribution, parameter updates — and assess both the syntax and the protocol’s economic logic.
In projects such as ERC-20 tokens and DeFi protocols that FreeBlock develops and prepares for listing and IDO, this stage concludes with a detailed report.
In it, each issue receives a severity rating and a description. A possible attack scenario is provided, along with recommendations for fixing it.
On TON, the audit is supplemented with verification of behavior in the asynchronous model:
The auditor examines what messages the contract sends, how it responds to unexpected replies, and what happens if one link in the chain fails to execute because of a gas limit.
The code is analyzed in FunC or Tact.
The correctness of data serialization into cells, the absence of overflows, and the proper handling of flags and options are checked.
Compliance of the behavior with the algorithm described in the product specification is monitored.
This is important for business.
On TON, a failure is often expressed not simply as a “transaction error,” but as partial execution of the scenario. The user may have sent funds, but the expected action did not occur. Or part of the logic executed while another part did not.
That is why TON smart contract audits always include resilience testing, simulation of non-standard responses, and analysis of how the contract behaves under edge conditions.
A professional smart contract audit looks beyond the code.
It checks whether the actual behavior of the contract matches the promises made in the documentation, pitch deck, or whitepaper.
For a token sale, this means that:
tokens are distributed according to the assigned shares;
vesting works correctly;
cliff periods are respected;
the refund or cancellation mechanism works without loopholes for abuse.
In staking and DeFi protocols, a smart contract audit checks how rewards are calculated, what happens when TVL sharply rises or falls, and how situations with zero or extreme values are handled.
In FreeBlock’s cases involving DeFi platforms and wallets, for example — MetaSwap, this combination of technical and business auditing makes it possible to identify in advance scenarios that are formally “valid” for the virtual machine but destructive to the product’s economics.
The result of a smart contract audit is not just a verbal verdict like “ready to launch” or “needs to be rewritten.” It is a set of specific artifacts.
Usually, the result is presented in a detailed report describing the architecture, listing discovered vulnerabilities, their priority, potential attack vectors, and recommendations for fixing issues. In addition, there is a list of areas that the auditor recommends monitoring after release.
The development team implements fixes, updates the tests, deploys updated versions of the contracts to Ethereum or TON testnets, and runs the scenarios again.
After rerunning the scenarios, a re-audit of key changes is often carried out. This is necessary to make sure that the new fixes have not opened other “holes.”
For public DeFi and token projects, the external layer is also valuable. A published “green” smart contract audit report helps build trust among investors and users.
It is especially relevant when it comes to launching an IDO or ICO, or listing on major platforms.
Choosing the team to conduct the audit directly affects the quality of the review.
What matters here is not only certificates and logos, but also proven experience in the required stacks: Solidity and the EVM ecosystem for Ethereum, and FunC/Tact and the TON toolset for contracts on that network.
It is important to have live cases in which the contractor has already combined smart contract development and auditing, as FreeBlock does:
tokens;
DeFi protocols;
crypto wallets;
Telegram apps.
For business, it is convenient when one team covers the full cycle of work. This includes design, development, preparation for an external audit, communication with independent auditors, and assistance with implementing fixes.
This approach reduces time-to-market and the number of rebuilds.
For products on Ethereum and TON, smart contract audits are becoming a regular practice. They are conducted before the first release, before major updates, before launching an IDO or ICO, and before listing on exchanges.
This is cheaper and more reliable than reacting to incidents during operation with loss of funds, blocked functionality, and reputational risks.
Are you planning to launch a token, DeFi protocol, crypto wallet, or Telegram Mini App and want to make the architecture secure from day one?
It makes sense to entrust smart contract development and auditing to a specialized team. FreeBlock specialists work with Ethereum, TON, and other networks.
We rely on real-world cases and help businesses reach mainnet with reviewed code and a security story that is clear to both users and investors.
7 minutes to read