Skip to content

Commit

Permalink
Merge pull request #268 from ensdomains/dev
Browse files Browse the repository at this point in the history
Deploy to production - Fix 0x00000
  • Loading branch information
jefflau authored May 6, 2019
2 parents 23a071a + 18a3481 commit cb769c9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/api/registrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,13 @@ export const getPermanentEntry = async name => {
}
try {
const web3 = await getWeb3()
const namehash = web3.utils.sha3(name)
const namehash = web3.utils.soliditySha3({ type: 'string', value: name })
const { permanentRegistrarRead: Registrar } = await getPermanentRegistrar()
const {
permanentRegistrarController: RegistrarController
} = await getPermanentRegistrarController()
// Returns true if name is available
obj.available = await Registrar.available(namehash).call()
obj.available = await RegistrarController.available(name).call()
// This is used for old registrar to figure out when the name can be migrated.
obj.migrationLockPeriod = parseInt(
await Registrar.MIGRATION_LOCK_PERIOD().call()
Expand All @@ -177,6 +180,7 @@ export const getPermanentEntry = async name => {
obj.nameExpires = new Date(nameExpires * 1000)
}
} catch (e) {
console.log('Error getting permanent registrar entry', e)
obj.error = e.message
} finally {
return obj
Expand Down Expand Up @@ -239,7 +243,7 @@ export const transferOwner = async ({ to, name }) => {
const nameArray = name.split('.')
const labelHash = web3.utils.sha3(nameArray[0])
const account = await getAccount()
const { permanentRegistrar: Registrar } = await getPermanentRegistrar()
const { permanentRegistrarRead: Registrar } = await getPermanentRegistrar()
return () =>
Registrar.safeTransferFrom(account, to, labelHash).send({
from: account
Expand Down

0 comments on commit cb769c9

Please sign in to comment.