-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Into Library and Binary Crates (#7)
This PR refactors `deadbeef` into separate binary and library crates. This makes producing additional `deadbeef` targets (for WASM for example, see #5) possible.
- Loading branch information
Nicholas Rodrigues Lordello
authored
Jun 30, 2023
1 parent
ff7896b
commit 4bb4c51
Showing
10 changed files
with
178 additions
and
85 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
[package] | ||
name = "deadbeef" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
license = "GPL-3.0-or-later" | ||
|
||
[dependencies] | ||
clap = { version = "4", features = ["derive"] } | ||
hex = "0.4" | ||
hex-literal = "0.4" | ||
num_cpus = "1" | ||
rand = { version = "0.8", features = ["small_rng"] } | ||
tiny-keccak = { version = "2", features = ["keccak"] } | ||
[workspace] | ||
members = [ | ||
"cli", | ||
"core", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "deadbeef" | ||
version = "0.1.1" | ||
edition = "2021" | ||
publish = false | ||
license = "GPL-3.0-or-later" | ||
|
||
[dependencies] | ||
clap = { version = "4", features = ["derive"] } | ||
deadbeef-core = { version = "0.1.0", path = "../core" } | ||
hex = "0.4" | ||
num_cpus = "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[package] | ||
name = "deadbeef-core" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
license = "GPL-3.0-or-later" | ||
|
||
[dependencies] | ||
hex = "0.4" | ||
hex-literal = "0.4" | ||
rand = { version = "0.8", features = ["small_rng"] } | ||
tiny-keccak = { version = "2", features = ["keccak"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#[macro_use] | ||
mod address; | ||
mod create2; | ||
mod safe; | ||
|
||
pub use self::{ | ||
address::Address, | ||
safe::{Contracts, Safe, Transaction}, | ||
}; | ||
pub use hex_literal::hex; | ||
use rand::{rngs::SmallRng, Rng as _, SeedableRng as _}; | ||
|
||
/// For the specified Safe parameters | ||
pub fn search(mut safe: Safe, prefix: &[u8]) -> Transaction { | ||
let mut rng = SmallRng::from_entropy(); | ||
while !safe.creation_address().0.starts_with(prefix) { | ||
safe.update_salt_nonce(|n| rng.fill(n)); | ||
} | ||
safe.transaction() | ||
} |
Oops, something went wrong.