diff --git a/packages/contracts/contracts/l1/LineaResolverStub.sol b/packages/contracts/contracts/l1/LineaResolverStub.sol index a573e2ceb..083f09297 100644 --- a/packages/contracts/contracts/l1/LineaResolverStub.sol +++ b/packages/contracts/contracts/l1/LineaResolverStub.sol @@ -1,14 +1,11 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; -pragma abicoder v2; import { Lib_OVMCodec } from "@eth-optimism/contracts/libraries/codec/Lib_OVMCodec.sol"; import { Lib_SecureMerkleTrie } from "@eth-optimism/contracts/libraries/trie/Lib_SecureMerkleTrie.sol"; import { Lib_RLPReader } from "@eth-optimism/contracts/libraries/rlp/Lib_RLPReader.sol"; import { Lib_BytesUtils } from "@eth-optimism/contracts/libraries/utils/Lib_BytesUtils.sol"; -import "hardhat/console.sol"; - struct L2StateProof { uint64 nodeIndex; bytes32 blockHash; @@ -120,12 +117,10 @@ contract LineaResolverStub is IExtendedResolver, SupportsInterface { require( keccak256(proof.result) == keccak256(abi.encode(value)), - "NEEDS TO BE EQUAL" + "LineaResolverStub: value different from expected result" ); - console.logBytes(proof.result); - console.logBytes(abi.encode(value)); - return abi.encode(value); + return proof.result; } function getl2Resolver() external view returns (address) { diff --git a/packages/contracts/contracts/l2/LineaResolver.sol b/packages/contracts/contracts/l2/LineaResolver.sol index 569dba499..6230eff1f 100644 --- a/packages/contracts/contracts/l2/LineaResolver.sol +++ b/packages/contracts/contracts/l2/LineaResolver.sol @@ -1,19 +1,19 @@ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.9; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; contract LineaResolver is Ownable { - mapping(bytes32 => address) addresses; + mapping(bytes32 => address) addresses; - event AddrChanged(bytes32 indexed node, address a); + event AddrChanged(bytes32 indexed node, address a); - function setAddr(bytes32 node, address _addr) public onlyOwner { - addresses[node] = _addr; - emit AddrChanged(node, _addr); - } + function setAddr(bytes32 node, address _addr) public { + addresses[node] = _addr; + emit AddrChanged(node, _addr); + } - function addr(bytes32 node) public view returns (address) { - return addresses[node]; - } + function addr(bytes32 node) public view returns (address) { + return addresses[node]; + } } diff --git a/packages/contracts/scripts/deployL1.ts b/packages/contracts/scripts/deployL1.ts index 911abb965..ae9f26786 100644 --- a/packages/contracts/scripts/deployL1.ts +++ b/packages/contracts/scripts/deployL1.ts @@ -22,7 +22,7 @@ async function main() { } // Deploy Linea Resolver Stub to L1 - const gatewayUrl = process.env.GATEWAY_URL ? process.env.GATEWAY_URL : "http://localhost:8080/{sender}/{data}.json"; + const gatewayUrl = process.env.GATEWAY_URL ? process.env.GATEWAY_URL : "https://www.ensgateway.amineharty.me/{sender}/{data}.json"; const rollupAddress = ROLLUP_ADDRESSES[network.name as keyof typeof ROLLUP_ADDRESSES]; const LineaResolverStub = await ethers.getContractFactory("LineaResolverStub"); const lineaResolverStub = await LineaResolverStub.deploy([gatewayUrl], rollupAddress, L2_RESOLVER_ADDRESS); diff --git a/packages/gateway/src/index.ts b/packages/gateway/src/index.ts index fe9123698..73a71dd13 100644 --- a/packages/gateway/src/index.ts +++ b/packages/gateway/src/index.ts @@ -167,7 +167,7 @@ function decodeDnsName(dnsname: Buffer) { async function getResult( name: string, data: string -): Promise<{ result: BytesLike; validUntil: number }> { +): Promise<{ result: BytesLike }> { // Parse the data nested inside the second argument to `resolve` const { signature, args } = Resolver.parseTransaction({ data }); console.log("signature", signature); @@ -188,11 +188,7 @@ async function getResult( const node = ethers.utils.namehash(name); const result = await resolverL2.addr(node); - const test = Resolver.encodeFunctionResult(signature, [result]); - console.log("test", test); - return { result: Resolver.encodeFunctionResult(signature, [result]), - validUntil: Math.floor(Date.now() / 1000), }; }