Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #14 from rnsdomains/new-resolver
Browse files Browse the repository at this point in the history
New resolver
  • Loading branch information
ilanolkies authored Jun 12, 2020
2 parents 1c9f0cb + 5bcdcec commit 959d3ca
Show file tree
Hide file tree
Showing 4 changed files with 1,579 additions and 2,876 deletions.
8 changes: 6 additions & 2 deletions contracts/RNSImports.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ pragma solidity ^0.5.3;

import "@rsksmart/rns-registry/contracts/RNS.sol";

import "@rsksmart/rns-resolver/contracts/PublicResolver.sol";
import "@rsksmart/rns-resolver/contracts/MultiChainResolver.sol";
import "@rsksmart/rns-resolver/contracts/legacy/PublicResolver.sol";
import "@rsksmart/rns-resolver/contracts/legacy/MultiChainResolver.sol";

import "@rsksmart/rns-reverse/contracts/ReverseSetup.sol";
import "@rsksmart/rns-reverse/contracts/ReverseRegistrar.sol";
Expand All @@ -19,5 +19,9 @@ import "@rsksmart/rns-rskregistrar/contracts/FIFSAddrRegistrar.sol";
import "@rsksmart/rns-rskregistrar/contracts/Renewer.sol";
import "@rsksmart/rns-rskregistrar/contracts/NamePrice.sol";

import "@openzeppelin/upgrades/contracts/upgradeability/ProxyFactory.sol";
import "@openzeppelin/upgrades/contracts/upgradeability/ProxyAdmin.sol";
import "@rsksmart/rns-resolver/contracts/ResolverV1.sol";

contract RNSImports {
}
62 changes: 44 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ const FIFSRegistrar = require('./build/contracts/FIFSRegistrar');
const FIFSAddrRegistrar = require('./build/contracts/FIFSAddrRegistrar');
const Renewer = require('./build/contracts/Renewer');

const ProxyFactory = require('./build/contracts/ProxyFactory');
const ProxyAdmin = require('./build/contracts/ProxyAdmin');
const ResolverV1 = require('./build/contracts/ResolverV1');
const { encodeCall } = require('@openzeppelin/upgrades');

function link(artifact, libName, libAddress) {
console.log(chalk.cyan(`Linking ${libName} into ${artifact.contractName}`));

Expand Down Expand Up @@ -319,28 +324,48 @@ async function main(provider, registrations, auctionRegistrations, registrations
await Promise.all(allAddrs);
console.log(`Set addr for: ${domains}`);
console.log();
}
}
}


console.log(chalk.italic('Definitive resolver (proxy deployment)'));
const proxyFactory = await deployContract(ProxyFactory);
const proxyAdmin = await deployContract(ProxyAdmin);
const resolverV1 = await deployContract(ResolverV1);

console.log(chalk.bold('Creating instance'));

const salt = '16';
const data = encodeCall('initialize', ['address'], [rns.options.address]);

await executeTx(proxyFactory.methods.deploy(salt, resolverV1.options.address, proxyAdmin.options.address, data));

const deploymentAddress = await proxyFactory.methods.getDeploymentAddress(salt, from).call();

const defintiveResolver = new web3.eth.Contract(ResolverV1.abi, deploymentAddress);

console.log()

console.log('Done! Summary:')

console.log('|============================|============================================|')
console.log('| Contract | Address |')
console.log('|============================|============================================|')
console.log(`| RNS registry | ${rns.options.address} |`)
console.log(`| Public resolver | ${publicResolver.options.address} |`)
console.log(`| Multi-chain resolver | ${multiChainResolver.options.address} |`)
console.log(`| Name resolver | ${nameResolver.options.address} |`)
console.log(`| Reverse registrar | ${reverseRegistrar.options.address} |`)
console.log(`| RIF token | ${rif.options.address} |`)
console.log(`| Auction registrar (legacy) | ${auctionRegistrar.options.address} |`)
console.log(`| RSK owner | ${rskOwner.options.address} |`)
console.log(`| Name price | ${namePrice.options.address} |`)
console.log(`| Bytes utils | ${bytesUtils.options.address} |`)
console.log(`| FIFS registrar | ${fifsRegistrar.options.address} |`)
console.log(`| FIFS addr registrar | ${fifsAddrRegistrar.options.address} |`)
console.log(`| Renewer | ${renewer.options.address} |`)
console.log('|============================|============================================|\n')
console.log('|===============================|============================================|')
console.log('| Contract | Address |')
console.log('|===============================|============================================|')
console.log(`| RNS registry | ${rns.options.address} |`)
console.log(`| Public resolver (legacy) | ${publicResolver.options.address} |`)
console.log(`| Multi-chain resolver (legacy) | ${multiChainResolver.options.address} |`)
console.log(`| Name resolver | ${nameResolver.options.address} |`)
console.log(`| Reverse registrar | ${reverseRegistrar.options.address} |`)
console.log(`| RIF token | ${rif.options.address} |`)
console.log(`| Auction registrar (legacy) | ${auctionRegistrar.options.address} |`)
console.log(`| RSK owner | ${rskOwner.options.address} |`)
console.log(`| Name price | ${namePrice.options.address} |`)
console.log(`| Bytes utils | ${bytesUtils.options.address} |`)
console.log(`| FIFS registrar | ${fifsRegistrar.options.address} |`)
console.log(`| FIFS addr registrar | ${fifsAddrRegistrar.options.address} |`)
console.log(`| Renewer | ${renewer.options.address} |`)
console.log(`| Definitive resolver | ${defintiveResolver.options.address} |`)
console.log('|===============================|============================================|\n')

if (registeredDomainsAuction)
console.log(`Registered domains with the auction registrar(legacy): ${registeredDomainsAuction}`);
Expand Down Expand Up @@ -370,6 +395,7 @@ async function main(provider, registrations, auctionRegistrations, registrations
fifsRegistrar,
fifsAddrRegistrar,
renewer,
defintiveResolver
}
}

Expand Down
Loading

0 comments on commit 959d3ca

Please sign in to comment.