WTF-Solidity icon indicating copy to clipboard operation
WTF-Solidity copied to clipboard

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

Open Alexzhuangyao opened this issue 1 year ago • 1 comments

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

  • [x] Typo(勘误)

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

  • resolve(修复) : #

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

EOA账户 转移ERC721成功: image

Alexzhuangyao avatar May 06 '24 16:05 Alexzhuangyao

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

Alexzhuangyao avatar May 06 '24 16:05 Alexzhuangyao

lgtm

AmazingAng avatar May 12 '24 08:05 AmazingAng