Skip to content

Commit

Permalink
♻️ Tiny Improvements (#2)
Browse files Browse the repository at this point in the history
* 👷 Add CI Pipeline

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 📖 Improve docs

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 📖 sequence

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 👷 Disallow redirects

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 📖 docs

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 📖 Add MIT License

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

* 📖 Adjust License Badge

Signed-off-by: Pascal Marco Caversaccio <[email protected]>

---------

Signed-off-by: Pascal Marco Caversaccio <[email protected]>
  • Loading branch information
pcaversaccio authored Feb 4, 2024
1 parent 0c3df52 commit a8aa9d7
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 15 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: 👮‍♂️ Sanity checks

on: [push, pull_request, workflow_dispatch]

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
prettify:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
node_version:
- 20

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}

- name: Run Prettier
run: npx prettier -c '**/*.{md,yml,yaml}'

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt

- name: Format Rust code
run: cargo fmt --all --check

codespell:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run codespell
uses: codespell-project/[email protected]
with:
check_filenames: true
ignore_words_list: wee
skip: ./.git

validate-links:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
ruby_version:
- 3.3

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true

- name: Install awesome_bot
run: gem install awesome_bot

- name: Validate URLs
run: awesome_bot ./*.md src/*.rs src/**/*.cl --allow-dupe --request-delay 0.4
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Hrik Bhowal

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
# createXcrunch
# `createXcrunch`

createXcrunch is a Rust-based program designed to efficiently find zero-leading, zero-containing, or pattern-matching addresses for the [CreateX](https://github.com/pcaversaccio/createx) contract factory. Uses OpenCL in order to leverage a GPU's mining capabilities.
[![👮‍♂️ Sanity checks](https://github.com/HrikB/createXcrunch/actions/workflows/checks.yml/badge.svg)](https://github.com/HrikB/createXcrunch/actions/workflows/checks.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit/)

`createXcrunch` is a [Rust](https://www.rust-lang.org)-based program designed to efficiently find _zero-leading_, _zero-containing_, or _pattern-matching_ addresses for the [CreateX](https://github.com/pcaversaccio/createx) contract factory. Uses [OpenCL](https://www.khronos.org/opencl/) in order to leverage a GPU's mining capabilities.

## Installation

1. **Clone the Repository**

```
git clone https://github.com/HrikB/createXcrunch
cd createXcrunch
```

2. **Build the Project**

```
cargo build --release
```

> Building on Windows currently fails (see [this](https://github.com/HrikB/createXcrunch/issues/1) issue). If you want to continue using Windows, we recommend using the Windows Subsystem for Linux (WSL) and installing Rust via `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`.
## Usage
```

```console
./target/release/createxcrunch create3 --caller 0x88c6C46EBf353A52Bdbab708c23D0c81dAA8134A
\ --crosschain 1
\ --matching ba5edXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXba5ed
```

Use the `--help` flag for a full overview of all the features and how to use them.
Use the `--help` flag for a full overview of all the features and how to use them:

```console
./target/release/createxcrunch create2 --help
```

or

```console
./target/release/createxcrunch create3 --help
```

## Contributions

PRs welcome!

## Acknowledgements

- https://github.com/0age/create2crunch
- https://github.com/Vectorized/function-selector-miner
- https://github.com/pcaversaccio/createx
20 changes: 9 additions & 11 deletions src/kernels/keccak256.cl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -16,33 +16,31 @@

/**
* Based on the following, with small tweaks and optimizations:
* https://github.com/lwYeo/SoliditySHA3Miner/blob/master/SoliditySHA3Miner/Miner/Kernels/OpenCL/sha3KingKernel.cl
*
* https://github.com/lwYeo/SoliditySHA3Miner/blob/master/SoliditySHA3Miner/
* Miner/Kernels/OpenCL/sha3KingKernel.cl
* Originally modified for OpenCL processing by lwYeo
*
* Originally modified for openCL processing by lwYeo
*
* Original implementor: David Leon Gil
* Original implementer: David Leon Gil
*
* License: CC0, attribution kindly requested. Blame taken too, but not
* liability.
*/

/**
* A generalized GPU kernel template used for mining Ethereum addresses deployed
* through the CreateX contract factory.
* through the CreateX contract factory:
* https://github.com/pcaversaccio/createx
*
* This kernel is modified from two implementations:
* https://github.com/0age/create2crunch/blob/master/src/kernels/keccak256.cl
* This implementation is from create2crunch, however, that keccak implementation
* This implementation is from create2crunch, however, that keccak256 implementation
* is optimized to the point that it only calculates the proper values for the
* last 20 bytes (a partial keccak). This is not sufficient for CreateX which
* performs multiple keccak hashes. However, a partial keccak is used for the
* last 20 bytes (a partial keccak256). This is not sufficient for CreateX which
* performs multiple keccak256 hashes. However, a partial keccak256 is used for the
* last ones.
*
* https://github.com/Vectorized/function-selector-miner/blob/b900660837f5fac66b5837fdaa5b3f93ff1b0ad4/cpp/main.cpp
* This implementation provides a full keccak implementation (although for a
* This implementation provides a full keccak256 implementation (although for a
* different purpose).
*
* h/t https://github.com/Vectorized
Expand Down

0 comments on commit a8aa9d7

Please sign in to comment.