Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Feb 17, 2021
2 parents 96e69c4 + 36ab5d8 commit 0833cd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions packages/react-app/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,18 @@ function App({
}
}
const lookupName = async(provider, label) => {
console.log('***lookupName1', {label})
if (!label.match(/\.eth/)) {
return false
}
let encoded, registry
try{
encoded = namehash.hash(label)
console.log('***lookupName2', {encoded, registryAddress})
registry = new Contract(registryAddress, abis.registry, provider);
console.log('***lookupName3', {registry})
const res = await registry.owner(encoded)
console.log('***lookupName4', {res})
return res
}catch(e){
setMessage('Problem looking up the name')
Expand All @@ -103,7 +107,9 @@ function App({
childDomain = label.replace(/\.eth$/, '')
labelhash = '0x' + sha3(childDomain)
registrar = new Contract(registrarAddress, abis.registrar, provider);
console.log('***lookupDeed1', {registrarAddress, labelhash})
const [bid, deedAddress, registrationDate, value, highestBid] = await registrar.entries(labelhash)
console.log('***lookupDeed2', {label, bid, deedAddress, registrationDate, value, highestBid})
if(bid > 0){
deed = new Contract(deedAddress, abis.deed, provider);
deedOwner = await deed.owner()
Expand Down
16 changes: 8 additions & 8 deletions packages/react-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import App from "./App";
console.log({ENV:process.env})

let stage, reclaimUri, ensUri, registryAddress, registrarAddress
if (process.env.REACT_APP_STAGE === 'live'){
// if (process.env.REACT_APP_STAGE === 'live'){
stage = 'live'
reclaimUri = "https://api.thegraph.com/subgraphs/name/makoto/ens-reclaim-deposit-subgraph"
ensUri = "https://api.thegraph.com/subgraphs/name/ensdomains/ens"
registrarAddress = '0x6090a6e47849629b7245dfa1ca21d94cd15878ef'
registryAddress = '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e'
}else{
stage = 'dev'
reclaimUri = "http://127.0.0.1:8000/subgraphs/name/makoto/ens-reclaim-deposit-subgraph"
ensUri = "http://127.0.0.1:8000/subgraphs/name/graphprotocol/ens"
registrarAddress = '0xA47b9D846D03E74C736D650dfb23D085C773AFCE'
registryAddress = '0x7F90FA6F67Aa366D8ca17d36a1B2E5A06C647151'
}
// }else{
// stage = 'dev'
// reclaimUri = "http://127.0.0.1:8000/subgraphs/name/makoto/ens-reclaim-deposit-subgraph"
// ensUri = "http://127.0.0.1:8000/subgraphs/name/graphprotocol/ens"
// registrarAddress = '0xA47b9D846D03E74C736D650dfb23D085C773AFCE'
// registryAddress = '0x7F90FA6F67Aa366D8ca17d36a1B2E5A06C647151'
// }

const client = new ApolloClient({ uri: reclaimUri });
const ensClient = new ApolloClient({ uri: ensUri });
Expand Down

0 comments on commit 0833cd6

Please sign in to comment.