帖子

分享您的知识。

帖子

分享您的知识。

Serpent0x.
May 30, 2024
讨论

Reentrancy Vulnerability

Hello everyone , I've noticed that the offer function uses the .call{value: amount}("") method to send Ether to the recipient's address.

Could anyone provide insight into whether this function is indeed vulnerable to reentrancy and suggest any best practices or modifications to mitigate such risks?

function _offer(address to, uint256 amount) internal {

      balance -= amount;

      (bool success, ) = to.call{value: amount}("");
      if (!success) {
          revert TransferFailed(address(0), address(this), to, amount);
      }
  }
  • Foundry
  • Security
  • Solidity
  • Blockchain
  • Smart Contract
0
0
分享
评论
.

你知道答案吗?

请登录并分享。

Cyfrin Updraft is an education platform specializing on teaching the next generation of smart contract developers

195帖子196答案
我们使用 cookie 确保您在我们的网站上获得最佳体验。
更多信息