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 contracts instruction #347

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,39 @@ yarn test
yarn pub
```

## How to deploy l2 contracts

There are a set of l2 contracts currently on the `feature/crosschain-resolver-with-reverse-registrar` branch

```
git checkout feature/crosschain-resolver-with-reverse-registrar
DEPLOYER_KEY=$DEPLOYER_KEY ETHERSCAN_API_KEY=$ETHERSCAN_API_KEY npx hardhat deploy --tags l2 --network optimismSepolia/baseSepolia/arbSepolia
```

The script will deploy the following three contracts

- DelegatableResolver = A template resolver contract
- DelegatableResolverFactory = A factory contract that creates a resolver for each user. A user can add delegates which can update record on behalf of the contract owner. The potential use case is to give subname under the resolver contract and grant a permission to update the subname.
- L2ReverseResolver = A Reverse resolver contract, following the [Evm reverse resolution draft ENSIP](https://github.com/ensdomains/docs/pull/157)

NOTE: Each name owner will be deploying a dedicated resolver for the name and their subnames.
You can predict the resolver address by calling the predictAddress

```
DelegatableResolverFactory.predictAddress(ownerAddress)
```

The function is an external function and you cannot call read function from etherscan.
To work around, you may want to define the abi function as view function

```
const abi = [
"function predictAddress(address) view returns (address)"
]
const l2Factory = new ethers.Contract(L2_RESOLVER_FACTORY_ADDRESS, abi, l2provider);
const l2resolverAddress = await l2Factory.predictAddress(ETH_ADDRESS)
```

## Release flow

1. Create a `feature` branch from `staging` branch
Expand Down
Loading