1

I would like for my contracts to have vanity addresses, more specifically to begin with the word "face" such as "0xface...".

I have the following code to deploy a Token, and my problem is deploying it to a Vanity address, with a Vanity address contract as well, instead of a random one.

Here's where I believe it would be done:

contract SimpleToken is StandardToken {

  string public constant name = "FACETOKE";
  string public constant symbol = "FACE";
  uint8 public constant decimals = 18;

  uint256 public constant INITIAL_SUPPLY = 1000000*10**18; // 1 million Face tokens

  function SimpleToken() {
    totalSupply = INITIAL_SUPPLY;
    balances[msg.sender] = INITIAL_SUPPLY;
  }

}

And here is my full current code: https://gist.githubusercontent.com/anonymous/caeff72acbaa144eff23bfbc84912b33/raw/f1fbc2778d9595ebaac6bf5715ef1a6024dae33d/FaceToken.sol

1

Interesting but hard! First of all let's look at [how Ethereum smart contract addresses are created] (How is the address of an Ethereum contract computed?): they only depend on the sender address and it's nonce. So basically you have to trial and error (a lot!). So which of the two are you going to try on? Since you can only increase the nonce by sending a tx that gets mined, which in turn costs you money, you'd rather try and error on the address. You can create a ton of address e.g. like this (warning this is pretty slow, try paralelising massively) and calculate the resulting contract address with nonce 0, 1,...,10 to keep it reasonable. Eventually you'll find one. I'd decouple the contracts and not make one deploy another as that makes it a lot harder. Try finding one address that works first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.