AmazingAng / WTF-Solidity

我最近在重新学solidity,巩固一下细节,也写一个“WTF Solidity极简入门”,供小白们使用,每周更新1-3讲。Now supports English! 官网: https://wtf.academy
https://wtf.academy
Other
10.75k stars 1.89k forks source link

[issue:558]remove Address.sol, replace isContract with address(...).code.length > 0 #721

Closed Alexzhuangyao closed 1 month ago

Alexzhuangyao commented 2 months ago

What type of PR is this (这是什么类型的PR)

Which issue(s) this PR fixes(Optional) (这个PR 修复了什么问题 (可选择))

https://github.com/AmazingAng/WTF-Solidity/issues/558

openzeppelin-contracts has already removed isContract function in Address.sol due to this issue https://github.com/OpenZeppelin/openzeppelin-contracts/issues/3417

MR: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3945

openzeppelin-contracts has already modified the implementation of _checkOnERC721Received MR: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/4377/files

What this PR does / why we need it (这个PR 做了什么/ 我们为什么需要这个PR)

1.移除Address.sol 2.对于引用isContract方法处,修改为address(...).code.length > 0 3.openzeppelin已修改对_checkOnERC721Received的实现,适配。

合约账户 转移ERC721失败: image

EOA账户 转移ERC721成功: image

Alexzhuangyao commented 2 months ago

@AmazingAng A大看看这个 适配openzeppelin的修改

AmazingAng commented 1 month ago

lgtm