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

Commit

Permalink
Update development script
Browse files Browse the repository at this point in the history
  • Loading branch information
ilanolkies committed Feb 3, 2020
1 parent 207825a commit 7cf9e5e
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions migrations/1_rsk_owner.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const TokenRegistrar = artifacts.require('TokenRegistrar');
const RSKOwner = artifacts.require('RSKOwner');
const NamePrice = artifacts.require('NamePrice');
const FIFSRegistrar = artifacts.require('FIFSRegistrar');
const FIFSAddrRegistrar = artifacts.require('FIFSAddrRegistrar');
const BytesUtils = artifacts.require('BytesUtils');
const Renewer = artifacts.require('Renewer');

Expand All @@ -21,18 +22,20 @@ const namehash = require('eth-ens-namehash').hash;
*/
function deployDev (deployer, accounts) {
const POOL = accounts[1];
let rns, rif, tokenRegistrar, rskOwner, namePrice, fifsRegistrar, renewer;
let rns, rif, tokenRegistrar, rskOwner, namePrice, fifsRegistrar, fifsAddrRegistrar, renewer;

const devAddress = '0x2824b21e348d520a50cddfa77ba158822160dd94';

const rootNode = namehash('rsk');

const label = web3.utils.sha3('javiesses');
const amount = web3.utils.toBN('1000000000000000000');

return deployer.deploy(RNS).then(_rns => {
rns = _rns;
})
.then(() => {
return deployer.deploy(RIF, accounts[0], web3.utils.toBN('1000000000000000000000'));
return deployer.deploy(RIF, accounts[0], web3.utils.toBN('1000000000000000000000'), 'RIFOS', 'RIF', web3.utils.toBN('18'));
})
.then(_rif => {
rif = _rif;
Expand All @@ -41,7 +44,7 @@ function deployDev (deployer, accounts) {
return rif.transfer(devAddress, web3.utils.toBN('100000000000000000000'));
})
.then(() => {
return deployer.deploy(TokenRegistrar, rns.address, namehash('rsk'), rif.address);
return deployer.deploy(TokenRegistrar, rns.address, rootNode, rif.address);
})
.then(_tokenRegistrar => {
tokenRegistrar = _tokenRegistrar;
Expand Down Expand Up @@ -87,7 +90,7 @@ function deployDev (deployer, accounts) {
return tokenRegistrar.transfer(label, devAddress);
})
.then(() => {
return deployer.deploy(RSKOwner, tokenRegistrar.address, rns.address, namehash('rsk'));
return deployer.deploy(RSKOwner, tokenRegistrar.address, rns.address, rootNode);
})
.then(_rskOwner => {
rskOwner = _rskOwner;
Expand All @@ -107,6 +110,9 @@ function deployDev (deployer, accounts) {
.then(() => {
return deployer.link(BytesUtils, FIFSRegistrar);
})
.then(() => {
return deployer.link(BytesUtils, FIFSAddrRegistrar);
})
.then(() => {
return deployer.deploy(FIFSRegistrar, rif.address, rskOwner.address, POOL, namePrice.address);
})
Expand All @@ -116,6 +122,15 @@ function deployDev (deployer, accounts) {
.then(() => {
return rskOwner.addRegistrar(fifsRegistrar.address);
})
.then(() => {
return deployer.deploy(FIFSAddrRegistrar, rif.address, rskOwner.address, POOL, namePrice.address, rns.address, rootNode);
})
.then(_fifsAddrRegistrar => {
fifsAddrRegistrar = _fifsAddrRegistrar;
})
.then(() => {
return rskOwner.addRegistrar(fifsAddrRegistrar.address);
})
.then(() => {
return deployer.link(BytesUtils, Renewer);
})
Expand Down

0 comments on commit 7cf9e5e

Please sign in to comment.