Skip to content

Commit

Permalink
Add namespace to deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
jefflau committed Dec 21, 2023
1 parent d2315a9 commit a97255a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions contracts/reverseRegistrar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ You can set records using one of the follow functions:
`setNameForAddrWithSignature()`/`setTextForAddrWithSignature()` - uses the address parameter instead of `msg.sender` and allows authorisation via a signature

`setNameForAddrWithSignatureAndOwnable()`/`setTextForAddrWithSignatureOwnable()` - uses the address parameter instead of `msg.sender`. The sender is authorised by checking if the contract's owner (via the Ownable pattern) is the msg.sender, which then checks that the signer has authorised the record on behalf of msg.sender using `ERC1271`

## Signatures for setting records

Signatures use a double keccak256 structure that first hashes the function id with the variables that you are passing to that function. It then hashes the result of that with the rest of the parameters.
4 changes: 2 additions & 2 deletions deploy/reverseregistrar/01_deploy_l2_reverse_registrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'

// Replace with coinid of L2
const NAMESPACE = 'optimism'
const COINTYPE = 123

const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { getNamedAccounts, deployments, network } = hre
Expand All @@ -13,7 +13,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {

await deploy('L2ReverseRegistrar', {
from: deployer,
args: [namehash(`${NAMESPACE}.reverse`)],
args: [namehash(`${COINTYPE}.reverse`), COINTYPE],
log: true,
})
}
Expand Down

0 comments on commit a97255a

Please sign in to comment.