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

[L2] Create contract for Arbitrum reading (Part.1) #47

Closed
1 task
LeonardoVieira1630 opened this issue Mar 21, 2024 · 1 comment
Closed
1 task

[L2] Create contract for Arbitrum reading (Part.1) #47

LeonardoVieira1630 opened this issue Mar 21, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@LeonardoVieira1630
Copy link
Member

LeonardoVieira1630 commented Mar 21, 2024

Feature Request

We need to have an smart contract deployed on any given layer 2 protocol to be used as an external source which will be used on the redirecting phase of the L1 flow.

sequenceDiagram
  Client->>Registry :resolver("test.eth")
  Registry->>Client :0x....
  Client->>Resolver :setText("test.eth", "avatar", "avatar.png")
  Resolver->>Client :revert `StorageHandledByL2(chainId, contractAddress)`
  Client->>⭐ L2 Contract :setText("test.eth", "avatar", "avatar.png")

Describe Preferred Solution

The L2 contract should behave exactly the same way as Public Resolver would in the Layer 1.

Address reading implementation

/**
    * Returns the address associated with an ENS node.
    * @param node The ENS node to query.
    * @return The associated address.
    */
function addr(
    bytes32 node
) public view virtual override returns (address payable) {
    bytes memory a = addr(node, COIN_TYPE_ETH);
    if (a.length == 0) {
        return payable(0);
    }
    return bytesToAddress(a);
}

Checklist

  • Run local node with Layer 2.

Related Code

Public Resolver contract implementation
Offchain Resolving
Address reading implementation

Additional Context

After being deployed to the given layer 2, the contract address should be stored in the layer 1 contract in order to redirect the requests by using StorageHandledByL2(chainID, contractAddress).

@LeonardoVieira1630 LeonardoVieira1630 self-assigned this Mar 21, 2024
@LeonardoVieira1630 LeonardoVieira1630 added the enhancement New feature or request label Mar 21, 2024
@pikonha pikonha changed the title [L2] Create contract for Arbitrum reading [L2] Create contract for Arbitrum reading (Part.1) Apr 1, 2024
@pikonha
Copy link
Contributor

pikonha commented Apr 1, 2024

continuation on #51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants