Cointime

Download App
iOS & Android

Eliminating the Problem of Smart Contracts Vulnerabilities

Cointime Official

By Pruvendo

Blockchain smart contracts is not new technology.

For 7 years people have been engaged in smart contract’s development for the most different types of projects, from DAOs to GameFi. But security problems, which were relevant 7 years ago, are still relevant now.

Why, despite the application of audit to almost every web3 project, the vast majority of smart contracts continue to be vulnerable and contain exploits?

The main reasons that most smart contracts are insecure:

  1. Technologies that do not meet modern realities.Due to the fact that most vulnerabilities are not obvious, it’s required an enormous amount of time to find them using most prevalent methods like testing or code review.
  2. Lack of time on production.Usually smart contracts are written in a short time to meet the TTM deadline. And often in such conditions, security is not the main goal, considering that the security check key point is audit.
  3. Insufficient tools.The fact that there are no tools or solutions in the smart contract developer’s toolset which could allow them to quickly detect vulnerabilities in smart contracts during the development process.
  4. The complexity of smart contract logic.Smart contracts often contain tens of thousands lines of code, a large number of functions and variables, which make it impossible to cover all probable scenarios that may trigger errors or vulnerabilities, when there are millions of possible combinations and interactions between them.

All this leads to the fact that vulnerabilities remain in smart contracts after the project is launched. And, due to that in most cases smart contracts are immutable, it’s nearly impossible to prevent the attack and money loss (usually the major problem is not even money, but reputational loss).

But what tool or method could help to avoid all these risks and would allow to create 100% secure-by-design smart contract, unavailable to be hacked or attacked?

The formal verification (FV).

How? — let’s analyze its application using examples of the most common vulnerabilities of smart contracts.

Integer Arithmetic Error

Shortly — the overflow of integers and the problem that there could be inaccuracy in values during the calculation process.

The way that FV prevents this error is simple — during the process of formal verification of the smart contract all possible values are tested. There couldn’t be an unexpected value, which may cause an error.

Missing Parameters

This occurs from sloppy designs in smart contracts and some other programming mistakes during the process. Application of the FV fixes the entire problem by checking every possible input and prerequisite for every operation. This solves the problem from its basics.

Smart Contract Security Audit

How about using actual audit (code review + testing) to verify security of formally verified smart contracts? The answer is already in the question: if the smart contract is formally verified, then methods, which are currently used by auditors will not find any bugs or exploits due to their absence.

Last thoughts

There are many ways to attack a smart contract. But all of them developed in a situation where smart contracts had many vulnerabilities and had no mechanisms to avoid this.

The application of formal verification changes the rules of the game between hackers and security engineers, invalidating hackers of ways to attack.

Comments

All Comments

Recommended for you

  • Putin: Russia "supports" Harris, calls her smile "contagious"

    According to foreign media such as TASS and Russia's Sputnik News, Jinse Finance reported that on the afternoon of September 5th local time, Russian President Putin said at the plenary session of the Eastern Economic Forum 2024 that Russia will "support" the US Democratic Party presidential candidate and vice president Harris as recommended by the US President Biden in the upcoming US presidential election. When asked how he viewed the 2024 US election, Putin said it was the choice of the American people. The new US president will be elected by the American people, and Russia will respect the choice of the American people. Putin also said that just as Biden suggested his supporters to support Harris, "we will do the same, we will support her." The report said that Putin also joked that Harris' laughter is "expressive and infectious," which shows that "she is doing everything well." He added that this may mean that she will avoid further sanctions against Russia.

  • An ETH whale repurchased 5,153 ETH with 12.23 million USDT 20 minutes ago

    A certain high-frequency trading ETH whale monitored by on-chain analyst Yu Jin bought 5,153 ETH with 12.23 million USDT 20 minutes ago.

  • CFTC: Uniswap Labs has actively cooperated with the investigation and only needs to pay a fine of US$175,000

    The CFTC has filed a lawsuit against Uniswap Labs and reached a settlement. It was found that Uniswap Labs illegally provided leveraged or margined retail commodity transactions of digital assets through a decentralized digital asset trading protocol. Uniswap Labs was required to pay a civil penalty of $175,000 and cease violations of the Commodity Exchange Act (CEA). The CFTC acknowledged that Uniswap Labs actively cooperated with law enforcement agencies in the investigation and reduced the civil penalty.

  • Federal Reserve Beige Book: Respondents generally expect economic activity to remain stable or improve

    The Federal Reserve's Beige Book pointed out that economic activity in three regions has slightly increased, while the number of regions reporting flat or declining economic activity has increased from five in the previous quarter to nine in this quarter. Overall employment levels remain stable, although some reports indicate that companies are only filling necessary positions, reducing working hours and shifts, or reducing overall employment levels through natural attrition. However, reports of layoffs are still rare. Generally speaking, wage growth is moderate, and the growth rate of labor input costs and sales prices ranges from slight to moderate. Consumer spending has declined in most regions, while in the previous reporting period, consumer spending remained stable overall.

  • Puffpaw Completes $6 Million Seed Round with Lemniscap Ventures as Participant

    Puffpaw has announced the completion of a $6 million seed round of financing, with participation from Lemniscap Ventures. The Puffpaw project plans to launch a blockchain-enabled electronic cigarette aimed at helping users reduce nicotine intake through token incentives. The project encourages users to quit smoking by recording their smoking habits and rewarding them with tokens. Puffpaw's token economics aims to cover 30% of the cost of users' first month of using their product and provide social rewards. The project also considers possible system abuse, but the issue of users potentially reporting smoking habits dishonestly is not yet clear.

  • Affected by Ethervista and others, Ethereum Gas temporarily rose to 33gwei

    According to Etherscan, due to the influence of contracts such as Ethervista, Ethereum Gas has temporarily risen to 33gwei, with the top three being EthervistaRouter, UniswapRouter, and BananaGun.

  • The probability of the Fed cutting interest rates by 25 basis points in September is 55%.

    The probability of the Federal Reserve cutting interest rates by 25 basis points in September is 55.0%, while the probability of a 50 basis point cut is 45.0%. The probability of the Federal Reserve cutting interest rates by a cumulative 50 basis points by November is 32.1%, by 75 basis points is 49.2%, and by 100 basis points is 18.8%.

  • Nvidia: No subpoena received from the US Department of Justice

    Nvidia (NVDA.O) stated that it has not received a subpoena from the US Department of Justice.

  • BITCOIN PIONEER CHUN WANG TO COMMAND SPACEX'S FIRST MISSION OVER EARTH'S POLAR REGIONS

    Chun Wang, the co-founder of Bitcoin mining pool f2pool and a well-known figure in the Bitcoin community, is set to command SpaceX’s first human spaceflight mission to explore Earth’s polar regions from orbit. Wang, who began mining Bitcoin back in 2011, said he has been eagerly preparing for this mission for the past 2.5 years and has been involved in every aspect of the mission, from the initial proposal and planning to the trajectory design and crew selection.

  • MarbleX and Netmarble Launch $20 Million Ecosystem Promotion Plan

    Ethereum game platform Immutable has announced a partnership with the blockchain game division Marblex of South Korean gaming giant Netmarble. The collaboration will migrate Marblex's ecosystem and its multiple games from the Klaytn blockchain to the Ethereum Layer 2 network Immutable zkEVM. The games include "Ni no Kuni: Cross Worlds", "A3: Still Alive" and "Meta World: My City", and the two parties will also launch an "ecosystem promotion plan" to provide up to $20 million in support to developers to attract new games to join Marblex and Immutable. It is currently unclear whether the Immutable migration will affect Saga's plans, and the project representatives have not commented on the issue.