diff --git a/Cargo.lock b/Cargo.lock index 70da7cb..66f9c10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,16 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] +version = 4 [[package]] name = "addr2line" @@ -28,23 +18,889 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] -name = "aes" -version = "0.8.4" +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "alloy" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae58d888221eecf621595e2096836ce7cfc37be06bfa39d7f64aa6a3ea4c9e5b" +dependencies = [ + "alloy-consensus", + "alloy-contract", + "alloy-core", + "alloy-eips", + "alloy-genesis", + "alloy-network", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types", + "alloy-serde", + "alloy-signer", + "alloy-signer-local", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", +] + +[[package]] +name = "alloy-chains" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5674914c2cfdb866c21cb0c09d82374ee39a1395cf512e7515f4c014083b3fff" +dependencies = [ + "alloy-primitives", + "num_enum", + "strum", +] + +[[package]] +name = "alloy-consensus" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73e7f99e3a50210eaee2abd57293a2e72b1a5b7bb251b44c4bf33d02ddd402ab" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-trie", + "alloy-tx-macros", + "auto_impl", + "c-kzg", + "derive_more", + "either", + "k256", + "once_cell", + "rand 0.8.5", + "secp256k1", + "serde", + "serde_with", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-consensus-any" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9945351a277c914f3776ae72b3fc1d22f90d2e840276830e48e9be5bf371a8fe" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-contract" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f27be9e6b587904ee5135f72182a565adaf0c7dd341bae330ee6f0e342822b1" +dependencies = [ + "alloy-consensus", + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-provider", + "alloy-pubsub", + "alloy-rpc-types-eth", + "alloy-sol-types", + "alloy-transport", + "futures", + "futures-util", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-core" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad31216895d27d307369daa1393f5850b50bbbd372478a9fa951c095c210627e" +dependencies = [ + "alloy-dyn-abi", + "alloy-json-abi", + "alloy-primitives", + "alloy-rlp", + "alloy-sol-types", +] + +[[package]] +name = "alloy-dyn-abi" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b95b3deca680efc7e9cba781f1a1db352fa1ea50e6384a514944dcf4419e652" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-type-parser", + "alloy-sol-types", + "itoa", + "serde", + "serde_json", + "winnow 0.7.12", +] + +[[package]] +name = "alloy-eip2124" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "741bdd7499908b3aa0b159bba11e71c8cddd009a2c2eb7a06e825f1ec87900a5" dependencies = [ + "alloy-primitives", + "alloy-rlp", + "crc", + "serde", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-eip2930" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b82752a889170df67bbb36d42ca63c531eb16274f0d7299ae2a680facba17bd" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "serde", +] + +[[package]] +name = "alloy-eip7702" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4769c6ffddca380b0070d71c8b7f30bed375543fe76bb2f74ec0acf4b7cd16" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "k256", + "serde", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-eips" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4134375e533d095e045982cd7684a29c37089ab7a605ecf2b4aa17a5e61d72d3" +dependencies = [ + "alloy-eip2124", + "alloy-eip2930", + "alloy-eip7702", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "auto_impl", + "c-kzg", + "derive_more", + "either", + "serde", + "sha2", +] + +[[package]] +name = "alloy-genesis" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61d58e94791b74c2566a2f240f3f796366e2479d4d39b4a3ec848c733fb92ce" +dependencies = [ + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "alloy-trie", + "serde", + "serde_with", +] + +[[package]] +name = "alloy-json-abi" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15516116086325c157c18261d768a20677f0f699348000ed391d4ad0dcb82530" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-json-rpc" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edaf2255b0ea9213ecbb056fa92870d858719911e04fb4260bcc43f7743d370" +dependencies = [ + "alloy-primitives", + "alloy-sol-types", + "http", + "serde", + "serde_json", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "alloy-network" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c224eafcd1bd4c54cc45b5fc3634ae42722bdb9253780ac64a5deffd794a6cec" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-json-rpc", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rpc-types-any", + "alloy-rpc-types-eth", + "alloy-serde", + "alloy-signer", + "alloy-sol-types", + "async-trait", + "auto_impl", + "derive_more", + "futures-utils-wasm", + "serde", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-network-primitives" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b21283a28b117505a75ee1f2e63c16ea2ea72afca44f670b1f02795d9f5d988" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-primitives" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6177ed26655d4e84e00b65cb494d4e0b8830e7cae7ef5d63087d445a2600fb55" +dependencies = [ + "alloy-rlp", + "bytes", "cfg-if", - "cipher", - "cpufeatures", + "const-hex", + "derive_more", + "foldhash", + "hashbrown 0.15.4", + "indexmap 2.10.0", + "itoa", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.9.1", + "ruint", + "rustc-hash", + "serde", + "sha3", + "tiny-keccak", +] + +[[package]] +name = "alloy-provider" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09e5f02654272d9a95c66949b78f30c87701c232cf8302d4a1dab02957f5a0c1" +dependencies = [ + "alloy-chains", + "alloy-consensus", + "alloy-eips", + "alloy-json-rpc", + "alloy-network", + "alloy-network-primitives", + "alloy-primitives", + "alloy-pubsub", + "alloy-rpc-client", + "alloy-rpc-types-anvil", + "alloy-rpc-types-debug", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-rpc-types-txpool", + "alloy-signer", + "alloy-sol-types", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", + "async-stream", + "async-trait", + "auto_impl", + "dashmap", + "either", + "futures", + "futures-utils-wasm", + "http", + "lru", + "parking_lot", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror 2.0.12", + "tokio", + "tracing", + "url", + "wasmtimer", ] [[package]] -name = "aho-corasick" -version = "1.1.3" +name = "alloy-pubsub" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "08acc8843da1207a80f778bc0ac3e5dc94c2683280fa70ff3090b895d0179537" dependencies = [ - "memchr", + "alloy-json-rpc", + "alloy-primitives", + "alloy-transport", + "bimap", + "futures", + "parking_lot", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "wasmtimer", +] + +[[package]] +name = "alloy-rlp" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" +dependencies = [ + "alloy-rlp-derive", + "arrayvec", + "bytes", +] + +[[package]] +name = "alloy-rlp-derive" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-rpc-client" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c956d223a5fa7ef28af1c6ae41b77ecb95a36d686d5644ee22266f6b517615b4" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "alloy-pubsub", + "alloy-transport", + "alloy-transport-http", + "alloy-transport-ipc", + "alloy-transport-ws", + "async-stream", + "futures", + "pin-project", + "reqwest", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tower", + "tracing", + "tracing-futures", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-rpc-types" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99074f79ad4b188b1049807f8f96637abc3cc019fde53791906edc26bc092a57" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-anvil", + "alloy-rpc-types-engine", + "alloy-rpc-types-eth", + "alloy-rpc-types-trace", + "alloy-rpc-types-txpool", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-anvil" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d34231e06b5f1ad5f274a6ddb3eca8730db5eb868b70a4494a1e4b716b7fe88" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-rpc-types-any" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c13e5081ae6b99a7f4e46c18b80d652440320ff404790932cb8259ec73f596e" +dependencies = [ + "alloy-consensus-any", + "alloy-rpc-types-eth", + "alloy-serde", +] + +[[package]] +name = "alloy-rpc-types-debug" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220aeda799891b518a171d3d640ec310bab2f4d80c3987c9ea089cedd8a67008" +dependencies = [ + "alloy-primitives", + "serde", +] + +[[package]] +name = "alloy-rpc-types-engine" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14796fd8574c77213802b0dc0e85886b5cb27c44e72678ab7d0a4a2d5aee79e9" +dependencies = [ + "alloy-consensus", + "alloy-eips", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "derive_more", + "rand 0.8.5", + "serde", + "strum", +] + +[[package]] +name = "alloy-rpc-types-eth" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bea7326ca6cd6971c58042055a039d5c97a1431e30380d8b4883ad98067c1b5" +dependencies = [ + "alloy-consensus", + "alloy-consensus-any", + "alloy-eips", + "alloy-network-primitives", + "alloy-primitives", + "alloy-rlp", + "alloy-serde", + "alloy-sol-types", + "itertools 0.14.0", + "serde", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-rpc-types-trace" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc92f9dd9e56a9edcfe0c28c0d1898a2c5281a2944d89e2b8a4effeca13823e" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-rpc-types-txpool" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fadc5c919b4e8b3bdcbea2705d63dccb8ed2ce864399d005fed534eefebc8fe4" +dependencies = [ + "alloy-primitives", + "alloy-rpc-types-eth", + "alloy-serde", + "serde", +] + +[[package]] +name = "alloy-serde" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c02a06ae34d2354398dc9d2de0503129c3f0904a3eb791b5d0149f267c2688" +dependencies = [ + "alloy-primitives", + "serde", + "serde_json", +] + +[[package]] +name = "alloy-signer" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2389ec473fc24735896960b1189f1d92177ed53c4e464d285e54ed3483f9cca3" +dependencies = [ + "alloy-primitives", + "async-trait", + "auto_impl", + "either", + "elliptic-curve", + "k256", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-signer-local" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab70b75dee5f4673ace65058927310658c8ffac63a94aa4b973f925bab020367" +dependencies = [ + "alloy-consensus", + "alloy-network", + "alloy-primitives", + "alloy-signer", + "async-trait", + "k256", + "rand 0.8.5", + "thiserror 2.0.12", +] + +[[package]] +name = "alloy-sol-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a14f21d053aea4c6630687c2f4ad614bed4c81e14737a9b904798b24f30ea849" +dependencies = [ + "alloy-sol-macro-expander", + "alloy-sol-macro-input", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "alloy-sol-macro-expander" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34d99282e7c9ef14eb62727981a985a01869e586d1dec729d3bb33679094c100" +dependencies = [ + "alloy-json-abi", + "alloy-sol-macro-input", + "const-hex", + "heck", + "indexmap 2.10.0", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn 2.0.104", + "syn-solidity", + "tiny-keccak", +] + +[[package]] +name = "alloy-sol-macro-input" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eda029f955b78e493360ee1d7bd11e1ab9f2a220a5715449babc79d6d0a01105" +dependencies = [ + "alloy-json-abi", + "const-hex", + "dunce", + "heck", + "macro-string", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.104", + "syn-solidity", +] + +[[package]] +name = "alloy-sol-type-parser" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10db1bd7baa35bc8d4a1b07efbf734e73e5ba09f2580fb8cee3483a36087ceb2" +dependencies = [ + "serde", + "winnow 0.7.12", +] + +[[package]] +name = "alloy-sol-types" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58377025a47d8b8426b3e4846a251f2c1991033b27f517aade368146f6ab1dfe" +dependencies = [ + "alloy-json-abi", + "alloy-primitives", + "alloy-sol-macro", + "serde", +] + +[[package]] +name = "alloy-transport" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b99ffb19be54a61d18599843ef887ddd12c3b713244462c184e2eab67106d51a" +dependencies = [ + "alloy-json-rpc", + "alloy-primitives", + "base64", + "derive_more", + "futures", + "futures-utils-wasm", + "parking_lot", + "serde", + "serde_json", + "thiserror 2.0.12", + "tokio", + "tower", + "tracing", + "url", + "wasmtimer", +] + +[[package]] +name = "alloy-transport-http" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92b5a640491f3ab18d17bd6e521c64744041cd86f741b25cdb6a346ca0e90c66" +dependencies = [ + "alloy-json-rpc", + "alloy-transport", + "reqwest", + "serde_json", + "tower", + "tracing", + "url", +] + +[[package]] +name = "alloy-transport-ipc" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17fe2576d9689409724f7cb737aa7fdd70674edfec4b9c3ce54f6ffac00e83ca" +dependencies = [ + "alloy-json-rpc", + "alloy-pubsub", + "alloy-transport", + "bytes", + "futures", + "interprocess", + "pin-project", + "serde", + "serde_json", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "alloy-transport-ws" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4816ea8425e789057d08804452eff399204808b7b7a233ac3f7534183cae2236" +dependencies = [ + "alloy-pubsub", + "alloy-transport", + "futures", + "http", + "rustls", + "serde_json", + "tokio", + "tokio-tungstenite", + "tracing", + "ws_stream_wasm", +] + +[[package]] +name = "alloy-trie" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bada1fc392a33665de0dc50d401a3701b62583c655e3522a323490a5da016962" +dependencies = [ + "alloy-primitives", + "alloy-rlp", + "arrayvec", + "derive_more", + "nybbles", + "serde", + "smallvec", + "tracing", +] + +[[package]] +name = "alloy-tx-macros" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afd621a9ddef2fdc06d17089f45e47cf84d0b46ca5a1bc6c83807c9119636f52" +dependencies = [ + "alloy-primitives", + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm 0.3.0", + "ark-ff-macros 0.3.0", + "ark-serialize 0.3.0", + "ark-std 0.3.0", + "derivative", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm 0.4.2", + "ark-ff-macros 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version 0.4.0", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std 0.3.0", + "digest 0.9.0", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", ] [[package]] @@ -52,14 +908,30 @@ name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +dependencies = [ + "serde", +] [[package]] -name = "ascii-canvas" -version = "3.0.0" +name = "async-stream" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ - "term", + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -70,7 +942,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -81,16 +953,16 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version", + "rustc_version 0.4.0", ] [[package]] name = "attack" version = "0.1.0" dependencies = [ + "alloy", "async-trait", "ctf", - "ethers", "eyre", "serde", "tokio", @@ -104,7 +976,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -136,15 +1008,9 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -153,37 +1019,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] -name = "bech32" -version = "0.9.1" +name = "bimap" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" [[package]] -name = "bitflags" -version = "1.3.2" +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative", +] [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -207,13 +1083,15 @@ dependencies = [ ] [[package]] -name = "bs58" -version = "0.5.1" +name = "blst" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +checksum = "4fd49896f12ac9b6dcd7a5998466b9b58263a695a3dd1ecc1aaca2e12a90b080" dependencies = [ - "sha2", - "tinyvec", + "cc", + "glob", + "threadpool", + "zeroize", ] [[package]] @@ -236,75 +1114,35 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] [[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" +name = "c-kzg" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "7318cfa722931cb5fe0838b98d3ce5621e75f6a6408abc21721d80de9223f2e4" dependencies = [ + "blst", "cc", + "glob", + "hex", "libc", - "pkg-config", -] - -[[package]] -name = "camino" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver", + "once_cell", "serde", - "serde_json", - "thiserror", ] [[package]] name = "cc" -version = "1.1.0" +version = "1.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" +checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362" dependencies = [ - "jobserver", - "libc", - "once_cell", + "shlex", ] [[package]] @@ -319,76 +1157,18 @@ version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ + "android-tzdata", + "iana-time-zone", "num-traits", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "coins-bip32" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" -dependencies = [ - "bs58", - "coins-core", - "digest", - "hmac", - "k256", - "serde", - "sha2", - "thiserror", -] - -[[package]] -name = "coins-bip39" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" -dependencies = [ - "bitvec", - "coins-bip32", - "hmac", - "once_cell", - "pbkdf2 0.12.2", - "rand", - "sha2", - "thiserror", -] - -[[package]] -name = "coins-core" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" -dependencies = [ - "base64 0.21.7", - "bech32", - "bs58", - "digest", - "generic-array", - "hex", - "ripemd", "serde", - "serde_derive", - "sha2", - "sha3", - "thiserror", + "windows-targets 0.52.6", ] [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" dependencies = [ "cfg-if", "cpufeatures", @@ -403,12 +1183,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "core-foundation" version = "0.9.4" @@ -435,32 +1209,19 @@ dependencies = [ ] [[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" +name = "crc" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "crc-catalog", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "crc-catalog" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crossbeam-utils" @@ -481,7 +1242,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -500,527 +1261,219 @@ dependencies = [ name = "ctf" version = "0.1.0" dependencies = [ + "alloy", "async-trait", - "ethers", "eyre", - "rand", + "rand 0.8.5", "serde", "serde_json", "tokio", ] [[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "data-encoding" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" +name = "darling" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "powerfmt", + "darling_core", + "darling_macro", ] [[package]] -name = "derive_more" -version = "0.99.18" +name = "darling_core" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ + "fnv", + "ident_case", "proc-macro2", "quote", - "syn 2.0.70", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer", - "const-oid", - "crypto-common", - "subtle", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - -[[package]] -name = "ecdsa" -version = "0.16.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "rfc6979", - "signature", - "spki", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "elliptic-curve" -version = "0.13.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", + "strsim", + "syn 2.0.104", ] [[package]] -name = "ena" -version = "0.14.3" +name = "darling_macro" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "log", + "darling_core", + "quote", + "syn 2.0.104", ] [[package]] -name = "encoding_rs" -version = "0.8.34" +name = "dashmap" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if", -] - -[[package]] -name = "enr" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256", - "log", - "rand", - "rlp", - "serde", - "sha3", - "zeroize", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "eth-keystore" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" -dependencies = [ - "aes", - "ctr", - "digest", - "hex", - "hmac", - "pbkdf2 0.11.0", - "rand", - "scrypt", - "serde", - "serde_json", - "sha2", - "sha3", - "thiserror", - "uuid", -] - -[[package]] -name = "ethabi" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" -dependencies = [ - "ethereum-types", - "hex", + "crossbeam-utils", + "hashbrown 0.14.5", + "lock_api", "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", + "parking_lot_core", ] [[package]] -name = "ethereum-types" -version = "0.14.1" +name = "data-encoding" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] -name = "ethers" -version = "2.0.14" +name = "der" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", + "const-oid", + "zeroize", ] [[package]] -name = "ethers-addressbook" -version = "2.0.14" +name = "deranged" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ - "ethers-core", - "once_cell", + "powerfmt", "serde", - "serde_json", ] [[package]] -name = "ethers-contract" -version = "2.0.14" +name = "derivative" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project", - "serde", - "serde_json", - "thiserror", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] -name = "ethers-contract-abigen" -version = "2.0.14" +name = "derive_more" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "syn 2.0.70", - "toml", - "walkdir", + "derive_more-impl", ] [[package]] -name = "ethers-contract-derive" -version = "2.0.14" +name = "derive_more-impl" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", "proc-macro2", "quote", - "serde_json", - "syn 2.0.70", + "syn 2.0.104", + "unicode-xid", ] [[package]] -name = "ethers-core" -version = "2.0.14" +name = "digest" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "arrayvec", - "bytes", - "cargo_metadata", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", "generic-array", - "k256", - "num_enum", - "once_cell", - "open-fastrlp", - "rand", - "rlp", - "serde", - "serde_json", - "strum", - "syn 2.0.70", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", ] [[package]] -name = "ethers-etherscan" -version = "2.0.14" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "chrono", - "ethers-core", - "reqwest", - "semver", - "serde", - "serde_json", - "thiserror", - "tracing", + "block-buffer", + "const-oid", + "crypto-common", + "subtle", ] [[package]] -name = "ethers-middleware" -version = "2.0.14" +name = "doctest-file" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac81fa3e28d21450aa4d2ac065992ba96a1d7303efbce51a95f4fd175b67562" + +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "ecdsa" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", + "signature", + "spki", ] [[package]] -name = "ethers-providers" -version = "2.0.14" +name = "either" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest", "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", ] [[package]] -name = "ethers-signers" -version = "2.0.14" +name = "elliptic-curve" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "async-trait", - "coins-bip32", - "coins-bip39", - "const-hex", - "elliptic-curve", - "eth-keystore", - "ethers-core", - "rand", - "sha2", - "thiserror", - "tracing", + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", ] [[package]] -name = "ethers-solc" -version = "2.0.14" +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cfg-if", - "const-hex", - "dirs", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", + "libc", + "windows-sys 0.52.0", ] [[package]] @@ -1039,13 +1492,35 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "fastrlp" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -1056,32 +1531,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] [[package]] -name = "fixedbitset" -version = "0.4.2" +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] -name = "flate2" -version = "1.0.30" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "crc32fast", - "miniz_oxide", + "foreign-types-shared", ] [[package]] -name = "fnv" -version = "1.0.7" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" @@ -1092,16 +1572,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" @@ -1156,16 +1626,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] - [[package]] name = "futures-macro" version = "0.3.30" @@ -1174,7 +1634,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -1189,16 +1649,6 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] - [[package]] name = "futures-util" version = "0.3.30" @@ -1218,13 +1668,10 @@ dependencies = [ ] [[package]] -name = "fxhash" -version = "0.2.1" +name = "futures-utils-wasm" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] +checksum = "42012b0f064e01aa58b545fe3727f90f7dd4020f4a3ea735b50344965f5a57e9" [[package]] name = "generic-array" @@ -1245,7 +1692,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -1260,48 +1719,23 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", + "ff", + "rand_core 0.6.4", + "subtle", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "hashbrown" version = "0.14.5" @@ -1309,12 +1743,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] -name = "hashers" -version = "1.0.1" +name = "hashbrown" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ - "fxhash", + "allocator-api2", + "equivalent", + "foldhash", + "serde", ] [[package]] @@ -1334,30 +1771,33 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] -name = "hmac" -version = "0.12.1" +name = "hex-conservative" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" dependencies = [ - "digest", + "arrayvec", ] [[package]] -name = "home" -version = "0.5.9" +name = "hmac" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "windows-sys 0.52.0", + "digest 0.10.7", ] [[package]] name = "http" -version = "0.2.12" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -1366,12 +1806,24 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.6" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", + "futures-core", "http", + "http-body", "pin-project-lite", ] @@ -1381,85 +1833,107 @@ version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "hyper" -version = "0.14.29" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", - "futures-core", "futures-util", - "h2", "http", "http-body", "httparse", - "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] -name = "hyper-rustls" -version = "0.24.2" +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ + "bytes", + "futures-channel", "futures-util", "http", + "http-body", "hyper", - "rustls", + "pin-project-lite", + "socket2", "tokio", - "tokio-rustls", + "tower-service", + "tracing", ] [[package]] -name = "idna" -version = "0.5.0" +name = "iana-time-zone" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", ] [[package]] -name = "impl-codec" -version = "0.6.0" +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "parity-scale-codec", + "cc", ] [[package]] -name = "impl-rlp" -version = "0.3.0" +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "rlp", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "impl-serde" -version = "0.4.0" +name = "impl-codec" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" dependencies = [ - "serde", + "parity-scale-codec", ] [[package]] @@ -1481,30 +1955,39 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "2.2.6" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ - "equivalent", - "hashbrown", + "autocfg", + "hashbrown 0.12.3", + "serde", ] [[package]] -name = "inout" -version = "0.1.3" +name = "indexmap" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" dependencies = [ - "generic-array", + "equivalent", + "hashbrown 0.15.4", + "serde", ] [[package]] -name = "instant" -version = "0.1.13" +name = "interprocess" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" dependencies = [ - "cfg-if", + "doctest-file", + "futures-core", + "libc", + "recvmsg", + "tokio", + "widestring", + "windows-sys 0.52.0", ] [[package]] @@ -1515,27 +1998,27 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "itertools" -version = "0.11.0" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] [[package]] -name = "itoa" -version = "1.0.11" +name = "itertools" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] [[package]] -name = "jobserver" -version = "0.1.31" +name = "itoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" -dependencies = [ - "libc", -] +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" @@ -1546,20 +2029,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - [[package]] name = "k256" version = "0.13.3" @@ -1570,8 +2039,8 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2", - "signature", ] [[package]] @@ -1584,33 +2053,13 @@ dependencies = [ ] [[package]] -name = "lalrpop" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" -dependencies = [ - "ascii-canvas", - "bit-set", - "ena", - "itertools", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", - "walkdir", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.2" +name = "keccak-asm" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ - "regex-automata", + "digest 0.10.7", + "sha3-asm", ] [[package]] @@ -1631,16 +2080,6 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -1664,13 +2103,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] -name = "md-5" -version = "0.10.6" +name = "lru" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" dependencies = [ - "cfg-if", - "digest", + "hashbrown 0.15.4", +] + +[[package]] +name = "macro-string" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b27834086c65ec3f9387b096d66e99f221cf081c2b738042aa252bcd41204e3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -1701,15 +2150,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] [[package]] -name = "new_debug_unreachable" -version = "1.0.6" +name = "native-tls" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] [[package]] name = "num-bigint" @@ -1771,10 +2231,23 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", +] + +[[package]] +name = "nybbles" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "675b3a54e5b12af997abc8b6638b0aee51a28caedab70d4967e0d5db3a3f1d06" +dependencies = [ + "alloy-rlp", + "cfg-if", + "proptest", + "ruint", + "serde", + "smallvec", ] [[package]] @@ -1788,40 +2261,53 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] -name = "open-fastrlp" -version = "0.1.4" +name = "openssl" +version = "0.10.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", ] [[package]] -name = "open-fastrlp-derive" +name = "openssl-macros" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "bytes", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.104", ] [[package]] -name = "option-ext" -version = "0.2.0" +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] [[package]] name = "parity-scale-codec" @@ -1873,52 +2359,10 @@ dependencies = [ ] [[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] - -[[package]] -name = "pem" -version = "1.1.1" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -1927,74 +2371,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "petgraph" -version = "0.6.5" +name = "pest" +version = "2.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_macros", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared 0.11.2", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator", - "phf_shared 0.11.2", - "proc-macro2", - "quote", - "syn 2.0.70", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", + "memchr", + "thiserror 2.0.12", + "ucd-trie", ] [[package]] -name = "phf_shared" -version = "0.11.2" +name = "pharos" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ - "siphasher", + "futures", + "rustc_version 0.4.0", ] [[package]] @@ -2014,7 +2408,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -2057,22 +2451,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.70", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -2081,9 +2459,6 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", "uint", ] @@ -2093,34 +2468,66 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "6fcdab19deb5195a31cf7726a210015ff1496ba1464fd42cb4f537b8b01b471f" dependencies = [ - "bitflags 2.6.0", + "bit-set", + "bit-vec", + "bitflags", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.9.1", + "rand_chacha 0.9.0", "rand_xorshift", "regex-syntax", + "rusty-fork", + "tempfile", "unarray", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.36" @@ -2130,6 +2537,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + [[package]] name = "radium" version = "0.7.0" @@ -2143,8 +2556,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", + "serde", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "serde", ] [[package]] @@ -2154,7 +2579,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", ] [[package]] @@ -2163,37 +2598,33 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] -name = "rand_xorshift" -version = "0.3.0" +name = "rand_core" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "rand_core", + "getrandom 0.3.3", + "serde", ] [[package]] -name = "rayon" -version = "1.10.0" +name = "rand_xorshift" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "513962919efc330f829edb2535844d1b912b0fbe2ca165d613e4e8788bb05a5a" dependencies = [ - "either", - "rayon-core", + "rand_core 0.9.3", ] [[package]] -name = "rayon-core" -version = "1.12.1" +name = "recvmsg" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] +checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" @@ -2201,41 +2632,27 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "redox_users" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" -dependencies = [ - "getrandom", - "libredox", - "thiserror", + "bitflags", ] [[package]] -name = "regex" -version = "1.10.5" +name = "ref-cast" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", + "ref-cast-impl", ] [[package]] -name = "regex-automata" -version = "0.4.7" +name = "ref-cast-impl" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -2246,43 +2663,42 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ - "base64 0.21.7", + "base64", "bytes", - "encoding_rs", "futures-core", "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", - "hyper-rustls", + "hyper-tls", + "hyper-util", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-rustls", + "tokio-native-tls", + "tower", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", + "windows-registry", ] [[package]] @@ -2295,21 +2711,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -2318,22 +2719,13 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest", -] - [[package]] name = "rlp" version = "0.5.2" @@ -2341,40 +2733,76 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", - "rlp-derive", "rustc-hex", ] [[package]] -name = "rlp-derive" -version = "0.1.0" +name = "ruint" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +checksum = "11256b5fe8c68f56ac6f39ef0720e592f33d2367a4782740d9c9142e889c7fb4" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "alloy-rlp", + "ark-ff 0.3.0", + "ark-ff 0.4.2", + "bytes", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint", + "num-integer", + "num-traits", + "parity-scale-codec", + "primitive-types", + "proptest", + "rand 0.8.5", + "rand 0.9.1", + "rlp", + "ruint-macro", + "serde", + "valuable", + "zeroize", ] +[[package]] +name = "ruint-macro" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" + [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] @@ -2383,7 +2811,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.6.0", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -2392,33 +2820,45 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" dependencies = [ - "log", - "ring 0.17.8", + "once_cell", + "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ - "base64 0.21.7", + "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.101.7" +version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "rustls-pki-types", + "untrusted", ] [[package]] @@ -2427,6 +2867,18 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +[[package]] +name = "rusty-fork" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" +dependencies = [ + "fnv", + "quick-error", + "tempfile", + "wait-timeout", +] + [[package]] name = "ryu" version = "1.0.18" @@ -2434,103 +2886,126 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] -name = "salsa20" -version = "0.10.2" +name = "schannel" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "cipher", + "windows-sys 0.59.0", ] [[package]] -name = "same-file" -version = "1.0.6" +name = "schemars" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" dependencies = [ - "winapi-util", + "dyn-clone", + "ref-cast", + "serde", + "serde_json", ] [[package]] -name = "scale-info" -version = "2.11.3" +name = "schemars" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca070c12893629e2cc820a9761bedf6ce1dcddc9852984d1dc734b8bd9bd024" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" dependencies = [ - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", + "dyn-clone", + "ref-cast", + "serde", + "serde_json", ] [[package]] -name = "scale-info-derive" -version = "2.11.3" +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "secp256k1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "secp256k1-sys", + "serde", +] [[package]] -name = "scrypt" -version = "0.10.0" +name = "secp256k1-sys" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ - "hmac", - "pbkdf2 0.11.0", - "salsa20", - "sha2", + "cc", ] [[package]] -name = "sct" -version = "0.7.1" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] -name = "sec1" -version = "0.7.3" +name = "security-framework-sys" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", + "core-foundation-sys", + "libc", ] [[package]] name = "semver" -version = "1.0.23" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "serde", + "semver-parser", ] [[package]] -name = "send_wrapper" -version = "0.4.0" +name = "semver" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" + +[[package]] +name = "semver-parser" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] [[package]] name = "send_wrapper" @@ -2555,29 +3030,21 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] -[[package]] -name = "serde_spanned" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" -dependencies = [ - "serde", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2590,6 +3057,48 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha1" version = "0.10.6" @@ -2598,7 +3107,7 @@ checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -2609,7 +3118,7 @@ checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", - "digest", + "digest 0.10.7", ] [[package]] @@ -2618,38 +3127,36 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "digest", + "digest 0.10.7", "keccak", ] [[package]] -name = "signature" -version = "2.2.0" +name = "sha3-asm" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ - "digest", - "rand_core", + "cc", + "cfg-if", ] [[package]] -name = "simple_asn1" -version = "0.6.2" +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", + "digest 0.10.7", + "rand_core 0.6.4", ] -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "slab" version = "0.4.9" @@ -2664,6 +3171,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "socket2" @@ -2675,26 +3185,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "solang-parser" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" -dependencies = [ - "itertools", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -2718,38 +3208,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "string_cache" -version = "0.8.7" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", -] +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.3" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" dependencies = [ "strum_macros", ] [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -2758,26 +3241,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "svm-rs" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" -dependencies = [ - "dirs", - "fs2", - "hex", - "once_cell", - "reqwest", - "semver", - "serde", - "serde_json", - "sha2", - "thiserror", - "url", - "zip", -] - [[package]] name = "syn" version = "1.0.109" @@ -2791,9 +3254,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.70" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -2801,30 +3264,24 @@ dependencies = [ ] [[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "system-configuration" -version = "0.5.1" +name = "syn-solidity" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "b9ac494e7266fcdd2ad80bf4375d55d27a117ea5c866c26d0e97fe5b3caeeb75" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", + "paste", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ - "core-foundation-sys", - "libc", + "futures-core", ] [[package]] @@ -2846,23 +3303,21 @@ dependencies = [ ] [[package]] -name = "term" -version = "0.7.0" +name = "thiserror" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ - "dirs-next", - "rustversion", - "winapi", + "thiserror-impl 1.0.61", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.12", ] [[package]] @@ -2873,7 +3328,27 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", ] [[package]] @@ -2956,32 +3431,55 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "7a9daff607c6d2bf6c16fd681ccb7eecc83e4e2cdc1ca067ffaadfca5de7f084" dependencies = [ "futures-util", "log", "rustls", + "rustls-pki-types", "tokio", "tokio-rustls", "tungstenite", - "webpki-roots", + "webpki-roots 0.26.11", ] [[package]] @@ -2997,26 +3495,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "toml" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.22.15", -] - [[package]] name = "toml_datetime" version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" -dependencies = [ - "serde", -] [[package]] name = "toml_edit" @@ -3024,29 +3507,37 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap", + "indexmap 2.10.0", "toml_datetime", "winnow 0.5.40", ] [[package]] -name = "toml_edit" -version = "0.22.15" +name = "tower" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow 0.6.13", + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", ] +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3067,7 +3558,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", ] [[package]] @@ -3085,6 +3576,8 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ + "futures", + "futures-task", "pin-project", "tracing", ] @@ -3097,21 +3590,20 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "4793cb5e56680ecbb1d843515b23b6de9a75eb04b66643e256a396d43be33c13" dependencies = [ - "byteorder", "bytes", "data-encoding", "http", "httparse", "log", - "rand", + "rand 0.9.1", "rustls", + "rustls-pki-types", "sha1", - "thiserror", - "url", + "thiserror 2.0.12", "utf-8", ] @@ -3121,6 +3613,12 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uint" version = "0.9.5" @@ -3166,12 +3664,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -3196,14 +3688,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] -name = "uuid" -version = "0.8.2" +name = "valuable" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom", - "serde", -] +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" @@ -3212,13 +3706,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "walkdir" -version = "2.5.0" +name = "wait-timeout" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ - "same-file", - "winapi-util", + "libc", ] [[package]] @@ -3236,6 +3729,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -3257,7 +3759,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -3291,7 +3793,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.70", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3302,6 +3804,20 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "wasmtimer" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8d49b5d6c64e8558d9b1b065014426f35c18de636895d24893dbbd329743446" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.69" @@ -3314,40 +3830,116 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.4" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.1", +] [[package]] -name = "winapi" -version = "0.3.9" +name = "webpki-roots" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "8782dd5a41a24eed3a4f40b606249b3e236ca61adf1f25ea4d45c73de122b502" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "rustls-pki-types", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "widestring" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" [[package]] -name = "winapi-util" -version = "0.1.8" +name = "windows-core" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-sys 0.52.0", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result 0.3.4", + "windows-strings 0.4.2", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result 0.2.0", + "windows-strings 0.1.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] [[package]] name = "windows-sys" @@ -3367,6 +3959,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -3499,21 +4100,20 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.13" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "f3edebf492c8125044983378ecb5766203ad3b4c2f7a922bd7dd207f6d443e95" dependencies = [ "memchr", ] [[package]] -name = "winreg" -version = "0.50.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "bitflags", ] [[package]] @@ -3527,9 +4127,9 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version", - "send_wrapper 0.6.0", - "thiserror", + "rustc_version 0.4.0", + "send_wrapper", + "thiserror 1.0.61", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -3544,63 +4144,22 @@ dependencies = [ "tap", ] -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ - "libc", - "zstd-sys", + "zeroize_derive", ] [[package]] -name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +name = "zeroize_derive" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "cc", - "pkg-config", + "proc-macro2", + "quote", + "syn 2.0.104", ] diff --git a/Cargo.toml b/Cargo.toml index 2c98c8d..bbdf822 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ exclude = [".github/", "**/tests/", "**/contracts/", "**/cache/", "**/out/"] [workspace.dependencies] async-trait = "0.1.81" -ethers = "2.0.14" +alloy = { version = "1.0", features = ["full"] } eyre = "0.6" rand = "0.8.5" serde = "1.0.204" diff --git a/attack/Cargo.toml b/attack/Cargo.toml index 13d0595..91ce97c 100644 --- a/attack/Cargo.toml +++ b/attack/Cargo.toml @@ -9,7 +9,7 @@ resolver = "2" ctf.path = "../ctf" async-trait.workspace = true -ethers.workspace = true +alloy.workspace = true eyre.workspace = true serde.workspace = true tokio.workspace = true diff --git a/attack/src/ethernaut/hack01_fallback.rs b/attack/src/ethernaut/hack01_fallback.rs index 75cd140..4d5d823 100644 --- a/attack/src/ethernaut/hack01_fallback.rs +++ b/attack/src/ethernaut/hack01_fallback.rs @@ -1,6 +1,6 @@ +use alloy::{primitives::U256, rpc::types::TransactionRequest}; use async_trait::async_trait; use ctf::ethernaut::lvl01_fallback::*; -use ethers::prelude::*; pub(crate) struct Exploit; @@ -13,22 +13,29 @@ impl ctf::Exploit for Exploit { target: &Self::Target, offender: &ctf::Actor, ) -> eyre::Result<()> { - let contract = Fallback::new(target.address, offender.clone()); + let contract = Fallback::new(target.address, offender); println!("Calling contribute()..."); - contract.contribute().value(1).send().await?.await?; - - println!("Calling receive()..."); - offender - .send_transaction( - TransactionRequest::new().to(contract.address()).value(1), - None, - ) + let receipt = contract + .contribute() + .value(U256::from(1)) + .send() .await? + .get_receipt() .await?; + println!("Contribute tx: {:?}", receipt.transaction_hash); + + println!("Calling receive()..."); + let tx = TransactionRequest::default() + .to(contract.address()) + .value(U256::from(1)); + let receipt = + offender.send_transaction(tx).await?.get_receipt().await?; + println!("Receive tx: {:?}", receipt.transaction_hash); println!("Calling withdraw()..."); - contract.withdraw().send().await?.await?; + let receipt = contract.withdraw().send().await?.get_receipt().await?; + println!("Withdraw tx: {:?}", receipt.transaction_hash); Ok(()) } diff --git a/attack/src/ethernaut/mod.rs b/attack/src/ethernaut/mod.rs index b0f681f..b9a75f0 100644 --- a/attack/src/ethernaut/mod.rs +++ b/attack/src/ethernaut/mod.rs @@ -3,16 +3,13 @@ pub mod hack01_fallback; #[cfg(test)] mod tests { use super::*; - use ethers::prelude::*; use hack01_fallback as hack01; #[tokio::test] async fn test() -> eyre::Result<()> { - let provider = Provider::::try_from("http://127.0.0.1:8545")?; - println!("Initializing accounts..."); - let roles = ctf::Roles::new(provider)?; + let roles = ctf::Roles::new("http://127.0.0.1:8545").await?; ctf::check_exploit(&roles, hack01::Exploit).await?; diff --git a/attack/src/roles.rs b/attack/src/roles.rs index 5b5d2c3..dbae290 100644 --- a/attack/src/roles.rs +++ b/attack/src/roles.rs @@ -1,43 +1,64 @@ -use ethers::prelude::*; +use alloy::{ + providers::{ProviderBuilder, RootProvider}, + network::Ethereum, + signers::{local::PrivateKeySigner, wallet::EthereumWallet}, + transports::http::{Http, Client}, + primitives::Address, +}; use std::sync::Arc; -pub type Actor = Arc, LocalWallet>>; +pub type Actor = Arc>>; #[derive(Debug, Clone)] pub struct Roles { pub deployer: Actor, - pub some_user: Actor, + pub deployer_address: Address, + pub some_user: Actor, + pub some_user_address: Address, pub offender: Actor, + pub offender_address: Address, } impl Roles { - pub fn new() -> eyre::Result { - let provider = Provider::::try_from("http://localhost:8545")?; + pub async fn new() -> eyre::Result { + let rpc_url = "http://localhost:8545"; - let deployer: LocalWallet = + let deployer_key: PrivateKeySigner = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80".parse()?; - let deployer = - mk_signer(provider.clone(), deployer, Chain::AnvilHardhat)?; + let deployer_address = deployer_key.address(); + let deployer = mk_provider_with_signer(rpc_url, deployer_key).await?; - let some_user: LocalWallet = + let some_user_key: PrivateKeySigner = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d".parse()?; - let some_user = - mk_signer(provider.clone(), some_user, Chain::AnvilHardhat)?; + let some_user_address = some_user_key.address(); + let some_user = mk_provider_with_signer(rpc_url, some_user_key).await?; - let offender: LocalWallet = + let offender_key: PrivateKeySigner = "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6".parse()?; - let offender = mk_signer(provider, offender, Chain::AnvilHardhat)?; + let offender_address = offender_key.address(); + let offender = mk_provider_with_signer(rpc_url, offender_key).await?; - Ok(Roles { deployer, some_user, offender }) + Ok(Roles { + deployer, + deployer_address, + some_user, + some_user_address, + offender, + offender_address + }) } } -fn mk_signer( - provider: Provider, - wallet: LocalWallet, - chain_id: impl Into, +async fn mk_provider_with_signer( + rpc_url: &str, + signer: PrivateKeySigner, ) -> eyre::Result { - let wallet = - SignerMiddleware::new(provider, wallet.with_chain_id(chain_id)); - Ok(Arc::new(wallet)) + let wallet = EthereumWallet::from(signer); + let provider = ProviderBuilder::new() + .with_recommended_fillers() + .wallet(wallet) + .on_http(rpc_url.parse()?) + .await?; + + Ok(Arc::new(provider)) } diff --git a/ctf/Cargo.toml b/ctf/Cargo.toml index f873939..ea9ffec 100644 --- a/ctf/Cargo.toml +++ b/ctf/Cargo.toml @@ -12,4 +12,4 @@ serde = { workspace = true } serde_json = { workspace = true } async-trait = { workspace = true } tokio = { workspace = true } -ethers = { workspace = true } +alloy = { workspace = true } diff --git a/ctf/src/abi/alien_codex.rs b/ctf/src/abi/alien_codex.rs index 460e70b..587940d 100644 --- a/ctf/src/abi/alien_codex.rs +++ b/ctf/src/abi/alien_codex.rs @@ -1,916 +1,16 @@ -pub use alien_codex::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod alien_codex { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("codex"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("codex"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 32usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("contact"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("contact"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("isOwner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("isOwner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("makeContact"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("makeContact"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("record"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("record"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_content"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 32usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("renounceOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("renounceOwnership"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("retract"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("retract"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("revise"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("revise"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("i"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_content"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 32usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transferOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transferOwnership"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("OwnershipTransferred"), - ::std::vec![ - ::ethers::core::abi::ethabi::Event { - name: ::std::borrow::ToOwned::to_owned( - "OwnershipTransferred", - ), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("previousOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ], - anonymous: false, - }, - ], - ), - ]), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract AlienCodex { + bool public contact; + address public owner; + bytes32[] public codex; + + function makeContact() external; + function record(bytes32 _content) external; + function retract() external; + function revise(uint256 i, bytes32 _content) external; } - ///The parsed JSON ABI of the contract. - pub static ALIENCODEX_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90Ua\x04\xE1\x80a\0%`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\x9EW`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x11a\0fW\x80c\x8D\xA5\xCB[\x14a\0\xFCW\x80c\x8F2\xD5\x9B\x14a\x01 W\x80c\x94\xBDui\x14a\x01(W\x80c\xB5\xC6E\xBD\x14a\x01WW\x80c\xF2\xFD\xE3\x8B\x14a\x01tWa\0\x9EV[\x80c\x039\xF3\0\x14a\0\xA3W\x80c2\x8BR\xCB\x14a\0\xC8W\x80c3\xA8\xC4Z\x14a\0\xD0W\x80cG\xF5{2\x14a\0\xECW\x80cqP\x18\xA6\x14a\0\xF4W[`\0\x80\xFD[a\0\xC6`\x04\x806\x03`@\x81\x10\x15a\0\xB9W`\0\x80\xFD[P\x805\x90` \x015a\x01\x9AV[\0[a\0\xC6a\x01\xCBV[a\0\xD8a\x01\xE0V[`@\x80Q\x91\x15\x15\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xC6a\x01\xF0V[a\0\xC6a\x02\x19V[a\x01\x04a\x02\xBCV[`@\x80Q`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xD8a\x02\xCCV[a\x01E`\x04\x806\x03` \x81\x10\x15a\x01>W`\0\x80\xFD[P5a\x02\xDDV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xC6`\x04\x806\x03` \x81\x10\x15a\x01mW`\0\x80\xFD[P5a\x02\xFBV[a\0\xC6`\x04\x806\x03` \x81\x10\x15a\x01\x8AW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x03BV[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x01\xADW\xFE[\x80`\x01\x83\x81T\x81\x10a\x01\xBBW\xFE[`\0\x91\x82R` \x90\x91 \x01UPPV[`\0\x80T`\xFF`\xA0\x1B\x19\x16`\x01`\xA0\x1B\x17\x90UV[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16\x81V[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x02\x03W\xFE[`\x01\x80T\x90a\x02\x16\x90`\0\x19\x83\x01a\x04?V[PV[a\x02!a\x02\xCCV[a\x02rW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x90\x83\x90\xA3`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90UV[`\0T`\x01`\x01`\xA0\x1B\x03\x16[\x90V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14\x90V[`\x01\x81\x81T\x81\x10a\x02\xEAW\xFE[`\0\x91\x82R` \x90\x91 \x01T\x90P\x81V[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x03\x0EW\xFE[`\x01\x80T\x80\x82\x01\x82U`\0\x91\x90\x91R\x7F\xB1\x0E-Rv\x12\x07;&\xEE\xCD\xFDq~j2\x0C\xF4KJ\xFA\xC2\xB0s-\x9F\xCB\xE2\xB7\xFA\x0C\xF6\x01UV[a\x03Ja\x02\xCCV[a\x03\x9BW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[a\x02\x16\x81`\x01`\x01`\xA0\x1B\x03\x81\x16a\x03\xE4W`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01\x80\x80` \x01\x82\x81\x03\x82R`&\x81R` \x01\x80a\x04\x87`&\x919`@\x01\x91PP`@Q\x80\x91\x03\x90\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x80\x85\x16\x93\x92\x16\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\xA3`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\x81T\x81\x83U\x81\x81\x11\x15a\x04cW`\0\x83\x81R` \x90 a\x04c\x91\x81\x01\x90\x83\x01a\x04hV[PPPV[a\x02\xC9\x91\x90[\x80\x82\x11\x15a\x04\x82W`\0\x81U`\x01\x01a\x04nV[P\x90V\xFEOwnable: new owner is the zero address\xA2ebzzr1X \xC8,k\x8C\x11o\x04\xC6,r!\xC5i\x9A\xDD\xC6\x0F\xA4\xC4C\x15\xD0\x99S\x12c\xC00$G\x89\xBDdsolcC\0\x05\x11\x002"; - /// The bytecode of the contract. - pub static ALIENCODEX_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\x9EW`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x11a\0fW\x80c\x8D\xA5\xCB[\x14a\0\xFCW\x80c\x8F2\xD5\x9B\x14a\x01 W\x80c\x94\xBDui\x14a\x01(W\x80c\xB5\xC6E\xBD\x14a\x01WW\x80c\xF2\xFD\xE3\x8B\x14a\x01tWa\0\x9EV[\x80c\x039\xF3\0\x14a\0\xA3W\x80c2\x8BR\xCB\x14a\0\xC8W\x80c3\xA8\xC4Z\x14a\0\xD0W\x80cG\xF5{2\x14a\0\xECW\x80cqP\x18\xA6\x14a\0\xF4W[`\0\x80\xFD[a\0\xC6`\x04\x806\x03`@\x81\x10\x15a\0\xB9W`\0\x80\xFD[P\x805\x90` \x015a\x01\x9AV[\0[a\0\xC6a\x01\xCBV[a\0\xD8a\x01\xE0V[`@\x80Q\x91\x15\x15\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xC6a\x01\xF0V[a\0\xC6a\x02\x19V[a\x01\x04a\x02\xBCV[`@\x80Q`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xD8a\x02\xCCV[a\x01E`\x04\x806\x03` \x81\x10\x15a\x01>W`\0\x80\xFD[P5a\x02\xDDV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0\xC6`\x04\x806\x03` \x81\x10\x15a\x01mW`\0\x80\xFD[P5a\x02\xFBV[a\0\xC6`\x04\x806\x03` \x81\x10\x15a\x01\x8AW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x03BV[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x01\xADW\xFE[\x80`\x01\x83\x81T\x81\x10a\x01\xBBW\xFE[`\0\x91\x82R` \x90\x91 \x01UPPV[`\0\x80T`\xFF`\xA0\x1B\x19\x16`\x01`\xA0\x1B\x17\x90UV[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16\x81V[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x02\x03W\xFE[`\x01\x80T\x90a\x02\x16\x90`\0\x19\x83\x01a\x04?V[PV[a\x02!a\x02\xCCV[a\x02rW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x90\x83\x90\xA3`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16\x90UV[`\0T`\x01`\x01`\xA0\x1B\x03\x16[\x90V[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14\x90V[`\x01\x81\x81T\x81\x10a\x02\xEAW\xFE[`\0\x91\x82R` \x90\x91 \x01T\x90P\x81V[`\0T`\x01`\xA0\x1B\x90\x04`\xFF\x16a\x03\x0EW\xFE[`\x01\x80T\x80\x82\x01\x82U`\0\x91\x90\x91R\x7F\xB1\x0E-Rv\x12\x07;&\xEE\xCD\xFDq~j2\x0C\xF4KJ\xFA\xC2\xB0s-\x9F\xCB\xE2\xB7\xFA\x0C\xF6\x01UV[a\x03Ja\x02\xCCV[a\x03\x9BW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[a\x02\x16\x81`\x01`\x01`\xA0\x1B\x03\x81\x16a\x03\xE4W`@QbF\x1B\xCD`\xE5\x1B\x81R`\x04\x01\x80\x80` \x01\x82\x81\x03\x82R`&\x81R` \x01\x80a\x04\x87`&\x919`@\x01\x91PP`@Q\x80\x91\x03\x90\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x80\x85\x16\x93\x92\x16\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\xA3`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\x81T\x81\x83U\x81\x81\x11\x15a\x04cW`\0\x83\x81R` \x90 a\x04c\x91\x81\x01\x90\x83\x01a\x04hV[PPPV[a\x02\xC9\x91\x90[\x80\x82\x11\x15a\x04\x82W`\0\x81U`\x01\x01a\x04nV[P\x90V\xFEOwnable: new owner is the zero address\xA2ebzzr1X \xC8,k\x8C\x11o\x04\xC6,r!\xC5i\x9A\xDD\xC6\x0F\xA4\xC4C\x15\xD0\x99S\x12c\xC00$G\x89\xBDdsolcC\0\x05\x11\x002"; - /// The deployed bytecode of the contract. - pub static ALIENCODEX_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct AlienCodex(::ethers::contract::Contract); - impl ::core::clone::Clone for AlienCodex { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for AlienCodex { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for AlienCodex { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for AlienCodex { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(AlienCodex)) - .field(&self.address()) - .finish() - } - } - impl AlienCodex { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - ALIENCODEX_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - ALIENCODEX_ABI.clone(), - ALIENCODEX_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `codex` (0x94bd7569) - /// function - pub fn codex( - &self, - p0: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([148, 189, 117, 105], p0) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `contact` (0x33a8c45a) - /// function - pub fn contact( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([51, 168, 196, 90], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `isOwner` (0x8f32d59b) - /// function - pub fn is_owner( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([143, 50, 213, 155], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `makeContact` (0x328b52cb) - /// function - pub fn make_contact( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([50, 139, 82, 203], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `record` (0xb5c645bd) - /// function - pub fn record( - &self, - content: [u8; 32], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([181, 198, 69, 189], content) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `renounceOwnership` - /// (0x715018a6) function - pub fn renounce_ownership( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([113, 80, 24, 166], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `retract` (0x47f57b32) - /// function - pub fn retract( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([71, 245, 123, 50], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `revise` (0x0339f300) - /// function - pub fn revise( - &self, - i: ::ethers::core::types::U256, - content: [u8; 32], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([3, 57, 243, 0], (i, content)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `transferOwnership` - /// (0xf2fde38b) function - pub fn transfer_ownership( - &self, - new_owner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([242, 253, 227, 139], new_owner) - .expect("method not found (this should never happen)") - } - ///Gets the contract's `OwnershipTransferred` event - pub fn ownership_transferred_filter( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event() - } - /// Returns an `Event` builder for all the events of - /// this contract. - pub fn events( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event_with_filter(::core::default::Default::default()) - } - } - impl - From<::ethers::contract::Contract> for AlienCodex - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - #[derive( - Clone, - ::ethers::contract::EthEvent, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethevent( - name = "OwnershipTransferred", - abi = "OwnershipTransferred(address,address)" - )] - pub struct OwnershipTransferredFilter { - #[ethevent(indexed)] - pub previous_owner: ::ethers::core::types::Address, - #[ethevent(indexed)] - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `codex` function with signature `codex(uint256)` and - /// selector `0x94bd7569` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "codex", abi = "codex(uint256)")] - pub struct CodexCall(pub ::ethers::core::types::U256); - ///Container type for all input parameters for the - /// `contact` function with signature `contact()` and - /// selector `0x33a8c45a` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "contact", abi = "contact()")] - pub struct ContactCall; - ///Container type for all input parameters for the - /// `isOwner` function with signature `isOwner()` and - /// selector `0x8f32d59b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "isOwner", abi = "isOwner()")] - pub struct IsOwnerCall; - ///Container type for all input parameters for the - /// `makeContact` function with signature - /// `makeContact()` and selector `0x328b52cb` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "makeContact", abi = "makeContact()")] - pub struct MakeContactCall; - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `record` function with signature `record(bytes32)` - /// and selector `0xb5c645bd` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "record", abi = "record(bytes32)")] - pub struct RecordCall { - pub content: [u8; 32], - } - ///Container type for all input parameters for the - /// `renounceOwnership` function with signature - /// `renounceOwnership()` and selector `0x715018a6` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")] - pub struct RenounceOwnershipCall; - ///Container type for all input parameters for the - /// `retract` function with signature `retract()` and - /// selector `0x47f57b32` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "retract", abi = "retract()")] - pub struct RetractCall; - ///Container type for all input parameters for the - /// `revise` function with signature - /// `revise(uint256,bytes32)` and selector `0x0339f300` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "revise", abi = "revise(uint256,bytes32)")] - pub struct ReviseCall { - pub i: ::ethers::core::types::U256, - pub content: [u8; 32], - } - ///Container type for all input parameters for the - /// `transferOwnership` function with signature - /// `transferOwnership(address)` and selector - /// `0xf2fde38b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")] - pub struct TransferOwnershipCall { - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum AlienCodexCalls { - Codex(CodexCall), - Contact(ContactCall), - IsOwner(IsOwnerCall), - MakeContact(MakeContactCall), - Owner(OwnerCall), - Record(RecordCall), - RenounceOwnership(RenounceOwnershipCall), - Retract(RetractCall), - Revise(ReviseCall), - TransferOwnership(TransferOwnershipCall), - } - impl ::ethers::core::abi::AbiDecode for AlienCodexCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Codex(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Contact(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::IsOwner(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::MakeContact(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Record(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::RenounceOwnership(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Retract(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Revise(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::TransferOwnership(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for AlienCodexCalls { - fn encode(self) -> Vec { - match self { - Self::Codex(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Contact(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::IsOwner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::MakeContact(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Record(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::RenounceOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Retract(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Revise(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::TransferOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for AlienCodexCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Codex(element) => ::core::fmt::Display::fmt(element, f), - Self::Contact(element) => ::core::fmt::Display::fmt(element, f), - Self::IsOwner(element) => ::core::fmt::Display::fmt(element, f), - Self::MakeContact(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::Record(element) => ::core::fmt::Display::fmt(element, f), - Self::RenounceOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Retract(element) => ::core::fmt::Display::fmt(element, f), - Self::Revise(element) => ::core::fmt::Display::fmt(element, f), - Self::TransferOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: CodexCall) -> Self { Self::Codex(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: ContactCall) -> Self { Self::Contact(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: IsOwnerCall) -> Self { Self::IsOwner(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: MakeContactCall) -> Self { Self::MakeContact(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: RecordCall) -> Self { Self::Record(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: RenounceOwnershipCall) -> Self { - Self::RenounceOwnership(value) - } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: RetractCall) -> Self { Self::Retract(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: ReviseCall) -> Self { Self::Revise(value) } - } - impl ::core::convert::From for AlienCodexCalls { - fn from(value: TransferOwnershipCall) -> Self { - Self::TransferOwnership(value) - } - } - ///Container type for all return fields from the - /// `codex` function with signature `codex(uint256)` and - /// selector `0x94bd7569` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct CodexReturn(pub [u8; 32]); - ///Container type for all return fields from the - /// `contact` function with signature `contact()` and - /// selector `0x33a8c45a` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct ContactReturn(pub bool); - ///Container type for all return fields from the - /// `isOwner` function with signature `isOwner()` and - /// selector `0x8f32d59b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct IsOwnerReturn(pub bool); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/coin_flip.rs b/ctf/src/abi/coin_flip.rs index 8f78435..4b6f93a 100644 --- a/ctf/src/abi/coin_flip.rs +++ b/ctf/src/abi/coin_flip.rs @@ -1,340 +1,14 @@ -pub use coin_flip::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod coin_flip { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("consecutiveWins"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("consecutiveWins"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("flip"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("flip"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_guess"), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract CoinFlip { + uint256 public consecutiveWins; + uint256 lastHash; + uint256 FACTOR; + + constructor(); + + function flip(bool _guess) public returns (bool); } - ///The parsed JSON ABI of the contract. - pub static COINFLIP_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R`\x01`\xFF\x1B`\x02U4\x80\x15`\x17W`\0\x80\xFD[P`\0\x80Ua\x01\xCA\x80a\0+`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c\x1D&?g\x14a\0;W\x80c\xE6\xF34\xD7\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x01\x01V[a\0zV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0l`\0T\x81V[`@Q\x90\x81R` \x01a\0ZV[`\0\x80a\0\x88`\x01Ca\x01@V[@`\0\x1C\x90P\x80`\x01T\x03a\0\x9CW`\0\x80\xFD[`\x01\x81\x90U`\x02T`\0\x90a\0\xB1\x90\x83a\x01YV[\x90P`\0\x81`\x01\x14a\0\xC4W`\0a\0\xC7V[`\x01[\x90P\x84\x15\x15\x81\x15\x15\x03a\0\xF3W`\0\x80T\x90\x80a\0\xE3\x83a\x01{V[\x90\x91UP`\x01\x96\x95PPPPPPV[PP`\0\x80\x80U\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\x01\x13W`\0\x80\xFD[\x815\x80\x15\x15\x81\x14a\x01#W`\0\x80\xFD[\x93\x92PPPV[cNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x81\x81\x03\x81\x81\x11\x15a\x01SWa\x01Sa\x01*V[\x92\x91PPV[`\0\x82a\x01vWcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V[`\0`\x01\x82\x01a\x01\x8DWa\x01\x8Da\x01*V[P`\x01\x01\x90V\xFE\xA2dipfsX\"\x12 \xA38|*\0\x13\xA4\x87\xE1\xA6\xC8\x1B\xC2:\x885J\xD8u\xFF\xC8(\xD2\xDD\xB0\x7Fd~\xF8\x0C\xACRdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static COINFLIP_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c\x1D&?g\x14a\0;W\x80c\xE6\xF34\xD7\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x01\x01V[a\0zV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0l`\0T\x81V[`@Q\x90\x81R` \x01a\0ZV[`\0\x80a\0\x88`\x01Ca\x01@V[@`\0\x1C\x90P\x80`\x01T\x03a\0\x9CW`\0\x80\xFD[`\x01\x81\x90U`\x02T`\0\x90a\0\xB1\x90\x83a\x01YV[\x90P`\0\x81`\x01\x14a\0\xC4W`\0a\0\xC7V[`\x01[\x90P\x84\x15\x15\x81\x15\x15\x03a\0\xF3W`\0\x80T\x90\x80a\0\xE3\x83a\x01{V[\x90\x91UP`\x01\x96\x95PPPPPPV[PP`\0\x80\x80U\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\x01\x13W`\0\x80\xFD[\x815\x80\x15\x15\x81\x14a\x01#W`\0\x80\xFD[\x93\x92PPPV[cNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x81\x81\x03\x81\x81\x11\x15a\x01SWa\x01Sa\x01*V[\x92\x91PPV[`\0\x82a\x01vWcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V[`\0`\x01\x82\x01a\x01\x8DWa\x01\x8Da\x01*V[P`\x01\x01\x90V\xFE\xA2dipfsX\"\x12 \xA38|*\0\x13\xA4\x87\xE1\xA6\xC8\x1B\xC2:\x885J\xD8u\xFF\xC8(\xD2\xDD\xB0\x7Fd~\xF8\x0C\xACRdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static COINFLIP_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct CoinFlip(::ethers::contract::Contract); - impl ::core::clone::Clone for CoinFlip { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for CoinFlip { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for CoinFlip { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for CoinFlip { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(CoinFlip)) - .field(&self.address()) - .finish() - } - } - impl CoinFlip { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - COINFLIP_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - COINFLIP_ABI.clone(), - COINFLIP_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `consecutiveWins` - /// (0xe6f334d7) function - pub fn consecutive_wins( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([230, 243, 52, 215], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `flip` (0x1d263f67) - /// function - pub fn flip( - &self, - guess: bool, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([29, 38, 63, 103], guess) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for CoinFlip - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `consecutiveWins` function with signature - /// `consecutiveWins()` and selector `0xe6f334d7` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "consecutiveWins", abi = "consecutiveWins()")] - pub struct ConsecutiveWinsCall; - ///Container type for all input parameters for the - /// `flip` function with signature `flip(bool)` and - /// selector `0x1d263f67` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "flip", abi = "flip(bool)")] - pub struct FlipCall { - pub guess: bool, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum CoinFlipCalls { - ConsecutiveWins(ConsecutiveWinsCall), - Flip(FlipCall), - } - impl ::ethers::core::abi::AbiDecode for CoinFlipCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::ConsecutiveWins(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Flip(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for CoinFlipCalls { - fn encode(self) -> Vec { - match self { - Self::ConsecutiveWins(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Flip(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for CoinFlipCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::ConsecutiveWins(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Flip(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for CoinFlipCalls { - fn from(value: ConsecutiveWinsCall) -> Self { - Self::ConsecutiveWins(value) - } - } - impl ::core::convert::From for CoinFlipCalls { - fn from(value: FlipCall) -> Self { Self::Flip(value) } - } - ///Container type for all return fields from the - /// `consecutiveWins` function with signature - /// `consecutiveWins()` and selector `0xe6f334d7` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct ConsecutiveWinsReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the `flip` - /// function with signature `flip(bool)` and selector - /// `0x1d263f67` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct FlipReturn(pub bool); } diff --git a/ctf/src/abi/delegate.rs b/ctf/src/abi/delegate.rs index e8b9710..56704da 100644 --- a/ctf/src/abi/delegate.rs +++ b/ctf/src/abi/delegate.rs @@ -1,302 +1,12 @@ -pub use delegate::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod delegate { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_owner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("pwn"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("pwn"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Delegate { + address public owner; + + constructor(address _owner); + + function pwn() public; } - ///The parsed JSON ABI of the contract. - pub static DELEGATE_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`@Qa\x01?8\x03\x80a\x01?\x839\x81\x01`@\x81\x90R`,\x91`PV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90U`~V[`\0` \x82\x84\x03\x12\x15`aW`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`wW`\0\x80\xFD[\x93\x92PPPV[`\xB3\x80a\0\x8C`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`7W\x80c\xDD6[\x8B\x14`eW[`\0\x80\xFD[`\0T`I\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`{`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90UV[\0\xFE\xA2dipfsX\"\x12 q\xB0\x0B=\x95\xDC\xEC|B\x8F@v\xB1\xF2\xDE\t9b\x9A=w\xD7\xD51\x90\xF6\xEE\xF4\xF6\xE5 >dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static DELEGATE_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`7W\x80c\xDD6[\x8B\x14`eW[`\0\x80\xFD[`\0T`I\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`{`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90UV[\0\xFE\xA2dipfsX\"\x12 q\xB0\x0B=\x95\xDC\xEC|B\x8F@v\xB1\xF2\xDE\t9b\x9A=w\xD7\xD51\x90\xF6\xEE\xF4\xF6\xE5 >dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static DELEGATE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Delegate(::ethers::contract::Contract); - impl ::core::clone::Clone for Delegate { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Delegate { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Delegate { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Delegate { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Delegate)) - .field(&self.address()) - .finish() - } - } - impl Delegate { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - DELEGATE_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - DELEGATE_ABI.clone(), - DELEGATE_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `pwn` (0xdd365b8b) function - pub fn pwn(&self) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([221, 54, 91, 139], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Delegate - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `pwn` function with signature `pwn()` and selector - /// `0xdd365b8b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "pwn", abi = "pwn()")] - pub struct PwnCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum DelegateCalls { - Owner(OwnerCall), - Pwn(PwnCall), - } - impl ::ethers::core::abi::AbiDecode for DelegateCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Pwn(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for DelegateCalls { - fn encode(self) -> Vec { - match self { - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Pwn(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for DelegateCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::Pwn(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for DelegateCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for DelegateCalls { - fn from(value: PwnCall) -> Self { Self::Pwn(value) } - } - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/delegation.rs b/ctf/src/abi/delegation.rs index dac314d..284e91f 100644 --- a/ctf/src/abi/delegation.rs +++ b/ctf/src/abi/delegation.rs @@ -1,201 +1,13 @@ -pub use delegation::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod delegation { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some( - ::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned( - "_delegateAddress" - ), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - },], - }, - ), - functions: ::core::convert::From::from([( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - },], - constant: ::core::option::Option::None, - state_mutability: - ::ethers::core::abi::ethabi::StateMutability::View, - },], - )]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: true, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Delegation { + address public owner; + address delegate; + + constructor(address _delegateAddress); + + fallback() external; } - ///The parsed JSON ABI of the contract. - pub static DELEGATION_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`@Qa\x01\x888\x03\x80a\x01\x88\x839\x81\x01`@\x81\x90R`,\x91`YV[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x90\x92\x16`\x01`\x01`\xA0\x1B\x03\x19\x92\x83\x16\x17\x90U`\0\x80T\x90\x91\x163\x17\x90U`\x87V[`\0` \x82\x84\x03\x12\x15`jW`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`\x80W`\0\x80\xFD[\x93\x92PPPV[`\xF3\x80a\0\x95`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`(W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`\x7FW[`\x01T`@Q`\0\x91`\x01`\x01`\xA0\x1B\x03\x16\x90`F\x90\x83\x906\x90`\xADV[`\0`@Q\x80\x83\x03\x81\x85Z\xF4\x91PP=\x80`\0\x81\x14`}W`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>\0[\0[`\0T`\x91\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[\x81\x83\x827`\0\x91\x01\x90\x81R\x91\x90PV\xFE\xA2dipfsX\"\x12 \xDF\x81\x1D{\xBA\xD9\x1FR\xF3=\xE0.O\x85m\xA3\xA5~\x8FD\x02\x163\x89\xE8F+\xEC\xD66\xF5,dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static DELEGATION_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`(W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`\x7FW[`\x01T`@Q`\0\x91`\x01`\x01`\xA0\x1B\x03\x16\x90`F\x90\x83\x906\x90`\xADV[`\0`@Q\x80\x83\x03\x81\x85Z\xF4\x91PP=\x80`\0\x81\x14`}W`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>\0[\0[`\0T`\x91\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[\x81\x83\x827`\0\x91\x01\x90\x81R\x91\x90PV\xFE\xA2dipfsX\"\x12 \xDF\x81\x1D{\xBA\xD9\x1FR\xF3=\xE0.O\x85m\xA3\xA5~\x8FD\x02\x163\x89\xE8F+\xEC\xD66\xF5,dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static DELEGATION_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Delegation(::ethers::contract::Contract); - impl ::core::clone::Clone for Delegation { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Delegation { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Delegation { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Delegation { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Delegation)) - .field(&self.address()) - .finish() - } - } - impl Delegation { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - DELEGATION_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - DELEGATION_ABI.clone(), - DELEGATION_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Delegation - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/denial.rs b/ctf/src/abi/denial.rs index 4aae699..e3bde8f 100644 --- a/ctf/src/abi/denial.rs +++ b/ctf/src/abi/denial.rs @@ -1,527 +1,16 @@ -pub use denial::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod denial { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("contractBalance"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("contractBalance"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("partner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("partner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("setWithdrawPartner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("setWithdrawPartner"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_partner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("withdraw"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("withdraw"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: true, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract Denial { + address public owner; + address public partner; + + function contractBalance() external view returns (uint256); + function setWithdrawPartner(address _partner) external; + function withdraw() external; + + receive() external payable; } - ///The parsed JSON ABI of the contract. - pub static DENIAL_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[Pa\x02\x91\x80a\0\x1F`\09`\0\xF3\xFE`\x80`@R`\x046\x10a\0NW`\x005`\xE0\x1C\x80c<\xCF\xD6\x0B\x14a\0ZW\x80cN\x1CY\x14\x14a\0qW\x80c\x8Bz\xFE.\x14a\0\xAEW\x80c\x8D\xA5\xCB[\x14a\0\xCEW\x80c\xBE\x10\x86+\x14a\0\xFCW`\0\x80\xFD[6a\0UW\0[`\0\x80\xFD[4\x80\x15a\0fW`\0\x80\xFD[Pa\0oa\x01\x1CV[\0[4\x80\x15a\0}W`\0\x80\xFD[Pa\0oa\0\x8C6`\x04a\x01\xE2V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[4\x80\x15a\0\xBAW`\0\x80\xFD[P`@QG\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[4\x80\x15a\0\xDAW`\0\x80\xFD[Pa\0\xE4a\n\x9E\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0\xC5V[4\x80\x15a\x01\x08W`\0\x80\xFD[P`\0Ta\0\xE4\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`\0a\x01)`dGa\x02\x12V[`\0\x80T`@Q\x92\x93P`\x01`\x01`\xA0\x1B\x03\x16\x91\x83\x91\x81\x81\x81\x85\x87Z\xF1\x92PPP=\x80`\0\x81\x14a\x01vW`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>a\x01{V[``\x91P[PP`@Qa\n\x9E\x91P\x82\x15a\x08\xFC\x02\x90\x83\x90`\0\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x01\xADW=`\0\x80>=`\0\xFD[PB`\x01U`\0\x80T`\x01`\x01`\xA0\x1B\x03\x16\x81R`\x02` R`@\x81 \x80T\x83\x92\x90a\x01\xDA\x90\x84\x90a\x024V[\x90\x91UPPPV[`\0` \x82\x84\x03\x12\x15a\x01\xF4W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\x0BW`\0\x80\xFD[\x93\x92PPPV[`\0\x82a\x02/WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V[\x80\x82\x01\x80\x82\x11\x15a\x02UWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 \xF4:\tn\xCF+\x9A\xE9\xA0b\xDA%N< \xD0s\xDD(\x0E\xE9Nv\xD3\xD9\x05\x06\x1A#\x97fTdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static DENIAL_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R`\x046\x10a\0NW`\x005`\xE0\x1C\x80c<\xCF\xD6\x0B\x14a\0ZW\x80cN\x1CY\x14\x14a\0qW\x80c\x8Bz\xFE.\x14a\0\xAEW\x80c\x8D\xA5\xCB[\x14a\0\xCEW\x80c\xBE\x10\x86+\x14a\0\xFCW`\0\x80\xFD[6a\0UW\0[`\0\x80\xFD[4\x80\x15a\0fW`\0\x80\xFD[Pa\0oa\x01\x1CV[\0[4\x80\x15a\0}W`\0\x80\xFD[Pa\0oa\0\x8C6`\x04a\x01\xE2V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[4\x80\x15a\0\xBAW`\0\x80\xFD[P`@QG\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[4\x80\x15a\0\xDAW`\0\x80\xFD[Pa\0\xE4a\n\x9E\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0\xC5V[4\x80\x15a\x01\x08W`\0\x80\xFD[P`\0Ta\0\xE4\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`\0a\x01)`dGa\x02\x12V[`\0\x80T`@Q\x92\x93P`\x01`\x01`\xA0\x1B\x03\x16\x91\x83\x91\x81\x81\x81\x85\x87Z\xF1\x92PPP=\x80`\0\x81\x14a\x01vW`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>a\x01{V[``\x91P[PP`@Qa\n\x9E\x91P\x82\x15a\x08\xFC\x02\x90\x83\x90`\0\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x01\xADW=`\0\x80>=`\0\xFD[PB`\x01U`\0\x80T`\x01`\x01`\xA0\x1B\x03\x16\x81R`\x02` R`@\x81 \x80T\x83\x92\x90a\x01\xDA\x90\x84\x90a\x024V[\x90\x91UPPPV[`\0` \x82\x84\x03\x12\x15a\x01\xF4W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\x0BW`\0\x80\xFD[\x93\x92PPPV[`\0\x82a\x02/WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V[\x80\x82\x01\x80\x82\x11\x15a\x02UWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 \xF4:\tn\xCF+\x9A\xE9\xA0b\xDA%N< \xD0s\xDD(\x0E\xE9Nv\xD3\xD9\x05\x06\x1A#\x97fTdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static DENIAL_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Denial(::ethers::contract::Contract); - impl ::core::clone::Clone for Denial { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Denial { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Denial { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Denial { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Denial)) - .field(&self.address()) - .finish() - } - } - impl Denial { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - DENIAL_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - DENIAL_ABI.clone(), - DENIAL_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `contractBalance` - /// (0x8b7afe2e) function - pub fn contract_balance( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([139, 122, 254, 46], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `partner` (0xbe10862b) - /// function - pub fn partner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([190, 16, 134, 43], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `setWithdrawPartner` - /// (0x4e1c5914) function - pub fn set_withdraw_partner( - &self, - partner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([78, 28, 89, 20], partner) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `withdraw` (0x3ccfd60b) - /// function - pub fn withdraw( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([60, 207, 214, 11], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Denial - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `contractBalance` function with signature - /// `contractBalance()` and selector `0x8b7afe2e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "contractBalance", abi = "contractBalance()")] - pub struct ContractBalanceCall; - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `partner` function with signature `partner()` and - /// selector `0xbe10862b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "partner", abi = "partner()")] - pub struct PartnerCall; - ///Container type for all input parameters for the - /// `setWithdrawPartner` function with signature - /// `setWithdrawPartner(address)` and selector - /// `0x4e1c5914` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "setWithdrawPartner", abi = "setWithdrawPartner(address)")] - pub struct SetWithdrawPartnerCall { - pub partner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `withdraw` function with signature `withdraw()` and - /// selector `0x3ccfd60b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "withdraw", abi = "withdraw()")] - pub struct WithdrawCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum DenialCalls { - ContractBalance(ContractBalanceCall), - Owner(OwnerCall), - Partner(PartnerCall), - SetWithdrawPartner(SetWithdrawPartnerCall), - Withdraw(WithdrawCall), - } - impl ::ethers::core::abi::AbiDecode for DenialCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::ContractBalance(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Partner(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::SetWithdrawPartner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Withdraw(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for DenialCalls { - fn encode(self) -> Vec { - match self { - Self::ContractBalance(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Partner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::SetWithdrawPartner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Withdraw(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for DenialCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::ContractBalance(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::Partner(element) => ::core::fmt::Display::fmt(element, f), - Self::SetWithdrawPartner(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Withdraw(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for DenialCalls { - fn from(value: ContractBalanceCall) -> Self { - Self::ContractBalance(value) - } - } - impl ::core::convert::From for DenialCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for DenialCalls { - fn from(value: PartnerCall) -> Self { Self::Partner(value) } - } - impl ::core::convert::From for DenialCalls { - fn from(value: SetWithdrawPartnerCall) -> Self { - Self::SetWithdrawPartner(value) - } - } - impl ::core::convert::From for DenialCalls { - fn from(value: WithdrawCall) -> Self { Self::Withdraw(value) } - } - ///Container type for all return fields from the - /// `contractBalance` function with signature - /// `contractBalance()` and selector `0x8b7afe2e` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct ContractBalanceReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `partner` function with signature `partner()` and - /// selector `0xbe10862b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct PartnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/dex.rs b/ctf/src/abi/dex.rs index ce57798..e80441c 100644 --- a/ctf/src/abi/dex.rs +++ b/ctf/src/abi/dex.rs @@ -1,1122 +1,19 @@ -pub use dex::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod dex { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("addLiquidity"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("addLiquidity"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("token_address"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("approve"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("approve"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("balanceOf"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balanceOf"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("token"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("account"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("getSwapPrice"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("getSwapPrice"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("renounceOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("renounceOwnership"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("setTokens"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("setTokens"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_token1"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_token2"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("swap"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("swap"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("token1"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("token1"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("token2"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("token2"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transferOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transferOwnership"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("OwnershipTransferred"), - ::std::vec![ - ::ethers::core::abi::ethabi::Event { - name: ::std::borrow::ToOwned::to_owned( - "OwnershipTransferred", - ), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("previousOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ], - anonymous: false, - }, - ], - ), - ]), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract Dex { + address public token1; + address public token2; + address public owner; + + constructor(); + function addLiquidity(address token_address, uint256 amount) external; + function approve(address spender, uint256 amount) external; + function balanceOf(address token, address account) external view returns (uint256); + function getSwapPrice(address from, address to, uint256 amount) external view returns (uint256); + function setTokens(address _token1, address _token2) external; + function swap(address from, address to, uint256 amount) external; } - ///The parsed JSON ABI of the contract. - pub static DEX_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x173`\x1BV[`kV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[a\n.\x80a\0z`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xA9W`\x005`\xE0\x1C\x80c\xBF\xD7\xE0\r\x11a\0qW\x80c\xBF\xD7\xE0\r\x14a\x01\x1FW\x80c\xCB\xC7\x85N\x14a\x01@W\x80c\xD2\x12 \xA7\x14a\x01SW\x80c\xDFy\x1EP\x14a\x01fW\x80c\xF2\xFD\xE3\x8B\x14a\x01yW\x80c\xF7\x88\x8A\xEC\x14a\x01\x8CW`\0\x80\xFD[\x80c\t^\xA7\xB3\x14a\0\xAEW\x80c%\xBE\x12N\x14a\0\xC3W\x80cVh\x87\0\x14a\0\xF3W\x80cqP\x18\xA6\x14a\x01\x06W\x80c\x8D\xA5\xCB[\x14a\x01\x0EW[`\0\x80\xFD[a\0\xC1a\0\xBC6`\x04a\x08\x97V[a\x01\x9FV[\0[`\x02Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xC1a\x01\x016`\x04a\x08\x97V[a\x02oV[a\0\xC1a\x02\xEFV[`\0T`\x01`\x01`\xA0\x1B\x03\x16a\0\xD6V[a\x012a\x01-6`\x04a\x08\xC1V[a\x03\x03V[`@Q\x90\x81R` \x01a\0\xEAV[a\0\xC1a\x01N6`\x04a\x08\xFDV[a\x03\xF2V[`\x01Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\0\xC1a\x01t6`\x04a\x08\xC1V[a\x04(V[a\0\xC1a\x01\x876`\x04a\t0V[a\x06\xE1V[a\x012a\x01\x9A6`\x04a\x08\xFDV[a\x07ZV[`\x01T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90c\xE1\xF2\x1Cg\x90a\x01\xD3\x903\x90\x86\x90\x86\x90`\x04\x01a\tKV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01\xEDW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x01W=`\0\x80>=`\0\xFD[PP`\x02T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x92Pc\xE1\xF2\x1Cg\x91Pa\x029\x903\x90\x86\x90\x86\x90`\x04\x01a\tKV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02SW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02gW=`\0\x80>=`\0\xFD[PPPPPPV[a\x02wa\x07\xD1V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x83\x16\x90c#\xB8r\xDD\x90a\x02\xA7\x903\x900\x90\x86\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x02\xC6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x02\xEA\x91\x90a\toV[PPPV[a\x02\xF7a\x07\xD1V[a\x03\x01`\0a\x08+V[V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\0\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03JW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03n\x91\x90a\t\x98V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03\xB2W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03\xD6\x91\x90a\t\x98V[a\x03\xE0\x90\x84a\t\xB1V[a\x03\xEA\x91\x90a\t\xD6V[\x94\x93PPPPV[a\x03\xFAa\x07\xD1V[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x93\x84\x16`\x01`\x01`\xA0\x1B\x03\x19\x91\x82\x16\x17\x90\x91U`\x02\x80T\x92\x90\x93\x16\x91\x16\x17\x90UV[`\x01T`\x01`\x01`\xA0\x1B\x03\x84\x81\x16\x91\x16\x14\x80\x15a\x04RWP`\x02T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16\x91\x16\x14[\x80a\x04\x82WP`\x02T`\x01`\x01`\xA0\x1B\x03\x84\x81\x16\x91\x16\x14\x80\x15a\x04\x82WP`\x01T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16\x91\x16\x14[a\x04\xC4W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x0E`$\x82\x01RmInvalid tokens`\x90\x1B`D\x82\x01R`d\x01[`@Q\x80\x91\x03\x90\xFD[`@Qcp\xA0\x821`\xE0\x1B\x81R3`\x04\x82\x01R\x81\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x05\nW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05.\x91\x90a\t\x98V[\x10\x15a\x05qW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x12`$\x82\x01Rq\x04\xE6\xF7B\x06V\xE6\xF7Vv\x82\x07F\xF2\x077v\x17`t\x1B`D\x82\x01R`d\x01a\x04\xBBV[`\0a\x05~\x84\x84\x84a\x03\x03V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R\x90\x91P`\x01`\x01`\xA0\x1B\x03\x85\x16\x90c#\xB8r\xDD\x90a\x05\xB1\x903\x900\x90\x87\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x05\xD0W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05\xF4\x91\x90a\toV[P`@Qc\t^\xA7\xB3`\xE0\x1B\x81R0`\x04\x82\x01R`$\x81\x01\x82\x90R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c\t^\xA7\xB3\x90`D\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06BW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06f\x91\x90a\toV[P`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c#\xB8r\xDD\x90a\x06\x97\x900\x903\x90\x86\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06\xB6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06\xDA\x91\x90a\toV[PPPPPV[a\x06\xE9a\x07\xD1V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x07NW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01a\x04\xBBV[a\x07W\x81a\x08+V[PV[`@Qcp\xA0\x821`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x82\x81\x16`\x04\x83\x01R`\0\x91\x90\x84\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x07\xA4W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x07\xC8\x91\x90a\t\x98V[\x90P[\x92\x91PPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x03\x01W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x04\xBBV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x08\x92W`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x08\xAAW`\0\x80\xFD[a\x08\xB3\x83a\x08{V[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08\xD6W`\0\x80\xFD[a\x08\xDF\x84a\x08{V[\x92Pa\x08\xED` \x85\x01a\x08{V[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0\x80`@\x83\x85\x03\x12\x15a\t\x10W`\0\x80\xFD[a\t\x19\x83a\x08{V[\x91Pa\t'` \x84\x01a\x08{V[\x90P\x92P\x92\x90PV[`\0` \x82\x84\x03\x12\x15a\tBW`\0\x80\xFD[a\x07\xC8\x82a\x08{V[`\x01`\x01`\xA0\x1B\x03\x93\x84\x16\x81R\x91\x90\x92\x16` \x82\x01R`@\x81\x01\x91\x90\x91R``\x01\x90V[`\0` \x82\x84\x03\x12\x15a\t\x81W`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\t\x91W`\0\x80\xFD[\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\t\xAAW`\0\x80\xFD[PQ\x91\x90PV[\x80\x82\x02\x81\x15\x82\x82\x04\x84\x14\x17a\x07\xCBWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[`\0\x82a\t\xF3WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V\xFE\xA2dipfsX\"\x12 I^\xB81s\xBE\x96\xCD\x96\xA5\x84\x97\x10\x92\xC3A\x0CM\xF7\x1C\x159\x19\x0C\x17\x89c\x1Ak\xF7CQdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static DEX_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xA9W`\x005`\xE0\x1C\x80c\xBF\xD7\xE0\r\x11a\0qW\x80c\xBF\xD7\xE0\r\x14a\x01\x1FW\x80c\xCB\xC7\x85N\x14a\x01@W\x80c\xD2\x12 \xA7\x14a\x01SW\x80c\xDFy\x1EP\x14a\x01fW\x80c\xF2\xFD\xE3\x8B\x14a\x01yW\x80c\xF7\x88\x8A\xEC\x14a\x01\x8CW`\0\x80\xFD[\x80c\t^\xA7\xB3\x14a\0\xAEW\x80c%\xBE\x12N\x14a\0\xC3W\x80cVh\x87\0\x14a\0\xF3W\x80cqP\x18\xA6\x14a\x01\x06W\x80c\x8D\xA5\xCB[\x14a\x01\x0EW[`\0\x80\xFD[a\0\xC1a\0\xBC6`\x04a\x08\x97V[a\x01\x9FV[\0[`\x02Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xC1a\x01\x016`\x04a\x08\x97V[a\x02oV[a\0\xC1a\x02\xEFV[`\0T`\x01`\x01`\xA0\x1B\x03\x16a\0\xD6V[a\x012a\x01-6`\x04a\x08\xC1V[a\x03\x03V[`@Q\x90\x81R` \x01a\0\xEAV[a\0\xC1a\x01N6`\x04a\x08\xFDV[a\x03\xF2V[`\x01Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\0\xC1a\x01t6`\x04a\x08\xC1V[a\x04(V[a\0\xC1a\x01\x876`\x04a\t0V[a\x06\xE1V[a\x012a\x01\x9A6`\x04a\x08\xFDV[a\x07ZV[`\x01T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90c\xE1\xF2\x1Cg\x90a\x01\xD3\x903\x90\x86\x90\x86\x90`\x04\x01a\tKV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01\xEDW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x01W=`\0\x80>=`\0\xFD[PP`\x02T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x92Pc\xE1\xF2\x1Cg\x91Pa\x029\x903\x90\x86\x90\x86\x90`\x04\x01a\tKV[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02SW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02gW=`\0\x80>=`\0\xFD[PPPPPPV[a\x02wa\x07\xD1V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x83\x16\x90c#\xB8r\xDD\x90a\x02\xA7\x903\x900\x90\x86\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x02\xC6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x02\xEA\x91\x90a\toV[PPPV[a\x02\xF7a\x07\xD1V[a\x03\x01`\0a\x08+V[V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\0\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03JW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03n\x91\x90a\t\x98V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03\xB2W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03\xD6\x91\x90a\t\x98V[a\x03\xE0\x90\x84a\t\xB1V[a\x03\xEA\x91\x90a\t\xD6V[\x94\x93PPPPV[a\x03\xFAa\x07\xD1V[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x93\x84\x16`\x01`\x01`\xA0\x1B\x03\x19\x91\x82\x16\x17\x90\x91U`\x02\x80T\x92\x90\x93\x16\x91\x16\x17\x90UV[`\x01T`\x01`\x01`\xA0\x1B\x03\x84\x81\x16\x91\x16\x14\x80\x15a\x04RWP`\x02T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16\x91\x16\x14[\x80a\x04\x82WP`\x02T`\x01`\x01`\xA0\x1B\x03\x84\x81\x16\x91\x16\x14\x80\x15a\x04\x82WP`\x01T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16\x91\x16\x14[a\x04\xC4W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x0E`$\x82\x01RmInvalid tokens`\x90\x1B`D\x82\x01R`d\x01[`@Q\x80\x91\x03\x90\xFD[`@Qcp\xA0\x821`\xE0\x1B\x81R3`\x04\x82\x01R\x81\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x05\nW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05.\x91\x90a\t\x98V[\x10\x15a\x05qW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x12`$\x82\x01Rq\x04\xE6\xF7B\x06V\xE6\xF7Vv\x82\x07F\xF2\x077v\x17`t\x1B`D\x82\x01R`d\x01a\x04\xBBV[`\0a\x05~\x84\x84\x84a\x03\x03V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R\x90\x91P`\x01`\x01`\xA0\x1B\x03\x85\x16\x90c#\xB8r\xDD\x90a\x05\xB1\x903\x900\x90\x87\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x05\xD0W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05\xF4\x91\x90a\toV[P`@Qc\t^\xA7\xB3`\xE0\x1B\x81R0`\x04\x82\x01R`$\x81\x01\x82\x90R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c\t^\xA7\xB3\x90`D\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06BW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06f\x91\x90a\toV[P`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c#\xB8r\xDD\x90a\x06\x97\x900\x903\x90\x86\x90`\x04\x01a\tKV[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06\xB6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06\xDA\x91\x90a\toV[PPPPPV[a\x06\xE9a\x07\xD1V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x07NW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01a\x04\xBBV[a\x07W\x81a\x08+V[PV[`@Qcp\xA0\x821`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x82\x81\x16`\x04\x83\x01R`\0\x91\x90\x84\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x07\xA4W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x07\xC8\x91\x90a\t\x98V[\x90P[\x92\x91PPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x03\x01W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x04\xBBV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x08\x92W`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x08\xAAW`\0\x80\xFD[a\x08\xB3\x83a\x08{V[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08\xD6W`\0\x80\xFD[a\x08\xDF\x84a\x08{V[\x92Pa\x08\xED` \x85\x01a\x08{V[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0\x80`@\x83\x85\x03\x12\x15a\t\x10W`\0\x80\xFD[a\t\x19\x83a\x08{V[\x91Pa\t'` \x84\x01a\x08{V[\x90P\x92P\x92\x90PV[`\0` \x82\x84\x03\x12\x15a\tBW`\0\x80\xFD[a\x07\xC8\x82a\x08{V[`\x01`\x01`\xA0\x1B\x03\x93\x84\x16\x81R\x91\x90\x92\x16` \x82\x01R`@\x81\x01\x91\x90\x91R``\x01\x90V[`\0` \x82\x84\x03\x12\x15a\t\x81W`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\t\x91W`\0\x80\xFD[\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\t\xAAW`\0\x80\xFD[PQ\x91\x90PV[\x80\x82\x02\x81\x15\x82\x82\x04\x84\x14\x17a\x07\xCBWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[`\0\x82a\t\xF3WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V\xFE\xA2dipfsX\"\x12 I^\xB81s\xBE\x96\xCD\x96\xA5\x84\x97\x10\x92\xC3A\x0CM\xF7\x1C\x159\x19\x0C\x17\x89c\x1Ak\xF7CQdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static DEX_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Dex(::ethers::contract::Contract); - impl ::core::clone::Clone for Dex { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Dex { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Dex { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Dex { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Dex)) - .field(&self.address()) - .finish() - } - } - impl Dex { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - DEX_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - DEX_ABI.clone(), - DEX_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `addLiquidity` (0x56688700) - /// function - pub fn add_liquidity( - &self, - token_address: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([86, 104, 135, 0], (token_address, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `approve` (0x095ea7b3) - /// function - pub fn approve( - &self, - spender: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([9, 94, 167, 179], (spender, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `balanceOf` (0xf7888aec) - /// function - pub fn balance_of( - &self, - token: ::ethers::core::types::Address, - account: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([247, 136, 138, 236], (token, account)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `getSwapPrice` (0xbfd7e00d) - /// function - pub fn get_swap_price( - &self, - from: ::ethers::core::types::Address, - to: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([191, 215, 224, 13], (from, to, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `renounceOwnership` - /// (0x715018a6) function - pub fn renounce_ownership( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([113, 80, 24, 166], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `setTokens` (0xcbc7854e) - /// function - pub fn set_tokens( - &self, - token_1: ::ethers::core::types::Address, - token_2: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([203, 199, 133, 78], (token_1, token_2)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `swap` (0xdf791e50) - /// function - pub fn swap( - &self, - from: ::ethers::core::types::Address, - to: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([223, 121, 30, 80], (from, to, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `token1` (0xd21220a7) - /// function - pub fn token_1( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([210, 18, 32, 167], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `token2` (0x25be124e) - /// function - pub fn token_2( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([37, 190, 18, 78], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `transferOwnership` - /// (0xf2fde38b) function - pub fn transfer_ownership( - &self, - new_owner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([242, 253, 227, 139], new_owner) - .expect("method not found (this should never happen)") - } - ///Gets the contract's `OwnershipTransferred` event - pub fn ownership_transferred_filter( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event() - } - /// Returns an `Event` builder for all the events of - /// this contract. - pub fn events( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event_with_filter(::core::default::Default::default()) - } - } - impl - From<::ethers::contract::Contract> for Dex - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - #[derive( - Clone, - ::ethers::contract::EthEvent, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethevent( - name = "OwnershipTransferred", - abi = "OwnershipTransferred(address,address)" - )] - pub struct OwnershipTransferredFilter { - #[ethevent(indexed)] - pub previous_owner: ::ethers::core::types::Address, - #[ethevent(indexed)] - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `addLiquidity` function with signature - /// `addLiquidity(address,uint256)` and selector - /// `0x56688700` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "addLiquidity", abi = "addLiquidity(address,uint256)")] - pub struct AddLiquidityCall { - pub token_address: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `approve` function with signature - /// `approve(address,uint256)` and selector `0x095ea7b3` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "approve", abi = "approve(address,uint256)")] - pub struct ApproveCall { - pub spender: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `balanceOf` function with signature - /// `balanceOf(address,address)` and selector - /// `0xf7888aec` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "balanceOf", abi = "balanceOf(address,address)")] - pub struct BalanceOfCall { - pub token: ::ethers::core::types::Address, - pub account: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `getSwapPrice` function with signature - /// `getSwapPrice(address,address,uint256)` and selector - /// `0xbfd7e00d` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall( - name = "getSwapPrice", - abi = "getSwapPrice(address,address,uint256)" - )] - pub struct GetSwapPriceCall { - pub from: ::ethers::core::types::Address, - pub to: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `renounceOwnership` function with signature - /// `renounceOwnership()` and selector `0x715018a6` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")] - pub struct RenounceOwnershipCall; - ///Container type for all input parameters for the - /// `setTokens` function with signature - /// `setTokens(address,address)` and selector - /// `0xcbc7854e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "setTokens", abi = "setTokens(address,address)")] - pub struct SetTokensCall { - pub token_1: ::ethers::core::types::Address, - pub token_2: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `swap` function with signature - /// `swap(address,address,uint256)` and selector - /// `0xdf791e50` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "swap", abi = "swap(address,address,uint256)")] - pub struct SwapCall { - pub from: ::ethers::core::types::Address, - pub to: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `token1` function with signature `token1()` and - /// selector `0xd21220a7` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "token1", abi = "token1()")] - pub struct Token1Call; - ///Container type for all input parameters for the - /// `token2` function with signature `token2()` and - /// selector `0x25be124e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "token2", abi = "token2()")] - pub struct Token2Call; - ///Container type for all input parameters for the - /// `transferOwnership` function with signature - /// `transferOwnership(address)` and selector - /// `0xf2fde38b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")] - pub struct TransferOwnershipCall { - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum DexCalls { - AddLiquidity(AddLiquidityCall), - Approve(ApproveCall), - BalanceOf(BalanceOfCall), - GetSwapPrice(GetSwapPriceCall), - Owner(OwnerCall), - RenounceOwnership(RenounceOwnershipCall), - SetTokens(SetTokensCall), - Swap(SwapCall), - Token1(Token1Call), - Token2(Token2Call), - TransferOwnership(TransferOwnershipCall), - } - impl ::ethers::core::abi::AbiDecode for DexCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::AddLiquidity(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Approve(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::BalanceOf(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::GetSwapPrice(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::RenounceOwnership(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::SetTokens(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Swap(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Token1(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Token2(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::TransferOwnership(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for DexCalls { - fn encode(self) -> Vec { - match self { - Self::AddLiquidity(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Approve(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::BalanceOf(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::GetSwapPrice(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::RenounceOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::SetTokens(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Swap(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Token1(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Token2(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::TransferOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for DexCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::AddLiquidity(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Approve(element) => ::core::fmt::Display::fmt(element, f), - Self::BalanceOf(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::GetSwapPrice(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::RenounceOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::SetTokens(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Swap(element) => ::core::fmt::Display::fmt(element, f), - Self::Token1(element) => ::core::fmt::Display::fmt(element, f), - Self::Token2(element) => ::core::fmt::Display::fmt(element, f), - Self::TransferOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for DexCalls { - fn from(value: AddLiquidityCall) -> Self { Self::AddLiquidity(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: ApproveCall) -> Self { Self::Approve(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: BalanceOfCall) -> Self { Self::BalanceOf(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: GetSwapPriceCall) -> Self { Self::GetSwapPrice(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: RenounceOwnershipCall) -> Self { - Self::RenounceOwnership(value) - } - } - impl ::core::convert::From for DexCalls { - fn from(value: SetTokensCall) -> Self { Self::SetTokens(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: SwapCall) -> Self { Self::Swap(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: Token1Call) -> Self { Self::Token1(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: Token2Call) -> Self { Self::Token2(value) } - } - impl ::core::convert::From for DexCalls { - fn from(value: TransferOwnershipCall) -> Self { - Self::TransferOwnership(value) - } - } - ///Container type for all return fields from the - /// `balanceOf` function with signature - /// `balanceOf(address,address)` and selector - /// `0xf7888aec` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct BalanceOfReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `getSwapPrice` function with signature - /// `getSwapPrice(address,address,uint256)` and selector - /// `0xbfd7e00d` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct GetSwapPriceReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `token1` function with signature `token1()` and - /// selector `0xd21220a7` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct Token1Return(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `token2` function with signature `token2()` and - /// selector `0x25be124e` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct Token2Return(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/dex_two.rs b/ctf/src/abi/dex_two.rs index 38fb139..f18ddad 100644 --- a/ctf/src/abi/dex_two.rs +++ b/ctf/src/abi/dex_two.rs @@ -1,1122 +1,19 @@ -pub use dex_two::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod dex_two { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("add_liquidity"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("add_liquidity"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("token_address"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("approve"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("approve"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("balanceOf"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balanceOf"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("token"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("account"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("getSwapAmount"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("getSwapAmount"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("renounceOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("renounceOwnership"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("setTokens"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("setTokens"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_token1"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_token2"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("swap"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("swap"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("token1"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("token1"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("token2"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("token2"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transferOwnership"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transferOwnership"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("OwnershipTransferred"), - ::std::vec![ - ::ethers::core::abi::ethabi::Event { - name: ::std::borrow::ToOwned::to_owned( - "OwnershipTransferred", - ), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("previousOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("newOwner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ], - anonymous: false, - }, - ], - ), - ]), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract DexTwo { + address public token1; + address public token2; + address public owner; + + constructor(); + function addLiquidity(address token_address, uint256 amount) external; + function approve(address spender, uint256 amount) external; + function balanceOf(address token, address account) external view returns (uint256); + function getSwapAmount(address from, address to, uint256 amount) external view returns (uint256); + function setTokens(address _token1, address _token2) external; + function swap(address from, address to, uint256 amount) external; } - ///The parsed JSON ABI of the contract. - pub static DEXTWO_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x173`\x1BV[`kV[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[a\t\x97\x80a\0z`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xA9W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x11a\0qW\x80c\x8D\xA5\xCB[\x14a\x01/W\x80c\xCB\xC7\x85N\x14a\x01@W\x80c\xD2\x12 \xA7\x14a\x01SW\x80c\xDFy\x1EP\x14a\x01fW\x80c\xF2\xFD\xE3\x8B\x14a\x01yW\x80c\xF7\x88\x8A\xEC\x14a\x01\x8CW`\0\x80\xFD[\x80c\t^\xA7\xB3\x14a\0\xAEW\x80c%\xBE\x12N\x14a\0\xC3W\x80c&N\x88\x93\x14a\0\xF3W\x80cc[\xC0\xC2\x14a\x01\x06W\x80cqP\x18\xA6\x14a\x01'W[`\0\x80\xFD[a\0\xC1a\0\xBC6`\x04a\x08\0V[a\x01\x9FV[\0[`\x02Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xC1a\x01\x016`\x04a\x08\0V[a\x02oV[a\x01\x19a\x01\x146`\x04a\x08*V[a\x02\xEFV[`@Q\x90\x81R` \x01a\0\xEAV[a\0\xC1a\x03\xDEV[`\0T`\x01`\x01`\xA0\x1B\x03\x16a\0\xD6V[a\0\xC1a\x01N6`\x04a\x08fV[a\x03\xF2V[`\x01Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\0\xC1a\x01t6`\x04a\x08*V[a\x04(V[a\0\xC1a\x01\x876`\x04a\x08\x99V[a\x06JV[a\x01\x19a\x01\x9A6`\x04a\x08fV[a\x06\xC3V[`\x01T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90c\xE1\xF2\x1Cg\x90a\x01\xD3\x903\x90\x86\x90\x86\x90`\x04\x01a\x08\xB4V[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01\xEDW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x01W=`\0\x80>=`\0\xFD[PP`\x02T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x92Pc\xE1\xF2\x1Cg\x91Pa\x029\x903\x90\x86\x90\x86\x90`\x04\x01a\x08\xB4V[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02SW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02gW=`\0\x80>=`\0\xFD[PPPPPPV[a\x02wa\x07:V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x83\x16\x90c#\xB8r\xDD\x90a\x02\xA7\x903\x900\x90\x86\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x02\xC6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x02\xEA\x91\x90a\x08\xD8V[PPPV[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\0\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x036W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03Z\x91\x90a\t\x01V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03\x9EW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03\xC2\x91\x90a\t\x01V[a\x03\xCC\x90\x84a\t\x1AV[a\x03\xD6\x91\x90a\t?V[\x94\x93PPPPV[a\x03\xE6a\x07:V[a\x03\xF0`\0a\x07\x94V[V[a\x03\xFAa\x07:V[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x93\x84\x16`\x01`\x01`\xA0\x1B\x03\x19\x91\x82\x16\x17\x90\x91U`\x02\x80T\x92\x90\x93\x16\x91\x16\x17\x90UV[`@Qcp\xA0\x821`\xE0\x1B\x81R3`\x04\x82\x01R\x81\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x04nW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x04\x92\x91\x90a\t\x01V[\x10\x15a\x04\xDAW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x12`$\x82\x01Rq\x04\xE6\xF7B\x06V\xE6\xF7Vv\x82\x07F\xF2\x077v\x17`t\x1B`D\x82\x01R`d\x01[`@Q\x80\x91\x03\x90\xFD[`\0a\x04\xE7\x84\x84\x84a\x02\xEFV[`@Qc#\xB8r\xDD`\xE0\x1B\x81R\x90\x91P`\x01`\x01`\xA0\x1B\x03\x85\x16\x90c#\xB8r\xDD\x90a\x05\x1A\x903\x900\x90\x87\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x059W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05]\x91\x90a\x08\xD8V[P`@Qc\t^\xA7\xB3`\xE0\x1B\x81R0`\x04\x82\x01R`$\x81\x01\x82\x90R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c\t^\xA7\xB3\x90`D\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x05\xABW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05\xCF\x91\x90a\x08\xD8V[P`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c#\xB8r\xDD\x90a\x06\0\x900\x903\x90\x86\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06\x1FW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06C\x91\x90a\x08\xD8V[PPPPPV[a\x06Ra\x07:V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x06\xB7W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01a\x04\xD1V[a\x06\xC0\x81a\x07\x94V[PV[`@Qcp\xA0\x821`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x82\x81\x16`\x04\x83\x01R`\0\x91\x90\x84\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x07\rW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x071\x91\x90a\t\x01V[\x90P[\x92\x91PPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x03\xF0W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x04\xD1V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x07\xFBW`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x08\x13W`\0\x80\xFD[a\x08\x1C\x83a\x07\xE4V[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08?W`\0\x80\xFD[a\x08H\x84a\x07\xE4V[\x92Pa\x08V` \x85\x01a\x07\xE4V[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0\x80`@\x83\x85\x03\x12\x15a\x08yW`\0\x80\xFD[a\x08\x82\x83a\x07\xE4V[\x91Pa\x08\x90` \x84\x01a\x07\xE4V[\x90P\x92P\x92\x90PV[`\0` \x82\x84\x03\x12\x15a\x08\xABW`\0\x80\xFD[a\x071\x82a\x07\xE4V[`\x01`\x01`\xA0\x1B\x03\x93\x84\x16\x81R\x91\x90\x92\x16` \x82\x01R`@\x81\x01\x91\x90\x91R``\x01\x90V[`\0` \x82\x84\x03\x12\x15a\x08\xEAW`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\x08\xFAW`\0\x80\xFD[\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\t\x13W`\0\x80\xFD[PQ\x91\x90PV[\x80\x82\x02\x81\x15\x82\x82\x04\x84\x14\x17a\x074WcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[`\0\x82a\t\\WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V\xFE\xA2dipfsX\"\x12 !\xED\xAF\x82\xC3\x87\xD6\x7Fc\x08\x84\x94\xF7U\x7F\xF0\x8BN\nz\x82\x18\x9F^{\x18\xAB#\x81\x88\x8C/dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static DEXTWO_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xA9W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x11a\0qW\x80c\x8D\xA5\xCB[\x14a\x01/W\x80c\xCB\xC7\x85N\x14a\x01@W\x80c\xD2\x12 \xA7\x14a\x01SW\x80c\xDFy\x1EP\x14a\x01fW\x80c\xF2\xFD\xE3\x8B\x14a\x01yW\x80c\xF7\x88\x8A\xEC\x14a\x01\x8CW`\0\x80\xFD[\x80c\t^\xA7\xB3\x14a\0\xAEW\x80c%\xBE\x12N\x14a\0\xC3W\x80c&N\x88\x93\x14a\0\xF3W\x80cc[\xC0\xC2\x14a\x01\x06W\x80cqP\x18\xA6\x14a\x01'W[`\0\x80\xFD[a\0\xC1a\0\xBC6`\x04a\x08\0V[a\x01\x9FV[\0[`\x02Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0\xC1a\x01\x016`\x04a\x08\0V[a\x02oV[a\x01\x19a\x01\x146`\x04a\x08*V[a\x02\xEFV[`@Q\x90\x81R` \x01a\0\xEAV[a\0\xC1a\x03\xDEV[`\0T`\x01`\x01`\xA0\x1B\x03\x16a\0\xD6V[a\0\xC1a\x01N6`\x04a\x08fV[a\x03\xF2V[`\x01Ta\0\xD6\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[a\0\xC1a\x01t6`\x04a\x08*V[a\x04(V[a\0\xC1a\x01\x876`\x04a\x08\x99V[a\x06JV[a\x01\x19a\x01\x9A6`\x04a\x08fV[a\x06\xC3V[`\x01T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90c\xE1\xF2\x1Cg\x90a\x01\xD3\x903\x90\x86\x90\x86\x90`\x04\x01a\x08\xB4V[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x01\xEDW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02\x01W=`\0\x80>=`\0\xFD[PP`\x02T`@Qc\xE1\xF2\x1Cg`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x92Pc\xE1\xF2\x1Cg\x91Pa\x029\x903\x90\x86\x90\x86\x90`\x04\x01a\x08\xB4V[`\0`@Q\x80\x83\x03\x81`\0\x87\x80;\x15\x80\x15a\x02SW`\0\x80\xFD[PZ\xF1\x15\x80\x15a\x02gW=`\0\x80>=`\0\xFD[PPPPPPV[a\x02wa\x07:V[`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x83\x16\x90c#\xB8r\xDD\x90a\x02\xA7\x903\x900\x90\x86\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x02\xC6W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x02\xEA\x91\x90a\x08\xD8V[PPPV[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\0\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x036W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03Z\x91\x90a\t\x01V[`@Qcp\xA0\x821`\xE0\x1B\x81R0`\x04\x82\x01R`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x03\x9EW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x03\xC2\x91\x90a\t\x01V[a\x03\xCC\x90\x84a\t\x1AV[a\x03\xD6\x91\x90a\t?V[\x94\x93PPPPV[a\x03\xE6a\x07:V[a\x03\xF0`\0a\x07\x94V[V[a\x03\xFAa\x07:V[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x93\x84\x16`\x01`\x01`\xA0\x1B\x03\x19\x91\x82\x16\x17\x90\x91U`\x02\x80T\x92\x90\x93\x16\x91\x16\x17\x90UV[`@Qcp\xA0\x821`\xE0\x1B\x81R3`\x04\x82\x01R\x81\x90`\x01`\x01`\xA0\x1B\x03\x85\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x04nW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x04\x92\x91\x90a\t\x01V[\x10\x15a\x04\xDAW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x12`$\x82\x01Rq\x04\xE6\xF7B\x06V\xE6\xF7Vv\x82\x07F\xF2\x077v\x17`t\x1B`D\x82\x01R`d\x01[`@Q\x80\x91\x03\x90\xFD[`\0a\x04\xE7\x84\x84\x84a\x02\xEFV[`@Qc#\xB8r\xDD`\xE0\x1B\x81R\x90\x91P`\x01`\x01`\xA0\x1B\x03\x85\x16\x90c#\xB8r\xDD\x90a\x05\x1A\x903\x900\x90\x87\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x059W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05]\x91\x90a\x08\xD8V[P`@Qc\t^\xA7\xB3`\xE0\x1B\x81R0`\x04\x82\x01R`$\x81\x01\x82\x90R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c\t^\xA7\xB3\x90`D\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x05\xABW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x05\xCF\x91\x90a\x08\xD8V[P`@Qc#\xB8r\xDD`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x84\x16\x90c#\xB8r\xDD\x90a\x06\0\x900\x903\x90\x86\x90`\x04\x01a\x08\xB4V[` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x06\x1FW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x06C\x91\x90a\x08\xD8V[PPPPPV[a\x06Ra\x07:V[`\x01`\x01`\xA0\x1B\x03\x81\x16a\x06\xB7W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FOwnable: new owner is the zero a`D\x82\x01Reddress`\xD0\x1B`d\x82\x01R`\x84\x01a\x04\xD1V[a\x06\xC0\x81a\x07\x94V[PV[`@Qcp\xA0\x821`\xE0\x1B\x81R`\x01`\x01`\xA0\x1B\x03\x82\x81\x16`\x04\x83\x01R`\0\x91\x90\x84\x16\x90cp\xA0\x821\x90`$\x01` `@Q\x80\x83\x03\x81\x86Z\xFA\x15\x80\x15a\x07\rW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x071\x91\x90a\t\x01V[\x90P[\x92\x91PPV[`\0T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x03\xF0W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01\x81\x90R`$\x82\x01R\x7FOwnable: caller is not the owner`D\x82\x01R`d\x01a\x04\xD1V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\x01`\x01`\xA0\x1B\x03\x19\x83\x16\x81\x17\x84U`@Q\x91\x90\x92\x16\x92\x83\x91\x7F\x8B\xE0\x07\x9CS\x16Y\x14\x13D\xCD\x1F\xD0\xA4\xF2\x84\x19I\x7F\x97\"\xA3\xDA\xAF\xE3\xB4\x18okdW\xE0\x91\x90\xA3PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x07\xFBW`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x08\x13W`\0\x80\xFD[a\x08\x1C\x83a\x07\xE4V[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08?W`\0\x80\xFD[a\x08H\x84a\x07\xE4V[\x92Pa\x08V` \x85\x01a\x07\xE4V[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0\x80`@\x83\x85\x03\x12\x15a\x08yW`\0\x80\xFD[a\x08\x82\x83a\x07\xE4V[\x91Pa\x08\x90` \x84\x01a\x07\xE4V[\x90P\x92P\x92\x90PV[`\0` \x82\x84\x03\x12\x15a\x08\xABW`\0\x80\xFD[a\x071\x82a\x07\xE4V[`\x01`\x01`\xA0\x1B\x03\x93\x84\x16\x81R\x91\x90\x92\x16` \x82\x01R`@\x81\x01\x91\x90\x91R``\x01\x90V[`\0` \x82\x84\x03\x12\x15a\x08\xEAW`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\x08\xFAW`\0\x80\xFD[\x93\x92PPPV[`\0` \x82\x84\x03\x12\x15a\t\x13W`\0\x80\xFD[PQ\x91\x90PV[\x80\x82\x02\x81\x15\x82\x82\x04\x84\x14\x17a\x074WcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[`\0\x82a\t\\WcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x04\x90V\xFE\xA2dipfsX\"\x12 !\xED\xAF\x82\xC3\x87\xD6\x7Fc\x08\x84\x94\xF7U\x7F\xF0\x8BN\nz\x82\x18\x9F^{\x18\xAB#\x81\x88\x8C/dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static DEXTWO_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct DexTwo(::ethers::contract::Contract); - impl ::core::clone::Clone for DexTwo { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for DexTwo { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for DexTwo { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for DexTwo { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(DexTwo)) - .field(&self.address()) - .finish() - } - } - impl DexTwo { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - DEXTWO_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - DEXTWO_ABI.clone(), - DEXTWO_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `add_liquidity` - /// (0x264e8893) function - pub fn add_liquidity( - &self, - token_address: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([38, 78, 136, 147], (token_address, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `approve` (0x095ea7b3) - /// function - pub fn approve( - &self, - spender: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([9, 94, 167, 179], (spender, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `balanceOf` (0xf7888aec) - /// function - pub fn balance_of( - &self, - token: ::ethers::core::types::Address, - account: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([247, 136, 138, 236], (token, account)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `getSwapAmount` - /// (0x635bc0c2) function - pub fn get_swap_amount( - &self, - from: ::ethers::core::types::Address, - to: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([99, 91, 192, 194], (from, to, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `renounceOwnership` - /// (0x715018a6) function - pub fn renounce_ownership( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([113, 80, 24, 166], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `setTokens` (0xcbc7854e) - /// function - pub fn set_tokens( - &self, - token_1: ::ethers::core::types::Address, - token_2: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([203, 199, 133, 78], (token_1, token_2)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `swap` (0xdf791e50) - /// function - pub fn swap( - &self, - from: ::ethers::core::types::Address, - to: ::ethers::core::types::Address, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([223, 121, 30, 80], (from, to, amount)) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `token1` (0xd21220a7) - /// function - pub fn token_1( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([210, 18, 32, 167], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `token2` (0x25be124e) - /// function - pub fn token_2( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([37, 190, 18, 78], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `transferOwnership` - /// (0xf2fde38b) function - pub fn transfer_ownership( - &self, - new_owner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([242, 253, 227, 139], new_owner) - .expect("method not found (this should never happen)") - } - ///Gets the contract's `OwnershipTransferred` event - pub fn ownership_transferred_filter( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event() - } - /// Returns an `Event` builder for all the events of - /// this contract. - pub fn events( - &self, - ) -> ::ethers::contract::builders::Event< - ::std::sync::Arc, - M, - OwnershipTransferredFilter, - > { - self.0.event_with_filter(::core::default::Default::default()) - } - } - impl - From<::ethers::contract::Contract> for DexTwo - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - #[derive( - Clone, - ::ethers::contract::EthEvent, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethevent( - name = "OwnershipTransferred", - abi = "OwnershipTransferred(address,address)" - )] - pub struct OwnershipTransferredFilter { - #[ethevent(indexed)] - pub previous_owner: ::ethers::core::types::Address, - #[ethevent(indexed)] - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `add_liquidity` function with signature - /// `add_liquidity(address,uint256)` and selector - /// `0x264e8893` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "add_liquidity", abi = "add_liquidity(address,uint256)")] - pub struct AddLiquidityCall { - pub token_address: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `approve` function with signature - /// `approve(address,uint256)` and selector `0x095ea7b3` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "approve", abi = "approve(address,uint256)")] - pub struct ApproveCall { - pub spender: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `balanceOf` function with signature - /// `balanceOf(address,address)` and selector - /// `0xf7888aec` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "balanceOf", abi = "balanceOf(address,address)")] - pub struct BalanceOfCall { - pub token: ::ethers::core::types::Address, - pub account: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `getSwapAmount` function with signature - /// `getSwapAmount(address,address,uint256)` and - /// selector `0x635bc0c2` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall( - name = "getSwapAmount", - abi = "getSwapAmount(address,address,uint256)" - )] - pub struct GetSwapAmountCall { - pub from: ::ethers::core::types::Address, - pub to: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `renounceOwnership` function with signature - /// `renounceOwnership()` and selector `0x715018a6` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")] - pub struct RenounceOwnershipCall; - ///Container type for all input parameters for the - /// `setTokens` function with signature - /// `setTokens(address,address)` and selector - /// `0xcbc7854e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "setTokens", abi = "setTokens(address,address)")] - pub struct SetTokensCall { - pub token_1: ::ethers::core::types::Address, - pub token_2: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `swap` function with signature - /// `swap(address,address,uint256)` and selector - /// `0xdf791e50` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "swap", abi = "swap(address,address,uint256)")] - pub struct SwapCall { - pub from: ::ethers::core::types::Address, - pub to: ::ethers::core::types::Address, - pub amount: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `token1` function with signature `token1()` and - /// selector `0xd21220a7` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "token1", abi = "token1()")] - pub struct Token1Call; - ///Container type for all input parameters for the - /// `token2` function with signature `token2()` and - /// selector `0x25be124e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "token2", abi = "token2()")] - pub struct Token2Call; - ///Container type for all input parameters for the - /// `transferOwnership` function with signature - /// `transferOwnership(address)` and selector - /// `0xf2fde38b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")] - pub struct TransferOwnershipCall { - pub new_owner: ::ethers::core::types::Address, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum DexTwoCalls { - AddLiquidity(AddLiquidityCall), - Approve(ApproveCall), - BalanceOf(BalanceOfCall), - GetSwapAmount(GetSwapAmountCall), - Owner(OwnerCall), - RenounceOwnership(RenounceOwnershipCall), - SetTokens(SetTokensCall), - Swap(SwapCall), - Token1(Token1Call), - Token2(Token2Call), - TransferOwnership(TransferOwnershipCall), - } - impl ::ethers::core::abi::AbiDecode for DexTwoCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::AddLiquidity(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Approve(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::BalanceOf(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::GetSwapAmount(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::RenounceOwnership(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::SetTokens(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Swap(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Token1(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Token2(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::TransferOwnership(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for DexTwoCalls { - fn encode(self) -> Vec { - match self { - Self::AddLiquidity(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Approve(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::BalanceOf(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::GetSwapAmount(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::RenounceOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::SetTokens(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Swap(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Token1(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Token2(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::TransferOwnership(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for DexTwoCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::AddLiquidity(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Approve(element) => ::core::fmt::Display::fmt(element, f), - Self::BalanceOf(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::GetSwapAmount(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::RenounceOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::SetTokens(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Swap(element) => ::core::fmt::Display::fmt(element, f), - Self::Token1(element) => ::core::fmt::Display::fmt(element, f), - Self::Token2(element) => ::core::fmt::Display::fmt(element, f), - Self::TransferOwnership(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: AddLiquidityCall) -> Self { Self::AddLiquidity(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: ApproveCall) -> Self { Self::Approve(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: BalanceOfCall) -> Self { Self::BalanceOf(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: GetSwapAmountCall) -> Self { Self::GetSwapAmount(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: RenounceOwnershipCall) -> Self { - Self::RenounceOwnership(value) - } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: SetTokensCall) -> Self { Self::SetTokens(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: SwapCall) -> Self { Self::Swap(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: Token1Call) -> Self { Self::Token1(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: Token2Call) -> Self { Self::Token2(value) } - } - impl ::core::convert::From for DexTwoCalls { - fn from(value: TransferOwnershipCall) -> Self { - Self::TransferOwnership(value) - } - } - ///Container type for all return fields from the - /// `balanceOf` function with signature - /// `balanceOf(address,address)` and selector - /// `0xf7888aec` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct BalanceOfReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `getSwapAmount` function with signature - /// `getSwapAmount(address,address,uint256)` and - /// selector `0x635bc0c2` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct GetSwapAmountReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `token1` function with signature `token1()` and - /// selector `0xd21220a7` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct Token1Return(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `token2` function with signature `token2()` and - /// selector `0x25be124e` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct Token2Return(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/elevator.rs b/ctf/src/abi/elevator.rs index aa3c3c1..a1ef78a 100644 --- a/ctf/src/abi/elevator.rs +++ b/ctf/src/abi/elevator.rs @@ -1,384 +1,12 @@ -pub use elevator::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod elevator { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("floor"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("floor"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("goTo"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("goTo"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_floor"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("top"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("top"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract Elevator { + bool public top; + uint256 public floor; + + function goTo(uint256 _floor) external; } - ///The parsed JSON ABI of the contract. - pub static ELEVATOR_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[Pa\x01\xFA\x80a\0\x1F`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0AW`\x005`\xE0\x1C\x80c@iSc\x14a\0FW\x80c\xED\x9Aq4\x14a\0bW\x80c\xFEm\xCD\xBA\x14a\0wW[`\0\x80\xFD[a\0O`\x01T\x81V[`@Q\x90\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0ua\0p6`\x04a\x01\x82V[a\0\x94V[\0[`\0Ta\0\x84\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\0YV[`@Qc/\xCD%\xE5`\xE1\x1B\x81R`\x04\x81\x01\x82\x90R3\x90\x81\x90c_\x9AK\xCA\x90`$\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\0\xD4W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\0\xF8\x91\x90a\x01\x9BV[a\x01~W`\x01\x82\x90U`@Qc/\xCD%\xE5`\xE1\x1B\x81R`\x04\x81\x01\x83\x90R`\x01`\x01`\xA0\x1B\x03\x82\x16\x90c_\x9AK\xCA\x90`$\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x01HW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x01l\x91\x90a\x01\x9BV[`\0\x80T`\xFF\x19\x16\x91\x15\x15\x91\x90\x91\x17\x90U[PPV[`\0` \x82\x84\x03\x12\x15a\x01\x94W`\0\x80\xFD[P5\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x01\xADW`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\x01\xBDW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xAF(\xE4\x17\x86\xAE\xC9WU,\x94\xCE7>$U=\xA6\x8E\xBD\x02\x9E,p\xFE\xF4eQ\xC1\r\xF9[dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static ELEVATOR_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0AW`\x005`\xE0\x1C\x80c@iSc\x14a\0FW\x80c\xED\x9Aq4\x14a\0bW\x80c\xFEm\xCD\xBA\x14a\0wW[`\0\x80\xFD[a\0O`\x01T\x81V[`@Q\x90\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[a\0ua\0p6`\x04a\x01\x82V[a\0\x94V[\0[`\0Ta\0\x84\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01a\0YV[`@Qc/\xCD%\xE5`\xE1\x1B\x81R`\x04\x81\x01\x82\x90R3\x90\x81\x90c_\x9AK\xCA\x90`$\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\0\xD4W=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\0\xF8\x91\x90a\x01\x9BV[a\x01~W`\x01\x82\x90U`@Qc/\xCD%\xE5`\xE1\x1B\x81R`\x04\x81\x01\x83\x90R`\x01`\x01`\xA0\x1B\x03\x82\x16\x90c_\x9AK\xCA\x90`$\x01` `@Q\x80\x83\x03\x81`\0\x87Z\xF1\x15\x80\x15a\x01HW=`\0\x80>=`\0\xFD[PPPP`@Q=`\x1F\x19`\x1F\x82\x01\x16\x82\x01\x80`@RP\x81\x01\x90a\x01l\x91\x90a\x01\x9BV[`\0\x80T`\xFF\x19\x16\x91\x15\x15\x91\x90\x91\x17\x90U[PPV[`\0` \x82\x84\x03\x12\x15a\x01\x94W`\0\x80\xFD[P5\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x01\xADW`\0\x80\xFD[\x81Q\x80\x15\x15\x81\x14a\x01\xBDW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xAF(\xE4\x17\x86\xAE\xC9WU,\x94\xCE7>$U=\xA6\x8E\xBD\x02\x9E,p\xFE\xF4eQ\xC1\r\xF9[dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static ELEVATOR_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Elevator(::ethers::contract::Contract); - impl ::core::clone::Clone for Elevator { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Elevator { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Elevator { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Elevator { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Elevator)) - .field(&self.address()) - .finish() - } - } - impl Elevator { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - ELEVATOR_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - ELEVATOR_ABI.clone(), - ELEVATOR_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `floor` (0x40695363) - /// function - pub fn floor( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([64, 105, 83, 99], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `goTo` (0xed9a7134) - /// function - pub fn go_to( - &self, - floor: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([237, 154, 113, 52], floor) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `top` (0xfe6dcdba) function - pub fn top( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([254, 109, 205, 186], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Elevator - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `floor` function with signature `floor()` and - /// selector `0x40695363` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "floor", abi = "floor()")] - pub struct FloorCall; - ///Container type for all input parameters for the - /// `goTo` function with signature `goTo(uint256)` and - /// selector `0xed9a7134` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "goTo", abi = "goTo(uint256)")] - pub struct GoToCall { - pub floor: ::ethers::core::types::U256, - } - ///Container type for all input parameters for the - /// `top` function with signature `top()` and selector - /// `0xfe6dcdba` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "top", abi = "top()")] - pub struct TopCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum ElevatorCalls { - Floor(FloorCall), - GoTo(GoToCall), - Top(TopCall), - } - impl ::ethers::core::abi::AbiDecode for ElevatorCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Floor(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::GoTo(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Top(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for ElevatorCalls { - fn encode(self) -> Vec { - match self { - Self::Floor(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::GoTo(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Top(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for ElevatorCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Floor(element) => ::core::fmt::Display::fmt(element, f), - Self::GoTo(element) => ::core::fmt::Display::fmt(element, f), - Self::Top(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for ElevatorCalls { - fn from(value: FloorCall) -> Self { Self::Floor(value) } - } - impl ::core::convert::From for ElevatorCalls { - fn from(value: GoToCall) -> Self { Self::GoTo(value) } - } - impl ::core::convert::From for ElevatorCalls { - fn from(value: TopCall) -> Self { Self::Top(value) } - } - ///Container type for all return fields from the - /// `floor` function with signature `floor()` and - /// selector `0x40695363` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct FloorReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the `top` - /// function with signature `top()` and selector - /// `0xfe6dcdba` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct TopReturn(pub bool); } diff --git a/ctf/src/abi/fallback.rs b/ctf/src/abi/fallback.rs index 574dd57..82d075b 100644 --- a/ctf/src/abi/fallback.rs +++ b/ctf/src/abi/fallback.rs @@ -1,531 +1,34 @@ -pub use fallback::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod fallback { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("contribute"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("contribute"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::Payable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("contributions"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("contributions"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("getContribution"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("getContribution"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("withdraw"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("withdraw"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: true, - fallback: false, +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc, bytecode = "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506103e8600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506101c9806100a76000396000f3fe608060405260043610610046576000357c0100000000000000000000000000000000000000000000000000000000900480635b6b431d1461004857806364d98f6e1461005f575b005b61005d6004803603810190610059919061012c565b610069565b005b61006761008e565b005b806001600033815260200190815260200160002060008282546100889190610159565b92505081905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610119576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610110906101f3565b60405180910390fd5b6101273361012690565b61020f565b565b6000813590506101368161024b565b92915050565b6000602082840312156101545761015361024b565b5b600061016284828501610127565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006101a6826101dc565b91506101b1836101dc565b9250828201905080821115610208576102076101dc565b5b92915050565b60007f08c379a000000000000000000000000000000000000000000000000000000000905092915050565b6000819050919050565b6101e5816101d1565b81146101f057600080fd5b50565b610232816101d1565b811461023d57600080fd5b50565b6000602082840312156102525761025161024b565b5b600061026084828501610127565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006102a4826101dc565b91506102af836101dc565b9250826102bf576102be61026c565b5b828204905092915050565b6102d3816101d1565b82525050565b60006020820190506102ee60008301846102ca565b92915050565b600081905092915050565b6000610310826102f4565b61031a81856102f4565b935061032a8185602086016102f4565b80840191505092915050565b6000610342828461030e565b91508190509291505056fea2646970667358221220e6c8896d3e5b4e5a2e2e7c5eaa2b5c5b3e6a6f5b7b6c0e9e6b2e3a2b6c1e2f1b64736f6c634300081a0033")] + contract Fallback { + mapping(address => uint256) public contributions; + address public owner; + + constructor() { + owner = msg.sender; + contributions[msg.sender] = 1000 * (10 ** 18); + } + + function contribute() public payable { + require(msg.value < 0.001 ether); + contributions[msg.sender] += msg.value; + } + + function getContribution() public view returns (uint256) { + return contributions[msg.sender]; + } + + function withdraw() public { + require(msg.sender == owner); + payable(owner).transfer(address(this).balance); + } + + receive() external payable { + require(msg.value > 0 && contributions[msg.sender] > 0); + owner = msg.sender; } } - ///The parsed JSON ABI of the contract. - pub static FALLBACK_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x90\x81\x17\x90\x91U`\0\x90\x81R` \x81\x90R`@\x90 h65\xC9\xAD\xC5\xDE\xA0\0\0\x90Ua\x02\xEA\x80a\0N`\09`\0\xF3\xFE`\x80`@R`\x046\x10a\0NW`\x005`\xE0\x1C\x80c<\xCF\xD6\x0B\x14a\0\x96W\x80cB\xE9L\x90\x14a\0\xADW\x80c\x8D\xA5\xCB[\x14a\0\xEDW\x80c\xD7\xBB\x99\xBA\x14a\x01%W\x80c\xF1\x0F\xDF\\\x14a\x01-W`\0\x80\xFD[6a\0\x91W`\x004\x11\x80\x15a\0qWP3`\0\x90\x81R` \x81\x90R`@\x90 T\x15\x15[a\0zW`\0\x80\xFD[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x90\x81\x17\x90\x91U\0[`\0\x80\xFD[4\x80\x15a\0\xA2W`\0\x80\xFD[Pa\0\xABa\x01OV[\0[4\x80\x15a\0\xB9W`\0\x80\xFD[Pa\0\xDAa\0\xC86`\x04a\x02]V[`\0` \x81\x90R\x90\x81R`@\x90 T\x81V[`@Q\x90\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[4\x80\x15a\0\xF9W`\0\x80\xFD[P`\x01Ta\x01\r\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0\xE4V[a\0\xABa\x01\xE9V[4\x80\x15a\x019W`\0\x80\xFD[P3`\0\x90\x81R` \x81\x90R`@\x90 Ta\0\xDAV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\xADW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x17`$\x82\x01R\x7Fcaller is not the owner\0\0\0\0\0\0\0\0\0`D\x82\x01R`d\x01`@Q\x80\x91\x03\x90\xFD[`\x01T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90G\x80\x15a\x08\xFC\x02\x91`\0\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x01\xE6W=`\0\x80>=`\0\xFD[PV[f\x03\x8D~\xA4\xC6\x80\x004\x10a\x01\xFCW`\0\x80\xFD[3`\0\x90\x81R` \x81\x90R`@\x81 \x80T4\x92\x90a\x02\x1B\x90\x84\x90a\x02\x8DV[\x90\x91UPP`\x01T`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x80\x82 T3\x83R\x91 T\x11\x15a\x02[W`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90U[V[`\0` \x82\x84\x03\x12\x15a\x02oW`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\x86W`\0\x80\xFD[\x93\x92PPPV[\x80\x82\x01\x80\x82\x11\x15a\x02\xAEWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 \xA6G\xF1~\x98X\xB0\xF0\x94\xE8Y\xAE\xDE\xDDh\xE6a1\x16\x835\x1A\xB5\xE8`\x93CP\xDC=`\0\xFD[PV[f\x03\x8D~\xA4\xC6\x80\x004\x10a\x01\xFCW`\0\x80\xFD[3`\0\x90\x81R` \x81\x90R`@\x81 \x80T4\x92\x90a\x02\x1B\x90\x84\x90a\x02\x8DV[\x90\x91UPP`\x01T`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x80\x82 T3\x83R\x91 T\x11\x15a\x02[W`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90U[V[`\0` \x82\x84\x03\x12\x15a\x02oW`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02\x86W`\0\x80\xFD[\x93\x92PPPV[\x80\x82\x01\x80\x82\x11\x15a\x02\xAEWcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x92\x91PPV\xFE\xA2dipfsX\"\x12 \xA6G\xF1~\x98X\xB0\xF0\x94\xE8Y\xAE\xDE\xDDh\xE6a1\x16\x835\x1A\xB5\xE8`\x93CP\xDC(::ethers::contract::Contract); - impl ::core::clone::Clone for Fallback { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Fallback { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Fallback { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Fallback { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Fallback)) - .field(&self.address()) - .finish() - } - } - impl Fallback { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - FALLBACK_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - FALLBACK_ABI.clone(), - FALLBACK_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `contribute` (0xd7bb99ba) - /// function - pub fn contribute( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([215, 187, 153, 186], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `contributions` - /// (0x42e94c90) function - pub fn contributions( - &self, - p0: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([66, 233, 76, 144], p0) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `getContribution` - /// (0xf10fdf5c) function - pub fn get_contribution( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([241, 15, 223, 92], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `withdraw` (0x3ccfd60b) - /// function - pub fn withdraw( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([60, 207, 214, 11], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Fallback - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `contribute` function with signature `contribute()` - /// and selector `0xd7bb99ba` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "contribute", abi = "contribute()")] - pub struct ContributeCall; - ///Container type for all input parameters for the - /// `contributions` function with signature - /// `contributions(address)` and selector `0x42e94c90` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "contributions", abi = "contributions(address)")] - pub struct ContributionsCall(pub ::ethers::core::types::Address); - ///Container type for all input parameters for the - /// `getContribution` function with signature - /// `getContribution()` and selector `0xf10fdf5c` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "getContribution", abi = "getContribution()")] - pub struct GetContributionCall; - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `withdraw` function with signature `withdraw()` and - /// selector `0x3ccfd60b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "withdraw", abi = "withdraw()")] - pub struct WithdrawCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum FallbackCalls { - Contribute(ContributeCall), - Contributions(ContributionsCall), - GetContribution(GetContributionCall), - Owner(OwnerCall), - Withdraw(WithdrawCall), - } - impl ::ethers::core::abi::AbiDecode for FallbackCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Contribute(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::Contributions(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::GetContribution(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Withdraw(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for FallbackCalls { - fn encode(self) -> Vec { - match self { - Self::Contribute(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Contributions(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::GetContribution(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Withdraw(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for FallbackCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Contribute(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Contributions(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::GetContribution(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::Withdraw(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for FallbackCalls { - fn from(value: ContributeCall) -> Self { Self::Contribute(value) } - } - impl ::core::convert::From for FallbackCalls { - fn from(value: ContributionsCall) -> Self { Self::Contributions(value) } - } - impl ::core::convert::From for FallbackCalls { - fn from(value: GetContributionCall) -> Self { - Self::GetContribution(value) - } - } - impl ::core::convert::From for FallbackCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for FallbackCalls { - fn from(value: WithdrawCall) -> Self { Self::Withdraw(value) } - } - ///Container type for all return fields from the - /// `contributions` function with signature - /// `contributions(address)` and selector `0x42e94c90` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct ContributionsReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `getContribution` function with signature - /// `getContribution()` and selector `0xf10fdf5c` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct GetContributionReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/fallout.rs b/ctf/src/abi/fallout.rs index 95165d5..664a22e 100644 --- a/ctf/src/abi/fallout.rs +++ b/ctf/src/abi/fallout.rs @@ -1,569 +1,14 @@ -pub use fallout::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod fallout { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("Fal1out"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("Fal1out"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::Payable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("allocate"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("allocate"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::Payable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("allocatorBalance"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("allocatorBalance"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("allocator"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("collectAllocations"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("collectAllocations"), - inputs: ::std::vec![], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address payable"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("sendAllocation"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("sendAllocation"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("allocator"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address payable"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Fallout { + mapping(address => uint256) allocatorBalance; + address payable public owner; + + function Fal1out() public payable; + function allocate() public payable; + function collectAllocations() public; + function sendAllocation(address payable allocator) public; } - ///The parsed JSON ABI of the contract. - pub static FALLOUT_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[Pa\x03A\x80a\0 `\09`\0\xF3\xFE`\x80`@R`\x046\x10a\0UW`\x005`\xE0\x1C\x80co\xAB]\xDF\x14a\0ZW\x80c\x8A\xA9o8\x14a\0dW\x80c\x8D\xA5\xCB[\x14a\0yW\x80c\xA2\xDE\xA2o\x14a\0\xAAW\x80c\xAB\xAA\x99\x16\x14a\0\xDDW\x80c\xFF\xD4\x0BV\x14a\0\xE5W[`\0\x80\xFD[a\0ba\x01*V[\0[4\x80\x15a\0pW`\0\x80\xFD[Pa\0ba\x01ZV[4\x80\x15a\0\x85W`\0\x80\xFD[Pa\0\x8Ea\x01\xE8V[`@\x80Q`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[4\x80\x15a\0\xB6W`\0\x80\xFD[Pa\0b`\x04\x806\x03` \x81\x10\x15a\0\xCDW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\xF7V[a\0ba\x02]V[4\x80\x15a\0\xF1W`\0\x80\xFD[Pa\x01\x18`\x04\x806\x03` \x81\x10\x15a\x01\x08W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x02\x8FV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90\x81\x90U`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 4\x90UV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\xB9W`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x17`$\x82\x01R\x7Fcaller is not the owner\0\0\0\0\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[`@Q3\x90G\x80\x15a\x08\xFC\x02\x91`\0\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x01\xE5W=`\0\x80>=`\0\xFD[PV[`\x01T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x90\x81R` \x81\x90R`@\x90 Ta\x02\x19W`\0\x80\xFD[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x81\x81R` \x81\x90R`@\x80\x82 T\x90Q\x81\x15a\x08\xFC\x02\x92\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x02YW=`\0\x80>=`\0\xFD[PPV[3`\0\x90\x81R` \x81\x90R`@\x90 Ta\x02}\x904c\xFF\xFF\xFF\xFFa\x02\xAA\x16V[3`\0\x90\x81R` \x81\x90R`@\x90 UV[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[`\0\x82\x82\x01\x83\x81\x10\x15a\x03\x04W`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7FSafeMath: addition overflow\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xCECr\xC4\x1DY\x13\xCAbii\x14\xE3\xEB\x16\xBA$\x93\0Z#\xFB`S\xE1\xF7\x0Ej\x9BA\x98jdsolcC\0\x06\x06\x003"; - /// The bytecode of the contract. - pub static FALLOUT_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R`\x046\x10a\0UW`\x005`\xE0\x1C\x80co\xAB]\xDF\x14a\0ZW\x80c\x8A\xA9o8\x14a\0dW\x80c\x8D\xA5\xCB[\x14a\0yW\x80c\xA2\xDE\xA2o\x14a\0\xAAW\x80c\xAB\xAA\x99\x16\x14a\0\xDDW\x80c\xFF\xD4\x0BV\x14a\0\xE5W[`\0\x80\xFD[a\0ba\x01*V[\0[4\x80\x15a\0pW`\0\x80\xFD[Pa\0ba\x01ZV[4\x80\x15a\0\x85W`\0\x80\xFD[Pa\0\x8Ea\x01\xE8V[`@\x80Q`\x01`\x01`\xA0\x1B\x03\x90\x92\x16\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[4\x80\x15a\0\xB6W`\0\x80\xFD[Pa\0b`\x04\x806\x03` \x81\x10\x15a\0\xCDW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\xF7V[a\0ba\x02]V[4\x80\x15a\0\xF1W`\0\x80\xFD[Pa\x01\x18`\x04\x806\x03` \x81\x10\x15a\x01\x08W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x02\x8FV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`\x01\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90\x81\x90U`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 4\x90UV[`\x01T`\x01`\x01`\xA0\x1B\x03\x163\x14a\x01\xB9W`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x17`$\x82\x01R\x7Fcaller is not the owner\0\0\0\0\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[`@Q3\x90G\x80\x15a\x08\xFC\x02\x91`\0\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x01\xE5W=`\0\x80>=`\0\xFD[PV[`\x01T`\x01`\x01`\xA0\x1B\x03\x16\x81V[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x90\x81R` \x81\x90R`@\x90 Ta\x02\x19W`\0\x80\xFD[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x81\x81R` \x81\x90R`@\x80\x82 T\x90Q\x81\x15a\x08\xFC\x02\x92\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\x02YW=`\0\x80>=`\0\xFD[PPV[3`\0\x90\x81R` \x81\x90R`@\x90 Ta\x02}\x904c\xFF\xFF\xFF\xFFa\x02\xAA\x16V[3`\0\x90\x81R` \x81\x90R`@\x90 UV[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[`\0\x82\x82\x01\x83\x81\x10\x15a\x03\x04W`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7FSafeMath: addition overflow\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xCECr\xC4\x1DY\x13\xCAbii\x14\xE3\xEB\x16\xBA$\x93\0Z#\xFB`S\xE1\xF7\x0Ej\x9BA\x98jdsolcC\0\x06\x06\x003"; - /// The deployed bytecode of the contract. - pub static FALLOUT_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Fallout(::ethers::contract::Contract); - impl ::core::clone::Clone for Fallout { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Fallout { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Fallout { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Fallout { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Fallout)) - .field(&self.address()) - .finish() - } - } - impl Fallout { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - FALLOUT_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - FALLOUT_ABI.clone(), - FALLOUT_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `Fal1out` (0x6fab5ddf) - /// function - pub fn fal_1out( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([111, 171, 93, 223], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `allocate` (0xabaa9916) - /// function - pub fn allocate( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([171, 170, 153, 22], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `allocatorBalance` - /// (0xffd40b56) function - pub fn allocator_balance( - &self, - allocator: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([255, 212, 11, 86], allocator) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `collectAllocations` - /// (0x8aa96f38) function - pub fn collect_allocations( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([138, 169, 111, 56], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `sendAllocation` - /// (0xa2dea26f) function - pub fn send_allocation( - &self, - allocator: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([162, 222, 162, 111], allocator) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Fallout - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `Fal1out` function with signature `Fal1out()` and - /// selector `0x6fab5ddf` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "Fal1out", abi = "Fal1out()")] - pub struct Fal1OutCall; - ///Container type for all input parameters for the - /// `allocate` function with signature `allocate()` and - /// selector `0xabaa9916` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "allocate", abi = "allocate()")] - pub struct AllocateCall; - ///Container type for all input parameters for the - /// `allocatorBalance` function with signature - /// `allocatorBalance(address)` and selector - /// `0xffd40b56` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "allocatorBalance", abi = "allocatorBalance(address)")] - pub struct AllocatorBalanceCall { - pub allocator: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `collectAllocations` function with signature - /// `collectAllocations()` and selector `0x8aa96f38` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "collectAllocations", abi = "collectAllocations()")] - pub struct CollectAllocationsCall; - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `sendAllocation` function with signature - /// `sendAllocation(address)` and selector `0xa2dea26f` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "sendAllocation", abi = "sendAllocation(address)")] - pub struct SendAllocationCall { - pub allocator: ::ethers::core::types::Address, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum FalloutCalls { - Fal1Out(Fal1OutCall), - Allocate(AllocateCall), - AllocatorBalance(AllocatorBalanceCall), - CollectAllocations(CollectAllocationsCall), - Owner(OwnerCall), - SendAllocation(SendAllocationCall), - } - impl ::ethers::core::abi::AbiDecode for FalloutCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Fal1Out(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Allocate(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::AllocatorBalance(decoded)); - } - if let Ok(decoded) = ::decode( - data, - ) { - return Ok(Self::CollectAllocations(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::SendAllocation(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for FalloutCalls { - fn encode(self) -> Vec { - match self { - Self::Fal1Out(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Allocate(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::AllocatorBalance(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::CollectAllocations(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::SendAllocation(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for FalloutCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Fal1Out(element) => ::core::fmt::Display::fmt(element, f), - Self::Allocate(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::AllocatorBalance(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::CollectAllocations(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::SendAllocation(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: Fal1OutCall) -> Self { Self::Fal1Out(value) } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: AllocateCall) -> Self { Self::Allocate(value) } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: AllocatorBalanceCall) -> Self { - Self::AllocatorBalance(value) - } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: CollectAllocationsCall) -> Self { - Self::CollectAllocations(value) - } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for FalloutCalls { - fn from(value: SendAllocationCall) -> Self { - Self::SendAllocation(value) - } - } - ///Container type for all return fields from the - /// `allocatorBalance` function with signature - /// `allocatorBalance(address)` and selector - /// `0xffd40b56` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct AllocatorBalanceReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/force.rs b/ctf/src/abi/force.rs index 4954a48..ddb011b 100644 --- a/ctf/src/abi/force.rs +++ b/ctf/src/abi/force.rs @@ -1,127 +1,8 @@ -pub use force::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod force { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::std::collections::BTreeMap::new(), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } - } - ///The parsed JSON ABI of the contract. - pub static FORCE_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`?\x80`\x1D`\09`\0\xF3\xFE`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xA9\xC9\xFC\xB8\x98By\xFBZ\x8E\x8Ad\x03?\x04)\x94\x83\xD3l\xDD\xEBIH;\x92\xC6\x93\xAAhM\xF3dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static FORCE_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R`\0\x80\xFD\xFE\xA2dipfsX\"\x12 \xA9\xC9\xFC\xB8\x98By\xFBZ\x8E\x8Ad\x03?\x04)\x94\x83\xD3l\xDD\xEBIH;\x92\xC6\x93\xAAhM\xF3dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static FORCE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Force(::ethers::contract::Contract); - impl ::core::clone::Clone for Force { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Force { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Force { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Force { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Force)) - .field(&self.address()) - .finish() - } - } - impl Force { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - FORCE_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - FORCE_ABI.clone(), - FORCE_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - } - impl - From<::ethers::contract::Contract> for Force - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Force { + constructor(); } } diff --git a/ctf/src/abi/gatekeeper_one.rs b/ctf/src/abi/gatekeeper_one.rs index f893d0d..553f97d 100644 --- a/ctf/src/abi/gatekeeper_one.rs +++ b/ctf/src/abi/gatekeeper_one.rs @@ -1,332 +1,11 @@ -pub use gatekeeper_one::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod gatekeeper_one { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("enter"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("enter"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_gateKey"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 8usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes8"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("entrant"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("entrant"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract GatekeeperOne { + address public entrant; + + function enter(bytes8 _gateKey) external returns (bool); } - ///The parsed JSON ABI of the contract. - pub static GATEKEEPERONE_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[Pa\x02\xAB\x80a\0\x1F`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c3p N\x14a\0;W\x80c\x9D\xB3\x1Dw\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x02\"V[a\0\x8EV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0Ta\0v\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0ZV[`\x0023\x03a\0\x9CW`\0\x80\xFD[a\x1F\xFFZa\0\xAA\x91\x90a\x02SV[\x15a\0\xB4W`\0\x80\xFD[\x81\x80`\xC0\x1Ca\xFF\xFF\x16\x81`\xC0\x1Cc\xFF\xFF\xFF\xFF\x16\x14a\x01+W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`)`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rh part one`\xB8\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[`\xC0\x81\x90\x1Cc\xFF\xFF\xFF\xFF\x81\x16\x03a\x01\x96W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`)`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rh part two`\xB8\x1B`d\x82\x01R`\x84\x01a\x01\"V[2a\xFF\xFF\x16\x81`\xC0\x1Cc\xFF\xFF\xFF\xFF\x16\x14a\x02\x06W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`+`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rj part three`\xA8\x1B`d\x82\x01R`\x84\x01a\x01\"V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x162\x17\x90U`\x01\x91PP\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x024W`\0\x80\xFD[\x815`\x01`\x01`\xC0\x1B\x03\x19\x81\x16\x81\x14a\x02LW`\0\x80\xFD[\x93\x92PPPV[`\0\x82a\x02pWcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x06\x90V\xFE\xA2dipfsX\"\x12 T\x913\xBD\x0E\xDE\xC1'<\xF2\xE2\xBD\xF1\xDA\xC5ueT\xD2]\xC9\x04f\xED\xABh\\\xBA\x81\xA0\x16*dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static GATEKEEPERONE_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c3p N\x14a\0;W\x80c\x9D\xB3\x1Dw\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x02\"V[a\0\x8EV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0Ta\0v\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0ZV[`\x0023\x03a\0\x9CW`\0\x80\xFD[a\x1F\xFFZa\0\xAA\x91\x90a\x02SV[\x15a\0\xB4W`\0\x80\xFD[\x81\x80`\xC0\x1Ca\xFF\xFF\x16\x81`\xC0\x1Cc\xFF\xFF\xFF\xFF\x16\x14a\x01+W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`)`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rh part one`\xB8\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[`\xC0\x81\x90\x1Cc\xFF\xFF\xFF\xFF\x81\x16\x03a\x01\x96W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`)`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rh part two`\xB8\x1B`d\x82\x01R`\x84\x01a\x01\"V[2a\xFF\xFF\x16\x81`\xC0\x1Cc\xFF\xFF\xFF\xFF\x16\x14a\x02\x06W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`+`$\x82\x01R\x7FGatekeeperOne: invalid gateThree`D\x82\x01Rj part three`\xA8\x1B`d\x82\x01R`\x84\x01a\x01\"V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x162\x17\x90U`\x01\x91PP\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x024W`\0\x80\xFD[\x815`\x01`\x01`\xC0\x1B\x03\x19\x81\x16\x81\x14a\x02LW`\0\x80\xFD[\x93\x92PPPV[`\0\x82a\x02pWcNH{q`\xE0\x1B`\0R`\x12`\x04R`$`\0\xFD[P\x06\x90V\xFE\xA2dipfsX\"\x12 T\x913\xBD\x0E\xDE\xC1'<\xF2\xE2\xBD\xF1\xDA\xC5ueT\xD2]\xC9\x04f\xED\xABh\\\xBA\x81\xA0\x16*dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static GATEKEEPERONE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct GatekeeperOne(::ethers::contract::Contract); - impl ::core::clone::Clone for GatekeeperOne { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for GatekeeperOne { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for GatekeeperOne { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for GatekeeperOne { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(GatekeeperOne)) - .field(&self.address()) - .finish() - } - } - impl GatekeeperOne { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - GATEKEEPERONE_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - GATEKEEPERONE_ABI.clone(), - GATEKEEPERONE_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `enter` (0x3370204e) - /// function - pub fn enter( - &self, - gate_key: [u8; 8], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([51, 112, 32, 78], gate_key) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `entrant` (0x9db31d77) - /// function - pub fn entrant( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([157, 179, 29, 119], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for GatekeeperOne - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `enter` function with signature `enter(bytes8)` and - /// selector `0x3370204e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "enter", abi = "enter(bytes8)")] - pub struct EnterCall { - pub gate_key: [u8; 8], - } - ///Container type for all input parameters for the - /// `entrant` function with signature `entrant()` and - /// selector `0x9db31d77` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "entrant", abi = "entrant()")] - pub struct EntrantCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum GatekeeperOneCalls { - Enter(EnterCall), - Entrant(EntrantCall), - } - impl ::ethers::core::abi::AbiDecode for GatekeeperOneCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Enter(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Entrant(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for GatekeeperOneCalls { - fn encode(self) -> Vec { - match self { - Self::Enter(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Entrant(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for GatekeeperOneCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Enter(element) => ::core::fmt::Display::fmt(element, f), - Self::Entrant(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for GatekeeperOneCalls { - fn from(value: EnterCall) -> Self { Self::Enter(value) } - } - impl ::core::convert::From for GatekeeperOneCalls { - fn from(value: EntrantCall) -> Self { Self::Entrant(value) } - } - ///Container type for all return fields from the - /// `enter` function with signature `enter(bytes8)` and - /// selector `0x3370204e` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct EnterReturn(pub bool); - ///Container type for all return fields from the - /// `entrant` function with signature `entrant()` and - /// selector `0x9db31d77` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct EntrantReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/gatekeeper_two.rs b/ctf/src/abi/gatekeeper_two.rs index f5505f7..3fa1fcf 100644 --- a/ctf/src/abi/gatekeeper_two.rs +++ b/ctf/src/abi/gatekeeper_two.rs @@ -1,332 +1,11 @@ -pub use gatekeeper_two::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod gatekeeper_two { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("enter"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("enter"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_gateKey"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 8usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes8"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("entrant"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("entrant"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract GatekeeperTwo { + address public entrant; + + function enter(bytes8 _gateKey) external returns (bool); } - ///The parsed JSON ABI of the contract. - pub static GATEKEEPERTWO_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[Pa\x01\x8B\x80a\0\x1F`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c3p N\x14a\0;W\x80c\x9D\xB3\x1Dw\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x01$V[a\0\x8EV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0Ta\0v\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0ZV[`\x0023\x03a\0\x9CW`\0\x80\xFD[3;\x80\x15a\0\xA9W`\0\x80\xFD[`@Qk\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x193``\x1B\x16` \x82\x01R\x83\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x90`\xC0\x83\x90\x1C\x90`4\x01`@Q` \x81\x83\x03\x03\x81R\x90`@R\x80Q\x90` \x01 `\xC0\x1C\x18g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x14a\x01\x07W`\0\x80\xFD[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x162\x17\x90U`\x01\x92PPP\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x016W`\0\x80\xFD[\x815`\x01`\x01`\xC0\x1B\x03\x19\x81\x16\x81\x14a\x01NW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xB5?[\xF3NP\x03\x11\x9B2Y\x08'\xAD\xFA\xF9\xD9)\xB0\xF6\xCB\xBC;\xC5\xEE\x06\xECZ\t1\xE1TdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static GATEKEEPERTWO_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\x006W`\x005`\xE0\x1C\x80c3p N\x14a\0;W\x80c\x9D\xB3\x1Dw\x14a\0cW[`\0\x80\xFD[a\0Na\0I6`\x04a\x01$V[a\0\x8EV[`@Q\x90\x15\x15\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0Ta\0v\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\0ZV[`\x0023\x03a\0\x9CW`\0\x80\xFD[3;\x80\x15a\0\xA9W`\0\x80\xFD[`@Qk\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x193``\x1B\x16` \x82\x01R\x83\x90g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x90`\xC0\x83\x90\x1C\x90`4\x01`@Q` \x81\x83\x03\x03\x81R\x90`@R\x80Q\x90` \x01 `\xC0\x1C\x18g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x16\x14a\x01\x07W`\0\x80\xFD[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x162\x17\x90U`\x01\x92PPP\x91\x90PV[`\0` \x82\x84\x03\x12\x15a\x016W`\0\x80\xFD[\x815`\x01`\x01`\xC0\x1B\x03\x19\x81\x16\x81\x14a\x01NW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xB5?[\xF3NP\x03\x11\x9B2Y\x08'\xAD\xFA\xF9\xD9)\xB0\xF6\xCB\xBC;\xC5\xEE\x06\xECZ\t1\xE1TdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static GATEKEEPERTWO_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct GatekeeperTwo(::ethers::contract::Contract); - impl ::core::clone::Clone for GatekeeperTwo { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for GatekeeperTwo { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for GatekeeperTwo { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for GatekeeperTwo { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(GatekeeperTwo)) - .field(&self.address()) - .finish() - } - } - impl GatekeeperTwo { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - GATEKEEPERTWO_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - GATEKEEPERTWO_ABI.clone(), - GATEKEEPERTWO_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `enter` (0x3370204e) - /// function - pub fn enter( - &self, - gate_key: [u8; 8], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([51, 112, 32, 78], gate_key) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `entrant` (0x9db31d77) - /// function - pub fn entrant( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([157, 179, 29, 119], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for GatekeeperTwo - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `enter` function with signature `enter(bytes8)` and - /// selector `0x3370204e` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "enter", abi = "enter(bytes8)")] - pub struct EnterCall { - pub gate_key: [u8; 8], - } - ///Container type for all input parameters for the - /// `entrant` function with signature `entrant()` and - /// selector `0x9db31d77` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "entrant", abi = "entrant()")] - pub struct EntrantCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum GatekeeperTwoCalls { - Enter(EnterCall), - Entrant(EntrantCall), - } - impl ::ethers::core::abi::AbiDecode for GatekeeperTwoCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Enter(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Entrant(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for GatekeeperTwoCalls { - fn encode(self) -> Vec { - match self { - Self::Enter(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Entrant(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for GatekeeperTwoCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Enter(element) => ::core::fmt::Display::fmt(element, f), - Self::Entrant(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for GatekeeperTwoCalls { - fn from(value: EnterCall) -> Self { Self::Enter(value) } - } - impl ::core::convert::From for GatekeeperTwoCalls { - fn from(value: EntrantCall) -> Self { Self::Entrant(value) } - } - ///Container type for all return fields from the - /// `enter` function with signature `enter(bytes8)` and - /// selector `0x3370204e` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct EnterReturn(pub bool); - ///Container type for all return fields from the - /// `entrant` function with signature `entrant()` and - /// selector `0x9db31d77` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct EntrantReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/king.rs b/ctf/src/abi/king.rs index 0b0022d..69063b2 100644 --- a/ctf/src/abi/king.rs +++ b/ctf/src/abi/king.rs @@ -1,403 +1,14 @@ -pub use king::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod king { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("_king"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("_king"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("prize"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("prize"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: true, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract King { + address public _king; + uint256 public prize; + address public owner; + + constructor() payable; + + receive() external payable; } - ///The parsed JSON ABI of the contract. - pub static KING_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R`\x02\x80T`\x01`\x01`\xA0\x1B\x03\x19\x90\x81\x163\x90\x81\x17\x90\x92U`\0\x80T\x90\x91\x16\x90\x91\x17\x90U4`\x01Ua\x01l\x80a\0:`\09`\0\xF3\xFE`\x80`@R`\x046\x10a\08W`\x005`\xE0\x1C\x80c)\xCCmo\x14a\0\xBBW\x80c\x8D\xA5\xCB[\x14a\0\xF2W\x80c\xE3\xAC]&\x14a\x01\x12W`\0\x80\xFD[6a\0\xB6W`\x01T4\x10\x15\x80a\0XWP`\x02T`\x01`\x01`\xA0\x1B\x03\x163\x14[a\0aW`\0\x80\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x914\x80\x15a\x08\xFC\x02\x92\x90\x91\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\0\x9BW=`\0\x80>=`\0\xFD[P`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90U4`\x01\x81\x90U\0[`\0\x80\xFD[4\x80\x15a\0\xC7W`\0\x80\xFD[P`\0T`\x01`\x01`\xA0\x1B\x03\x16[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[4\x80\x15a\0\xFEW`\0\x80\xFD[P`\x02Ta\0\xD5\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[4\x80\x15a\x01\x1EW`\0\x80\xFD[Pa\x01(`\x01T\x81V[`@Q\x90\x81R` \x01a\0\xE9V\xFE\xA2dipfsX\"\x12 Ky\x08\xE4\x91}.\x04\x13\x9F\x11D\x18\xB7\xFBT\xC9\xE2\x95\x99\x9A\x7F\xAC-H\xE3\x9BqsZyJdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static KING_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R`\x046\x10a\08W`\x005`\xE0\x1C\x80c)\xCCmo\x14a\0\xBBW\x80c\x8D\xA5\xCB[\x14a\0\xF2W\x80c\xE3\xAC]&\x14a\x01\x12W`\0\x80\xFD[6a\0\xB6W`\x01T4\x10\x15\x80a\0XWP`\x02T`\x01`\x01`\xA0\x1B\x03\x163\x14[a\0aW`\0\x80\xFD[`\0\x80T`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x914\x80\x15a\x08\xFC\x02\x92\x90\x91\x81\x81\x81\x85\x88\x88\xF1\x93PPPP\x15\x80\x15a\0\x9BW=`\0\x80>=`\0\xFD[P`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90U4`\x01\x81\x90U\0[`\0\x80\xFD[4\x80\x15a\0\xC7W`\0\x80\xFD[P`\0T`\x01`\x01`\xA0\x1B\x03\x16[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[4\x80\x15a\0\xFEW`\0\x80\xFD[P`\x02Ta\0\xD5\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[4\x80\x15a\x01\x1EW`\0\x80\xFD[Pa\x01(`\x01T\x81V[`@Q\x90\x81R` \x01a\0\xE9V\xFE\xA2dipfsX\"\x12 Ky\x08\xE4\x91}.\x04\x13\x9F\x11D\x18\xB7\xFBT\xC9\xE2\x95\x99\x9A\x7F\xAC-H\xE3\x9BqsZyJdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static KING_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct King(::ethers::contract::Contract); - impl ::core::clone::Clone for King { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for King { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for King { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for King { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(King)) - .field(&self.address()) - .finish() - } - } - impl King { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - KING_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - KING_ABI.clone(), - KING_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `_king` (0x29cc6d6f) - /// function - pub fn king( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([41, 204, 109, 111], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `prize` (0xe3ac5d26) - /// function - pub fn prize( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([227, 172, 93, 38], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for King - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `_king` function with signature `_king()` and - /// selector `0x29cc6d6f` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "_king", abi = "_king()")] - pub struct KingCall; - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all input parameters for the - /// `prize` function with signature `prize()` and - /// selector `0xe3ac5d26` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "prize", abi = "prize()")] - pub struct PrizeCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum KingCalls { - King(KingCall), - Owner(OwnerCall), - Prize(PrizeCall), - } - impl ::ethers::core::abi::AbiDecode for KingCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::King(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Prize(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for KingCalls { - fn encode(self) -> Vec { - match self { - Self::King(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Prize(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for KingCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::King(element) => ::core::fmt::Display::fmt(element, f), - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - Self::Prize(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for KingCalls { - fn from(value: KingCall) -> Self { Self::King(value) } - } - impl ::core::convert::From for KingCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - impl ::core::convert::From for KingCalls { - fn from(value: PrizeCall) -> Self { Self::Prize(value) } - } - ///Container type for all return fields from the - /// `_king` function with signature `_king()` and - /// selector `0x29cc6d6f` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct KingReturn(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); - ///Container type for all return fields from the - /// `prize` function with signature `prize()` and - /// selector `0xe3ac5d26` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct PrizeReturn(pub ::ethers::core::types::U256); } diff --git a/ctf/src/abi/magic_num.rs b/ctf/src/abi/magic_num.rs index a53c146..d856068 100644 --- a/ctf/src/abi/magic_num.rs +++ b/ctf/src/abi/magic_num.rs @@ -1,310 +1,11 @@ -pub use magic_num::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod magic_num { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("setSolver"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("setSolver"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_solver"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("solver"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("solver"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract MagicNum { + address public solver; + + function setSolver(address _solver) external; } - ///The parsed JSON ABI of the contract. - pub static MAGICNUM_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\xF8\x80a\0\x1E`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x1F\x87\x943\x14`7W\x80cI\xA7\xA2m\x14`fW[`\0\x80\xFD[`d`B6`\x04`\x94V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\0[`\0T`x\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`\0` \x82\x84\x03\x12\x15`\xA5W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`\xBBW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 R\x9BT\xFF\xFE\xB6\x0C7q\xBB\xE1\xF1\x13\x8B\x07X\x95\xB2M\xC8\x1A/\xB4$\xBC\x1F\xD8\xAE\xAC\xB9\xFF\xD5dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static MAGICNUM_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x1F\x87\x943\x14`7W\x80cI\xA7\xA2m\x14`fW[`\0\x80\xFD[`d`B6`\x04`\x94V[`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x92\x90\x92\x16\x91\x90\x91\x17\x90UV[\0[`\0T`x\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`\0` \x82\x84\x03\x12\x15`\xA5W`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`\xBBW`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 R\x9BT\xFF\xFE\xB6\x0C7q\xBB\xE1\xF1\x13\x8B\x07X\x95\xB2M\xC8\x1A/\xB4$\xBC\x1F\xD8\xAE\xAC\xB9\xFF\xD5dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static MAGICNUM_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct MagicNum(::ethers::contract::Contract); - impl ::core::clone::Clone for MagicNum { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for MagicNum { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for MagicNum { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for MagicNum { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(MagicNum)) - .field(&self.address()) - .finish() - } - } - impl MagicNum { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - MAGICNUM_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - MAGICNUM_ABI.clone(), - MAGICNUM_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `setSolver` (0x1f879433) - /// function - pub fn set_solver( - &self, - solver: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([31, 135, 148, 51], solver) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `solver` (0x49a7a26d) - /// function - pub fn solver( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([73, 167, 162, 109], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for MagicNum - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `setSolver` function with signature - /// `setSolver(address)` and selector `0x1f879433` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "setSolver", abi = "setSolver(address)")] - pub struct SetSolverCall { - pub solver: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `solver` function with signature `solver()` and - /// selector `0x49a7a26d` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "solver", abi = "solver()")] - pub struct SolverCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum MagicNumCalls { - SetSolver(SetSolverCall), - Solver(SolverCall), - } - impl ::ethers::core::abi::AbiDecode for MagicNumCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::SetSolver(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Solver(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for MagicNumCalls { - fn encode(self) -> Vec { - match self { - Self::SetSolver(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Solver(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for MagicNumCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::SetSolver(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Solver(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for MagicNumCalls { - fn from(value: SetSolverCall) -> Self { Self::SetSolver(value) } - } - impl ::core::convert::From for MagicNumCalls { - fn from(value: SolverCall) -> Self { Self::Solver(value) } - } - ///Container type for all return fields from the - /// `solver` function with signature `solver()` and - /// selector `0x49a7a26d` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct SolverReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/mod.rs b/ctf/src/abi/mod.rs index 604ab56..0d14ac5 100644 --- a/ctf/src/abi/mod.rs +++ b/ctf/src/abi/mod.rs @@ -4,168 +4,188 @@ //! Do not manually edit these files. //! These files may be overwritten by the codegen system at //! any time. -pub mod access_control; -pub mod access_control_enumerable; -pub mod accounting_token; -pub mod address; -pub mod address_upgradeable; -pub mod alien_codex; -pub mod arrays; -pub mod authorized_executor; -pub mod building; -pub mod buyer; -pub mod climber_timelock; -pub mod climber_timelock_base; -pub mod climber_vault; -pub mod coin; + +// Migrated ABI files (using alloy sol! macros) pub mod coin_flip; -pub mod context; -pub mod context_upgradeable; -pub mod counters; -pub mod crypto_vault; -pub mod damn_valuable_nft; -pub mod damn_valuable_token; -pub mod damn_valuable_token_snapshot; pub mod delegate; -pub mod delegate_erc20; pub mod delegation; -pub mod denial; -pub mod dex; -pub mod dex_two; -pub mod double_entry_point; pub mod elevator; -pub mod engine; -pub mod enum_; -pub mod enumerable_set; -pub mod erc165; -pub mod erc1967_upgrade_upgradeable; -pub mod erc20; -pub mod erc20_snapshot; -pub mod erc4626; -pub mod erc721; -pub mod erc721_burnable; -pub mod ether_payment_fallback; -pub mod exchange; -pub mod executor; +pub mod gatekeeper_one; +pub mod privacy; +pub mod reentrance; pub mod fallback; -pub mod fallback_manager; pub mod fallout; -pub mod fixed_point_math_lib; -pub mod flash_loan_receiver; -pub mod flash_loaner_pool; pub mod force; -pub mod forta; -pub mod free_rider_nft_marketplace; -pub mod free_rider_recovery; -pub mod full_math; -pub mod gatekeeper_one; -pub mod gatekeeper_three; -pub mod gatekeeper_two; -pub mod gnosis_safe; -pub mod gnosis_safe_math; -pub mod gnosis_safe_proxy; -pub mod good_samaritan; -pub mod guard; -pub mod guard_manager; -pub mod i_access_control; -pub mod i_access_control_enumerable; -pub mod i_beacon_upgradeable; -pub mod i_detection_bot; -pub mod i_flash_loan_ether_receiver; -pub mod i_forta; -pub mod i_gnosis_safe_proxy_factory; -pub mod i_notifyable; -pub mod i_proxy; -pub mod i_proxy_creation_callback; -pub mod i_signature_validator; -pub mod i_signature_validator_constants; -pub mod i_simple_governance; -pub mod i_uniswap_v2_pair; -pub mod i_uniswap_v3_pool; -pub mod i_uniswap_v3_pool_actions; -pub mod i_uniswap_v3_pool_derived_state; -pub mod i_uniswap_v3_pool_events; -pub mod i_uniswap_v3_pool_immutables; -pub mod i_uniswap_v3_pool_owner_actions; -pub mod i_uniswap_v3_pool_state; -pub mod ierc165; -pub mod ierc1822_proxiable_upgradeable; -pub mod ierc1967_upgradeable; -pub mod ierc20; -pub mod ierc20_metadata; -pub mod ierc20_minimal; -pub mod ierc3156_flash_borrower; -pub mod ierc3156_flash_lender; -pub mod ierc721; -pub mod ierc721_metadata; -pub mod ierc721_receiver; -pub mod initializable; pub mod king; -pub mod legacy_token; -pub mod lib_sort; -pub mod library_contract; +pub mod telephone; +pub mod token; +pub mod alien_codex; +pub mod denial; +pub mod dex; +pub mod dex_two; +pub mod gatekeeper_two; pub mod magic_num; -pub mod math; -pub mod meaning_of_life; -pub mod module_manager; -pub mod motorbike; -pub mod naive_receiver_lender_pool; pub mod naught_coin; -pub mod oracle_library; -pub mod ownable; -pub mod ownable_roles; -pub mod ownable_upgradeable; -pub mod owned; -pub mod owner_manager; pub mod preservation; -pub mod privacy; -pub mod proxy; -pub mod puppet_pool; -pub mod puppet_v2_pool; -pub mod puppet_v3_pool; -pub mod puzzle_proxy; -pub mod puzzle_wallet; -pub mod receiver_unstoppable; pub mod recovery; -pub mod recovery_solution; -pub mod reentrance; -pub mod reentrancy_guard; -pub mod reward_token; -pub mod safe_math; -pub mod safe_transfer_lib; -pub mod secured_token_transfer; -pub mod self_authorized; -pub mod self_authorized_vault; -pub mod selfie_pool; -pub mod shared_types; pub mod shop; -pub mod side_entrance_lender_pool; -pub mod signature_decoder; -pub mod signed_math; -pub mod simple_governance; -pub mod simple_token; -pub mod simple_trick; -pub mod singleton; -pub mod storage_accessible; -pub mod storage_slot; -pub mod storage_slot_upgradeable; -pub mod strings; pub mod swappable_token; pub mod swappable_token_two; -pub mod switch; -pub mod telephone; -pub mod the_rewarder_pool; -pub mod tick_math; -pub mod token; -pub mod transfer_helper; -pub mod truster_lender_pool; -pub mod trustful_oracle; -pub mod trustful_oracle_initializer; -pub mod uniswap_v2_library; -pub mod unstoppable_vault; -pub mod upgradeable_proxy; -pub mod uups_upgradeable; pub mod vault; -pub mod wallet; -pub mod wallet_deployer; -pub mod wallet_registry; + +// Unmigrated ABI files - commented out until migration to alloy is complete +// pub mod access_control; +// pub mod access_control_enumerable; +// pub mod accounting_token; +// pub mod address; +// pub mod address_upgradeable; +// pub mod alien_codex; +// pub mod arrays; +// pub mod authorized_executor; +// pub mod building; +// pub mod buyer; +// pub mod climber_timelock; +// pub mod climber_timelock_base; +// pub mod climber_vault; +// pub mod coin; +// pub mod context; +// pub mod context_upgradeable; +// pub mod counters; +// pub mod crypto_vault; +// pub mod damn_valuable_nft; +// pub mod damn_valuable_token; +// pub mod damn_valuable_token_snapshot; +// pub mod delegate_erc20; +// pub mod denial; +// pub mod dex; +// pub mod dex_two; +// pub mod double_entry_point; +// pub mod elevator; +// pub mod engine; +// pub mod enum_; +// pub mod enumerable_set; +// pub mod erc165; +// pub mod erc1967_upgrade_upgradeable; +// pub mod erc20; +// pub mod erc20_snapshot; +// pub mod erc4626; +// pub mod erc721; +// pub mod erc721_burnable; +// pub mod ether_payment_fallback; +// pub mod exchange; +// pub mod executor; +// pub mod fallback_manager; +// pub mod fixed_point_math_lib; +// pub mod flash_loan_receiver; +// pub mod flash_loaner_pool; +// pub mod forta; +// pub mod free_rider_nft_marketplace; +// pub mod free_rider_recovery; +// pub mod full_math; +// pub mod gatekeeper_one; +// pub mod gatekeeper_three; +// pub mod gatekeeper_two; +// pub mod gnosis_safe; +// pub mod gnosis_safe_math; +// pub mod gnosis_safe_proxy; +// pub mod good_samaritan; +// pub mod guard; +// pub mod guard_manager; +// pub mod i_access_control; +// pub mod i_access_control_enumerable; +// pub mod i_beacon_upgradeable; +// pub mod i_detection_bot; +// pub mod i_flash_loan_ether_receiver; +// pub mod i_forta; +// pub mod i_gnosis_safe_proxy_factory; +// pub mod i_notifyable; +// pub mod i_proxy; +// pub mod i_proxy_creation_callback; +// pub mod i_signature_validator; +// pub mod i_signature_validator_constants; +// pub mod i_simple_governance; +// pub mod i_uniswap_v2_pair; +// pub mod i_uniswap_v3_pool; +// pub mod i_uniswap_v3_pool_actions; +// pub mod i_uniswap_v3_pool_derived_state; +// pub mod i_uniswap_v3_pool_events; +// pub mod i_uniswap_v3_pool_immutables; +// pub mod i_uniswap_v3_pool_owner_actions; +// pub mod i_uniswap_v3_pool_state; +// pub mod ierc165; +// pub mod ierc1822_proxiable_upgradeable; +// pub mod ierc1967_upgradeable; +// pub mod ierc20; +// pub mod ierc20_metadata; +// pub mod ierc20_minimal; +// pub mod ierc3156_flash_borrower; +// pub mod ierc3156_flash_lender; +// pub mod ierc721; +// pub mod ierc721_metadata; +// pub mod ierc721_receiver; +// pub mod initializable; +// pub mod legacy_token; +// pub mod lib_sort; +// pub mod library_contract; +// pub mod magic_num; +// pub mod math; +// pub mod meaning_of_life; +// pub mod module_manager; +// pub mod motorbike; +// pub mod naive_receiver_lender_pool; +// pub mod naught_coin; +// pub mod oracle_library; +// pub mod ownable; +// pub mod ownable_roles; +// pub mod ownable_upgradeable; +// pub mod owned; +// pub mod owner_manager; +// pub mod preservation; +// pub mod privacy; +// pub mod proxy; +// pub mod puppet_pool; +// pub mod puppet_v2_pool; +// pub mod puppet_v3_pool; +// pub mod puzzle_proxy; +// pub mod puzzle_wallet; +// pub mod receiver_unstoppable; +// pub mod recovery; +// pub mod recovery_solution; +// pub mod reentrance; +// pub mod reentrancy_guard; +// pub mod reward_token; +// pub mod safe_math; +// pub mod safe_transfer_lib; +// pub mod secured_token_transfer; +// pub mod self_authorized; +// pub mod self_authorized_vault; +// pub mod selfie_pool; +// pub mod shared_types; +// pub mod shop; +// pub mod side_entrance_lender_pool; +// pub mod signature_decoder; +// pub mod signed_math; +// pub mod simple_governance; +// pub mod simple_token; +// pub mod simple_trick; +// pub mod singleton; +// pub mod storage_accessible; +// pub mod storage_slot; +// pub mod storage_slot_upgradeable; +// pub mod strings; +// pub mod swappable_token; +// pub mod swappable_token_two; +// pub mod switch; +// pub mod the_rewarder_pool; +// pub mod tick_math; +// pub mod transfer_helper; +// pub mod truster_lender_pool; +// pub mod trustful_oracle; +// pub mod trustful_oracle_initializer; +// pub mod uniswap_v2_library; +// pub mod unstoppable_vault; +// pub mod upgradeable_proxy; +// pub mod uups_upgradeable; +// pub mod wallet; +// pub mod wallet_deployer; +// pub mod wallet_registry; diff --git a/ctf/src/abi/naught_coin.rs b/ctf/src/abi/naught_coin.rs index 78c68af..40e1cf1 100644 --- a/ctf/src/abi/naught_coin.rs +++ b/ctf/src/abi/naught_coin.rs @@ -1,510 +1,26 @@ -pub use naught_coin::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod naught_coin { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_player"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("INITIAL_SUPPLY"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("INITIAL_SUPPLY"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("allowance"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("allowance"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("owner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("approve"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("approve"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("balanceOf"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balanceOf"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("account"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("decimals"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("decimals"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(8usize), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint8"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("decreaseAllowance"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("decreaseAllowance"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("subtractedValue"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("increaseAllowance"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("increaseAllowance"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("addedValue"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("name"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("name"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::String, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("string"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("player"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("player"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("symbol"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("symbol"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::String, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("string"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("timeLock"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("timeLock"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("totalSupply"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("totalSupply"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transfer"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transfer"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_value"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transferFrom"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transferFrom"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("Approval"), - ::std::vec![ - ::ethers::core::abi::ethabi::Event { - name: ::std::borrow::ToOwned::to_owned("Approval"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("owner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("spender"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("value"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - indexed: false, - }, - ], - anonymous: false, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("Transfer"), - ::std::vec![ - ::ethers::core::abi::ethabi::Event { - name: ::std::borrow::ToOwned::to_owned("Transfer"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("from"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - indexed: true, - }, - ::ethers::core::abi::ethabi::EventParam { - name: ::std::borrow::ToOwned::to_owned("value"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - indexed: false, - }, - ], - anonymous: false, - }, - ], - ), - ]), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract NaughtCoin { + string public name; + string public symbol; + uint8 public decimals; + uint256 public totalSupply; + uint256 public INITIAL_SUPPLY; + mapping(address => uint256) public balances; + mapping(address => mapping(address => uint256)) public allowance; + address public player; + uint256 public timeLock; + + constructor(address _player); + function balanceOf(address _owner) external view returns (uint256); + function approve(address _spender, uint256 _value) external returns (bool); + function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) external returns (bool); + function transfer(address _to, uint256 _value) external returns (bool); + function transferFrom(address _from, address _to, uint256 _value) external returns (bool); } - ///The parsed JSON ABI of the contract. - pub static NAUGHTCOIN_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@Ra\0\x12Bc\x12\xCC\x03\0a\x02\x01V[`\x05U4\x80\x15a\0!W`\0\x80\xFD[P`@Qa\r\xF48\x03\x80a\r\xF4\x839\x81\x01`@\x81\x90Ra\0@\x91a\x02\x1AV[`@Q\x80`@\x01`@R\x80`\n\x81R` \x01i'0\xBA\xB3\xB4:!\xB7\xB4\xB7`\xB1\x1B\x81RP`@Q\x80`@\x01`@R\x80`\x03\x81R` \x01b\x03\x07\x83`\xEC\x1B\x81RP\x81`\x03\x90\x81a\0\x8E\x91\x90a\x02\xEAV[P`\x04a\0\x9B\x82\x82a\x02\xEAV[PP`\x07\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x84\x16\x17\x90UPa\0\xC1`\x12\x90V[a\0\xCF\x90`\xFF\x16`\na\x04\x8DV[a\0\xDC\x90b\x0FB@a\x04\x99V[`\x06\x81\x90U`\x07Ta\0\xF9\x91`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90a\x015V[`\x07T`\x06T`@Q\x90\x81R`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x90`\0\x90`\0\x80Q` a\r\xD4\x839\x81Q\x91R\x90` \x01`@Q\x80\x91\x03\x90\xA3Pa\x04\xB0V[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x01\x8FW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1F`$\x82\x01R\x7FERC20: mint to the zero address\0`D\x82\x01R`d\x01`@Q\x80\x91\x03\x90\xFD[\x80`\x02`\0\x82\x82Ta\x01\xA1\x91\x90a\x02\x01V[\x90\x91UPP`\x01`\x01`\xA0\x1B\x03\x82\x16`\0\x81\x81R` \x81\x81R`@\x80\x83 \x80T\x86\x01\x90UQ\x84\x81R`\0\x80Q` a\r\xD4\x839\x81Q\x91R\x91\x01`@Q\x80\x91\x03\x90\xA3PPV[PPPV[cNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD[\x80\x82\x01\x80\x82\x11\x15a\x02\x14Wa\x02\x14a\x01\xEBV[\x92\x91PPV[`\0` \x82\x84\x03\x12\x15a\x02,W`\0\x80\xFD[\x81Q`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x02CW`\0\x80\xFD[\x93\x92PPPV[cNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`\x01\x81\x81\x1C\x90\x82\x16\x80a\x02tW`\x7F\x82\x16\x91P[` \x82\x10\x81\x03a\x02\x94WcNH{q`\xE0\x1B`\0R`\"`\x04R`$`\0\xFD[P\x91\x90PV[`\x1F\x82\x11\x15a\x01\xE6W`\0\x81`\0R` `\0 `\x1F\x85\x01`\x05\x1C\x81\x01` \x86\x10\x15a\x02\xC3WP\x80[`\x1F\x85\x01`\x05\x1C\x82\x01\x91P[\x81\x81\x10\x15a\x02\xE2W\x82\x81U`\x01\x01a\x02\xCFV[PPPPPPV[\x81Q`\x01`\x01`@\x1B\x03\x81\x11\x15a\x03\x03Wa\x03\x03a\x02JV[a\x03\x17\x81a\x03\x11\x84Ta\x02`V[\x84a\x02\x9AV[` \x80`\x1F\x83\x11`\x01\x81\x14a\x03LW`\0\x84\x15a\x034WP\x85\x83\x01Q[`\0\x19`\x03\x86\x90\x1B\x1C\x19\x16`\x01\x85\x90\x1B\x17\x85Ua\x02\xE2V[`\0\x85\x81R` \x81 `\x1F\x19\x86\x16\x91[\x82\x81\x10\x15a\x03{W\x88\x86\x01Q\x82U\x94\x84\x01\x94`\x01\x90\x91\x01\x90\x84\x01a\x03\\V[P\x85\x82\x10\x15a\x03\x99W\x87\x85\x01Q`\0\x19`\x03\x88\x90\x1B`\xF8\x16\x1C\x19\x16\x81U[PPPPP`\x01\x90\x81\x1B\x01\x90UPV[`\x01\x81\x81[\x80\x85\x11\x15a\x03\xE4W\x81`\0\x19\x04\x82\x11\x15a\x03\xCAWa\x03\xCAa\x01\xEBV[\x80\x85\x16\x15a\x03\xD7W\x91\x81\x02\x91[\x93\x84\x1C\x93\x90\x80\x02\x90a\x03\xAEV[P\x92P\x92\x90PV[`\0\x82a\x03\xFBWP`\x01a\x02\x14V[\x81a\x04\x08WP`\0a\x02\x14V[\x81`\x01\x81\x14a\x04\x1EW`\x02\x81\x14a\x04(Wa\x04DV[`\x01\x91PPa\x02\x14V[`\xFF\x84\x11\x15a\x049Wa\x049a\x01\xEBV[PP`\x01\x82\x1Ba\x02\x14V[P` \x83\x10a\x013\x83\x10\x16`N\x84\x10`\x0B\x84\x10\x16\x17\x15a\x04gWP\x81\x81\na\x02\x14V[a\x04q\x83\x83a\x03\xA9V[\x80`\0\x19\x04\x82\x11\x15a\x04\x85Wa\x04\x85a\x01\xEBV[\x02\x93\x92PPPV[`\0a\x02C\x83\x83a\x03\xECV[\x80\x82\x02\x81\x15\x82\x82\x04\x84\x14\x17a\x02\x14Wa\x02\x14a\x01\xEBV[a\t\x15\x80a\x04\xBF`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xEAW`\x005`\xE0\x1C\x80cH\xDB_\x89\x11a\0\x8CW\x80c\xA4W\xC2\xD7\x11a\0fW\x80c\xA4W\xC2\xD7\x14a\x01\xDCW\x80c\xA9\x05\x9C\xBB\x14a\x01\xEFW\x80c\xD0\x85\x83Z\x14a\x02\x02W\x80c\xDDb\xED>\x14a\x02\x0BW`\0\x80\xFD[\x80cH\xDB_\x89\x14a\x01\x80W\x80cp\xA0\x821\x14a\x01\xABW\x80c\x95\xD8\x9BA\x14a\x01\xD4W`\0\x80\xFD[\x80c#\xB8r\xDD\x11a\0\xC8W\x80c#\xB8r\xDD\x14a\x01BW\x80c/\xF2\xE9\xDC\x14a\x01UW\x80c1<\xE5g\x14a\x01^W\x80c9P\x93Q\x14a\x01mW`\0\x80\xFD[\x80c\x06\xFD\xDE\x03\x14a\0\xEFW\x80c\t^\xA7\xB3\x14a\x01\rW\x80c\x18\x16\r\xDD\x14a\x010W[`\0\x80\xFD[a\0\xF7a\x02\x1EV[`@Qa\x01\x04\x91\x90a\x07^V[`@Q\x80\x91\x03\x90\xF3[a\x01 a\x01\x1B6`\x04a\x07\xC9V[a\x02\xB0V[`@Q\x90\x15\x15\x81R` \x01a\x01\x04V[`\x02T[`@Q\x90\x81R` \x01a\x01\x04V[a\x01 a\x01P6`\x04a\x07\xF3V[a\x02\xCAV[a\x014`\x06T\x81V[`@Q`\x12\x81R` \x01a\x01\x04V[a\x01 a\x01{6`\x04a\x07\xC9V[a\x02\xEEV[`\x07Ta\x01\x93\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\x01\x04V[a\x014a\x01\xB96`\x04a\x08/V[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[a\0\xF7a\x03\x10V[a\x01 a\x01\xEA6`\x04a\x07\xC9V[a\x03\x1FV[a\x01 a\x01\xFD6`\x04a\x07\xC9V[a\x03\x9FV[a\x014`\x05T\x81V[a\x014a\x02\x196`\x04a\x08QV[a\x03\xE3V[```\x03\x80Ta\x02-\x90a\x08\x84V[\x80`\x1F\x01` \x80\x91\x04\x02` \x01`@Q\x90\x81\x01`@R\x80\x92\x91\x90\x81\x81R` \x01\x82\x80Ta\x02Y\x90a\x08\x84V[\x80\x15a\x02\xA6W\x80`\x1F\x10a\x02{Wa\x01\0\x80\x83T\x04\x02\x83R\x91` \x01\x91a\x02\xA6V[\x82\x01\x91\x90`\0R` `\0 \x90[\x81T\x81R\x90`\x01\x01\x90` \x01\x80\x83\x11a\x02\x89W\x82\x90\x03`\x1F\x16\x82\x01\x91[PPPPP\x90P\x90V[`\x003a\x02\xBE\x81\x85\x85a\x04\x0EV[`\x01\x91PP[\x92\x91PPV[`\x003a\x02\xD8\x85\x82\x85a\x052V[a\x02\xE3\x85\x85\x85a\x05\xACV[P`\x01\x94\x93PPPPV[`\x003a\x02\xBE\x81\x85\x85a\x03\x01\x83\x83a\x03\xE3V[a\x03\x0B\x91\x90a\x08\xBEV[a\x04\x0EV[```\x04\x80Ta\x02-\x90a\x08\x84V[`\x003\x81a\x03-\x82\x86a\x03\xE3V[\x90P\x83\x81\x10\x15a\x03\x92W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`%`$\x82\x01R\x7FERC20: decreased allowance below`D\x82\x01Rd zero`\xD8\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[a\x02\xE3\x82\x86\x86\x84\x03a\x04\x0EV[`\x07T`\0\x90`\x01`\x01`\xA0\x1B\x03\x163\x03a\x03\xD2W`\x05TB\x11a\x03\xC2W`\0\x80\xFD[a\x03\xCC\x83\x83a\x07PV[Pa\x02\xC4V[a\x03\xDC\x83\x83a\x07PV[P\x92\x91PPV[`\x01`\x01`\xA0\x1B\x03\x91\x82\x16`\0\x90\x81R`\x01` \x90\x81R`@\x80\x83 \x93\x90\x94\x16\x82R\x91\x90\x91R T\x90V[`\x01`\x01`\xA0\x1B\x03\x83\x16a\x04pW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`$\x80\x82\x01R\x7FERC20: approve from the zero add`D\x82\x01Rcress`\xE0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x04\xD1W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\"`$\x82\x01R\x7FERC20: approve to the zero addre`D\x82\x01Rass`\xF0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\0\x81\x81R`\x01` \x90\x81R`@\x80\x83 \x94\x87\x16\x80\x84R\x94\x82R\x91\x82\x90 \x85\x90U\x90Q\x84\x81R\x7F\x8C[\xE1\xE5\xEB\xEC}[\xD1OqB}\x1E\x84\xF3\xDD\x03\x14\xC0\xF7\xB2)\x1E[ \n\xC8\xC7\xC3\xB9%\x91\x01`@Q\x80\x91\x03\x90\xA3PPPV[`\0a\x05>\x84\x84a\x03\xE3V[\x90P`\0\x19\x81\x14a\x05\xA6W\x81\x81\x10\x15a\x05\x99W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1D`$\x82\x01R\x7FERC20: insufficient allowance\0\0\0`D\x82\x01R`d\x01a\x03\x89V[a\x05\xA6\x84\x84\x84\x84\x03a\x04\x0EV[PPPPV[`\x01`\x01`\xA0\x1B\x03\x83\x16a\x06\x10W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`%`$\x82\x01R\x7FERC20: transfer from the zero ad`D\x82\x01Rddress`\xD8\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x06rW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`#`$\x82\x01R\x7FERC20: transfer to the zero addr`D\x82\x01Rbess`\xE8\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x81\x81\x10\x15a\x06\xEAW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FERC20: transfer amount exceeds b`D\x82\x01Realance`\xD0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x84\x81\x16`\0\x81\x81R` \x81\x81R`@\x80\x83 \x87\x87\x03\x90U\x93\x87\x16\x80\x83R\x91\x84\x90 \x80T\x87\x01\x90U\x92Q\x85\x81R\x90\x92\x7F\xDD\xF2R\xAD\x1B\xE2\xC8\x9Bi\xC2\xB0h\xFC7\x8D\xAA\x95+\xA7\xF1c\xC4\xA1\x16(\xF5ZM\xF5#\xB3\xEF\x91\x01`@Q\x80\x91\x03\x90\xA3a\x05\xA6V[`\x003a\x02\xBE\x81\x85\x85a\x05\xACV[`\0` \x80\x83R\x83Q\x80` \x85\x01R`\0[\x81\x81\x10\x15a\x07\x8CW\x85\x81\x01\x83\x01Q\x85\x82\x01`@\x01R\x82\x01a\x07pV[P`\0`@\x82\x86\x01\x01R`@`\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x92PPP\x92\x91PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x07\xC4W`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x07\xDCW`\0\x80\xFD[a\x07\xE5\x83a\x07\xADV[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08\x08W`\0\x80\xFD[a\x08\x11\x84a\x07\xADV[\x92Pa\x08\x1F` \x85\x01a\x07\xADV[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0` \x82\x84\x03\x12\x15a\x08AW`\0\x80\xFD[a\x08J\x82a\x07\xADV[\x93\x92PPPV[`\0\x80`@\x83\x85\x03\x12\x15a\x08dW`\0\x80\xFD[a\x08m\x83a\x07\xADV[\x91Pa\x08{` \x84\x01a\x07\xADV[\x90P\x92P\x92\x90PV[`\x01\x81\x81\x1C\x90\x82\x16\x80a\x08\x98W`\x7F\x82\x16\x91P[` \x82\x10\x81\x03a\x08\xB8WcNH{q`\xE0\x1B`\0R`\"`\x04R`$`\0\xFD[P\x91\x90PV[\x80\x82\x01\x80\x82\x11\x15a\x02\xC4WcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD\xFE\xA2dipfsX\"\x12 \xA6\xB6\x11m#\xE5~W$\xE80\xF02p\x82\xEF\x8D`\xFA\t+&\x1A\xBE\r\x8D:}\xA0\xAD_\x95dsolcC\0\x08\x19\x003\xDD\xF2R\xAD\x1B\xE2\xC8\x9Bi\xC2\xB0h\xFC7\x8D\xAA\x95+\xA7\xF1c\xC4\xA1\x16(\xF5ZM\xF5#\xB3\xEF"; - /// The bytecode of the contract. - pub static NAUGHTCOIN_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0\xEAW`\x005`\xE0\x1C\x80cH\xDB_\x89\x11a\0\x8CW\x80c\xA4W\xC2\xD7\x11a\0fW\x80c\xA4W\xC2\xD7\x14a\x01\xDCW\x80c\xA9\x05\x9C\xBB\x14a\x01\xEFW\x80c\xD0\x85\x83Z\x14a\x02\x02W\x80c\xDDb\xED>\x14a\x02\x0BW`\0\x80\xFD[\x80cH\xDB_\x89\x14a\x01\x80W\x80cp\xA0\x821\x14a\x01\xABW\x80c\x95\xD8\x9BA\x14a\x01\xD4W`\0\x80\xFD[\x80c#\xB8r\xDD\x11a\0\xC8W\x80c#\xB8r\xDD\x14a\x01BW\x80c/\xF2\xE9\xDC\x14a\x01UW\x80c1<\xE5g\x14a\x01^W\x80c9P\x93Q\x14a\x01mW`\0\x80\xFD[\x80c\x06\xFD\xDE\x03\x14a\0\xEFW\x80c\t^\xA7\xB3\x14a\x01\rW\x80c\x18\x16\r\xDD\x14a\x010W[`\0\x80\xFD[a\0\xF7a\x02\x1EV[`@Qa\x01\x04\x91\x90a\x07^V[`@Q\x80\x91\x03\x90\xF3[a\x01 a\x01\x1B6`\x04a\x07\xC9V[a\x02\xB0V[`@Q\x90\x15\x15\x81R` \x01a\x01\x04V[`\x02T[`@Q\x90\x81R` \x01a\x01\x04V[a\x01 a\x01P6`\x04a\x07\xF3V[a\x02\xCAV[a\x014`\x06T\x81V[`@Q`\x12\x81R` \x01a\x01\x04V[a\x01 a\x01{6`\x04a\x07\xC9V[a\x02\xEEV[`\x07Ta\x01\x93\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01a\x01\x04V[a\x014a\x01\xB96`\x04a\x08/V[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[a\0\xF7a\x03\x10V[a\x01 a\x01\xEA6`\x04a\x07\xC9V[a\x03\x1FV[a\x01 a\x01\xFD6`\x04a\x07\xC9V[a\x03\x9FV[a\x014`\x05T\x81V[a\x014a\x02\x196`\x04a\x08QV[a\x03\xE3V[```\x03\x80Ta\x02-\x90a\x08\x84V[\x80`\x1F\x01` \x80\x91\x04\x02` \x01`@Q\x90\x81\x01`@R\x80\x92\x91\x90\x81\x81R` \x01\x82\x80Ta\x02Y\x90a\x08\x84V[\x80\x15a\x02\xA6W\x80`\x1F\x10a\x02{Wa\x01\0\x80\x83T\x04\x02\x83R\x91` \x01\x91a\x02\xA6V[\x82\x01\x91\x90`\0R` `\0 \x90[\x81T\x81R\x90`\x01\x01\x90` \x01\x80\x83\x11a\x02\x89W\x82\x90\x03`\x1F\x16\x82\x01\x91[PPPPP\x90P\x90V[`\x003a\x02\xBE\x81\x85\x85a\x04\x0EV[`\x01\x91PP[\x92\x91PPV[`\x003a\x02\xD8\x85\x82\x85a\x052V[a\x02\xE3\x85\x85\x85a\x05\xACV[P`\x01\x94\x93PPPPV[`\x003a\x02\xBE\x81\x85\x85a\x03\x01\x83\x83a\x03\xE3V[a\x03\x0B\x91\x90a\x08\xBEV[a\x04\x0EV[```\x04\x80Ta\x02-\x90a\x08\x84V[`\x003\x81a\x03-\x82\x86a\x03\xE3V[\x90P\x83\x81\x10\x15a\x03\x92W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`%`$\x82\x01R\x7FERC20: decreased allowance below`D\x82\x01Rd zero`\xD8\x1B`d\x82\x01R`\x84\x01[`@Q\x80\x91\x03\x90\xFD[a\x02\xE3\x82\x86\x86\x84\x03a\x04\x0EV[`\x07T`\0\x90`\x01`\x01`\xA0\x1B\x03\x163\x03a\x03\xD2W`\x05TB\x11a\x03\xC2W`\0\x80\xFD[a\x03\xCC\x83\x83a\x07PV[Pa\x02\xC4V[a\x03\xDC\x83\x83a\x07PV[P\x92\x91PPV[`\x01`\x01`\xA0\x1B\x03\x91\x82\x16`\0\x90\x81R`\x01` \x90\x81R`@\x80\x83 \x93\x90\x94\x16\x82R\x91\x90\x91R T\x90V[`\x01`\x01`\xA0\x1B\x03\x83\x16a\x04pW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`$\x80\x82\x01R\x7FERC20: approve from the zero add`D\x82\x01Rcress`\xE0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x04\xD1W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\"`$\x82\x01R\x7FERC20: approve to the zero addre`D\x82\x01Rass`\xF0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x83\x81\x16`\0\x81\x81R`\x01` \x90\x81R`@\x80\x83 \x94\x87\x16\x80\x84R\x94\x82R\x91\x82\x90 \x85\x90U\x90Q\x84\x81R\x7F\x8C[\xE1\xE5\xEB\xEC}[\xD1OqB}\x1E\x84\xF3\xDD\x03\x14\xC0\xF7\xB2)\x1E[ \n\xC8\xC7\xC3\xB9%\x91\x01`@Q\x80\x91\x03\x90\xA3PPPV[`\0a\x05>\x84\x84a\x03\xE3V[\x90P`\0\x19\x81\x14a\x05\xA6W\x81\x81\x10\x15a\x05\x99W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1D`$\x82\x01R\x7FERC20: insufficient allowance\0\0\0`D\x82\x01R`d\x01a\x03\x89V[a\x05\xA6\x84\x84\x84\x84\x03a\x04\x0EV[PPPPV[`\x01`\x01`\xA0\x1B\x03\x83\x16a\x06\x10W`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`%`$\x82\x01R\x7FERC20: transfer from the zero ad`D\x82\x01Rddress`\xD8\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x82\x16a\x06rW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`#`$\x82\x01R\x7FERC20: transfer to the zero addr`D\x82\x01Rbess`\xE8\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x83\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x81\x81\x10\x15a\x06\xEAW`@QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`&`$\x82\x01R\x7FERC20: transfer amount exceeds b`D\x82\x01Realance`\xD0\x1B`d\x82\x01R`\x84\x01a\x03\x89V[`\x01`\x01`\xA0\x1B\x03\x84\x81\x16`\0\x81\x81R` \x81\x81R`@\x80\x83 \x87\x87\x03\x90U\x93\x87\x16\x80\x83R\x91\x84\x90 \x80T\x87\x01\x90U\x92Q\x85\x81R\x90\x92\x7F\xDD\xF2R\xAD\x1B\xE2\xC8\x9Bi\xC2\xB0h\xFC7\x8D\xAA\x95+\xA7\xF1c\xC4\xA1\x16(\xF5ZM\xF5#\xB3\xEF\x91\x01`@Q\x80\x91\x03\x90\xA3a\x05\xA6V[`\x003a\x02\xBE\x81\x85\x85a\x05\xACV[`\0` \x80\x83R\x83Q\x80` \x85\x01R`\0[\x81\x81\x10\x15a\x07\x8CW\x85\x81\x01\x83\x01Q\x85\x82\x01`@\x01R\x82\x01a\x07pV[P`\0`@\x82\x86\x01\x01R`@`\x1F\x19`\x1F\x83\x01\x16\x85\x01\x01\x92PPP\x92\x91PPV[\x805`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14a\x07\xC4W`\0\x80\xFD[\x91\x90PV[`\0\x80`@\x83\x85\x03\x12\x15a\x07\xDCW`\0\x80\xFD[a\x07\xE5\x83a\x07\xADV[\x94` \x93\x90\x93\x015\x93PPPV[`\0\x80`\0``\x84\x86\x03\x12\x15a\x08\x08W`\0\x80\xFD[a\x08\x11\x84a\x07\xADV[\x92Pa\x08\x1F` \x85\x01a\x07\xADV[\x91P`@\x84\x015\x90P\x92P\x92P\x92V[`\0` \x82\x84\x03\x12\x15a\x08AW`\0\x80\xFD[a\x08J\x82a\x07\xADV[\x93\x92PPPV[`\0\x80`@\x83\x85\x03\x12\x15a\x08dW`\0\x80\xFD[a\x08m\x83a\x07\xADV[\x91Pa\x08{` \x84\x01a\x07\xADV[\x90P\x92P\x92\x90PV[`\x01\x81\x81\x1C\x90\x82\x16\x80a\x08\x98W`\x7F\x82\x16\x91P[` \x82\x10\x81\x03a\x08\xB8WcNH{q`\xE0\x1B`\0R`\"`\x04R`$`\0\xFD[P\x91\x90PV[\x80\x82\x01\x80\x82\x11\x15a\x02\xC4WcNH{q`\xE0\x1B`\0R`\x11`\x04R`$`\0\xFD\xFE\xA2dipfsX\"\x12 \xA6\xB6\x11m#\xE5~W$\xE80\xF02p\x82\xEF\x8D`\xFA\t+&\x1A\xBE\r\x8D:}\xA0\xAD_\x95dsolcC\0\x08\x19\x003"; /// The deployed bytecode of the contract. pub static NAUGHTCOIN_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); diff --git a/ctf/src/abi/privacy.rs b/ctf/src/abi/privacy.rs index 16407c8..dac7a6b 100644 --- a/ctf/src/abi/privacy.rs +++ b/ctf/src/abi/privacy.rs @@ -1,398 +1,14 @@ -pub use privacy::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod privacy { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_data"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedArray( - ::std::boxed::Box::new( - ::ethers::core::abi::ethabi::ParamType::FixedBytes(32usize), - ), - 3usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32[3]"), - ), - }, - ], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("ID"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("ID"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("locked"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("locked"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("unlock"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("unlock"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_key"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 16usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes16"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract Privacy { + bool public locked; + uint256 public ID; + bytes32[3] private data; + + constructor(bytes32[3] memory _data); + function unlock(bytes16 _key) external; } - ///The parsed JSON ABI of the contract. - pub static PRIVACY_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R`\0\x80T`\xFF\x19\x16`\x01\x90\x81\x17\x90\x91UB\x90\x81\x90U`\x02\x80Ta\xFF\xFF\x90\x92\x16b\x01\0\0\x02c\xFF\xFF\xFF\xFF\x19\x90\x92\x16\x91\x90\x91\x17a\xFF\n\x17\x90U4\x80\x15a\0GW`\0\x80\xFD[P`@Qa\x02z8\x03\x80a\x02z\x839\x81\x01`@\x81\x90Ra\0f\x91a\0\xCCV[a\0r`\x03\x82\x81a\0yV[PPa\x01WV[\x82`\x03\x81\x01\x92\x82\x15a\0\xA7W\x91` \x02\x82\x01[\x82\x81\x11\x15a\0\xA7W\x82Q\x82U\x91` \x01\x91\x90`\x01\x01\x90a\0\x8CV[Pa\0\xB3\x92\x91Pa\0\xB7V[P\x90V[[\x80\x82\x11\x15a\0\xB3W`\0\x81U`\x01\x01a\0\xB8V[`\0``\x82\x84\x03\x12\x15a\0\xDEW`\0\x80\xFD[\x82`\x1F\x83\x01\x12a\0\xEDW`\0\x80\xFD[`@Q``\x81\x01`\x01`\x01`@\x1B\x03\x81\x11\x82\x82\x10\x17\x15a\x01\x1DWcNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`@R\x80``\x84\x01\x85\x81\x11\x15a\x012W`\0\x80\xFD[\x84[\x81\x81\x10\x15a\x01LW\x80Q\x83R` \x92\x83\x01\x92\x01a\x014V[P\x91\x95\x94PPPPPV[a\x01\x14\x80a\x01f`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`(::ethers::contract::Contract); - impl ::core::clone::Clone for Privacy { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Privacy { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Privacy { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Privacy { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Privacy)) - .field(&self.address()) - .finish() - } - } - impl Privacy { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - PRIVACY_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - PRIVACY_ABI.clone(), - PRIVACY_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `ID` (0xb3cea217) function - pub fn id( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([179, 206, 162, 23], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `locked` (0xcf309012) - /// function - pub fn locked( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([207, 48, 144, 18], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `unlock` (0xe1afb08c) - /// function - pub fn unlock( - &self, - key: [u8; 16], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([225, 175, 176, 140], key) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Privacy - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the `ID` - /// function with signature `ID()` and selector - /// `0xb3cea217` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "ID", abi = "ID()")] - pub struct IdCall; - ///Container type for all input parameters for the - /// `locked` function with signature `locked()` and - /// selector `0xcf309012` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "locked", abi = "locked()")] - pub struct LockedCall; - ///Container type for all input parameters for the - /// `unlock` function with signature `unlock(bytes16)` - /// and selector `0xe1afb08c` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "unlock", abi = "unlock(bytes16)")] - pub struct UnlockCall { - pub key: [u8; 16], - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum PrivacyCalls { - Id(IdCall), - Locked(LockedCall), - Unlock(UnlockCall), - } - impl ::ethers::core::abi::AbiDecode for PrivacyCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Id(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Locked(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Unlock(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for PrivacyCalls { - fn encode(self) -> Vec { - match self { - Self::Id(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Locked(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Unlock(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for PrivacyCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Id(element) => ::core::fmt::Display::fmt(element, f), - Self::Locked(element) => ::core::fmt::Display::fmt(element, f), - Self::Unlock(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for PrivacyCalls { - fn from(value: IdCall) -> Self { Self::Id(value) } - } - impl ::core::convert::From for PrivacyCalls { - fn from(value: LockedCall) -> Self { Self::Locked(value) } - } - impl ::core::convert::From for PrivacyCalls { - fn from(value: UnlockCall) -> Self { Self::Unlock(value) } - } - ///Container type for all return fields from the `ID` - /// function with signature `ID()` and selector - /// `0xb3cea217` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct IdReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `locked` function with signature `locked()` and - /// selector `0xcf309012` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct LockedReturn(pub bool); } diff --git a/ctf/src/abi/reentrance.rs b/ctf/src/abi/reentrance.rs index 6227d4a..9cbec24 100644 --- a/ctf/src/abi/reentrance.rs +++ b/ctf/src/abi/reentrance.rs @@ -1,480 +1,15 @@ -pub use reentrance::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod reentrance { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::None, - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("balanceOf"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balanceOf"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_who"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("balance"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("balances"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balances"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("donate"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("donate"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::Payable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("withdraw"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("withdraw"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_amount"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: true, - fallback: false, - } +use alloy::sol; + +sol! { + #[allow(missing_docs)] + #[sol(rpc)] + contract Reentrance { + mapping(address => uint256) public balances; + + function balanceOf(address _who) external view returns (uint256 balance); + function donate(address _to) external payable; + function withdraw(uint256 _amount) external; + + receive() external payable; } - ///The parsed JSON ABI of the contract. - pub static REENTRANCE_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[Pa\x02\x96\x80a\0 `\09`\0\xF3\xFE`\x80`@R`\x046\x10a\0BW`\x005`\xE0\x1C\x80b6*\x95\x14a\0NW\x80c'\xE25\xE3\x14a\0vW\x80c.\x1A}M\x14a\0\xBBW\x80cp\xA0\x821\x14a\0\xE5Wa\0IV[6a\0IW\0[`\0\x80\xFD[a\0t`\x04\x806\x03` \x81\x10\x15a\0dW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\x18V[\0[4\x80\x15a\0\x82W`\0\x80\xFD[Pa\0\xA9`\x04\x806\x03` \x81\x10\x15a\0\x99W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01WV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[4\x80\x15a\0\xC7W`\0\x80\xFD[Pa\0t`\x04\x806\x03` \x81\x10\x15a\0\xDEW`\0\x80\xFD[P5a\x01iV[4\x80\x15a\0\xF1W`\0\x80\xFD[Pa\0\xA9`\x04\x806\x03` \x81\x10\x15a\x01\x08W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\xE4V[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x90\x81R` \x81\x90R`@\x90 Ta\x01;\x904a\x01\xFFV[`\x01`\x01`\xA0\x1B\x03\x90\x91\x16`\0\x90\x81R` \x81\x90R`@\x90 UV[`\0` \x81\x90R\x90\x81R`@\x90 T\x81V[3`\0\x90\x81R` \x81\x90R`@\x90 T\x81\x11a\x01\xE1W`@Q`\0\x903\x90\x83\x90\x83\x81\x81\x81\x85\x87Z\xF1\x92PPP=\x80`\0\x81\x14a\x01\xC1W`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>a\x01\xC6V[``\x91P[PP3`\0\x90\x81R` \x81\x90R`@\x90 \x80T\x84\x90\x03\x90UPP[PV[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[`\0\x82\x82\x01\x83\x81\x10\x15a\x02YW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7FSafeMath: addition overflow\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \x9Bd-x\x1A\xE3\x97\xDF\xF5\xEEcV\x08\x02^o\x11\xE1\xCF\xD0\xD5\"\x9D\xB6\x9F\xBAP\xFB\xF2\xB4u\x95dsolcC\0\x06\x0C\x003"; - /// The bytecode of the contract. - pub static REENTRANCE_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R`\x046\x10a\0BW`\x005`\xE0\x1C\x80b6*\x95\x14a\0NW\x80c'\xE25\xE3\x14a\0vW\x80c.\x1A}M\x14a\0\xBBW\x80cp\xA0\x821\x14a\0\xE5Wa\0IV[6a\0IW\0[`\0\x80\xFD[a\0t`\x04\x806\x03` \x81\x10\x15a\0dW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\x18V[\0[4\x80\x15a\0\x82W`\0\x80\xFD[Pa\0\xA9`\x04\x806\x03` \x81\x10\x15a\0\x99W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01WV[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[4\x80\x15a\0\xC7W`\0\x80\xFD[Pa\0t`\x04\x806\x03` \x81\x10\x15a\0\xDEW`\0\x80\xFD[P5a\x01iV[4\x80\x15a\0\xF1W`\0\x80\xFD[Pa\0\xA9`\x04\x806\x03` \x81\x10\x15a\x01\x08W`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\x01\xE4V[`\x01`\x01`\xA0\x1B\x03\x81\x16`\0\x90\x81R` \x81\x90R`@\x90 Ta\x01;\x904a\x01\xFFV[`\x01`\x01`\xA0\x1B\x03\x90\x91\x16`\0\x90\x81R` \x81\x90R`@\x90 UV[`\0` \x81\x90R\x90\x81R`@\x90 T\x81V[3`\0\x90\x81R` \x81\x90R`@\x90 T\x81\x11a\x01\xE1W`@Q`\0\x903\x90\x83\x90\x83\x81\x81\x81\x85\x87Z\xF1\x92PPP=\x80`\0\x81\x14a\x01\xC1W`@Q\x91P`\x1F\x19`?=\x01\x16\x82\x01`@R=\x82R=`\0` \x84\x01>a\x01\xC6V[``\x91P[PP3`\0\x90\x81R` \x81\x90R`@\x90 \x80T\x84\x90\x03\x90UPP[PV[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[`\0\x82\x82\x01\x83\x81\x10\x15a\x02YW`@\x80QbF\x1B\xCD`\xE5\x1B\x81R` `\x04\x82\x01R`\x1B`$\x82\x01R\x7FSafeMath: addition overflow\0\0\0\0\0`D\x82\x01R\x90Q\x90\x81\x90\x03`d\x01\x90\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \x9Bd-x\x1A\xE3\x97\xDF\xF5\xEEcV\x08\x02^o\x11\xE1\xCF\xD0\xD5\"\x9D\xB6\x9F\xBAP\xFB\xF2\xB4u\x95dsolcC\0\x06\x0C\x003"; - /// The deployed bytecode of the contract. - pub static REENTRANCE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Reentrance(::ethers::contract::Contract); - impl ::core::clone::Clone for Reentrance { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Reentrance { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Reentrance { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Reentrance { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Reentrance)) - .field(&self.address()) - .finish() - } - } - impl Reentrance { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - REENTRANCE_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - REENTRANCE_ABI.clone(), - REENTRANCE_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `balanceOf` (0x70a08231) - /// function - pub fn balance_of( - &self, - who: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([112, 160, 130, 49], who) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `balances` (0x27e235e3) - /// function - pub fn balances( - &self, - p0: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([39, 226, 53, 227], p0) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `donate` (0x00362a95) - /// function - pub fn donate( - &self, - to: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([0, 54, 42, 149], to) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `withdraw` (0x2e1a7d4d) - /// function - pub fn withdraw( - &self, - amount: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([46, 26, 125, 77], amount) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Reentrance - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `balanceOf` function with signature - /// `balanceOf(address)` and selector `0x70a08231` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "balanceOf", abi = "balanceOf(address)")] - pub struct BalanceOfCall { - pub who: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `balances` function with signature - /// `balances(address)` and selector `0x27e235e3` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "balances", abi = "balances(address)")] - pub struct BalancesCall(pub ::ethers::core::types::Address); - ///Container type for all input parameters for the - /// `donate` function with signature `donate(address)` - /// and selector `0x00362a95` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "donate", abi = "donate(address)")] - pub struct DonateCall { - pub to: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `withdraw` function with signature - /// `withdraw(uint256)` and selector `0x2e1a7d4d` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "withdraw", abi = "withdraw(uint256)")] - pub struct WithdrawCall { - pub amount: ::ethers::core::types::U256, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum ReentranceCalls { - BalanceOf(BalanceOfCall), - Balances(BalancesCall), - Donate(DonateCall), - Withdraw(WithdrawCall), - } - impl ::ethers::core::abi::AbiDecode for ReentranceCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::BalanceOf(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Balances(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Donate(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Withdraw(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for ReentranceCalls { - fn encode(self) -> Vec { - match self { - Self::BalanceOf(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Balances(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Donate(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Withdraw(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for ReentranceCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::BalanceOf(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Balances(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Donate(element) => ::core::fmt::Display::fmt(element, f), - Self::Withdraw(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for ReentranceCalls { - fn from(value: BalanceOfCall) -> Self { Self::BalanceOf(value) } - } - impl ::core::convert::From for ReentranceCalls { - fn from(value: BalancesCall) -> Self { Self::Balances(value) } - } - impl ::core::convert::From for ReentranceCalls { - fn from(value: DonateCall) -> Self { Self::Donate(value) } - } - impl ::core::convert::From for ReentranceCalls { - fn from(value: WithdrawCall) -> Self { Self::Withdraw(value) } - } - ///Container type for all return fields from the - /// `balanceOf` function with signature - /// `balanceOf(address)` and selector `0x70a08231` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct BalanceOfReturn { - pub balance: ::ethers::core::types::U256, - } - ///Container type for all return fields from the - /// `balances` function with signature - /// `balances(address)` and selector `0x27e235e3` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct BalancesReturn(pub ::ethers::core::types::U256); } diff --git a/ctf/src/abi/telephone.rs b/ctf/src/abi/telephone.rs index 198ad58..0c57f62 100644 --- a/ctf/src/abi/telephone.rs +++ b/ctf/src/abi/telephone.rs @@ -1,312 +1,12 @@ -pub use telephone::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod telephone { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("changeOwner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("changeOwner"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_owner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("owner"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("owner"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Telephone { + address public owner; + + constructor(); + + function changeOwner(address _owner) public; } - ///The parsed JSON ABI of the contract. - pub static TELEPHONE_ABI: ::ethers::contract::Lazy< - ::ethers::core::abi::Abi, - > = ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x163\x17\x90U`\xFF\x80a\x000`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`7W\x80c\xA6\xF9\xDA\xE1\x14`eW[`\0\x80\xFD[`\0T`I\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`t`p6`\x04`\x9BV[`vV[\0[23\x14`\x98W`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x83\x16\x17\x90U[PV[`\0` \x82\x84\x03\x12\x15`\xACW`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`\xC2W`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xABlH\x99\xF0 \xFC\xFC\x02OZ\xB6\t$E\xAD\xF2%\xFA\x01\xF7\x82n\x12]\x104'\xFBu&\xDDdsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static TELEPHONE_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\x8D\xA5\xCB[\x14`7W\x80c\xA6\xF9\xDA\xE1\x14`eW[`\0\x80\xFD[`\0T`I\x90`\x01`\x01`\xA0\x1B\x03\x16\x81V[`@Q`\x01`\x01`\xA0\x1B\x03\x90\x91\x16\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`t`p6`\x04`\x9BV[`vV[\0[23\x14`\x98W`\0\x80T`\x01`\x01`\xA0\x1B\x03\x19\x16`\x01`\x01`\xA0\x1B\x03\x83\x16\x17\x90U[PV[`\0` \x82\x84\x03\x12\x15`\xACW`\0\x80\xFD[\x815`\x01`\x01`\xA0\x1B\x03\x81\x16\x81\x14`\xC2W`\0\x80\xFD[\x93\x92PPPV\xFE\xA2dipfsX\"\x12 \xABlH\x99\xF0 \xFC\xFC\x02OZ\xB6\t$E\xAD\xF2%\xFA\x01\xF7\x82n\x12]\x104'\xFBu&\xDDdsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static TELEPHONE_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Telephone(::ethers::contract::Contract); - impl ::core::clone::Clone for Telephone { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Telephone { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Telephone { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Telephone { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Telephone)) - .field(&self.address()) - .finish() - } - } - impl Telephone { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - TELEPHONE_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - TELEPHONE_ABI.clone(), - TELEPHONE_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `changeOwner` (0xa6f9dae1) - /// function - pub fn change_owner( - &self, - owner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([166, 249, 218, 225], owner) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `owner` (0x8da5cb5b) - /// function - pub fn owner( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::Address, - > { - self.0 - .method_hash([141, 165, 203, 91], ()) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Telephone - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `changeOwner` function with signature - /// `changeOwner(address)` and selector `0xa6f9dae1` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "changeOwner", abi = "changeOwner(address)")] - pub struct ChangeOwnerCall { - pub owner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "owner", abi = "owner()")] - pub struct OwnerCall; - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum TelephoneCalls { - ChangeOwner(ChangeOwnerCall), - Owner(OwnerCall), - } - impl ::ethers::core::abi::AbiDecode for TelephoneCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::ChangeOwner(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Owner(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for TelephoneCalls { - fn encode(self) -> Vec { - match self { - Self::ChangeOwner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Owner(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for TelephoneCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::ChangeOwner(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Owner(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for TelephoneCalls { - fn from(value: ChangeOwnerCall) -> Self { Self::ChangeOwner(value) } - } - impl ::core::convert::From for TelephoneCalls { - fn from(value: OwnerCall) -> Self { Self::Owner(value) } - } - ///Container type for all return fields from the - /// `owner` function with signature `owner()` and - /// selector `0x8da5cb5b` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct OwnerReturn(pub ::ethers::core::types::Address); } diff --git a/ctf/src/abi/token.rs b/ctf/src/abi/token.rs index f2f423e..80b5a8b 100644 --- a/ctf/src/abi/token.rs +++ b/ctf/src/abi/token.rs @@ -1,455 +1,14 @@ -pub use token::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod token { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_initialSupply"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("balanceOf"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("balanceOf"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_owner"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("balance"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("totalSupply"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("totalSupply"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("transfer"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("transfer"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_to"), - kind: ::ethers::core::abi::ethabi::ParamType::Address, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("address"), - ), - }, - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_value"), - kind: ::ethers::core::abi::ethabi::ParamType::Uint( - 256usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("uint256"), - ), - }, - ], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Token { + uint256 public totalSupply; + mapping(address => uint256) balances; + + constructor(uint256 _initialSupply); + + function balanceOf(address _owner) public view returns (uint256 balance); + function transfer(address _to, uint256 _value) public returns (bool); } - ///The parsed JSON ABI of the contract. - pub static TOKEN_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`@Qa\x01\xAB8\x03\x80a\x01\xAB\x839\x81\x81\x01`@R` \x81\x10\x15a\x003W`\0\x80\xFD[PQ`\x01\x81\x90U3`\0\x90\x81R` \x81\x90R`@\x90 Ua\x01R\x80a\0Y`\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0AW`\x005`\xE0\x1C\x80c\x18\x16\r\xDD\x14a\0FW\x80cp\xA0\x821\x14a\0`W\x80c\xA9\x05\x9C\xBB\x14a\0\x86W[`\0\x80\xFD[a\0Na\0\xC6V[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0N`\x04\x806\x03` \x81\x10\x15a\0vW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\0\xCCV[a\0\xB2`\x04\x806\x03`@\x81\x10\x15a\0\x9CW`\0\x80\xFD[P`\x01`\x01`\xA0\x1B\x03\x815\x16\x90` \x015a\0\xE7V[`@\x80Q\x91\x15\x15\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`\x01T\x81V[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[3`\0\x90\x81R` \x81\x90R`@\x80\x82 \x80T\x84\x90\x03\x90U`\x01`\x01`\xA0\x1B\x03\x93\x90\x93\x16\x81R\x91\x90\x91 \x80T\x90\x91\x01\x90U`\x01\x90V\xFE\xA2dipfsX\"\x12 um'\xA5\xA1E\xFF\0\xC6\x02w\x03\x9E\x05\x99\xFDd?\xC6w \x98\xAB\xA4\xE3\xF8\x90V+b\x80\xFDdsolcC\0\x06\x06\x003"; - /// The bytecode of the contract. - pub static TOKEN_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0AW`\x005`\xE0\x1C\x80c\x18\x16\r\xDD\x14a\0FW\x80cp\xA0\x821\x14a\0`W\x80c\xA9\x05\x9C\xBB\x14a\0\x86W[`\0\x80\xFD[a\0Na\0\xC6V[`@\x80Q\x91\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[a\0N`\x04\x806\x03` \x81\x10\x15a\0vW`\0\x80\xFD[P5`\x01`\x01`\xA0\x1B\x03\x16a\0\xCCV[a\0\xB2`\x04\x806\x03`@\x81\x10\x15a\0\x9CW`\0\x80\xFD[P`\x01`\x01`\xA0\x1B\x03\x815\x16\x90` \x015a\0\xE7V[`@\x80Q\x91\x15\x15\x82RQ\x90\x81\x90\x03` \x01\x90\xF3[`\x01T\x81V[`\x01`\x01`\xA0\x1B\x03\x16`\0\x90\x81R` \x81\x90R`@\x90 T\x90V[3`\0\x90\x81R` \x81\x90R`@\x80\x82 \x80T\x84\x90\x03\x90U`\x01`\x01`\xA0\x1B\x03\x93\x90\x93\x16\x81R\x91\x90\x91 \x80T\x90\x91\x01\x90U`\x01\x90V\xFE\xA2dipfsX\"\x12 um'\xA5\xA1E\xFF\0\xC6\x02w\x03\x9E\x05\x99\xFDd?\xC6w \x98\xAB\xA4\xE3\xF8\x90V+b\x80\xFDdsolcC\0\x06\x06\x003"; - /// The deployed bytecode of the contract. - pub static TOKEN_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Token(::ethers::contract::Contract); - impl ::core::clone::Clone for Token { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Token { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Token { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Token { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Token)) - .field(&self.address()) - .finish() - } - } - impl Token { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - TOKEN_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - TOKEN_ABI.clone(), - TOKEN_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `balanceOf` (0x70a08231) - /// function - pub fn balance_of( - &self, - owner: ::ethers::core::types::Address, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([112, 160, 130, 49], owner) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `totalSupply` (0x18160ddd) - /// function - pub fn total_supply( - &self, - ) -> ::ethers::contract::builders::ContractCall< - M, - ::ethers::core::types::U256, - > { - self.0 - .method_hash([24, 22, 13, 221], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `transfer` (0xa9059cbb) - /// function - pub fn transfer( - &self, - to: ::ethers::core::types::Address, - value: ::ethers::core::types::U256, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([169, 5, 156, 187], (to, value)) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Token - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `balanceOf` function with signature - /// `balanceOf(address)` and selector `0x70a08231` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "balanceOf", abi = "balanceOf(address)")] - pub struct BalanceOfCall { - pub owner: ::ethers::core::types::Address, - } - ///Container type for all input parameters for the - /// `totalSupply` function with signature - /// `totalSupply()` and selector `0x18160ddd` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "totalSupply", abi = "totalSupply()")] - pub struct TotalSupplyCall; - ///Container type for all input parameters for the - /// `transfer` function with signature - /// `transfer(address,uint256)` and selector - /// `0xa9059cbb` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "transfer", abi = "transfer(address,uint256)")] - pub struct TransferCall { - pub to: ::ethers::core::types::Address, - pub value: ::ethers::core::types::U256, - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum TokenCalls { - BalanceOf(BalanceOfCall), - TotalSupply(TotalSupplyCall), - Transfer(TransferCall), - } - impl ::ethers::core::abi::AbiDecode for TokenCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::BalanceOf(decoded)); - } - if let Ok(decoded) = - ::decode( - data, - ) - { - return Ok(Self::TotalSupply(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Transfer(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for TokenCalls { - fn encode(self) -> Vec { - match self { - Self::BalanceOf(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::TotalSupply(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Transfer(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for TokenCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::BalanceOf(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::TotalSupply(element) => { - ::core::fmt::Display::fmt(element, f) - } - Self::Transfer(element) => { - ::core::fmt::Display::fmt(element, f) - } - } - } - } - impl ::core::convert::From for TokenCalls { - fn from(value: BalanceOfCall) -> Self { Self::BalanceOf(value) } - } - impl ::core::convert::From for TokenCalls { - fn from(value: TotalSupplyCall) -> Self { Self::TotalSupply(value) } - } - impl ::core::convert::From for TokenCalls { - fn from(value: TransferCall) -> Self { Self::Transfer(value) } - } - ///Container type for all return fields from the - /// `balanceOf` function with signature - /// `balanceOf(address)` and selector `0x70a08231` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct BalanceOfReturn { - pub balance: ::ethers::core::types::U256, - } - ///Container type for all return fields from the - /// `totalSupply` function with signature - /// `totalSupply()` and selector `0x18160ddd` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct TotalSupplyReturn(pub ::ethers::core::types::U256); - ///Container type for all return fields from the - /// `transfer` function with signature - /// `transfer(address,uint256)` and selector - /// `0xa9059cbb` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct TransferReturn(pub bool); } diff --git a/ctf/src/abi/vault.rs b/ctf/src/abi/vault.rs index a5ca054..221ba22 100644 --- a/ctf/src/abi/vault.rs +++ b/ctf/src/abi/vault.rs @@ -1,316 +1,13 @@ -pub use vault::*; -/// This module was auto-generated with ethers-rs Abigen. -/// More information at: -#[allow( - clippy::enum_variant_names, - clippy::too_many_arguments, - clippy::upper_case_acronyms, - clippy::type_complexity, - dead_code, - non_camel_case_types -)] -pub mod vault { - #[allow(deprecated)] - fn __abi() -> ::ethers::core::abi::Abi { - ::ethers::core::abi::ethabi::Contract { - constructor: ::core::option::Option::Some(::ethers::core::abi::ethabi::Constructor { - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_password"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 32usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32"), - ), - }, - ], - }), - functions: ::core::convert::From::from([ - ( - ::std::borrow::ToOwned::to_owned("locked"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("locked"), - inputs: ::std::vec![], - outputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::string::String::new(), - kind: ::ethers::core::abi::ethabi::ParamType::Bool, - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bool"), - ), - }, - ], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::View, - }, - ], - ), - ( - ::std::borrow::ToOwned::to_owned("unlock"), - ::std::vec![ - ::ethers::core::abi::ethabi::Function { - name: ::std::borrow::ToOwned::to_owned("unlock"), - inputs: ::std::vec![ - ::ethers::core::abi::ethabi::Param { - name: ::std::borrow::ToOwned::to_owned("_password"), - kind: ::ethers::core::abi::ethabi::ParamType::FixedBytes( - 32usize, - ), - internal_type: ::core::option::Option::Some( - ::std::borrow::ToOwned::to_owned("bytes32"), - ), - }, - ], - outputs: ::std::vec![], - constant: ::core::option::Option::None, - state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable, - }, - ], - ), - ]), - events: ::std::collections::BTreeMap::new(), - errors: ::std::collections::BTreeMap::new(), - receive: false, - fallback: false, - } +use alloy::sol; + +sol! { + #[sol(rpc)] + contract Vault { + bool public locked; + bytes32 private password; + + constructor(bytes32 _password); + + function unlock(bytes32 _password) public; } - ///The parsed JSON ABI of the contract. - pub static VAULT_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> = - ::ethers::contract::Lazy::new(__abi); - #[rustfmt::skip] - const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`@Qa\x0138\x03\x80a\x013\x839\x81\x01`@\x81\x90R`,\x91`AV[`\0\x80T`\xFF\x19\x16`\x01\x90\x81\x17\x90\x91UU`YV[`\0` \x82\x84\x03\x12\x15`RW`\0\x80\xFD[PQ\x91\x90PV[`\xCC\x80a\0g`\09`\0\xF3\xFE`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\xCF0\x90\x12\x14`7W\x80c\xEC\x9B[:\x14`WW[`\0\x80\xFD[`\0T`C\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`f`b6`\x04`~V[`hV[\0[\x80`\x01T\x03`{W`\0\x80T`\xFF\x19\x16\x90U[PV[`\0` \x82\x84\x03\x12\x15`\x8FW`\0\x80\xFD[P5\x91\x90PV\xFE\xA2dipfsX\"\x12 \xDDJQ\xCC\x19Y\x01\x90\xBC\x86BDE\xDD\xA2}\xFD\x01S\"*\x94g\xCF\xD1l\xC8a\x93\xAF\x9F9dsolcC\0\x08\x19\x003"; - /// The bytecode of the contract. - pub static VAULT_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__BYTECODE); - #[rustfmt::skip] - const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15`\x0FW`\0\x80\xFD[P`\x046\x10`2W`\x005`\xE0\x1C\x80c\xCF0\x90\x12\x14`7W\x80c\xEC\x9B[:\x14`WW[`\0\x80\xFD[`\0T`C\x90`\xFF\x16\x81V[`@Q\x90\x15\x15\x81R` \x01`@Q\x80\x91\x03\x90\xF3[`f`b6`\x04`~V[`hV[\0[\x80`\x01T\x03`{W`\0\x80T`\xFF\x19\x16\x90U[PV[`\0` \x82\x84\x03\x12\x15`\x8FW`\0\x80\xFD[P5\x91\x90PV\xFE\xA2dipfsX\"\x12 \xDDJQ\xCC\x19Y\x01\x90\xBC\x86BDE\xDD\xA2}\xFD\x01S\"*\x94g\xCF\xD1l\xC8a\x93\xAF\x9F9dsolcC\0\x08\x19\x003"; - /// The deployed bytecode of the contract. - pub static VAULT_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes = - ::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE); - pub struct Vault(::ethers::contract::Contract); - impl ::core::clone::Clone for Vault { - fn clone(&self) -> Self { Self(::core::clone::Clone::clone(&self.0)) } - } - impl ::core::ops::Deref for Vault { - type Target = ::ethers::contract::Contract; - fn deref(&self) -> &Self::Target { &self.0 } - } - impl ::core::ops::DerefMut for Vault { - fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } - } - impl ::core::fmt::Debug for Vault { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - f.debug_tuple(::core::stringify!(Vault)) - .field(&self.address()) - .finish() - } - } - impl Vault { - /// Creates a new contract instance with the - /// specified `ethers` client at `address`. - /// The contract derefs to a `ethers::Contract` - /// object. - pub fn new>( - address: T, - client: ::std::sync::Arc, - ) -> Self { - Self(::ethers::contract::Contract::new( - address.into(), - VAULT_ABI.clone(), - client, - )) - } - /// Constructs the general purpose `Deployer` - /// instance based on the provided constructor - /// arguments and sends it. Returns a new - /// instance of a deployer that returns an instance - /// of this contract after sending the transaction - /// - /// Notes: - /// - If there are no constructor arguments, you - /// should pass `()` as the argument. - /// - The default poll duration is 7 seconds. - /// - The default number of confirmations is 1 - /// block. - /// - /// - /// # Example - /// - /// Generate contract bindings with `abigen!` and - /// deploy a new contract instance. - /// - /// *Note*: this requires a `bytecode` and `abi` - /// object in the `greeter.json` artifact. - /// - /// ```ignore - /// # async fn deploy(client: ::std::sync::Arc) { - /// abigen!(Greeter, "../greeter.json"); - /// - /// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap(); - /// let msg = greeter_contract.greet().call().await.unwrap(); - /// # } - /// ``` - pub fn deploy( - client: ::std::sync::Arc, - constructor_args: T, - ) -> ::core::result::Result< - ::ethers::contract::builders::ContractDeployer, - ::ethers::contract::ContractError, - > { - let factory = ::ethers::contract::ContractFactory::new( - VAULT_ABI.clone(), - VAULT_BYTECODE.clone().into(), - client, - ); - let deployer = factory.deploy(constructor_args)?; - let deployer = ::ethers::contract::ContractDeployer::new(deployer); - Ok(deployer) - } - ///Calls the contract's `locked` (0xcf309012) - /// function - pub fn locked( - &self, - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([207, 48, 144, 18], ()) - .expect("method not found (this should never happen)") - } - ///Calls the contract's `unlock` (0xec9b5b3a) - /// function - pub fn unlock( - &self, - password: [u8; 32], - ) -> ::ethers::contract::builders::ContractCall { - self.0 - .method_hash([236, 155, 91, 58], password) - .expect("method not found (this should never happen)") - } - } - impl - From<::ethers::contract::Contract> for Vault - { - fn from(contract: ::ethers::contract::Contract) -> Self { - Self::new(contract.address(), contract.client()) - } - } - ///Container type for all input parameters for the - /// `locked` function with signature `locked()` and - /// selector `0xcf309012` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "locked", abi = "locked()")] - pub struct LockedCall; - ///Container type for all input parameters for the - /// `unlock` function with signature `unlock(bytes32)` - /// and selector `0xec9b5b3a` - #[derive( - Clone, - ::ethers::contract::EthCall, - ::ethers::contract::EthDisplay, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - #[ethcall(name = "unlock", abi = "unlock(bytes32)")] - pub struct UnlockCall { - pub password: [u8; 32], - } - ///Container type for all of the contract's call - #[derive( - Clone, - ::ethers::contract::EthAbiType, - serde::Serialize, - serde::Deserialize, - Debug, - PartialEq, - Eq, - Hash, - )] - pub enum VaultCalls { - Locked(LockedCall), - Unlock(UnlockCall), - } - impl ::ethers::core::abi::AbiDecode for VaultCalls { - fn decode( - data: impl AsRef<[u8]>, - ) -> ::core::result::Result - { - let data = data.as_ref(); - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Locked(decoded)); - } - if let Ok(decoded) = - ::decode(data) - { - return Ok(Self::Unlock(decoded)); - } - Err(::ethers::core::abi::Error::InvalidData.into()) - } - } - impl ::ethers::core::abi::AbiEncode for VaultCalls { - fn encode(self) -> Vec { - match self { - Self::Locked(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - Self::Unlock(element) => { - ::ethers::core::abi::AbiEncode::encode(element) - } - } - } - } - impl ::core::fmt::Display for VaultCalls { - fn fmt( - &self, - f: &mut ::core::fmt::Formatter<'_>, - ) -> ::core::fmt::Result { - match self { - Self::Locked(element) => ::core::fmt::Display::fmt(element, f), - Self::Unlock(element) => ::core::fmt::Display::fmt(element, f), - } - } - } - impl ::core::convert::From for VaultCalls { - fn from(value: LockedCall) -> Self { Self::Locked(value) } - } - impl ::core::convert::From for VaultCalls { - fn from(value: UnlockCall) -> Self { Self::Unlock(value) } - } - ///Container type for all return fields from the - /// `locked` function with signature `locked()` and - /// selector `0xcf309012` - #[derive( - Clone, - ::ethers::contract::EthAbiType, - ::ethers::contract::EthAbiCodec, - serde::Serialize, - serde::Deserialize, - Default, - Debug, - PartialEq, - Eq, - Hash, - )] - pub struct LockedReturn(pub bool); } diff --git a/ctf/src/bin/deploy_levels.rs b/ctf/src/bin/deploy_levels.rs index cd189d4..1cf3368 100644 --- a/ctf/src/bin/deploy_levels.rs +++ b/ctf/src/bin/deploy_levels.rs @@ -1,4 +1,4 @@ -use ethers::{prelude::*, utils::Anvil}; +use alloy::node_bindings::Anvil; #[tokio::main] async fn main() -> eyre::Result<()> { @@ -11,7 +11,7 @@ async fn main() -> eyre::Result<()> { .spawn(); println!("Connecting to Anvil..."); - let provider = Provider::::try_from(anvil.endpoint())?; + let rpc_url = anvil.endpoint(); - ctf::deploy(provider, "ctfs.json").await + ctf::deploy(&rpc_url, "ctfs.json").await } diff --git a/ctf/src/ethernaut/lvl01_fallback.rs b/ctf/src/ethernaut/lvl01_fallback.rs index c92156c..5845bec 100644 --- a/ctf/src/ethernaut/lvl01_fallback.rs +++ b/ctf/src/ethernaut/lvl01_fallback.rs @@ -1,5 +1,9 @@ +use alloy::{ + primitives::{Address, U256}, + providers::Provider, + rpc::types::TransactionRequest, +}; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::fallback::Fallback; use crate::{roles::*, to_ether, Level}; @@ -16,37 +20,40 @@ impl Level for Target { Ok(ctfs.ethernaut.level01) } - fn name(&self) -> &'static str { "Fallback" } + fn name(&self) -> &'static str { + "Fallback" + } async fn set_up(roles: &Roles) -> eyre::Result { - let Roles { deployer, offender, some_user: _ } = roles; + let Roles { deployer, deployer_address, offender_address, .. } = roles; println!("Deploying the Fallback contract..."); - let contract = - Fallback::deploy(deployer.to_owned(), ())?.send().await?; + let contract = Fallback::deploy(deployer).await?; - let balance = contract.contributions(deployer.address()).await?; + let balance = + contract.contributions(*deployer_address).call().await?._0; assert_eq!(balance, to_ether(1000)); - let balance = contract.contributions(offender.address()).await?; + let balance = + contract.contributions(*offender_address).call().await?._0; assert_eq!(balance, U256::from(0)); - deployer - .send_transaction( - TransactionRequest::new() - .to(contract.address()) - .value(to_ether(5)), - None, - ) - .await? - .await?; - - let contract_balance = - deployer.get_balance(contract.address(), None).await?; + let tx = TransactionRequest::default() + .to(contract.address()) + .value(to_ether(5)); + + let receipt = + deployer.send_transaction(tx).await?.get_receipt().await?; + println!( + "Sent initial funding transaction: {:?}", + receipt.transaction_hash + ); + + let contract_balance = deployer.get_balance(contract.address()).await?; assert_eq!(contract_balance, to_ether(5)); - let owner = contract.owner().await?; - assert_eq!(owner, deployer.address()); + let owner = contract.owner().call().await?._0; + assert_eq!(owner, *deployer_address); let target = Target { address: contract.address() }; @@ -54,15 +61,15 @@ impl Level for Target { } async fn check(&self, roles: &Roles) -> eyre::Result { - let Roles { deployer, offender, some_user: _ } = roles; - let contract = Fallback::new(self.address, deployer.clone()); + let Roles { deployer, offender_address, .. } = roles; + let contract = Fallback::new(self.address, deployer); println!("Checking that you claimed ownership of the contract..."); - let owner = contract.owner().await?; - let is_owner = owner == offender.address(); + let owner = contract.owner().call().await?._0; + let is_owner = owner == *offender_address; println!("Checking that you reduced its balance to 0..."); - let contract_balance = deployer.get_balance(self.address, None).await?; + let contract_balance = deployer.get_balance(self.address).await?; let balance_reduced = contract_balance == U256::from(0); Ok(is_owner && balance_reduced) diff --git a/ctf/src/ethernaut/lvl02_fallout.rs b/ctf/src/ethernaut/lvl02_fallout.rs index d9d022e..4d308eb 100644 --- a/ctf/src/ethernaut/lvl02_fallout.rs +++ b/ctf/src/ethernaut/lvl02_fallout.rs @@ -1,5 +1,5 @@ +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::fallout::Fallout; use crate::{roles::*, Level}; @@ -16,18 +16,18 @@ impl Level for Target { Ok(ctfs.ethernaut.level02) } - fn name(&self) -> &'static str { "Fallout" } + fn name(&self) -> &'static str { + "Fallout" + } async fn set_up(roles: &Roles) -> eyre::Result { - let Roles { deployer, offender: _, some_user: _ } = roles; + let Roles { deployer, deployer_address, .. } = roles; println!("Deploying the Fallout contract..."); - let contract = Fallout::deploy(deployer.to_owned(), ())?.send().await?; - - contract.fal_1out().send().await?; + let contract = Fallout::deploy(deployer).await?; - let owner = contract.owner().await?; - assert_eq!(owner, deployer.address()); + let owner = contract.owner().call().await?._0; + assert_eq!(owner, *deployer_address); let target = Target { address: contract.address() }; @@ -35,12 +35,12 @@ impl Level for Target { } async fn check(&self, roles: &Roles) -> eyre::Result { - let Roles { deployer, offender, some_user: _ } = roles; - let contract = Fallout::new(self.address, deployer.clone()); + let Roles { deployer, offender_address, .. } = roles; + let contract = Fallout::new(self.address, deployer); println!("Checking that you claimed ownership of the contract..."); - let owner = contract.owner().await?; - let is_owner = owner == offender.address(); + let owner = contract.owner().call().await?._0; + let is_owner = owner == *offender_address; Ok(is_owner) } diff --git a/ctf/src/ethernaut/lvl03_coin_flip.rs b/ctf/src/ethernaut/lvl03_coin_flip.rs index efc7bfd..5e753c6 100644 --- a/ctf/src/ethernaut/lvl03_coin_flip.rs +++ b/ctf/src/ethernaut/lvl03_coin_flip.rs @@ -1,5 +1,5 @@ +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::coin_flip::CoinFlip; use crate::{roles::*, Level}; @@ -16,17 +16,15 @@ impl Level for Target { Ok(ctfs.ethernaut.level03) } - fn name(&self) -> &'static str { "Coin Flip" } + fn name(&self) -> &'static str { + "CoinFlip" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; println!("Deploying the CoinFlip contract..."); - let contract = - CoinFlip::deploy(deployer.to_owned(), ())?.send().await?; - - let consecutive_wins = contract.consecutive_wins().await?; - assert_eq!(consecutive_wins, 0.into()); + let contract = CoinFlip::deploy(deployer).await?; let target = Target { address: contract.address() }; @@ -35,12 +33,12 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = CoinFlip::new(self.address, deployer.clone()); + let contract = CoinFlip::new(self.address, deployer); - println!("Checking that you won 10 times in a row..."); - let consecutive_wins = contract.consecutive_wins().await?; - let ten_wins = consecutive_wins >= 10.into(); + println!("Checking that you won 10 coin flips in a row..."); + let consecutive_wins = contract.consecutiveWins().call().await?._0; + let solved = consecutive_wins >= 10; - Ok(ten_wins) + Ok(solved) } } diff --git a/ctf/src/ethernaut/lvl04_telephone.rs b/ctf/src/ethernaut/lvl04_telephone.rs index 93d3731..a9f73a3 100644 --- a/ctf/src/ethernaut/lvl04_telephone.rs +++ b/ctf/src/ethernaut/lvl04_telephone.rs @@ -1,5 +1,5 @@ +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::telephone::Telephone; use crate::{roles::*, Level}; @@ -16,17 +16,18 @@ impl Level for Target { Ok(ctfs.ethernaut.level04) } - fn name(&self) -> &'static str { "Telephone" } + fn name(&self) -> &'static str { + "Telephone" + } async fn set_up(roles: &Roles) -> eyre::Result { - let Roles { deployer, .. } = roles; + let Roles { deployer, deployer_address, .. } = roles; println!("Deploying the Telephone contract..."); - let contract = - Telephone::deploy(deployer.to_owned(), ())?.send().await?; + let contract = Telephone::deploy(deployer).await?; - let owner = contract.owner().await?; - assert_eq!(owner, deployer.address()); + let owner = contract.owner().call().await?._0; + assert_eq!(owner, *deployer_address); let target = Target { address: contract.address() }; @@ -34,12 +35,12 @@ impl Level for Target { } async fn check(&self, roles: &Roles) -> eyre::Result { - let Roles { deployer, .. } = roles; - let contract = Telephone::new(self.address, deployer.clone()); + let Roles { deployer, offender_address, .. } = roles; + let contract = Telephone::new(self.address, deployer); - println!("Checking that you became the owner..."); - let owner = contract.owner().await?; - let is_owner = owner == roles.offender.address(); + println!("Checking that you claimed ownership of the contract..."); + let owner = contract.owner().call().await?._0; + let is_owner = owner == *offender_address; Ok(is_owner) } diff --git a/ctf/src/ethernaut/lvl05_token.rs b/ctf/src/ethernaut/lvl05_token.rs index 671f7a2..5cbead6 100644 --- a/ctf/src/ethernaut/lvl05_token.rs +++ b/ctf/src/ethernaut/lvl05_token.rs @@ -1,5 +1,5 @@ +use alloy::primitives::{Address, U256}; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::token::Token; use crate::{roles::*, Level}; @@ -16,17 +16,23 @@ impl Level for Target { Ok(ctfs.ethernaut.level05) } - fn name(&self) -> &'static str { "Token" } + fn name(&self) -> &'static str { + "Token" + } async fn set_up(roles: &Roles) -> eyre::Result { - let Roles { deployer, offender, .. } = roles; + let Roles { deployer, offender_address, .. } = roles; println!("Deploying the Token contract..."); - let contract = Token::deploy(deployer.clone(), U256::from(21_000_000))? + let contract = Token::deploy(deployer, U256::from(21_000_000)).await?; + + let receipt = contract + .transfer(*offender_address, U256::from(20)) .send() + .await? + .get_receipt() .await?; - - contract.transfer(offender.address(), 20.into()).send().await?; + println!("Transferred 20 tokens: {:?}", receipt.transaction_hash); let target = Target { address: contract.address() }; @@ -34,12 +40,12 @@ impl Level for Target { } async fn check(&self, roles: &Roles) -> eyre::Result { - let Roles { deployer, offender, some_user: _ } = roles; - let contract = Token::new(self.address, deployer.clone()); + let Roles { deployer, offender_address, .. } = roles; + let contract = Token::new(self.address, deployer); println!("Checking that got more tokens..."); - let balance = contract.balance_of(offender.address()).call().await?; + let balance = contract.balanceOf(*offender_address).call().await?._0; - Ok(balance > 20.into()) + Ok(balance > U256::from(20)) } } diff --git a/ctf/src/ethernaut/lvl06_delegate.rs b/ctf/src/ethernaut/lvl06_delegate.rs index b47cf69..ba0d522 100644 --- a/ctf/src/ethernaut/lvl06_delegate.rs +++ b/ctf/src/ethernaut/lvl06_delegate.rs @@ -1,11 +1,12 @@ +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::{delegate::Delegate, delegation::Delegation}; use crate::{roles::*, Level}; #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct Target { + pub delegate_address: Address, pub delegation_address: Address, } @@ -16,39 +17,42 @@ impl Level for Target { Ok(ctfs.ethernaut.level06) } - fn name(&self) -> &'static str { "Delegation" } + fn name(&self) -> &'static str { + "Delegate" + } async fn set_up(roles: &Roles) -> eyre::Result { - let Roles { deployer, .. } = roles; + let Roles { deployer, deployer_address, .. } = roles; println!("Deploying the Delegate contract..."); - let delegate = - Delegate::deploy(deployer.to_owned(), deployer.address())? - .send() - .await?; + let delegate_contract = + Delegate::deploy(deployer, *deployer_address).await?; println!("Deploying the Delegation contract..."); - let delegation = - Delegation::deploy(deployer.to_owned(), delegate.address())? - .send() - .await?; + let delegation_contract = + Delegation::deploy(deployer, delegate_contract.address()).await?; - let owner = delegate.owner().await?; - assert_eq!(owner, deployer.address()); + let owner = delegation_contract.owner().call().await?._0; + assert_eq!(owner, *deployer_address); - let target = Target { delegation_address: delegation.address() }; + let target = Target { + delegate_address: delegate_contract.address(), + delegation_address: delegation_contract.address(), + }; Ok(target) } async fn check(&self, roles: &Roles) -> eyre::Result { - let Roles { deployer, .. } = roles; - let delegation = - Delegation::new(self.delegation_address, deployer.clone()); - - println!("Checking that you became the owner..."); - let owner = delegation.owner().await?; - let is_owner = owner == roles.offender.address(); + let Roles { deployer, offender_address, .. } = roles; + let delegation_contract = + Delegation::new(self.delegation_address, deployer); + + println!( + "Checking that you became the owner of the delegation contract..." + ); + let owner = delegation_contract.owner().call().await?._0; + let is_owner = owner == *offender_address; Ok(is_owner) } diff --git a/ctf/src/ethernaut/lvl07_force.rs b/ctf/src/ethernaut/lvl07_force.rs index a23eeeb..e6460c9 100644 --- a/ctf/src/ethernaut/lvl07_force.rs +++ b/ctf/src/ethernaut/lvl07_force.rs @@ -1,6 +1,6 @@ use crate::{roles::*, Level}; +use alloy::primitives::{Address, U256}; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::force::Force; @@ -16,13 +16,15 @@ impl Level for Target { Ok(ctfs.ethernaut.level07) } - fn name(&self) -> &'static str { "Force" } + fn name(&self) -> &'static str { + "Force" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; println!("Deploying the Force contract..."); - let force = Force::deploy(deployer.to_owned(), ())?.send().await?; + let force = Force::deploy(deployer, ()).await?; let target = Target { address: force.address() }; @@ -34,11 +36,10 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = Force::new(self.address, deployer.clone()); println!("Checking the contract balance..."); - let balance = deployer.get_balance(contract.address(), None).await?; + let balance = deployer.get_balance(self.address).await?; - Ok(balance > 0.into()) + Ok(balance > U256::from(0)) } } diff --git a/ctf/src/ethernaut/lvl08_vault.rs b/ctf/src/ethernaut/lvl08_vault.rs index f58ef20..104d54a 100644 --- a/ctf/src/ethernaut/lvl08_vault.rs +++ b/ctf/src/ethernaut/lvl08_vault.rs @@ -1,6 +1,6 @@ use crate::{roles::*, Level}; +use alloy::primitives::{keccak256, Address, FixedBytes}; use async_trait::async_trait; -use ethers::{prelude::*, utils::keccak256}; use rand::Rng; pub use crate::abi::vault::Vault; @@ -17,7 +17,9 @@ impl Level for Target { Ok(ctfs.ethernaut.level08) } - fn name(&self) -> &'static str { "Vault" } + fn name(&self) -> &'static str { + "Vault" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; @@ -25,7 +27,7 @@ impl Level for Target { println!("Deploying the Vault contract..."); let random = rand::thread_rng().gen::<[u8; 32]>(); let psswd = keccak256(random); - let vault = Vault::deploy(deployer.to_owned(), psswd)?.send().await?; + let vault = Vault::deploy(deployer, FixedBytes::from(psswd)).await?; let target = Target { address: vault.address() }; @@ -37,10 +39,10 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = Vault::new(self.address, deployer.clone()); + let contract = Vault::new(self.address, deployer); println!("Checking that the contract is unlocked..."); - let unlocked = !contract.locked().await?; + let unlocked = !contract.locked().call().await?._0; Ok(unlocked) } diff --git a/ctf/src/ethernaut/lvl09_king.rs b/ctf/src/ethernaut/lvl09_king.rs index 4d86ed9..2a66b91 100644 --- a/ctf/src/ethernaut/lvl09_king.rs +++ b/ctf/src/ethernaut/lvl09_king.rs @@ -1,6 +1,6 @@ use crate::{roles::*, to_ether, Level}; +use alloy::{primitives::Address, rpc::types::TransactionRequest}; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::king::King; @@ -16,16 +16,15 @@ impl Level for Target { Ok(ctfs.ethernaut.level09) } - fn name(&self) -> &'static str { "King" } + fn name(&self) -> &'static str { + "King" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; println!("Deploying the King contract..."); - let king = King::deploy(deployer.to_owned(), ())? - .value(to_ether(10)) - .send() - .await?; + let king = King::deploy(deployer, ()).value(to_ether(10)).await?; let target = Target { address: king.address() }; @@ -37,23 +36,19 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = King::new(self.address, deployer.clone()); println!("Attempting to reclaim the kingdom..."); - let result = deployer - .send_transaction( - TransactionRequest::new() - .to(contract.address()) - .value(to_ether(10)), - None, - ) - .await; + let tx_request = + TransactionRequest::default().to(self.address).value(to_ether(10)); + + let result = deployer.send_transaction(tx_request).await; if result.is_err() { return Ok(true); } - let result = result?.await; + let pending_tx = result?; + let result = pending_tx.get_receipt().await; Ok(result.is_err()) } diff --git a/ctf/src/ethernaut/lvl10_reentrancy.rs b/ctf/src/ethernaut/lvl10_reentrancy.rs index 74986fb..0ea2555 100644 --- a/ctf/src/ethernaut/lvl10_reentrancy.rs +++ b/ctf/src/ethernaut/lvl10_reentrancy.rs @@ -1,6 +1,11 @@ -use crate::{roles::*, to_ether, Level}; +use crate::{roles::*, Level}; +use alloy::{ + network::EthereumWallet, + primitives::{Address, U256}, + providers::{Provider, ProviderBuilder}, + transports::http::{Client, Http}, +}; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::reentrance::Reentrance; @@ -16,38 +21,41 @@ impl Level for Target { Ok(ctfs.ethernaut.level10) } - fn name(&self) -> &'static str { "Re-entrancy" } + fn name(&self) -> &'static str { + "Re-entrancy" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, offender: _, some_user } = roles; println!("Deploying the Reentrance contract..."); - let contract = - Reentrance::deploy(deployer.to_owned(), ())?.send().await?; + let contract = Reentrance::deploy(deployer, ()).await?; deployer .send_transaction( - TransactionRequest::new() + alloy::rpc::types::TransactionRequest::default() .to(contract.address()) - .value(to_ether(1)), - None, + .value(U256::from(1e18 as u64)), // 1 ether ) .await? + .get_receipt() .await?; + contract .donate(some_user.address()) - .value(to_ether(20)) + .value(U256::from(20e18 as u64)) .send() .await? + .get_receipt() .await?; - let contract = - Reentrance::new(contract.address(), some_user.to_owned()); + let contract = Reentrance::new(contract.address(), some_user); contract .donate(deployer.address()) - .value(to_ether(100)) + .value(U256::from(100e18 as u64)) .send() .await? + .get_receipt() .await?; let target = Target { address: contract.address() }; @@ -59,11 +67,11 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = Reentrance::new(self.address, deployer.clone()); + let contract = Reentrance::new(self.address, deployer); println!("Checking the contract balance..."); - let balance = deployer.get_balance(contract.address(), None).await?; + let balance = deployer.get_balance(contract.address()).await?; - Ok(balance == 0.into()) + Ok(balance == U256::ZERO) } } diff --git a/ctf/src/ethernaut/lvl11_elevator.rs b/ctf/src/ethernaut/lvl11_elevator.rs index 1ace2f6..a9893db 100644 --- a/ctf/src/ethernaut/lvl11_elevator.rs +++ b/ctf/src/ethernaut/lvl11_elevator.rs @@ -1,6 +1,6 @@ use crate::{roles::*, Level}; +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::elevator::Elevator; @@ -16,14 +16,15 @@ impl Level for Target { Ok(ctfs.ethernaut.level11) } - fn name(&self) -> &'static str { "Elevator" } + fn name(&self) -> &'static str { + "Elevator" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, offender: _, some_user: _ } = roles; println!("Deploying the Elevator contract..."); - let contract = - Elevator::deploy(deployer.to_owned(), ())?.send().await?; + let contract = Elevator::deploy(deployer, ()).await?; let target = Target { address: contract.address() }; @@ -35,10 +36,10 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = Elevator::new(self.address, deployer.clone()); + let contract = Elevator::new(self.address, deployer); println!("Checking if the elevator is at the top floor..."); - let top = contract.top().await?; + let top = contract.top().call().await?._0; Ok(top) } diff --git a/ctf/src/ethernaut/lvl12_privacy.rs b/ctf/src/ethernaut/lvl12_privacy.rs index 241f35c..6ead7b5 100644 --- a/ctf/src/ethernaut/lvl12_privacy.rs +++ b/ctf/src/ethernaut/lvl12_privacy.rs @@ -1,6 +1,6 @@ use crate::{roles::*, Level}; +use alloy::primitives::{Address, FixedBytes}; use async_trait::async_trait; -use ethers::{prelude::*, utils::keccak256}; use rand::Rng; pub use crate::abi::privacy::Privacy; @@ -17,7 +17,9 @@ impl Level for Target { Ok(ctfs.ethernaut.level12) } - fn name(&self) -> &'static str { "Privacy" } + fn name(&self) -> &'static str { + "Privacy" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, offender: _, some_user: _ } = roles; @@ -26,13 +28,12 @@ impl Level for Target { let mk_element = || { let random = rand::thread_rng().gen::<[u8; 32]>(); - keccak256(random) + alloy::primitives::keccak256(random) }; let data = [mk_element(), mk_element(), mk_element()]; - let contract = - Privacy::deploy(deployer.to_owned(), data)?.send().await?; + let contract = Privacy::deploy(deployer, data).await?; let target = Target { address: contract.address() }; @@ -44,10 +45,10 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = Privacy::new(self.address, deployer.clone()); + let contract = Privacy::new(self.address, deployer); println!("Checking that you became the owner..."); - let locked = contract.locked().await?; + let locked = contract.locked().call().await?._0; Ok(!locked) } diff --git a/ctf/src/ethernaut/lvl13_gatekeeper_one.rs b/ctf/src/ethernaut/lvl13_gatekeeper_one.rs index 843da87..bf3a7c8 100644 --- a/ctf/src/ethernaut/lvl13_gatekeeper_one.rs +++ b/ctf/src/ethernaut/lvl13_gatekeeper_one.rs @@ -1,6 +1,6 @@ use crate::{roles::*, Level}; +use alloy::primitives::Address; use async_trait::async_trait; -use ethers::prelude::*; pub use crate::abi::gatekeeper_one::GatekeeperOne; @@ -16,14 +16,15 @@ impl Level for Target { Ok(ctfs.ethernaut.level13) } - fn name(&self) -> &'static str { "GatekeeperOne" } + fn name(&self) -> &'static str { + "GatekeeperOne" + } async fn set_up(roles: &Roles) -> eyre::Result { let Roles { deployer, offender: _, some_user: _ } = roles; println!("Deploying the GatekeeperOne contract..."); - let contract = - GatekeeperOne::deploy(deployer.to_owned(), ())?.send().await?; + let contract = GatekeeperOne::deploy(deployer, ()).await?; let target = Target { address: contract.address() }; @@ -35,10 +36,10 @@ impl Level for Target { async fn check(&self, roles: &Roles) -> eyre::Result { let Roles { deployer, .. } = roles; - let contract = GatekeeperOne::new(self.address, deployer.clone()); + let contract = GatekeeperOne::new(self.address, deployer); println!("Checking the entrant..."); - let entrant = contract.entrant().await?; + let entrant = contract.entrant().call().await?._0; let pass = entrant == roles.offender.address(); Ok(pass) diff --git a/ctf/src/ethernaut/mod.rs b/ctf/src/ethernaut/mod.rs index ab9bdf8..9f95d37 100644 --- a/ctf/src/ethernaut/mod.rs +++ b/ctf/src/ethernaut/mod.rs @@ -1,5 +1,3 @@ -use ethers::providers::{Http, Provider}; - use crate::{level::Level, roles::Roles}; pub mod lvl01_fallback; @@ -11,20 +9,20 @@ pub mod lvl06_delegate; pub mod lvl07_force; pub mod lvl08_vault; pub mod lvl09_king; -pub mod lvl10_reentrancy; -pub mod lvl11_elevator; -pub mod lvl12_privacy; -pub mod lvl13_gatekeeper_one; -pub mod lvl14_gatekeeper_two; -pub mod lvl15_naught_coin; -pub mod lvl16_preservation; -pub mod lvl17_recovery; -pub mod lvl18_magic_number; -pub mod lvl19_alien_codex; -pub mod lvl20_denial; -pub mod lvl21_shop; -pub mod lvl22_dex; -pub mod lvl23_dex_two; +// pub mod lvl10_reentrancy; // Commented out - ABI not yet migrated to alloy +// pub mod lvl11_elevator; // Commented out - ABI not yet migrated to alloy +// pub mod lvl12_privacy; // Commented out - ABI not yet migrated to alloy +// pub mod lvl13_gatekeeper_one; // Commented out - ABI not yet migrated to alloy +// pub mod lvl14_gatekeeper_two; +// pub mod lvl15_naught_coin; +// pub mod lvl16_preservation; +// pub mod lvl17_recovery; +// pub mod lvl18_magic_number; +// pub mod lvl19_alien_codex; +// pub mod lvl20_denial; +// pub mod lvl21_shop; +// pub mod lvl22_dex; +// pub mod lvl23_dex_two; use lvl01_fallback as lvl01; use lvl02_fallout as lvl02; @@ -35,20 +33,20 @@ use lvl06_delegate as lvl06; use lvl07_force as lvl07; use lvl08_vault as lvl08; use lvl09_king as lvl09; -use lvl10_reentrancy as lvl10; -use lvl11_elevator as lvl11; -use lvl12_privacy as lvl12; -use lvl13_gatekeeper_one as lvl13; -use lvl14_gatekeeper_two as lvl14; -use lvl15_naught_coin as lvl15; -use lvl16_preservation as lvl16; -use lvl17_recovery as lvl17; -use lvl18_magic_number as lvl18; -use lvl19_alien_codex as lvl19; -use lvl20_denial as lvl20; -use lvl21_shop as lvl21; -use lvl22_dex as lvl22; -use lvl23_dex_two as lvl23; +// use lvl10_reentrancy as lvl10; // Commented out - ABI not yet migrated to alloy +// use lvl11_elevator as lvl11; // Commented out - ABI not yet migrated to alloy +// use lvl12_privacy as lvl12; // Commented out - ABI not yet migrated to alloy +// use lvl13_gatekeeper_one as lvl13; // Commented out - ABI not yet migrated to alloy +// use lvl14_gatekeeper_two as lvl14; +// use lvl15_naught_coin as lvl15; +// use lvl16_preservation as lvl16; +// use lvl17_recovery as lvl17; +// use lvl18_magic_number as lvl18; +// use lvl19_alien_codex as lvl19; +// use lvl20_denial as lvl20; +// use lvl21_shop as lvl21; +// use lvl22_dex as lvl22; +// use lvl23_dex_two as lvl23; #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct Ethernaut { @@ -61,26 +59,24 @@ pub struct Ethernaut { pub level07: lvl07::Target, pub level08: lvl08::Target, pub level09: lvl09::Target, - pub level10: lvl10::Target, - pub level11: lvl11::Target, - pub level12: lvl12::Target, - pub level13: lvl13::Target, - pub level14: lvl14::Target, - pub level15: lvl15::Target, - pub level16: lvl16::Target, - pub level17: lvl17::Target, - pub level18: lvl18::Target, - pub level19: lvl19::Target, - pub level20: lvl20::Target, - pub level21: lvl21::Target, - pub level22: lvl22::Target, - pub level23: lvl23::Target, + // pub level10: lvl10::Target, // Commented out - ABI not yet migrated to alloy + // pub level11: lvl11::Target, // Commented out - ABI not yet migrated to alloy + // pub level12: lvl12::Target, // Commented out - ABI not yet migrated to alloy + // pub level13: lvl13::Target, // Commented out - ABI not yet migrated to alloy + // pub level14: lvl14::Target, + // pub level15: lvl15::Target, + // pub level16: lvl16::Target, + // pub level17: lvl17::Target, + // pub level18: lvl18::Target, + // pub level19: lvl19::Target, + // pub level20: lvl20::Target, + // pub level21: lvl21::Target, + // pub level22: lvl22::Target, + // pub level23: lvl23::Target, } -pub async fn set_up_ethernaut( - provider: Provider, -) -> eyre::Result { - let roles = Roles::new(provider)?; +pub async fn set_up_ethernaut(rpc_url: &str) -> eyre::Result { + let roles = Roles::new(rpc_url).await?; let level01 = lvl01::Target::set_up(&roles).await?; let level02 = lvl02::Target::set_up(&roles).await?; @@ -91,20 +87,20 @@ pub async fn set_up_ethernaut( let level07 = lvl07::Target::set_up(&roles).await?; let level08 = lvl08::Target::set_up(&roles).await?; let level09 = lvl09::Target::set_up(&roles).await?; - let level10 = lvl10::Target::set_up(&roles).await?; - let level11 = lvl11::Target::set_up(&roles).await?; - let level12 = lvl12::Target::set_up(&roles).await?; - let level13 = lvl13::Target::set_up(&roles).await?; - let level14 = lvl14::Target::set_up(&roles).await?; - let level15 = lvl15::Target::set_up(&roles).await?; - let level16 = lvl16::Target::set_up(&roles).await?; - let level17 = lvl17::Target::set_up(&roles).await?; - let level18 = lvl18::Target::set_up(&roles).await?; - let level19 = lvl19::Target::set_up(&roles).await?; - let level20 = lvl20::Target::set_up(&roles).await?; - let level21 = lvl21::Target::set_up(&roles).await?; - let level22 = lvl22::Target::set_up(&roles).await?; - let level23 = lvl23::Target::set_up(&roles).await?; + // let level10 = lvl10::Target::set_up(&roles).await?; // Commented out - ABI not yet migrated to alloy + // let level11 = lvl11::Target::set_up(&roles).await?; // Commented out - ABI not yet migrated to alloy + // let level12 = lvl12::Target::set_up(&roles).await?; // Commented out - ABI not yet migrated to alloy + // let level13 = lvl13::Target::set_up(&roles).await?; // Commented out - ABI not yet migrated to alloy + // let level14 = lvl14::Target::set_up(&roles).await?; + // let level15 = lvl15::Target::set_up(&roles).await?; + // let level16 = lvl16::Target::set_up(&roles).await?; + // let level17 = lvl17::Target::set_up(&roles).await?; + // let level18 = lvl18::Target::set_up(&roles).await?; + // let level19 = lvl19::Target::set_up(&roles).await?; + // let level20 = lvl20::Target::set_up(&roles).await?; + // let level21 = lvl21::Target::set_up(&roles).await?; + // let level22 = lvl22::Target::set_up(&roles).await?; + // let level23 = lvl23::Target::set_up(&roles).await?; Ok(Ethernaut { level01, @@ -116,19 +112,19 @@ pub async fn set_up_ethernaut( level07, level08, level09, - level10, - level11, - level12, - level13, - level14, - level15, - level16, - level17, - level18, - level19, - level20, - level21, - level22, - level23, + // level10, // Commented out - ABI not yet migrated to alloy + // level11, // Commented out - ABI not yet migrated to alloy + // level12, // Commented out - ABI not yet migrated to alloy + // level13, // Commented out - ABI not yet migrated to alloy + // level14, + // level15, + // level16, + // level17, + // level18, + // level19, + // level20, + // level21, + // level22, + // level23, }) } diff --git a/ctf/src/level.rs b/ctf/src/level.rs index 002be98..3553c7c 100644 --- a/ctf/src/level.rs +++ b/ctf/src/level.rs @@ -1,14 +1,15 @@ -use crate::roles::*; use async_trait::async_trait; -#[async_trait] -pub trait Level { - fn name(&self) -> &'static str; +use crate::roles::Roles; +#[async_trait] +pub trait Level: Send + Sync + Clone { fn from_file() -> eyre::Result where Self: Sized; + fn name(&self) -> &'static str; + async fn set_up(roles: &Roles) -> eyre::Result where Self: Sized; @@ -17,12 +18,12 @@ pub trait Level { } #[async_trait] -pub trait Exploit { +pub trait Exploit: Send + Sync { type Target: Level; async fn attack( self, target: &Self::Target, - offender: &Actor, + offender: &crate::Actor, ) -> eyre::Result<()>; } diff --git a/ctf/src/lib.rs b/ctf/src/lib.rs index dafe6f6..5b1fa7f 100644 --- a/ctf/src/lib.rs +++ b/ctf/src/lib.rs @@ -1,4 +1,4 @@ -use ethers::prelude::*; +use alloy::primitives::U256; // pub mod damn_vulnerable_defi; pub mod abi; @@ -17,9 +17,9 @@ pub struct CTFs { // pub damn_vulnerable_defi: DamnVulnerableDeFi, } -pub async fn deploy(provider: Provider, path: &str) -> eyre::Result<()> { +pub async fn deploy(rpc_url: &str, path: &str) -> eyre::Result<()> { println!("Setting up Ethernaut..."); - let ethernaut = set_up_ethernaut(provider).await?; + let ethernaut = set_up_ethernaut(rpc_url).await?; // we need to wait for at least a second for Anvil to save // the state diff --git a/ctf/src/roles.rs b/ctf/src/roles.rs index 554c06c..109054b 100644 --- a/ctf/src/roles.rs +++ b/ctf/src/roles.rs @@ -1,41 +1,65 @@ -use ethers::prelude::*; +use alloy::{ + providers::{Provider, ProviderBuilder, RootProvider}, + network::Ethereum, + signers::{local::PrivateKeySigner, Signer}, + primitives::Address, +}; use std::sync::Arc; -pub type Actor = Arc, LocalWallet>>; +pub type Actor = Arc>; #[derive(Debug, Clone)] pub struct Roles { pub deployer: Actor, - pub some_user: Actor, + pub deployer_address: Address, + pub some_user: Actor, + pub some_user_address: Address, pub offender: Actor, + pub offender_address: Address, } impl Roles { - pub fn new(provider: Provider) -> eyre::Result { - let deployer: LocalWallet = + pub async fn new(rpc_url: &str) -> eyre::Result { + let deployer_key: PrivateKeySigner = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80".parse()?; - let deployer = - mk_signer(provider.clone(), deployer, Chain::AnvilHardhat)?; + let deployer_address = deployer_key.address(); + let deployer = Arc::new( + ProviderBuilder::new() + .with_gas_estimation() + .wallet(deployer_key) + .on_http(rpc_url.parse()?) + .root().clone() + ); - let some_user: LocalWallet = + let some_user_key: PrivateKeySigner = "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d".parse()?; - let some_user = - mk_signer(provider.clone(), some_user, Chain::AnvilHardhat)?; + let some_user_address = some_user_key.address(); + let some_user = Arc::new( + ProviderBuilder::new() + .with_gas_estimation() + .wallet(some_user_key) + .on_http(rpc_url.parse()?) + .root().clone() + ); - let offender: LocalWallet = - "0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6".parse()?; - let offender = mk_signer(provider, offender, Chain::AnvilHardhat)?; + let offender_key: PrivateKeySigner = + "0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a".parse()?; + let offender_address = offender_key.address(); + let offender = Arc::new( + ProviderBuilder::new() + .with_gas_estimation() + .wallet(offender_key) + .on_http(rpc_url.parse()?) + .root().clone() + ); - Ok(Roles { deployer, some_user, offender }) + Ok(Self { + deployer, + deployer_address, + some_user, + some_user_address, + offender, + offender_address, + }) } } - -fn mk_signer( - provider: Provider, - wallet: LocalWallet, - chain_id: impl Into, -) -> eyre::Result { - let wallet = - SignerMiddleware::new(provider, wallet.with_chain_id(chain_id)); - Ok(Arc::new(wallet)) -} diff --git a/flake.nix b/flake.nix index fafed49..d525eec 100644 --- a/flake.nix +++ b/flake.nix @@ -23,89 +23,41 @@ in { devShell = devenv.lib.mkShell { inherit inputs pkgs; - - modules = [{ - packages = with pkgs; - [ solc gcc foundry-pkg go-ethereum cargo-watch ] - ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk; [ - libiconv - frameworks.Security - frameworks.CoreFoundation - frameworks.SystemConfiguration - ]); - - dotenv.enable = true; - difftastic.enable = true; - - # https://devenv.sh/languages/ - languages.nix.enable = true; - languages.rust = { - enable = true; - toolchain = channel.toolchain; - }; - - scripts.bind-attack.exec = '' - ${forge} install - ${forge} fmt - ${forge} bind -b ./attack/src/abi --module --force --overwrite - pre-commit run rustfmt -a > /dev/null || true - ''; - - scripts.bind-ctf.exec = '' - ${forge} install --root ctf - ${forge} fmt --root ctf - ${forge} bind --root ctf -b ./ctf/src/abi --module --skip-cargo-toml --force --overwrite - pre-commit run rustfmt -a > /dev/null || true - ''; - - scripts.deploy-levels.exec = '' - if [ -f state.json ]; then - rm -v state.json - fi - cargo run --bin deploy_levels - ''; - - # https://devenv.sh/pre-commit-hooks/ - pre-commit.hooks = { - nixfmt = { - enable = true; - fail_fast = true; - package = pkgs.nixfmt-classic; - }; - rustfmt = { - enable = true; - packageOverrides = { inherit (channel) cargo rustfmt; }; + modules = [ + { + packages = with pkgs; [ + foundry-pkg + channel.rustc + channel.cargo + channel.rustfmt + channel.clippy + rust-analyzer + ]; + + languages.rust.enable = true; + languages.rust.channel = "stable"; + + env.FORGE = forge; + + scripts.deploy.exec = '' + cargo run --bin deploy_levels + ''; + + scripts.test.exec = '' + cargo test -p attack + ''; + + scripts.check.exec = '' + cargo clippy --all-targets --all-features -- -D warnings + cargo fmt --all -- --check + ''; + + pre-commit.hooks = { + rustfmt.enable = true; + clippy.enable = true; }; - # bind-attack-contracts = { - # enable = true; - # name = "Bind attack contracts"; - # description = - # "Build attack/contracts/ contracts and generate Rust ABI bindings"; - # files = "attack/contracts/.*.sol$"; - # entry = ".devenv/profile/bin/bind-attack"; - # pass_filenames = false; - # verbose = true; - # }; - # bind-ctf-contracts = { - # enable = true; - # name = "Bind CTF contracts"; - # description = - # "Compile CTF smart contracts and generate Rust ABI bindings"; - # files = "ctf/contracts/.*.sol$"; - # entry = ".devenv/profile/bin/bind-ctfs"; - # pass_filenames = false; - # verbose = true; - # }; - # deploy-levels = { - # enable = true; - # name = "Deploy levels"; - # files = "ctf/src/.*.rs"; - # entry = ".devenv/profile/bin/deploy-levels"; - # pass_filenames = false; - # verbose = true; - # }; - }; - }]; + } + ]; }; }); }