-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb2d48f
commit 6aea623
Showing
51 changed files
with
3,094 additions
and
598 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 +1 @@ | ||
90.0 | ||
92.0 |
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,5 @@ | ||
target | ||
corpus | ||
artifacts | ||
coverage | ||
Cargo.lock |
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,54 @@ | ||
[package] | ||
name = "tw_evm-fuzz" | ||
version = "0.0.0" | ||
publish = false | ||
edition = "2021" | ||
|
||
[package.metadata] | ||
cargo-fuzz = true | ||
|
||
[dependencies] | ||
libfuzzer-sys = { version = "0.4", features = ["arbitrary-derive"] } | ||
serde_json = "1.0.95" | ||
tw_number = { path = "../../tw_number" } | ||
tw_proto = { path = "../../tw_proto", features = ["fuzz"] } | ||
|
||
[dependencies.tw_evm] | ||
path = ".." | ||
|
||
# Prevent this from interfering with workspaces | ||
[workspace] | ||
members = ["."] | ||
|
||
[profile.release] | ||
debug = 1 | ||
|
||
[[bin]] | ||
name = "abi_encode_function" | ||
path = "fuzz_targets/abi_encode_function.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "abi_decode_value" | ||
path = "fuzz_targets/abi_decode_value.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "abi_function_decode_input" | ||
path = "fuzz_targets/abi_function_decode_input.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "rlp_encode" | ||
path = "fuzz_targets/rlp_encode.rs" | ||
test = false | ||
doc = false | ||
|
||
[[bin]] | ||
name = "sign" | ||
path = "fuzz_targets/sign.rs" | ||
test = false | ||
doc = false |
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_evm::evm_context::StandardEvmContext; | ||
use tw_evm::modules::abi_encoder::AbiEncoder; | ||
use tw_proto::EthereumAbi::Proto; | ||
|
||
fuzz_target!(|input: Proto::ValueDecodingInput<'_>| { | ||
let _ = AbiEncoder::<StandardEvmContext>::decode_value(input); | ||
}); |
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_evm::evm_context::StandardEvmContext; | ||
use tw_evm::modules::abi_encoder::AbiEncoder; | ||
use tw_proto::EthereumAbi::Proto; | ||
|
||
fuzz_target!(|input: Proto::FunctionEncodingInput<'_>| { | ||
let _ = AbiEncoder::<StandardEvmContext>::encode_contract_call(input); | ||
}); |
16 changes: 16 additions & 0 deletions
16
rust/tw_evm/fuzz/fuzz_targets/abi_function_decode_input.rs
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_evm::evm_context::StandardEvmContext; | ||
use tw_evm::modules::abi_encoder::AbiEncoder; | ||
use tw_proto::EthereumAbi::Proto; | ||
|
||
fuzz_target!(|input: Proto::ParamsDecodingInput<'_>| { | ||
let _ = AbiEncoder::<StandardEvmContext>::decode_params(input); | ||
}); |
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_evm::evm_context::StandardEvmContext; | ||
use tw_evm::modules::rlp_encoder::RlpEncoder; | ||
use tw_proto::EthereumRlp::Proto; | ||
|
||
fuzz_target!(|input: Proto::EncodingInput<'_>| { | ||
let _ = RlpEncoder::<StandardEvmContext>::encode_with_proto(input); | ||
}); |
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,16 @@ | ||
// Copyright © 2017-2023 Trust Wallet. | ||
// | ||
// This file is part of Trust. The full Trust copyright notice, including | ||
// terms governing use, modification, and redistribution, is contained in the | ||
// file LICENSE at the root of the source code distribution tree. | ||
|
||
#![no_main] | ||
|
||
use libfuzzer_sys::fuzz_target; | ||
use tw_evm::evm_context::StandardEvmContext; | ||
use tw_evm::modules::signer::Signer; | ||
use tw_proto::Ethereum::Proto; | ||
|
||
fuzz_target!(|input: Proto::SigningInput<'_>| { | ||
let _ = Signer::<StandardEvmContext>::sign_proto(input); | ||
}); |
Oops, something went wrong.