forked from dm3-org/ENS-Bedrock-Resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setCcipResolver.ts
35 lines (25 loc) · 1.01 KB
/
setCcipResolver.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import hre, { ethers } from "hardhat";
const ENS_NAME = "testccip.eth";
export const setCcipResolver = async () => {
const { getNamedAccounts, deployments } = hre
const { deploy, get } = deployments
const ccipResolver = await get("ERC3668Resolver");
const nameWrapper = await get("NameWrapper");
const [signer] = await hre.ethers.getSigners();
const node = ethers.utils.namehash(ENS_NAME);
const registryInterface = new ethers.utils.Interface(["function setResolver(bytes32 node, address resolver) external"]);
const data = registryInterface.encodeFunctionData("setResolver", [
node,
ccipResolver.address
]);
const tx = await signer.sendTransaction({
to: nameWrapper.address,
data,
gasLimit: 56631,
gasPrice: '200000000'
});
console.log("Transaction hash: ", tx.hash);
const rec = await tx.wait();
console.log(`CCIP resolver for domain ${ENS_NAME} set to ${ccipResolver.address} `);
};
setCcipResolver();