Skip to content

Instantly share code, notes, and snippets.

@ligi
Created February 26, 2022 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ligi/3140a7d25f7baac0bd08e5dd3061ea70 to your computer and use it in GitHub Desktop.
Save ligi/3140a7d25f7baac0bd08e5dd3061ea70 to your computer and use it in GitHub Desktop.
find first contract tx
(1L..Long.MAX_VALUE).forEach { i ->
rpc.getBlockByNumber(BigInteger.valueOf(i))?.transactions?.forEach {
if (it.transaction.to == null) {
println("Found contract tx " + it.transaction.txHash)
return
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment