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

feat: add IERC7802 #123

Merged
merged 3 commits into from
Nov 1, 2024
Merged

feat: add IERC7802 #123

merged 3 commits into from
Nov 1, 2024

Conversation

agusduha
Copy link
Member

@agusduha agusduha commented Nov 1, 2024

Closes OPT-501

Changes:

  • Rename ICrosschainERC20 to IERC7802
  • Add support to ERC165
  • Integrate SuperchainTokenBridge with ERC165

just pre-pr and just test succeeded

@agusduha agusduha self-assigned this Nov 1, 2024
Copy link

linear bot commented Nov 1, 2024

0xDiscotech
0xDiscotech previously approved these changes Nov 1, 2024

/// @title SuperchainERC20
/// @notice SuperchainERC20 is a standard extension of the base ERC20 token contract that unifies ERC20 token
/// bridging to make it fungible across the Superchain. This construction allows the SuperchainTokenBridge to
/// burn and mint tokens.
abstract contract SuperchainERC20 is ERC20, ICrosschainERC20, ISemver {
abstract contract SuperchainERC20 is ERC20, ERC165, IERC7802, ISemver {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cant we make the IERC7802 include IERC165?

/// @notice Defines the interface for crosschain ERC20 transfers.
interface ICrosschainERC20 {
interface IERC7802 is IERC165 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you include it here, do you need to include in the implementation contract as well?

Copy link
Member Author

@agusduha agusduha Nov 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is for the interface to enforce it to be included when extending from it

The other one is an abstract contract that has the OZ implementation, it particularly declares supporting the IERC165 interface

One solution is to stop inheriting from ERC165 but manually add the interface support to each contract in the supportInterface function

@agusduha agusduha merged commit 9fd55c6 into sc-feat/add-ierc7802 Nov 1, 2024
1 check passed
@agusduha agusduha deleted the feat/add-ierc7802 branch November 1, 2024 20:00
agusduha added a commit that referenced this pull request Nov 5, 2024
* feat: add IERC7802 (#123)

* feat: add IERC7802

* fix: token address fuzz error

* feat: remove ERC165 contract inheritance

* feat: add IERC20 interface support (#124)

* feat: add IERC20 interface support

* fix: interfaces tests
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.

4 participants