Deployments: Nonce mining
Overview
It can be really handy to be able to find a nonce value that would lead to a particularly small number of leading zeros on a contract address. This would make it so you would need less bytecode to express that constant in any type of call (PUSH16 instead of PUSH20 uses less gas and code). Here's an example: https://github.com/ProjectOpenSea/seaport#deployments
Specification
acct.deploy(project.MyContract, ..., leading_zeros=8)
This could will hunt for a nonce by doing acct.transfer(acct, 0) a bunch of times until it finds a deployment address with 8 or more leading zeros in the address
Dependencies
N/a
You don't do this by nonce mining, but rather by generating a new keypair.
It's a feature in tools like VanityEth and profanity and it's unlikely a Python implementation would be faster.
You don't do this by nonce mining, but rather by generating a new keypair.
It's a feature in tools like VanityEth and profanity and it's unlikely a Python implementation would be faster.
Ah... Well, maybe this is an idea for an "ephermal accounts" AccountAPI plugin? :thinking:
Like, maybe:
$ ape ephemeral new --leading-zeroes 8 yearn-v3-deployer
# The next contract that `yearn-v3-deployer` deploys will have 8 leading zeros on it's address
Could also add some TornadoCash integration for funding the account