ensdomains / subdomain-registrar

A registrar that sells subdomains to users on behalf of their owners
BSD 2-Clause "Simplified" License
187 stars 166 forks source link

Ropsten address links? #119

Closed max-mapper closed 4 years ago

max-mapper commented 4 years ago

Hi, I'm trying to test everything out on Ropsten but can't find the ropsten.etherscan.io links for the newer subdomain smart contracts. Thanks

max-mapper commented 4 years ago

I tried deploying this to ropsten and ran into this error:

$ truffle migrate --network ropsten
... compilation output removed ...
> Compiled successfully using:
   - solc: 0.5.16+commit.9c3226ce.Emscripten.clang

Migrations dry-run (simulation)
===============================
> Network name:    'ropsten-fork'
> Network id:      3
> Block gas limit: 0x7a121d

1_initial_migration.js
======================

   Deploying 'Migrations'
   ----------------------
   > block number:        7307931
   > block timestamp:     1581451717
   > account:             0xc17C6851Dd25372a058248bE2b90AB9b9c0A1411
   > balance:             3.476284368381634224
   > gas used:            210237
   > gas price:           2 gwei
   > value sent:          0 ETH
   > total cost:          0.000420474 ETH

   -------------------------------------
   > Total cost:         0.000420474 ETH

2_deploy_contracts.js
=====================
Error: ENSRegistry has not been deployed to detected network (network/artifact mismatch)
Error: ENSRegistry has not been deployed to detected network (network/artifact mismatch)

/home/max/.config/truffle/compilers/node_modules/soljson-v0.5.16+commit.9c3226ce.js:1
"use strict";var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_HAS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_HAS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_NODE=ENVIRONMENT_HAS_NODE&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,s
abort(Error: ENSRegistry has not been deployed to detected network (network/artifact mismatch)). Build with -s ASSERTIONS=1 for more info.

My truffle.js looks like this:

const HDWalletProvider = require("@truffle/hdwallet-provider");

const mnemonic = process.env.ROPSTEN_MNEMONIC;
const ROPSTEN_ID = process.env.ROPSTEN_ID;

module.exports = {
  networks: {
    ropsten: {
      provider: function() {
        return new HDWalletProvider(
          mnemonic,
          "https://ropsten.infura.io/v3/" + ROPSTEN_ID
        );
      },
      network_id: "3"
    }
  }
};

Any ideas? I tried on two machines (Mac and Linux) and got the same error. Also tried with truffle cli@master

max-mapper commented 4 years ago

After realizing there was an implicit dependency on ENSRegistry.sol I was able to deploy by using this migration

var ENS = artifacts.require("@ensdomains/ens/contracts/ENSRegistry.sol");
var SubdomainRegistrar = artifacts.require("SubdomainRegistrar");

module.exports = async function (deployer, network, accounts) {
    await deployer.deploy(ENS)
    const ens = await ENS.deployed();
    await deployer.deploy(SubdomainRegistrar, ens.address);
};