Closed Alexzhuangyao closed 1 month ago
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
1.removes isContract utility function from Address.sol library 2.Wherever isContract was used in the other contracts, is replaced by inlining address(...).code.length > 0
1.移除Address.sol 2.对于引用isContract方法处,修改为address(...).code.length > 0 3.openzeppelin已修改对_checkOnERC721Received的实现,适配。
合约账户 转移ERC721失败:
EOA账户 转移ERC721成功:
@AmazingAng A大看看这个 适配openzeppelin的修改
lgtm
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
1.removes isContract utility function from Address.sol library 2.Wherever isContract was used in the other contracts, is replaced by inlining address(...).code.length > 0
What this PR does / why we need it (这个PR 做了什么/ 我们为什么需要这个PR)
1.移除Address.sol 2.对于引用isContract方法处,修改为address(...).code.length > 0 3.openzeppelin已修改对_checkOnERC721Received的实现,适配。
合约账户 转移ERC721失败:![image](https://github.com/AmazingAng/WTF-Solidity/assets/35444295/d124f738-bcc6-4f75-bddc-65584e44c81a)
EOA账户 转移ERC721成功:![image](https://github.com/AmazingAng/WTF-Solidity/assets/35444295/eb3ab9fe-15e3-47ca-a510-ef49be6cad21)