From 45bcc826bb5e374eb6b5208e106f8ea672bbd689 Mon Sep 17 00:00:00 2001 From: Sean Billig Date: Tue, 8 Mar 2022 17:27:54 -0800 Subject: [PATCH] Remove bitrotted `fuzz` crate --- fuzz/.gitignore | 4 - fuzz/Cargo.lock | 1375 ----------------------------- fuzz/Cargo.toml | 30 - fuzz/fixtures/fe/erc20.fe | 107 --- fuzz/fixtures/solidity/erc20.sol | 106 --- fuzz/fuzz_targets/erc20_target.rs | 10 - fuzz/src/erc20.rs | 277 ------ fuzz/src/lib.rs | 1 - 8 files changed, 1910 deletions(-) delete mode 100644 fuzz/.gitignore delete mode 100644 fuzz/Cargo.lock delete mode 100644 fuzz/Cargo.toml delete mode 100644 fuzz/fixtures/fe/erc20.fe delete mode 100644 fuzz/fixtures/solidity/erc20.sol delete mode 100644 fuzz/fuzz_targets/erc20_target.rs delete mode 100644 fuzz/src/erc20.rs delete mode 100644 fuzz/src/lib.rs diff --git a/fuzz/.gitignore b/fuzz/.gitignore deleted file mode 100644 index 572e03bdf3..0000000000 --- a/fuzz/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ - -target -corpus -artifacts diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock deleted file mode 100644 index 48abd22b06..0000000000 --- a/fuzz/Cargo.lock +++ /dev/null @@ -1,1375 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - -[[package]] -name = "arbitrary" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237430fd6ed3740afe94eefcc278ae21e050285be882804e0d6e8695f0c94691" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "beef" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "474a626a67200bd107d44179bb3d4fc61891172d11696609264589be6a0e6a43" - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bindgen" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "clap", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "which", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium", -] - -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.4", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "bumpalo" -version = "3.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" - -[[package]] -name = "byte-slice-cast" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0a5e3906bcbf133e33c1d4d95afc664ad37fbdb9f6568d8043e7ea8c27d93d3" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" - -[[package]] -name = "cc" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" - -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clang-sys" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "2.33.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" -dependencies = [ - "ansi_term 0.11.0", - "atty", - "bitflags", - "strsim", - "textwrap", - "unicode-width", - "vec_map", -] - -[[package]] -name = "cmake" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" -dependencies = [ - "cc", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "difference" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array 0.14.4", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "env_logger" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "ethabi" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052a565e3de82944527d6d10a465697e6bb92476b772ca7141080c901f6a63c6" -dependencies = [ - "ethereum-types", - "rustc-hex", - "serde", - "serde_json", - "tiny-keccak 1.5.0", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a6567e6fd35589fea0c63b94b4cf2e55573e413901bdbe60ab15cf0e25e5df" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-rlp", - "impl-serde", - "tiny-keccak 2.0.2", -] - -[[package]] -name = "ethereum" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ea35e1b0845310ade8eb048d401b0b899b8eff05c4d2a3454d29ef4eb1b8af" -dependencies = [ - "ethereum-types", - "hash-db", - "hash256-std-hasher", - "parity-scale-codec", - "rlp 0.4.6", - "rlp-derive", - "serde", - "sha3 0.9.1", - "triehash", -] - -[[package]] -name = "ethereum-types" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473aecff686bd8e7b9db0165cbbb53562376b39bf35b427f0c60446a9e1634b0" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-rlp", - "impl-serde", - "primitive-types", - "uint", -] - -[[package]] -name = "evm" -version = "0.18.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286da2277b078e7033491d62e674eeccd01d913a87bb60ec0cabbcf80ec62e9" -dependencies = [ - "ethereum", - "evm-core", - "evm-gasometer", - "evm-runtime", - "log", - "parity-scale-codec", - "primitive-types", - "rlp 0.4.6", - "serde", - "sha3 0.8.2", -] - -[[package]] -name = "evm-core" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63c6c39300d7779427f461408d867426e202ea72ac7ece2455689ff0e4bddb6f" -dependencies = [ - "parity-scale-codec", - "primitive-types", - "serde", -] - -[[package]] -name = "evm-gasometer" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689c481648c3f45b64b1278077c04284ad535e068c9d6872153c7b74da7ccb03" -dependencies = [ - "evm-core", - "evm-runtime", - "primitive-types", -] - -[[package]] -name = "evm-runtime" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a148ad1b3e0af31aa03c6c3cc9df3a529e279dad8e29b4ef90dccad32601e4" -dependencies = [ - "evm-core", - "primitive-types", - "sha3 0.8.2", -] - -[[package]] -name = "fe-analyzer" -version = "0.5.0-alpha" -dependencies = [ - "ansi_term 0.12.1", - "fe-common", - "fe-parser", - "hex", - "num-bigint", - "num-traits", - "strum", - "vec1", -] - -[[package]] -name = "fe-common" -version = "0.5.0-alpha" -dependencies = [ - "codespan-reporting", - "difference", - "hex", - "num-traits", - "ron", - "serde", - "tiny-keccak 2.0.2", -] - -[[package]] -name = "fe-compiler" -version = "0.5.0-alpha" -dependencies = [ - "ethabi", - "fe-analyzer", - "fe-common", - "fe-parser", - "hex", - "maplit", - "num-bigint", - "once_cell", - "serde", - "serde_json", - "solc", - "vec1", - "yultsur", -] - -[[package]] -name = "fe-compiler-test-utils" -version = "0.4.0-alpha" -dependencies = [ - "ethabi", - "evm", - "evm-runtime", - "fe-common", - "fe-compiler", - "hex", - "primitive-types", - "serde_json", - "solc", - "stringreader", - "yultsur", -] - -[[package]] -name = "fe-fuzzer" -version = "0.4.0-alpha" -dependencies = [ - "bincode", - "ethabi", - "fe-compiler-test-utils", - "libfuzzer-sys", - "serde", - "serde_json", -] - -[[package]] -name = "fe-parser" -version = "0.5.0-alpha" -dependencies = [ - "fe-common", - "if_chain", - "logos", - "serde", - "unescape", - "uuid", - "vec1", - "wasm-bindgen", -] - -[[package]] -name = "fixed-hash" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11498d382790b7a8f2fd211780bec78619bba81cdad3a283997c0c41f836759c" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - -[[package]] -name = "generic-array" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", - "wasm-bindgen", -] - -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - -[[package]] -name = "hash256-std-hasher" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "heck" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "hermit-abi" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "if_chain" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7280c75fb2e2fc47080ec80ccc481376923acb04501957fc38f935c3de5088" - -[[package]] -name = "impl-codec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be51a921b067b0eaca2fad532d9400041561aa922221cc65f95a85641c6bf53" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-rlp" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7a72f11830b52333f36e3b09a288333888bf54380fd0ac0790a3c31ab0f3c5" -dependencies = [ - "rlp 0.4.6", -] - -[[package]] -name = "impl-serde" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47ca4d2b6931707a55fce5cf66aff80e2178c8b63bbb4ecb5695cbc870ddf6f" -dependencies = [ - "serde", -] - -[[package]] -name = "itoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" - -[[package]] -name = "js-sys" -version = "0.3.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9dc6556604b8ad76486563d5a47fad989b643932fa006e76e23d948bef0f5b" -dependencies = [ - "arbitrary", - "cc", -] - -[[package]] -name = "libloading" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" -dependencies = [ - "cfg-if", - "winapi", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "logos" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91c49573597a5d6c094f9031617bb1fed15c0db68c81e6546d313414ce107e4" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-derive" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797b1f8a0571b331c1b47e7db245af3dc634838da7a92b3bef4e30376ae1c347" -dependencies = [ - "beef", - "fnv", - "proc-macro2", - "quote", - "regex-syntax", - "syn", - "utf8-ranges", -] - -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - -[[package]] -name = "memchr" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" - -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check", -] - -[[package]] -name = "num-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d0a3d5e207573f948a9e5376662aa743a2ea13f7c50a554d7af443a73fbfeba" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" - -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "parity-scale-codec" -version = "1.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b26b16c7687c3075982af47719e481815df30bc544f7a6690763a25ca16e9d" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41512944b1faff334a5f1b9447611bf4ef40638ccb6328173dacefb338e878c" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "primitive-types" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd39dcacf71411ba488570da7bbc89b717225e46478b30ba99b92db6b149809" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro2" -version = "1.0.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "rlp" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" -dependencies = [ - "rustc-hex", -] - -[[package]] -name = "rlp" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54369147e3e7796c9b885c7304db87ca3d09a0a98f72843d532868675bbfba8" -dependencies = [ - "bytes", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ron" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5" -dependencies = [ - "base64", - "bitflags", - "serde", -] - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "serde" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.126" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha3" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" -dependencies = [ - "block-buffer 0.7.3", - "byte-tools", - "digest 0.8.1", - "keccak", - "opaque-debug 0.2.3", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug 0.3.0", -] - -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - -[[package]] -name = "solc" -version = "0.1.0" -source = "git+https://github.com/g-r-a-n-t/solc-rust#9ba450f70534fa04d674534a50ae126f59eed163" -dependencies = [ - "bindgen", - "cmake", - "lazy_static", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "stringreader" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "913e7b03d63752f6cdd2df77da36749d82669904798fe8944b9ec3d23f159905" - -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - -[[package]] -name = "strum" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "syn" -version = "1.0.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "tiny-keccak" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d8a021c69bb74a44ccedb824a046447e2c84a01df9e5c20779750acb38e11b2" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde", -] - -[[package]] -name = "triehash" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" -dependencies = [ - "hash-db", - "rlp 0.5.0", -] - -[[package]] -name = "typenum" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f6906492a7cd215bfa4cf595b600146ccfac0c79bcbd1f3000162af5e8b06" - -[[package]] -name = "uint" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db035e67dfaf7edd9aebfe8676afcd63eed53c8a4044fed514c8cccf1835177" -dependencies = [ - "byteorder", - "crunchy", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "unescape" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb97dac3243214f8d8507998906ca3e2e0b900bf9bf4870477f125b82e68f6e" - -[[package]] -name = "unicode-segmentation" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" - -[[package]] -name = "unicode-width" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" - -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - -[[package]] -name = "utf8-ranges" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae116fef2b7fea257ed6440d3cfcff7f190865f170cdad00bb6465bf18ecba" - -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.3", -] - -[[package]] -name = "vec1" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc1631c774f0f9570797191e01247cbefde789eebfbf128074cb934115a6133" -dependencies = [ - "serde", -] - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasm-bindgen" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" -dependencies = [ - "bumpalo", - "lazy_static", - "log", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" - -[[package]] -name = "which" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" -dependencies = [ - "libc", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "yultsur" -version = "0.1.0" -source = "git+https://github.com/g-r-a-n-t/yultsur#6a7c162339cf615b2b2289d84b8bcfe57ffebf55" diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml deleted file mode 100644 index ca09d37143..0000000000 --- a/fuzz/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -authors = ["The Fe Developers "] -edition = "2021" -name = "fe-fuzzer" -publish = false -version = "0.4.0-alpha" - -[package.metadata] -cargo-fuzz = true - -[dependencies] -bincode = "1.3.3" -ethabi = "14.0" -fe-compiler-test-utils = {path = "../test-utils", version = "0.4.0-alpha"} -libfuzzer-sys = "0.4" -serde = {version = "1.0.125", features = ["derive"]} -serde_json = "1.0.64" - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] - -[[bin]] -doc = false -name = "erc20_target" -path = "fuzz_targets/erc20_target.rs" -test = false - -[features] -solc-backend = ["fe-compiler-test-utils/solc-backend"] diff --git a/fuzz/fixtures/fe/erc20.fe b/fuzz/fixtures/fe/erc20.fe deleted file mode 100644 index 57ba78ad7c..0000000000 --- a/fuzz/fixtures/fe/erc20.fe +++ /dev/null @@ -1,107 +0,0 @@ -contract ERC20: - _balances: Map - _allowances: Map> - - _total_supply: u256 - - _name: String<100> - _symbol: String<100> - _decimals: u8 - - event Approval: - idx owner: address - idx spender: address - value: u256 - - event Transfer: - idx from: address - idx to: address - value: u256 - - pub fn __init__(name: String<100>, symbol: String<100>): - self._name = name - self._symbol = symbol - self._decimals = u8(18) - self._mint(msg.sender, 1000000000000000000000000) - - pub fn name() -> String<100>: - return self._name.to_mem() - - pub fn symbol() -> String<100>: - return self._symbol.to_mem() - - pub fn decimals() -> u8: - return self._decimals - - pub fn totalSupply() -> u256: - return self._total_supply - - pub fn balanceOf(account: address) -> u256: - return self._balances[account] - - pub fn transfer(recipient: address, value: u256) -> bool: - self._transfer(msg.sender, recipient, value) - return true - - pub fn allowance(owner: address, spender: address) -> u256: - return self._allowances[owner][spender] - - pub fn approve(spender: address, value: u256) -> bool: - self._approve(msg.sender, spender, value) - return true - - pub fn transferFrom(sender: address, recipient: address, value: u256) -> bool: - assert self._allowances[sender][msg.sender] >= value - - self._transfer(sender, recipient, value) - self._approve(sender, msg.sender, self._allowances[sender][msg.sender] - value) - return true - - pub fn increaseAllowance(spender: address, addedValue: u256) -> bool: - self._approve(msg.sender, spender, self._allowances[msg.sender][spender] + addedValue) - return true - - pub fn decreaseAllowance(spender: address, subtractedValue: u256) -> bool: - self._approve(msg.sender, spender, self._allowances[msg.sender][spender] - subtractedValue) - return true - - fn _transfer(sender: address, recipient: address, value: u256): - assert sender != address(0) - assert recipient != address(0) - - self._before_token_transfer(sender, recipient, value) - - self._balances[sender] = self._balances[sender] - value - self._balances[recipient] = self._balances[recipient] + value - emit Transfer(ctx, from: sender, to: recipient, value: value) - - fn _mint(ctx: Context, account: address, value: u256): - assert account != address(0) - - self._before_token_transfer(address(0), account, value) - - self._total_supply = self._total_supply + value - self._balances[account] = self._balances[account] + value - emit Transfer(ctx, from: address(0), to: account, value: value) - - fn _burn(ctx: Context, account: address, value: u256): - assert account != address(0) - - self._before_token_transfer(account, address(0), value) - - self._balances[account] = self._balances[account] - value - self._total_supply = self._total_supply - value - emit Transfer(ctx, from: account, to: address(0), value) - - fn _approve(ctx: Context, owner: address, spender: address, value: u256): - assert owner != address(0) - assert spender != address(0) - - self._allowances[owner][spender] = value - emit Approval(ctx, owner, spender, value) - - fn _setup_decimals(decimals_: u8): - self._decimals = decimals_ - - fn _before_token_transfer(from: address, to: address, value: u256): - pass diff --git a/fuzz/fixtures/solidity/erc20.sol b/fuzz/fixtures/solidity/erc20.sol deleted file mode 100644 index 0e1b8fafd1..0000000000 --- a/fuzz/fixtures/solidity/erc20.sol +++ /dev/null @@ -1,106 +0,0 @@ -contract ERC20 { - mapping (address => uint256) private _balances; - mapping (address => mapping (address => uint256)) private _allowances; - event Transfer(address indexed from, address indexed to, uint256 value); - event Approval(address indexed owner, address indexed spender, uint256 value); - - uint256 private _totalSupply; - - string private _name; - string private _symbol; - - constructor (string memory name_, string memory symbol_){ - _name = name_; - _symbol = symbol_; - _mint(msg.sender, 1000000000000000000000000); - } - - function name() public view virtual returns (string memory){ - return _name; - } - - function symbol() public view virtual returns (string memory){ - return _symbol; - } - - function decimals() public view virtual returns (uint8){ - return 18; - } - - function totalSupply() public view virtual returns (uint256){ - return _totalSupply; - } - - function balanceOf(address account) public view virtual returns (uint256){ - return _balances[account]; - } - - function transfer(address recipient, uint256 amount) public virtual returns (bool){ - _transfer(msg.sender, recipient, amount); - return true; - } - - function allowance(address owner, address spender) public view virtual returns (uint256){ - return _allowances[owner][spender]; - } - - function approve(address spender, uint256 amount) public virtual returns (bool){ - _approve(msg.sender, spender, amount); - return true; - } - - function transferFrom(address sender, address recipient, uint256 amount) public virtual returns (bool){ - _transfer(sender, recipient, amount); - uint256 currentAllowance = _allowances[sender][msg.sender]; - require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); - _approve(sender, msg.sender, currentAllowance - amount); - return true; - } - - function _transfer(address sender, address recipient, uint256 amount) internal virtual{ - require(sender != address(0), "ERC20: transfer from the zero address"); - require(recipient != address(0), "ERC20: transfer to the zero address"); - - _beforeTokenTransfer(sender, recipient, amount); - - uint256 senderBalance = _balances[sender]; - require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); - _balances[sender] = senderBalance - amount; - _balances[recipient] += amount; - - emit Transfer(sender, recipient, amount); - } - - function _mint(address account, uint256 amount) internal virtual{ - require(account != address(0), "ERC20: mint to the zero address"); - - _beforeTokenTransfer(address(0), account, amount); - - _totalSupply += amount; - _balances[account] += amount; - emit Transfer(address(0), account, amount); - } - - function _burn(address account, uint256 amount) internal virtual{ - require(account != address(0), "ERC20: burn from the zero address"); - - _beforeTokenTransfer(account, address(0), amount); - - uint256 accountBalance = _balances[account]; - require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); - _balances[account] = accountBalance - amount; - _totalSupply -= amount; - - emit Transfer(account, address(0), amount); - } - - function _approve(address owner, address spender, uint256 amount) internal virtual{ - require(owner != address(0), "ERC20: approve from the zero address"); - require(spender != address(0), "ERC20: approve to the zero address"); - - _allowances[owner][spender] = amount; - emit Approval(owner, spender, amount); - } - - function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } -} \ No newline at end of file diff --git a/fuzz/fuzz_targets/erc20_target.rs b/fuzz/fuzz_targets/erc20_target.rs deleted file mode 100644 index 1552092c4c..0000000000 --- a/fuzz/fuzz_targets/erc20_target.rs +++ /dev/null @@ -1,10 +0,0 @@ -#![no_main] -extern crate fe_fuzzer; -use libfuzzer_sys::fuzz_target; - -fuzz_target!(|data: &[u8]| { - fe_fuzzer::erc20::fuzz_fe_erc20_constructor(data); - fe_fuzzer::erc20::fuzz_fe_erc20_transfer(data); - fe_fuzzer::erc20::fuzz_sol_erc20_constructor(data); - fe_fuzzer::erc20::fuzz_sol_erc20_transfer(data) -}); diff --git a/fuzz/src/erc20.rs b/fuzz/src/erc20.rs deleted file mode 100644 index 45b83edd38..0000000000 --- a/fuzz/src/erc20.rs +++ /dev/null @@ -1,277 +0,0 @@ -#![cfg(feature = "solc-backend")] -use fe_compiler_test_utils::*; -use serde::{Deserialize, Serialize}; -// Create fuzz test for the contracts - -const ALICE: &str = DEFAULT_CALLER; -const BOB: &str = "2000000000000000000000000000000000000002"; -const JAMES: &str = "3000000000000000000000000000000000000003"; -const TOTAL_SUPPLY: &str = "1000000000000000000000000"; - -#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)] -pub struct TokenDetails<'a> { - pub name: &'a str, - pub symbol: &'a str, -} - -#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone, Copy)] -pub struct TransferInfo<'a> { - pub to: &'a str, - pub value: u128, -} - -pub fn fe_erc20_constructor(details: TokenDetails) { - if !details.name.is_empty() { - with_executor(&|mut executor| { - let harness = deploy_contract( - &mut executor, - "test-utils/fuzz/fixtures/fe/erc20.fe", // TODO: Need to fix the path - "ERC20", - &[string_token(details.name), string_token(details.symbol)], - ); - erc20_constructor(details, &mut executor, harness); - }); - } -} - -pub fn sol_erc20_constructor(details: TokenDetails) { - if !details.name.is_empty() { - with_executor(&|mut executor| { - let harness = deploy_contract( - &mut executor, - "fuzz/fixtures/solidity/erc20.sol", - "ERC20", - &[string_token(details.name), string_token(details.symbol)], - ); - erc20_constructor(details, &mut executor, harness); - }); - } -} - -pub fn fe_erc20_transfer(info: TransferInfo) { - if info.value - <= TOTAL_SUPPLY - .parse::() - .unwrap_or(1000000000000000000000000) - { - with_executor(&|mut executor| { - let mut harness = deploy_contract( - &mut executor, - "test-utils/fuzz/fixtures/fe/erc20.fe", // TODO: Need to fix the path - "ERC20", - &[string_token("Fe Coin"), string_token("FE")], - ); - erc20_transfer(info, executor, harness); - }); - } -} - -pub fn sol_erc20_transfer(info: TransferInfo) { - if info.value - <= TOTAL_SUPPLY - .parse::() - .unwrap_or(1000000000000000000000000) - { - with_executor(&|mut executor| { - let mut harness = deploy_contract( - &mut executor, - "fuzz/fixtures/solidity/erc20.sol", - "ERC20", - &[string_token("Fe Coin"), string_token("FE")], - ); - erc20_transfer(info, executor, harness); - }); - } -} - -pub fn erc20_constructor(details: TokenDetails, executor: &mut Executor, harness: ContractHarness) { - let token_name = string_token(details.name); - let token_symbol = string_token(details.symbol); - // validate state after init - harness.test_function(executor, "name", &[], Some(&token_name)); - harness.test_function(executor, "symbol", &[], Some(&token_symbol)); - harness.test_function(executor, "decimals", &[], Some(&uint_token(18))); - harness.test_function( - executor, - "totalSupply", - &[], - Some(&uint_token_from_dec_str(TOTAL_SUPPLY)), - ); - harness.test_function( - executor, - "balanceOf", - &[address_token(ALICE)], - Some(&uint_token_from_dec_str(TOTAL_SUPPLY)), - ); -} - -pub fn erc20_transfer(info: TransferInfo, mut executor: Executor, mut harness: ContractHarness) { - let value = uint_token_from_dec_str(&info.value.to_string()); - - harness.test_function( - &mut executor, - "transfer", - &[address_token(info.to), value.clone()], - Some(&bool_token(true)), - ); - harness.test_function( - &mut executor, - "balanceOf", - &[address_token(info.to)], - Some(&value), - ); - harness.test_function( - &mut executor, - "balanceOf", - &[address_token(ALICE)], - Some(&uint_token_from_dec_str( - &(TOTAL_SUPPLY - .parse::() - .unwrap_or(1000000000000000000000000) - - info.value) - .to_string(), - )), - ); - - // Validate transferFrom and approve. - harness.set_caller(address(info.to)); - harness.test_function( - &mut executor, - "approve", - &[address_token(ALICE), value.clone()], - Some(&bool_token(true)), - ); - harness.set_caller(address(ALICE)); - harness.test_function( - &mut executor, - "transferFrom", - &[ - address_token(info.to), - address_token(JAMES), - uint_token_from_dec_str(&(info.value / 2).to_string()), - ], - Some(&bool_token(true)), - ); - harness.test_function( - &mut executor, - "balanceOf", - &[address_token(info.to)], - Some(&uint_token_from_dec_str(&(info.value / 2).to_string())), - ); - harness.test_function( - &mut executor, - "balanceOf", - &[address_token(JAMES)], - Some(&uint_token_from_dec_str(&(info.value / 2).to_string())), - ); - harness.test_function( - &mut executor, - "allowance", - &[address_token(info.to), address_token(ALICE)], - Some(&uint_token_from_dec_str(&(info.value / 2).to_string())), - ); - harness.test_function_reverts( - &mut executor, - "transferFrom", - &[address_token(info.to), address_token(BOB), value.clone()], - &[], - ); - harness.test_function( - &mut executor, - "transferFrom", - &[ - address_token(info.to), - address_token(BOB), - uint_token_from_dec_str(&(info.value / 4).to_string()), - ], - Some(&bool_token(true)), - ); - harness.test_function( - &mut executor, - "balanceOf", - &[address_token(JAMES)], - Some(&uint_token_from_dec_str(&(info.value / 4).to_string())), - ); - - // Validate events - harness.events_emitted( - executor, - &[ - ( - "Transfer", - &[address_token(ALICE), address_token(info.to), value.clone()], - ), - ( - "Transfer", - &[ - address_token(info.to), - address_token(JAMES), - uint_token_from_dec_str(&(info.value / 2).to_string()), - ], - ), - ( - "Transfer", - &[ - address_token(info.to), - address_token(BOB), - uint_token_from_dec_str(&(info.value / 4).to_string()), - ], - ), - ( - "Approval", - &[address_token(info.to), address_token(ALICE), value], - ), - ( - "Approval", - &[ - address_token(ALICE), - address_token(info.to), - uint_token_from_dec_str(&(info.value / 2).to_string()), - ], - ), - ( - "Approval", - &[ - address_token(ALICE), - address_token(info.to), - uint_token_from_dec_str(&(info.value / 4).to_string()), - ], - ), - ], - ); -} - -pub fn data_filter(data: &[u8]) -> Vec { - data.iter() - .filter(|c| c.is_ascii_alphabetic() || c.is_ascii_digit()) - .map(|c| *c) - .collect::>() -} - -pub fn fuzz_fe_erc20_constructor(data: &[u8]) { - let valid_data = data_filter(data); - bincode::deserialize::(&valid_data) - .ok() - .map(fe_erc20_constructor); -} - -pub fn fuzz_sol_erc20_constructor(data: &[u8]) { - let valid_data = data_filter(data); - bincode::deserialize::(&valid_data) - .ok() - .map(sol_erc20_constructor); -} - -pub fn fuzz_fe_erc20_transfer(data: &[u8]) { - let valid_data = data_filter(data); - bincode::deserialize::(&valid_data) - .ok() - .map(fe_erc20_transfer); -} - -pub fn fuzz_sol_erc20_transfer(data: &[u8]) { - let valid_data = data_filter(data); - bincode::deserialize::(&valid_data) - .ok() - .map(sol_erc20_transfer); -} diff --git a/fuzz/src/lib.rs b/fuzz/src/lib.rs deleted file mode 100644 index 8f3777f6bd..0000000000 --- a/fuzz/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod erc20;