5 Smart Contract Vulnerabilities You Need to Know About: Protect Your Funds and Assets with These Tips

Paulina Lewandowska

23 Dec 2022
<strong><noscript><img class=

In smart contracts, the details of the agreement between the buyer and seller are directly encoded into lines of code. These contracts self-execute. On a blockchain network, the code and the agreements it contains are copied and saved.

We have compiled a list of typical smart contract flaws that users may encounter and methods that may be taken to safeguard them as experts in building smart contracts.

Reentrancy attacks

These exploits give an adversary the ability to repeatedly run a smart contract function and siphon off its cash.

In a reentrancy attack, a malicious contract calling a vulnerable contract is created by the attacker, who then waits for the vulnerable contract to execute a function that transfers money to their contract. Before the susceptible contract has an opportunity to change its internal state, the attacker's contract calls the vulnerable contract once more right away. The attacker can drain the cash from the susceptible contract by doing this procedure repeatedly.

Reentrancy attacks are particularly harmful since they can be carried out covertly over a long period of time and are frequently challenging to identify. They can also be challenging to stop since they frequently rely on flaws in the vulnerable contract's architecture.

Smart contract developers should put protective measures in place to guard against reentrancy attacks, such as employing mutexes (locking mechanisms) to prevent repeated calls to a contract's functions and thoroughly examining the contract's code for any potential vulnerabilities.

Unchecked send

This flaw enables an attacker to transmit a lot of tokens to a smart contract, thereby exhausting its resources and leading to failure.

An attacker uses a malicious contract to transmit a large number of tokens to a weak contract in a single transaction in an unchecked send attack. The susceptible contract might not have adequate security measures in place to handle the significant influx of tokens, which might lead to it running out of gas and failing. Due to this, the contract might no longer be usable, which could cause users who depend on it to lose money or other assets.

Send attacks that are left unchecked pose a special threat because they might be challenging to identify and have negative user effects. Smart contract developers should put safety measures in place to stop massive influxes of tokens, like limiting the number of tokens that can be sent in a single transaction, to protect against uncontrolled send attacks.

Integer overflow/underflow

This flaw occurs when a smart contract improperly handles integer arithmetic operations, potentially allowing an attacker to change the state of the contract.

When an integer value exceeds the amount that can be stored in the specified number of bits, it is said to have overflowed. The value may "wrap around" as a result and turn very little negative. When an integer value is less than the smallest amount that may be stored in the allocated number of bits, an integer underflow occurs. The value may "wrap around" as a result and turn into an extremely large positive number.

An attacker may take advantage of these weaknesses to influence the state of the contract and maybe get unauthorized access to money or assets. An attacker may, for instance, employ an integer overflow to make a contract move more money than it should or an integer underflow to make a contract transfer less money than it should.

Smart contract developers should thoroughly evaluate the code and implement safety measures to prevent integer overflow and underflow flaws. Using tools or libraries that can handle arithmetic operations involving huge integers is one method to achieve this. Utilizing data types that can store huge integer values without incurring overflow or underflow is another choice. It is crucial for developers to put these safeguards in place in order to guard against vulnerabilities that might be used by attackers.

Lack of access control

Without adequate access control safeguards, a smart contract may be open to unwanted alterations or attacks.

A smart contract may be open to attacks or illegal changes if the right access control procedures are not in place. For instance, if the contract does not have adequate security measures to prevent unauthorized access, an attacker might be able to alter the status of the contract or access sensitive data.

Smart contract developers should use measures like using access modifiers (e.g., "public," "private," or "internal") to control access to contract functions and data, as well as role-based access control to grant access to certain functions or data to specific groups or individuals, to prevent lack of access control vulnerabilities.

Lack of input validation

A smart contract may be vulnerable to malicious data being injected into it if input is not adequately validated, which might allow an attacker to modify the contract's status.

A smart contract may be vulnerable to malicious data being injected into it if input is not adequately validated, which might allow an attacker to modify the contract's status. For instance, a hacker could be able to take advantage of a lack of input validation to force a contract to send money to an unapproved address or to gain access to confidential information.

Smart contract developers should put mechanisms in place to validate the data that is input into the contract in order to guard against vulnerabilities caused by a lack of input validation. This could entail putting in place checks to make sure that data satisfies particular requirements prior to being accepted by the contract and using libraries or tools to validate data types, ranges, and formats.

Summary

Smart contract flaws can have detrimental effects on consumers, including the loss of money, the impossibility of accessing assets, and the disclosure of private or confidential data. It's critical that both consumers and developers are aware of potential vulnerabilities and take precautions to guard against them. Using mutexes to prevent concurrent calls to a contract's functions, limiting the number of tokens that can be sent in a single transaction, using tools or libraries that support arithmetic operations with large integers, putting in place access control measures, and validating data input into the contract are some of the methods covered in this article for securing smart contracts.

Most viewed


Never miss a story

Stay updated about Nextrope news as it happens.

You are subscribed

Aethir Tokenomics – Case Study

Kajetan Olas

22 Nov 2024
Aethir Tokenomics – Case Study

Authors of the contents are not affiliated to the reviewed project in any way and none of the information presented should be taken as financial advice.

In this article we analyze tokenomics of Aethir - a project providing on-demand cloud compute resources for the AI, Gaming, and virtualized compute sectors.
Aethir aims to aggregate enterprise-grade GPUs from multiple providers into a DePIN (Decentralized Physical Infrastructure Network). Its competitive edge comes from utlizing the GPUs for very specific use-cases, such as low-latency rendering for online games.
Due to decentralized nature of its infrastructure Aethir can meet the demands of online-gaming in any region. This is especially important for some gamer-abundant regions in Asia with underdeveloped cloud infrastructure that causes high latency ("lags").
We will analyze Aethir's tokenomics, give our opinion on what was done well, and provide specific recommendations on how to improve it.

Evaluation Summary

Aethir Tokenomics Structure

The total supply of ATH tokens is capped at 42 billion ATH. This fixed cap provides a predictable supply environment, and the complete emissions schedule is listed here. As of November 2024 there are approximately 5.2 Billion ATH in circulation. In a year from now (November 2025), the circulating supply will almost triple, and will amount to approximately 15 Billion ATH. By November 2028, today's circulating supply will be diluted by around 86%.

From an investor standpoint the rational decision would be to stake their tokens and hope for rewards that will balance the inflation. Currently the estimated APR for 3-year staking is 195% and for 4-year staking APR is 261%. The rewards are paid out weekly. Furthermore, stakers can expect to get additional rewards from partnered AI projects.

Staking Incentives

Rewards are calculated based on the staking duration and staked amount. These factors are equally important and they linearly influence weekly rewards. This means that someone who stakes 100 ATH for 2 weeks will have the same weekly rewards as someone who stakes 200 ATH for 1 week. This mechanism greatly emphasizes long-term holding. That's because holding a token makes sense only if you go for long-term staking. E.g. a whale staking $200k with 1 week lockup. will have the same weekly rewards as person staking $1k with 4 year lockup. Furthermore the ATH staking rewards are fixed and divided among stakers. Therefore Increase of user base is likely to come with decrease in rewards.
We believe the main weak-point of Aethirs staking is the lack of equivalency between rewards paid out to the users and value generated for the protocol as a result of staking.

Token Distribution

The token distribution of $ATH is well designed and comes with long vesting time-frames. 18-month cliff and 36-moths subsequent linear vesting is applied to team's allocation. This is higher than industry standard and is a sign of long-term commitment.

  • Checkers and Compute Providers: 50%
  • Ecosystem: 15%
  • Team: 12.5%
  • Investors: 11.5%
  • Airdrop: 6%
  • Advisors: 5%

Aethir's airdrop is divided into 3 phases to ensure that only loyal users get rewarded. This mechanism is very-well thought and we rate it highly. It fosters high community engagement within the first months of the project and sets the ground for potentially giving more-control to the DAO.

Governance and Community-Led Development

Aethir’s governance model promotes community-led decision-making in a very practical way. Instead of rushing with creation of a DAO for PR and marketing purposes Aethir is trying to make it the right way. They support projects building on their infrastructure and regularly share updates with their community in the most professional manner.

We believe Aethir would benefit from implementing reputation boosted voting. An example of such system is described here. The core assumption is to abandon the simplistic: 1 token = 1 vote and go towards: Votes = tokens * reputation_based_multiplication_factor.

In the attached example, reputation_based_multiplication_factor rises exponentially with the number of standard deviations above norm, with regard to user's rating. For compute compute providers at Aethir, user's rating could be replaced by provider's uptime.

Perspectives for the future

While it's important to analyze aspects such as supply-side tokenomics, or governance, we must keep in mind that 95% of project's success depends on demand-side. In this regard the outlook for Aethir may be very bright. The project declares $36M annual reccuring revenue. Revenue like this is very rare in the web3 space. Many projects are not able to generate any revenue after succesfull ICO event, due to lack fo product-market-fit.

If you're looking to create a robust tokenomics model and go through institutional-grade testing please reach out to contact@nextrope.com. Our team is ready to help you with the token engineering process and ensure your project’s resilience in the long term.

Nextrope Partners with Hacken to Enhance Blockchain Security

Miłosz

21 Nov 2024
Nextrope Partners with Hacken to Enhance Blockchain Security

Nextrope announces a strategic partnership with Hacken, a renowned blockchain security auditor. It marks a significant step in delivering reliable decentralized solutions. After several successful collaborations resulting in flawless smart contract audits, the alliance solidifies the synergy between Nextrope's innovative blockchain development and Hacken's top-tier security auditing services. Together, we aim to set new benchmarks, ensuring that security is an integral part of blockchain technology.

Strengthening Blockchain Security

The partnership aims to fortify the security protocols within blockchain ecosystems. By integrating Hacken's comprehensive security audits with Nextrope's cutting-edge blockchain solutions, we are poised to offer unparalleled security features in our projects.

"Blockchain security should never be an afterthought"

"Our partnership with Hacken underscores our dedication to embedding security at the core of our blockchain solutions. Together, we're building a safer future for the industry."

said Mateusz Mach, CEO of Nextrope

About Nextrope

Nextrope is a forward-thinking blockchain development house specializing in creating innovative solutions for businesses worldwide. With a team of experienced developers and blockchain experts, Nextrope delivers high-quality, scalable, and secure blockchain applications tailored to meet the unique needs of each client.

About Hacken

Hacken is a leading blockchain security auditor known for its rigorous smart contract audits and security assessments. With a mission to make the industry safer, Hacken provides complex security services that help companies identify and mitigate vulnerabilities in their applications.

Looking Ahead

As a joint mission, both Nextrope and Hacken are committed to continuous innovation. We look forward to the exciting opportunities this partnership will bring and are eager to implement a more secure blockchain environment for all.

For more information, please contact:

Nextrope

Hacken

Join us on our journey to deliver top-notch blockchain tech and a safer future for the industry!