diff --git a/contracts/reverseRegistrar/README.md b/contracts/reverseRegistrar/README.md index 169c7623..050a50ee 100644 --- a/contracts/reverseRegistrar/README.md +++ b/contracts/reverseRegistrar/README.md @@ -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. diff --git a/deploy/reverseregistrar/01_deploy_l2_reverse_registrar.ts b/deploy/reverseregistrar/01_deploy_l2_reverse_registrar.ts index e4d2870f..83f4793e 100644 --- a/deploy/reverseregistrar/01_deploy_l2_reverse_registrar.ts +++ b/deploy/reverseregistrar/01_deploy_l2_reverse_registrar.ts @@ -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 @@ -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, }) }