Skip to content

Commit

Permalink
Merge pull request #752 from DankFang/main
Browse files Browse the repository at this point in the history
解决Safemath 库连接失效问题
  • Loading branch information
AmazingAng authored Oct 19, 2024
2 parents d78c761 + d7cdb03 commit 6a0370a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion S05_Overflow/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ contract Token {

## 预防办法

1. Solidity `0.8.0` 之前的版本,在合约中引用 [Safemath 库](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/math/SafeMath.sol),在整型溢出时报错。
1. Solidity `0.8.0` 之前的版本,在合约中引用 [Safemath 库](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.9/contracts/utils/math/SafeMath.sol),在整型溢出时报错。

2. Solidity `0.8.0` 之后的版本内置了 `Safemath`,因此几乎不存在这类问题。开发者有时会为了节省gas使用 `unchecked` 关键字在代码块中临时关闭整型溢出检测,这时要确保不存在整型溢出漏洞。

Expand Down

0 comments on commit 6a0370a

Please sign in to comment.