Go to https://remix.ethereum.org and compile the following contract deploying onto a javascript VM instance
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.8.0;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract NameHash {
function nameHash(
string calldata name,
address owner,
uint256 salt
) public pure returns (bytes32) {
return keccak256(abi.encodePacked(name, owner, salt));
}
}
Once deploy you need to call the function nameHash
. name
argument is the name you want, owner
is your ethereum address, or the address you want to have own the name, salt
is any random number.
After you fill in the values and press call
it gives you a namehash
Go to the registrar contract page and connect your web3 client (ie metamask)
https://etherscan.io/address/0x37723287ae6f34866d82ee623401f92ec9013154#writeContract
The registration fee is 10RAD so you need to make sure your account has 10RAD available. You also need to approve the Registrar contract to spend your 10RAD.
To do this go to the RAD token contract https://etherscan.io/token/0x31c8eacbffdd875c74b94b077895bd78cf1e64a3#writeContract
In the spender
argument enter the address of the Registrar contract
0x37723287Ae6F34866d82EE623401f92Ec9013154
In the rawAmount
argument enter in 10 in denominations of wei. Note that entering in the following amount is enough for one registration only, if you want to register more names you will need to increase this number
10000000000000000000
(one registration)20000000000000000000
(two registrations)30000000000000000000
(three registrations)
Fill these values in and click "write"
Expand the commit
function and enter the namehash, clicking write to broadcast the transaction
Wait 10 blocks
On the write contract page expand teh register
function and fill in the values that were used to generate the namehash. These must match the values used to generate the namehash supplied to the commit function or this will not work. Note if you attempt to broadcast the transaction with metamask and you get an error about the tx being rejected it usually means you have to wait more time for the "wait period" to pass. Wait another few minutes and try again