diff --git a/bun.lockb b/bun.lockb index 3ce7df6d..9bb72c49 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/crosschain-resolver/contracts/deps.sol b/crosschain-resolver/contracts/deps.sol index 9a885618..706dcf3d 100644 --- a/crosschain-resolver/contracts/deps.sol +++ b/crosschain-resolver/contracts/deps.sol @@ -7,7 +7,7 @@ import {ReverseRegistrar} from "@ensdomains/ens-contracts/contracts/reverseRegis import {PublicResolver} from "@ensdomains/ens-contracts/contracts/resolvers/PublicResolver.sol"; import {DelegatableResolverFactory} from "@ensdomains/ens-contracts/contracts/resolvers/DelegatableResolverFactory.sol"; import {DelegatableResolver} from "@ensdomains/ens-contracts/contracts/resolvers/DelegatableResolver.sol"; -import {L2ReverseRegistrar} from '@ensdomains/ens-contracts/contracts/reverseRegistrar/L2ReverseRegistrar.sol'; +import {L2ReverseResolver} from '@ensdomains/ens-contracts/contracts/reverseRegistrar/L2ReverseResolver.sol'; // Storage slot // ┌────────────────────────────┬──────────────────────────────┬──────────────┬ // │ contract │ state_variable │ storage_slot │ diff --git a/crosschain-reverse-resolver/contracts/deps.sol b/crosschain-reverse-resolver/contracts/deps.sol index 6356ea97..3e5c7834 100644 --- a/crosschain-reverse-resolver/contracts/deps.sol +++ b/crosschain-reverse-resolver/contracts/deps.sol @@ -1,11 +1,11 @@ import {L1Verifier} from '@ensdomains/l1-verifier/contracts/L1Verifier.sol'; -import '@ensdomains/ens-contracts/contracts/reverseRegistrar/L2ReverseRegistrar.sol'; +import '@ensdomains/ens-contracts/contracts/reverseRegistrar/L2ReverseResolver.sol'; import '@ensdomains/ens-contracts/contracts/resolvers/profiles/IVersionableResolver.sol'; // Storage slot // ┌────────────────────┬───────────────────┬──────────────┬ // │ contract │ state_variable │ storage_slot │ // ├────────────────────┼───────────────────┼──────────────┼ -// │ L2ReverseRegistrar │ lastUpdated │ 0 │ -// │ L2ReverseRegistrar │ versionable_texts │ 1 │ -// │ L2ReverseRegistrar │ versionable_names │ 2 │ -// │ L2ReverseRegistrar │ recordVersions │ 3 │ +// │ L2ReverseResolver │ lastUpdated │ 0 │ +// │ L2ReverseResolver │ versionable_texts │ 1 │ +// │ L2ReverseResolver │ versionable_names │ 2 │ +// │ L2ReverseResolver │ recordVersions │ 3 │ diff --git a/crosschain-reverse-resolver/scripts/setname.ts b/crosschain-reverse-resolver/scripts/setname.ts index 05896d88..248c747f 100644 --- a/crosschain-reverse-resolver/scripts/setname.ts +++ b/crosschain-reverse-resolver/scripts/setname.ts @@ -20,16 +20,16 @@ export const main = async () => { const name = ETH_ADDRESS.substring(2).toLowerCase() + "." + namespace const reversenode = ethers.namehash(name) - const L2ReverseRegistrarFactory = (await hre.ethers.getContractFactory("L2ReverseRegistrar")) as L2ReverseRegistrarFactory__factory; - const l2ReverseRegistrar = L2ReverseRegistrarFactory + const L2ReverseResolverFactory = (await hre.ethers.getContractFactory("L2ReverseResolver")) as L2ReverseResolverFactory__factory; + const L2ReverseResolver = L2ReverseResolverFactory .connect(signer) .attach(L2_REVERSE_REGISTRAR_ADDRESS); console.log({ L2_REVERSE_REGISTRAR_ADDRESS, L2_PROVIDER_URL,ENS_NAME, ETH_ADDRESS, namespace, name, reversenode}) - const tx = await l2ReverseRegistrar.setName(ENS_NAME); + const tx = await L2ReverseResolver.setName(ENS_NAME); const rec = await tx.wait(); console.log({txhash:rec.hash}); - console.log(await l2ReverseRegistrar.name(reversenode)) + console.log(await L2ReverseResolver.name(reversenode)) }; main(); \ No newline at end of file diff --git a/crosschain-reverse-resolver/test/testReverseResolver.ts b/crosschain-reverse-resolver/test/testReverseResolver.ts index 07bd4d2e..ce4e1ebe 100644 --- a/crosschain-reverse-resolver/test/testReverseResolver.ts +++ b/crosschain-reverse-resolver/test/testReverseResolver.ts @@ -45,7 +45,9 @@ describe('Crosschain Reverse Resolver', () => { let verifier: Contract; let target: Contract; let l2contract: Contract; + let l2contractAddress: string; let defaultReverseResolver: Contract; + let defaultReverseAddress: string; before(async () => { // Hack to get a 'real' ethers provider from hardhat. The default `HardhatProvider` @@ -88,19 +90,20 @@ describe('Crosschain Reverse Resolver', () => { defaultReverseResolver = await DefaultReverseResolverFactory.deploy() await provider.send('evm_mine', []); const testL2Factory = await ethers.getContractFactory( - 'L2ReverseRegistrar', + 'L2ReverseResolver', signer ); l2contract = await testL2Factory.deploy(ethers.namehash(`${NAMESPACE}.reverse`), NAMESPACE); - + l2contractAddress = await l2contract.getAddress(); + defaultReverseAddress = await defaultReverseResolver.getAddress(); const testL1Factory = await ethers.getContractFactory( 'L1ReverseResolver', signer ); target = await testL1Factory.deploy( await verifier.getAddress(), - await l2contract.getAddress(), - await defaultReverseResolver.getAddress() + l2contractAddress, + defaultReverseAddress ); // Mine an empty block so we have something to prove against await provider.send('evm_mine', []); @@ -149,8 +152,8 @@ describe('Crosschain Reverse Resolver', () => { const block = await provider.getBlock('latest') const inceptionDate = block?.timestamp const message = ethers.solidityPackedKeccak256( - ['bytes32', 'address', 'uint256', 'uint256'], - [ethers.solidityPackedKeccak256(['bytes4', 'string'], [funcId, name]), testAddress, inceptionDate, 0], + ['address', 'bytes32', 'address', 'uint256', 'uint256'], + [defaultReverseAddress, ethers.solidityPackedKeccak256(['bytes4', 'string'], [funcId, name]), testAddress, inceptionDate, 0], ) const signature = await testSigner.signMessage(ethers.toBeArray(message)) await defaultReverseResolver['setNameForAddrWithSignature']( @@ -219,10 +222,10 @@ describe('Crosschain Reverse Resolver', () => { const block = await provider.getBlock('latest') const inceptionDate = block?.timestamp const message = ethers.solidityPackedKeccak256( - ['bytes32', 'address', 'uint256', 'uint256'], - [ethers.solidityPackedKeccak256(['bytes4', 'string', 'string'], [funcId, key, value]), testAddress, inceptionDate, 0], + ['address', 'bytes32', 'address', 'uint256', 'uint256'], + [defaultReverseAddress, ethers.solidityPackedKeccak256(['bytes4', 'string', 'string'], [funcId, key, value]), testAddress, inceptionDate, 0], ) - const signature = await testSigner.signMessage(ethers.toBeArray(message)) + const signature = await testSigner.signMessage(ethers.toBeArray(message)) await defaultReverseResolver['setTextForAddrWithSignature']( testAddress, key,