Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from May 12, 2024

Conversation

Alexzhuangyao
Copy link
Contributor

@Alexzhuangyao Alexzhuangyao commented May 6, 2024

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

  • Typo(勘误)

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

#558

openzeppelin-contracts has already removed isContract function in Address.sol due to this issue
OpenZeppelin/openzeppelin-contracts#3417

MR:
OpenZeppelin/openzeppelin-contracts#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
Copy link
Contributor Author

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

@AmazingAng
Copy link
Owner

lgtm

@AmazingAng AmazingAng merged commit a0deca0 into AmazingAng:main May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants