diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..7a320c3 --- /dev/null +++ b/.github/workflows/checks.yml @@ -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/actions-codespell@v2.0 + 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 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0793aaf --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md index 8750a84..063d8d9 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/kernels/keccak256.cl b/src/kernels/keccak256.cl index 45fb49a..1433913 100644 --- a/src/kernels/keccak256.cl +++ b/src/kernels/keccak256.cl @@ -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, @@ -16,13 +16,11 @@ /** * 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. @@ -30,19 +28,19 @@ /** * 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