diff --git a/Cargo.lock b/Cargo.lock index f52514a1194..5b2906165c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -434,6 +434,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "assert_matches" version = "1.5.0" @@ -489,6 +495,83 @@ dependencies = [ "wildmatch", ] +[[package]] +name = "aurora-engine-modexp" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=3.6.1#26a126231e1ce338598a7d9909779f32e4dce8a2" +dependencies = [ + "hex", + "num", +] + +[[package]] +name = "aurora-engine-precompiles" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=3.6.1#26a126231e1ce338598a7d9909779f32e4dce8a2" +dependencies = [ + "aurora-engine-modexp", + "aurora-engine-sdk", + "aurora-engine-types", + "ethabi", + "evm", + "hex", + "libsecp256k1", + "num", + "ripemd", + "sha2 0.10.6", + "sha3", + "zeropool-bn", +] + +[[package]] +name = "aurora-engine-sdk" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=3.6.1#26a126231e1ce338598a7d9909779f32e4dce8a2" +dependencies = [ + "aurora-engine-types", + "base64 0.21.0", + "sha2 0.10.6", + "sha3", +] + +[[package]] +name = "aurora-engine-transactions" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=3.6.1#26a126231e1ce338598a7d9909779f32e4dce8a2" +dependencies = [ + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-types", + "evm", + "rlp", +] + +[[package]] +name = "aurora-engine-types" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?tag=3.6.1#26a126231e1ce338598a7d9909779f32e4dce8a2" +dependencies = [ + "base64 0.21.0", + "borsh 0.10.3", + "bs58 0.5.1", + "hex", + "primitive-types 0.12.2", + "rlp", + "serde", + "serde_json", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -684,7 +767,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" dependencies = [ "arrayref", - "arrayvec", + "arrayvec 0.5.2", "cc", "cfg-if 0.1.10", "constant_time_eq", @@ -692,6 +775,15 @@ dependencies = [ "digest 0.9.0", ] +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array 0.14.5", +] + [[package]] name = "block-buffer" version = "0.10.2" @@ -805,6 +897,16 @@ dependencies = [ "hashbrown 0.11.2", ] +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive 0.10.3", + "hashbrown 0.11.2", +] + [[package]] name = "borsh" version = "1.0.0" @@ -821,8 +923,21 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", + "borsh-derive-internal 0.9.3", + "borsh-schema-derive-internal 0.9.3", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.103", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", "proc-macro-crate 0.1.5", "proc-macro2", "syn 1.0.103", @@ -853,6 +968,17 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "borsh-schema-derive-internal" version = "0.9.3" @@ -864,6 +990,17 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "brotli" version = "3.3.4" @@ -891,12 +1028,28 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2 0.10.6", + "tinyvec", +] + [[package]] name = "bumpalo" version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + [[package]] name = "bytecheck" version = "0.6.8" @@ -1815,7 +1968,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ - "block-buffer", + "block-buffer 0.10.2", "crypto-common", "subtle", ] @@ -1935,7 +2088,7 @@ dependencies = [ "curve25519-dalek", "ed25519", "rand_core 0.6.4", - "sha2", + "sha2 0.10.6", "subtle", ] @@ -2065,6 +2218,114 @@ dependencies = [ "xshell", ] +[[package]] +name = "ethabi" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types", + "hex", + "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 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "rlp", + "sha3", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types 0.12.2", + "scale-info", + "uint", +] + +[[package]] +name = "evm" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "auto_impl", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "primitive-types 0.12.2", + "rlp", + "sha3", +] + +[[package]] +name = "evm-core" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "primitive-types 0.12.2", +] + +[[package]] +name = "evm-gasometer" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "evm-core", + "evm-runtime", + "primitive-types 0.12.2", +] + +[[package]] +name = "evm-runtime" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "auto_impl", + "evm-core", + "primitive-types 0.12.2", + "sha3", +] + [[package]] name = "expect-test" version = "1.3.0" @@ -2136,6 +2397,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + [[package]] name = "fixedbitset" version = "0.4.2" @@ -2449,6 +2722,21 @@ version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + [[package]] name = "hashbrown" version = "0.11.2" @@ -2568,7 +2856,17 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" dependencies = [ - "hmac", + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", ] [[package]] @@ -2580,6 +2878,17 @@ dependencies = [ "digest 0.10.6", ] +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.5", + "hmac 0.8.1", +] + [[package]] name = "http" version = "0.2.7" @@ -2717,6 +3026,44 @@ dependencies = [ "version_check", ] +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "indexer-example" version = "0.0.0" @@ -2790,12 +3137,15 @@ dependencies = [ "actix-rt", "anyhow", "assert_matches", + "aurora-engine-transactions", + "aurora-engine-types", "borsh 1.0.0", "bytesize", "chrono", "clap", "derive-enum-from-into", "derive_more", + "ethabi", "futures", "hex", "insta", @@ -2830,11 +3180,12 @@ dependencies = [ "node-runtime", "once_cell", "parking_lot 0.12.1", - "primitive-types", + "primitive-types 0.10.1", "rand", "rlp", "serde", "serde_json", + "sha3", "smart-default", "strum", "tempfile", @@ -3012,6 +3363,54 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.0", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + [[package]] name = "libsqlite3-sys" version = "0.26.0" @@ -3415,7 +3814,7 @@ dependencies = [ "near-crypto", "near-primitives", "near-primitives-core", - "num-rational", + "num-rational 0.3.2", "serde", "serde_json", "tempfile", @@ -3494,9 +3893,9 @@ dependencies = [ "near-store", "near-vm-runner", "node-runtime", - "num-rational", + "num-rational 0.3.2", "once_cell", - "primitive-types", + "primitive-types 0.10.1", "rand", "rand_chacha", "rayon", @@ -3522,11 +3921,11 @@ dependencies = [ "near-o11y", "near-parameters", "near-primitives", - "num-rational", + "num-rational 0.3.2", "once_cell", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "smart-default", "time", "tracing", @@ -3624,7 +4023,7 @@ dependencies = [ "near-store", "near-telemetry", "near-vm-runner", - "num-rational", + "num-rational 0.3.2", "once_cell", "percent-encoding", "rand", @@ -3682,7 +4081,7 @@ dependencies = [ "blake2", "bolero", "borsh 1.0.0", - "bs58", + "bs58 0.4.0", "curve25519-dalek", "derive_more", "ed25519-dalek", @@ -3692,11 +4091,11 @@ dependencies = [ "near-config-utils", "near-stdx", "once_cell", - "primitive-types", + "primitive-types 0.10.1", "secp256k1", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "subtle", "tempfile", "thiserror", @@ -3755,9 +4154,9 @@ dependencies = [ "near-o11y", "near-primitives", "near-store", - "num-rational", + "num-rational 0.3.2", "once_cell", - "primitive-types", + "primitive-types 0.10.1", "rand", "rand_hc", "serde_json", @@ -3874,7 +4273,7 @@ dependencies = [ "actix", "actix-cors", "actix-web", - "bs58", + "bs58 0.4.0", "derive_more", "easy-ext", "futures", @@ -3997,7 +4396,7 @@ dependencies = [ "anyhow", "async-trait", "borsh 1.0.0", - "bs58", + "bs58 0.4.0", "clap", "ed25519-dalek", "hex", @@ -4025,7 +4424,7 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "strum", "thiserror", "tokio", @@ -4074,7 +4473,7 @@ dependencies = [ "rayon", "rlimit", "serde", - "sha2", + "sha2 0.10.6", "smart-default", "strum", "stun", @@ -4129,7 +4528,7 @@ dependencies = [ "insta", "near-account-id", "near-primitives-core", - "num-rational", + "num-rational 0.3.2", "serde", "serde_repr", "serde_yaml", @@ -4220,9 +4619,9 @@ dependencies = [ "near-rpc-error-macro", "near-stdx", "near-vm-runner", - "num-rational", + "num-rational 0.3.2", "once_cell", - "primitive-types", + "primitive-types 0.10.1", "rand", "rand_chacha", "reed-solomon-erasure", @@ -4244,17 +4643,17 @@ dependencies = [ "arbitrary", "base64 0.21.0", "borsh 1.0.0", - "bs58", + "bs58 0.4.0", "derive_more", "enum-map", "expect-test", "insta", "near-account-id", - "num-rational", + "num-rational 0.3.2", "serde", "serde_json", "serde_repr", - "sha2", + "sha2 0.10.6", "thiserror", ] @@ -4326,7 +4725,7 @@ dependencies = [ "near-ping", "near-primitives", "once_cell", - "sha2", + "sha2 0.10.6", "tokio", "tracing", ] @@ -4549,7 +4948,7 @@ dependencies = [ "near-vm-engine", "near-vm-types", "near-vm-vm", - "num-rational", + "num-rational 0.3.2", "once_cell", "parity-wasm 0.41.0", "parity-wasm 0.42.2", @@ -4561,7 +4960,7 @@ dependencies = [ "serde", "serde_json", "serde_repr", - "sha2", + "sha2 0.10.6", "sha3", "strum", "tempfile", @@ -4730,9 +5129,9 @@ dependencies = [ "near-telemetry", "near-vm-runner", "node-runtime", - "num-rational", + "num-rational 0.3.2", "once_cell", - "primitive-types", + "primitive-types 0.10.1", "rand", "rayon", "regex", @@ -4844,14 +5243,14 @@ dependencies = [ "near-vm-runner", "near-wallet-contract", "num-bigint 0.3.3", - "num-rational", + "num-rational 0.3.2", "num-traits", "once_cell", "rand", "rayon", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "tempfile", "testlib", "thiserror", @@ -4887,6 +5286,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.3", + "num-complex", + "num-integer", + "num-iter", + "num-rational 0.4.1", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.2.6" @@ -4909,6 +5322,26 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +dependencies = [ + "num-traits", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -4919,6 +5352,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.3.2" @@ -4932,6 +5376,18 @@ dependencies = [ "serde", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint 0.4.3", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -5197,6 +5653,32 @@ dependencies = [ "syn 1.0.103", ] +[[package]] +name = "parity-scale-codec" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +dependencies = [ + "arrayvec 0.7.4", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +dependencies = [ + "proc-macro-crate 2.0.2", + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "parity-wasm" version = "0.41.0" @@ -5427,7 +5909,21 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" dependencies = [ - "fixed-hash", + "fixed-hash 0.7.0", + "uint", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", "uint", ] @@ -5447,7 +5943,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", ] [[package]] @@ -5994,9 +6500,21 @@ 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -6013,7 +6531,7 @@ version = "0.0.0" dependencies = [ "anyhow", "borsh 1.0.0", - "bs58", + "bs58 0.4.0", "bytesize", "cfg-if 1.0.0", "chrono", @@ -6034,7 +6552,7 @@ dependencies = [ "near-vm-runner", "nearcore", "node-runtime", - "num-rational", + "num-rational 0.3.2", "num-traits", "rand", "rand_xorshift", @@ -6122,7 +6640,7 @@ dependencies = [ "block_on_proc", "cfg-if 1.0.0", "hex", - "hmac", + "hmac 0.12.1", "http", "log", "maybe-async", @@ -6133,7 +6651,7 @@ dependencies = [ "serde", "serde-xml-rs", "serde_derive", - "sha2", + "sha2 0.10.6", "thiserror", "time", "tokio", @@ -6258,6 +6776,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-info" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef2175c2907e7c8bc0a9c3f86aeb5ec1f3b275300ad58a44d0c3ae379a5e52e" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b8eb8fd61c5cdd3390d9b2132300a7e7618955b98b8416f118c1b4e144f" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.103", +] + [[package]] name = "schannel" version = "0.1.19" @@ -6527,6 +7069,19 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + [[package]] name = "sha2" version = "0.10.6" @@ -7059,6 +7614,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -7212,6 +7776,17 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow", +] + [[package]] name = "tonic" version = "0.6.2" @@ -7415,6 +7990,16 @@ dependencies = [ "tracing-log 0.2.0", ] +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -7469,9 +8054,9 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uint" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f03af7ccf01dd611cc450a0d10dbc9b745770d096473e2faf0ca6e2d66d1e0" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ "byteorder", "crunchy", diff --git a/Cargo.toml b/Cargo.toml index d7abc7a388b..1e5eba56cc6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -121,6 +121,8 @@ arbitrary = { version = "1.2.3", features = ["derive"] } arc-swap = "1.5" assert_matches = "1.5.0" async-trait = "0.1.58" +aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.1" } +aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", tag = "3.6.1" } awc = { version = "3", features = ["openssl"] } backtrace = "0.3" base64 = "0.21" @@ -170,6 +172,7 @@ ed25519-dalek = { version = "2.1.0", default-features = false, features = [ elastic-array = "0.11" enum-map = "2.1.0" enumset = "1.0" +ethabi = "18" expect-test = "1.3.0" finite-wasm = "0.5.0" fs2 = "0.4" diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 94bcc438f73..2f3606f20ce 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -67,10 +67,14 @@ testlib.workspace = true [dev-dependencies] assert_matches.workspace = true +aurora-engine-transactions.workspace = true +aurora-engine-types.workspace = true derive-enum-from-into.workspace = true +ethabi.workspace = true insta.workspace = true near-undo-block.workspace = true rlp.workspace = true +sha3.workspace = true [features] performance_stats = [ diff --git a/integration-tests/src/tests/client/features/wallet_contract.rs b/integration-tests/src/tests/client/features/wallet_contract.rs index 9666c2a61a5..2f1a8b6bd22 100644 --- a/integration-tests/src/tests/client/features/wallet_contract.rs +++ b/integration-tests/src/tests/client/features/wallet_contract.rs @@ -1,12 +1,15 @@ use assert_matches::assert_matches; +use aurora_engine_transactions::eip_2930::Transaction2930; +use aurora_engine_transactions::EthTransactionKind; +use aurora_engine_types::types::{Address, Wei}; +use ethabi::ethereum_types::U256; use near_chain_configs::{Genesis, NEAR_BASE}; use near_client::{test_utils::TestEnv, ProcessTxResponse}; -use near_crypto::{InMemorySigner, KeyType, SecretKey}; -use near_primitives::errors::{ - ActionError, ActionErrorKind, FunctionCallError, InvalidAccessKeyError, InvalidTxError, - TxExecutionError, -}; -use near_primitives::test_utils::eth_implicit_test_account; +use near_crypto::{InMemorySigner, KeyType, PublicKey, SecretKey}; +use near_primitives::account::id::AccountIdRef; +use near_primitives::account::{AccessKeyPermission, FunctionCallPermission}; +use near_primitives::errors::{InvalidAccessKeyError, InvalidTxError}; +use near_primitives::test_utils::{create_user_test_signer, eth_implicit_test_account}; use near_primitives::transaction::{ Action, AddKeyAction, DeployContractAction, FunctionCallAction, SignedTransaction, TransferAction, @@ -23,13 +26,9 @@ use near_vm_runner::ContractCode; use near_wallet_contract::{wallet_contract, wallet_contract_magic_bytes}; use nearcore::test_utils::TestEnvNightshadeSetupExt; use node_runtime::ZERO_BALANCE_ACCOUNT_STORAGE_LIMIT; -use rlp::RlpStream; -use testlib::runtime_utils::{alice_account, bob_account, carol_account}; +use testlib::runtime_utils::{alice_account, bob_account}; -use crate::{ - node::{Node, RuntimeNode}, - tests::client::process_blocks::produce_blocks_from_height, -}; +use crate::tests::client::process_blocks::produce_blocks_from_height; /// Try to process tx in the next blocks, check that tx and all generated receipts succeed. /// Return height of the next block. @@ -43,6 +42,7 @@ fn check_tx_processing( assert_eq!(env.clients[0].process_tx(tx, false, false), ProcessTxResponse::ValidTx); let next_height = produce_blocks_from_height(env, blocks_number, height); let final_outcome = env.clients[0].chain.get_final_transaction_result(&tx_hash).unwrap(); + println!("{final_outcome:?}"); assert_matches!(final_outcome.status, FinalExecutionStatus::SuccessValue(_)); next_height } @@ -65,6 +65,22 @@ fn view_request(env: &TestEnv, request: QueryRequest) -> QueryResponse { .unwrap() } +fn view_balance(env: &TestEnv, account: &AccountIdRef) -> u128 { + let request = QueryRequest::ViewAccount { account_id: account.into() }; + match view_request(&env, request).kind { + QueryResponseKind::ViewAccount(view) => view.amount, + _ => panic!("wrong query response"), + } +} + +fn view_nonce(env: &TestEnv, account: &AccountIdRef, pk: PublicKey) -> u64 { + let request = QueryRequest::ViewAccessKey { account_id: account.into(), public_key: pk }; + match view_request(&env, request).kind { + QueryResponseKind::AccessKey(view) => view.nonce, + _ => panic!("wrong query response"), + } +} + /// Tests that ETH-implicit account is created correctly, with Wallet Contract hash. #[test] fn test_eth_implicit_account_creation() { @@ -214,126 +230,258 @@ fn test_transaction_from_eth_implicit_account_fail() { assert_eq!(response, expected_tx_error); } -// TODO(eth-implicit) Remove this test and replace it with tests that directly call the `Wallet Contract` when it is ready. -/// Creating an ETH-implicit account with meta-transaction, then attempting to use it with another meta-transaction. -/// -/// The `create_account` parameter controls whether we create ETH-implicit account -/// before attempting to use it by making a function call. -/// Depending on `rlp_transaction` blob that is sent to the `Wallet Contract` -/// the transaction is either authorized or unauthorized. -/// The `authorized` parameter controls which case will be tested. -fn meta_tx_call_wallet_contract(create_account: bool, authorized: bool) { +#[test] +fn test_wallet_contract_interaction() { if !checked_feature!("stable", EthImplicitAccounts, PROTOCOL_VERSION) { return; } - let genesis = Genesis::test(vec![alice_account(), bob_account(), carol_account()], 3); + + let genesis = Genesis::test(vec!["test0".parse().unwrap(), alice_account(), bob_account()], 1); + let mut env = TestEnv::builder(&genesis.config).nightshade_runtimes(&genesis).build(); + + let genesis_block = env.clients[0].chain.get_block_by_height(0).unwrap(); + let mut height = 1; + let blocks_number = 10; + + // As the relayer, alice will be sending Near transactions which + // contain the Ethereum transactions the user signs. let relayer = alice_account(); - let node = RuntimeNode::new_from_genesis(&relayer, genesis); - let sender = bob_account(); + let mut relayer_signer = + NearSigner { account_id: &relayer, signer: create_user_test_signer(&relayer) }; + // Bob will receive a $NEAR transfer from the eth implicit account + let receiver = bob_account(); + // Generate an eth implicit account for the user let secret_key = SecretKey::from_seed(KeyType::SECP256K1, "test"); let public_key = secret_key.public_key(); let eth_implicit_account = derive_eth_implicit_account_id(public_key.unwrap_as_secp256k1()); - let other_public_key = SecretKey::from_seed(KeyType::SECP256K1, "test2").public_key(); - - // Although ETH-implicit account can be zero-balance, we pick 1 here in order to make transfer later from this account. - let transfer_amount = 1u128; - let actions = vec![Action::Transfer(TransferAction { deposit: transfer_amount })]; - - if create_account { - // Create ETH-implicit account by funding it. - node.user() - .meta_tx(sender.clone(), eth_implicit_account.clone(), relayer.clone(), actions) - .unwrap() - .assert_success(); - } - let target = carol_account(); - let initial_balance = node.view_balance(&target).expect("failed looking up balance"); - - // TODO(eth-implicit) Append appropriate values to the RLP stream when proper `Wallet Contract` is implemented. - let mut stream = RlpStream::new_list(3); - stream.append(&target.as_str()); - // The RLP trait `Encodable` is not implemented for `u128`. We must encode it as bytes. - // TODO(eth-implicit) Do not try to encode `u128` values directly, see https://github.com/near/nearcore/pull/10269#discussion_r1425585051. - stream.append(&transfer_amount.to_be_bytes().as_slice()); - if authorized { - stream.append(&public_key.key_data()); - } else { - stream.append(&other_public_key.key_data()); - } - let rlp_encoded_data = stream.out().to_vec(); + // Create ETH-implicit account by funding it. + // Although ETH-implicit account can be zero-balance, we pick a non-zero amount + // here in order to make transfer later from this account. + let deposit_for_account_creation = NEAR_BASE; + let actions = vec![Action::Transfer(TransferAction { deposit: deposit_for_account_creation })]; + let nonce = + view_nonce(&env, relayer_signer.account_id, relayer_signer.signer.public_key.clone()) + 1; + let block_hash = *genesis_block.hash(); + let signed_transaction = SignedTransaction::from_actions( + nonce, + relayer.clone(), + eth_implicit_account.clone(), + &relayer_signer.signer, + actions, + block_hash, + ); + height = check_tx_processing(&mut env, signed_transaction, height, blocks_number); - let args = serde_json::json!({ - "target": target.to_string(), - "rlp_transaction": rlp_encoded_data, - }) - .to_string() + // The relayer adds its key to the eth implicit account so that + // can sign Near transactions for the user. + let relayer_pk = relayer_signer.signer.public_key.clone(); + let action = Action::AddKey(Box::new(AddKeyAction { + public_key: relayer_pk, + access_key: AccessKey { + nonce: 0, + permission: AccessKeyPermission::FunctionCall(FunctionCallPermission { + allowance: None, + receiver_id: eth_implicit_account.to_string(), + method_names: vec!["rlp_execute".into()], + }), + }, + })); + let signed_transaction = create_rlp_execute_tx( + ð_implicit_account, + action, + 0, + ð_implicit_account, + &secret_key, + &mut relayer_signer, + &env, + ); + height = check_tx_processing(&mut env, signed_transaction, height, blocks_number); + + // Now the relayer can sign transactions for the implicit account directly + relayer_signer.account_id = ð_implicit_account; + + let init_wallet_balance = view_balance(&env, ð_implicit_account); + let init_receiver_balance = view_balance(&env, &receiver); + + // The user signs a transaction to transfer some $NEAR + let transfer_amount = NEAR_BASE / 7; + let action = Action::Transfer(TransferAction { deposit: transfer_amount }); + let signed_transaction = create_rlp_execute_tx( + &receiver, + action, + 1, + ð_implicit_account, + &secret_key, + &mut relayer_signer, + &env, + ); + check_tx_processing(&mut env, signed_transaction, height, blocks_number); + + let final_wallet_balance = view_balance(&env, ð_implicit_account); + let final_receiver_balance = view_balance(&env, &receiver); + + assert_eq!(final_receiver_balance - init_receiver_balance, transfer_amount); + let wallet_balance_diff = init_wallet_balance - final_wallet_balance; + // Wallet balance is a little lower due to gas fees. + assert!(wallet_balance_diff - transfer_amount < NEAR_BASE / 500); +} + +fn create_rlp_execute_tx( + target: &AccountIdRef, + mut action: Action, + nonce: u64, + eth_implicit_account: &AccountIdRef, + secret_key: &SecretKey, + near_signer: &mut NearSigner<'_>, + env: &TestEnv, +) -> SignedTransaction { + const CHAIN_ID: u64 = 0x4ea7; + // handles 24 vs 18 decimal mismatch between $NEAR and $ETH + const MAX_YOCTO_NEAR: u128 = 1_000_000; + + // Construct Eth transaction from user's intended action + let value = match &mut action { + Action::Transfer(tx) => { + let raw_amount = tx.deposit; + tx.deposit = raw_amount % MAX_YOCTO_NEAR; + Wei::new_u128(raw_amount / MAX_YOCTO_NEAR) + } + Action::FunctionCall(fn_call) => { + let raw_amount = fn_call.deposit; + fn_call.deposit = raw_amount % MAX_YOCTO_NEAR; + Wei::new_u128(raw_amount / MAX_YOCTO_NEAR) + } + _ => Wei::zero(), + }; + let tx_data = abi_encode(target.to_string(), action); + let transaction = Transaction2930 { + chain_id: CHAIN_ID, + nonce: nonce.into(), + gas_price: U256::zero(), + gas_limit: U256::zero(), + to: Some(derive_address(target)), + value, + data: tx_data, + access_list: Vec::new(), + }; + let signed_tx = sign_eth_transaction(transaction, &secret_key); + let signed_tx_bytes: Vec = (&signed_tx).into(); + let tx_bytes_b64 = near_primitives::serialize::to_base64(&signed_tx_bytes); + let args = format!( + r#"{{ + "target": "{target}", + "tx_bytes_b64": "{tx_bytes_b64}" + }}"# + ) .into_bytes(); + // Construct Near transaction to `rlp_execute` method let actions = vec![Action::FunctionCall(Box::new(FunctionCallAction { - method_name: "execute_rlp".to_owned(), + method_name: "rlp_execute".into(), args, - gas: 30_000_000_000_000, + gas: 300_000_000_000_000, deposit: 0, }))]; - // Call Wallet Contract with JSON-encoded arguments: `target` and `rlp_transaction`. The `rlp_transaction`'s value is RLP-encoded. - let tx_result = - node.user().meta_tx(sender, eth_implicit_account.clone(), relayer, actions).unwrap(); - let wallet_contract_call_result = &tx_result.receipts_outcome[1].outcome.status; - - if create_account && authorized { - // If the public key recovered from the RLP transaction's signature is valid for this ETH-implicit account, - // the transaction will succeed. `target`'s balance will increase by `transfer_amount`. - tx_result.assert_success(); - let final_balance = node.view_balance(&target).expect("failed looking up balance"); - assert_eq!(final_balance, initial_balance + transfer_amount); - return; - } + let nonce = view_nonce(env, near_signer.account_id, near_signer.signer.public_key.clone()) + 1; + let block_hash = *env.clients[0].chain.get_head_block().unwrap().hash(); + SignedTransaction::from_actions( + nonce, + near_signer.account_id.into(), + eth_implicit_account.into(), + &near_signer.signer, + actions, + block_hash, + ) +} - if create_account { - // The public key recovered from the RLP transaction's signature isn't valid for this ETH-implicit account. - // The Wallet Contract will reject this transaction. - let expected_error = near_primitives::views::ExecutionStatusView::Failure( - TxExecutionError::ActionError( - ActionError { - index: Some(0), - kind: ActionErrorKind::FunctionCallError { - 0: FunctionCallError::ExecutionError( - "Smart contract panicked: Public key does not match the Wallet Contract address." - .to_string() - ) - } - } - ) - ); - assert_eq!(wallet_contract_call_result, &expected_error); - } else { - // The Wallet Contract function call is not executed because the account does not exist. - let expected_error = near_primitives::views::ExecutionStatusView::Failure( - TxExecutionError::ActionError(ActionError { - index: Some(0), - kind: ActionErrorKind::AccountDoesNotExist { account_id: eth_implicit_account }, - }), - ); - assert_eq!(wallet_contract_call_result, &expected_error); +struct NearSigner<'a> { + account_id: &'a AccountIdRef, + signer: InMemorySigner, +} + +fn abi_encode(target: String, action: Action) -> Vec { + const ADD_KEY_SELECTOR: &[u8] = &[0x75, 0x3c, 0xe5, 0xab]; + const TRANSFER_SELECTOR: &[u8] = &[0x3e, 0xd6, 0x41, 0x24]; + + let mut buf = Vec::new(); + match action { + Action::AddKey(add_key) => { + buf.extend_from_slice(ADD_KEY_SELECTOR); + let (public_key_kind, public_key) = match add_key.public_key { + PublicKey::ED25519(key) => (0, key.as_ref().to_vec()), + PublicKey::SECP256K1(key) => (1, key.as_ref().to_vec()), + }; + let nonce = add_key.access_key.nonce; + let (is_full_access, is_limited_allowance, allowance, receiver_id, method_names) = + match add_key.access_key.permission { + AccessKeyPermission::FullAccess => (true, false, 0, String::new(), Vec::new()), + AccessKeyPermission::FunctionCall(permission) => ( + false, + permission.allowance.is_some(), + permission.allowance.unwrap_or_default(), + permission.receiver_id, + permission.method_names, + ), + }; + let tokens = &[ + ethabi::Token::Uint(public_key_kind.into()), + ethabi::Token::Bytes(public_key), + ethabi::Token::Uint(nonce.into()), + ethabi::Token::Bool(is_full_access), + ethabi::Token::Bool(is_limited_allowance), + ethabi::Token::Uint(allowance.into()), + ethabi::Token::String(receiver_id), + ethabi::Token::Array(method_names.into_iter().map(ethabi::Token::String).collect()), + ]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + Action::Transfer(tx) => { + buf.extend_from_slice(TRANSFER_SELECTOR); + let tokens = &[ethabi::Token::String(target), ethabi::Token::Uint(tx.deposit.into())]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + _ => unimplemented!(), } + buf } -/// Wallet Contract function call is rejected because the ETH-implicit account does not exist. -#[test] -fn meta_tx_call_wallet_contract_account_does_not_exist() { - meta_tx_call_wallet_contract(false, true); +fn sign_eth_transaction(transaction: Transaction2930, sk: &SecretKey) -> EthTransactionKind { + let mut rlp_stream = rlp::RlpStream::new(); + rlp_stream.append(&aurora_engine_transactions::eip_2930::TYPE_BYTE); + transaction.rlp_append_unsigned(&mut rlp_stream); + let message_hash = keccak256(rlp_stream.as_raw()); + let signature = sk.sign(&message_hash); + let bytes: [u8; 65] = match signature { + near_crypto::Signature::SECP256K1(x) => x.into(), + _ => panic!("Expected SECP256K1 key"), + }; + let v = bytes[64]; + let r = U256::from_big_endian(&bytes[0..32]); + let s = U256::from_big_endian(&bytes[32..64]); + let signed_transaction = aurora_engine_transactions::eip_2930::SignedTransaction2930 { + transaction, + parity: v, + r, + s, + }; + EthTransactionKind::Eip2930(signed_transaction) } -/// Wallet Contract function call fails because the provided public key does not match the ETH-implicit address. -#[test] -fn meta_tx_call_wallet_contract_unauthorized() { - meta_tx_call_wallet_contract(true, false); +fn keccak256(bytes: &[u8]) -> [u8; 32] { + use sha3::{Digest, Keccak256}; + + Keccak256::digest(bytes).into() } -/// Wallet Contract function call is executed successfully. -#[test] -fn meta_tx_call_wallet_contract_authorized() { - meta_tx_call_wallet_contract(true, true); +fn derive_address(account_id: &AccountIdRef) -> Address { + let bytes = if account_id.as_str().starts_with("0x") { + let buf = hex::decode(&account_id.as_str()[2..42]).expect("account_id is hex encoded"); + return Address::try_from_slice(&buf).expect("slice is correct size"); + } else { + account_id.as_bytes() + }; + let hash = keccak256(bytes); + Address::try_from_slice(&hash[12..32]).expect("slice is correct size") } diff --git a/runtime/near-wallet-contract/implementation/Cargo.lock b/runtime/near-wallet-contract/implementation/Cargo.lock new file mode 100644 index 00000000000..b8eeb1294df --- /dev/null +++ b/runtime/near-wallet-contract/implementation/Cargo.lock @@ -0,0 +1,5173 @@ +# 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" + +[[package]] +name = "actix" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb72882332b6d6282f428b77ba0358cb2687e61a6f6df6a6d3871e8a177c2d4f" +dependencies = [ + "actix-macros", + "actix-rt", + "actix_derive", + "bitflags 2.5.0", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util 0.7.10", +] + +[[package]] +name = "actix-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" +dependencies = [ + "quote", + "syn 2.0.53", +] + +[[package]] +name = "actix-rt" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" +dependencies = [ + "futures-core", + "tokio", +] + +[[package]] +name = "actix_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.1", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[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 = "anstream" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "async-trait" +version = "0.1.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "aurora-engine-modexp" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=c03a2d8610cd27a9decb91b3bddb107db2177b29#c03a2d8610cd27a9decb91b3bddb107db2177b29" +dependencies = [ + "hex", + "num", +] + +[[package]] +name = "aurora-engine-precompiles" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=c03a2d8610cd27a9decb91b3bddb107db2177b29#c03a2d8610cd27a9decb91b3bddb107db2177b29" +dependencies = [ + "aurora-engine-modexp", + "aurora-engine-sdk", + "aurora-engine-types", + "ethabi", + "evm", + "hex", + "libsecp256k1", + "num", + "ripemd", + "sha2 0.10.8", + "sha3", + "zeropool-bn", +] + +[[package]] +name = "aurora-engine-sdk" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=c03a2d8610cd27a9decb91b3bddb107db2177b29#c03a2d8610cd27a9decb91b3bddb107db2177b29" +dependencies = [ + "aurora-engine-types", + "base64 0.21.7", + "sha2 0.10.8", + "sha3", +] + +[[package]] +name = "aurora-engine-transactions" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=c03a2d8610cd27a9decb91b3bddb107db2177b29#c03a2d8610cd27a9decb91b3bddb107db2177b29" +dependencies = [ + "aurora-engine-precompiles", + "aurora-engine-sdk", + "aurora-engine-types", + "evm", + "rlp", +] + +[[package]] +name = "aurora-engine-types" +version = "1.0.0" +source = "git+https://github.com/aurora-is-near/aurora-engine.git?rev=c03a2d8610cd27a9decb91b3bddb107db2177b29#c03a2d8610cd27a9decb91b3bddb107db2177b29" +dependencies = [ + "base64 0.21.7", + "borsh 1.3.1", + "bs58 0.5.1", + "hex", + "primitive-types 0.12.2", + "rlp", + "serde", + "serde_json", +] + +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "binary-install" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93bff426ff93f3610dd2b946f3eb8cb2d1285ca8682834d43be531a3f93db2ff" +dependencies = [ + "anyhow", + "dirs-next", + "flate2", + "fs2", + "hex", + "is_executable", + "siphasher", + "tar", + "ureq", + "zip 0.6.6", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" +dependencies = [ + "crypto-mac", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", +] + +[[package]] +name = "borsh" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +dependencies = [ + "borsh-derive 1.3.1", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.53", + "syn_derive", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "brownstone" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "sha2 0.10.8", + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" +dependencies = [ + "cipher 0.2.5", + "ppv-lite86", +] + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-near" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f73eb01da3b6737778d2006645533e75563d1080c64bf714bfb88d3fb0ac09b" +dependencies = [ + "anyhow", + "atty", + "bs58 0.4.0", + "camino", + "cargo_metadata", + "clap 3.2.25", + "colored", + "env_logger", + "libloading", + "log", + "near-abi", + "rustc_version", + "schemars", + "serde_json", + "sha2 0.10.8", + "symbolic-debuginfo", + "zstd", +] + +[[package]] +name = "cargo-platform" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", +] + +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +dependencies = [ + "jobserver", + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.4", +] + +[[package]] +name = "cipher" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" +dependencies = [ + "generic-array", +] + +[[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 = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive 3.2.25", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap" +version = "4.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" +dependencies = [ + "clap_builder", + "clap_derive 4.5.3", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.7.0", + "strsim 0.11.0", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck 0.4.1", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_derive" +version = "4.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rand_core 0.6.4", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "darling" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 2.0.53", +] + +[[package]] +name = "darling_macro" +version = "0.20.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "debugid" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" +dependencies = [ + "uuid", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[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 = "dmsort" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + +[[package]] +name = "easy-ext" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", + "sha2 0.10.8", + "subtle", +] + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "elementtree" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6319c9433cf1e95c60c8533978bccf0614f27f03bb4e514253468eeeaa7fe3" +dependencies = [ + "string_cache", + "xml-rs", +] + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "eth-address-registrar" +version = "0.1.0" +dependencies = [ + "hex", + "near-sdk", + "serde", +] + +[[package]] +name = "eth-wallet-contract" +version = "0.1.0" +dependencies = [ + "anyhow", + "aurora-engine-transactions", + "aurora-engine-types", + "base64 0.21.7", + "ethabi", + "hex", + "near-crypto 0.21.2", + "near-sdk", + "near-workspaces", + "once_cell", + "rlp", + "serde", + "serde_json", + "sha3", + "tokio", +] + +[[package]] +name = "ethabi" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types", + "hex", + "sha3", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethereum" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "rlp", + "sha3", + "triehash", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "primitive-types 0.12.2", + "scale-info", + "uint", +] + +[[package]] +name = "evm" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "auto_impl", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "primitive-types 0.12.2", + "rlp", + "sha3", +] + +[[package]] +name = "evm-core" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "primitive-types 0.12.2", +] + +[[package]] +name = "evm-gasometer" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "evm-core", + "evm-runtime", + "primitive-types 0.12.2", +] + +[[package]] +name = "evm-runtime" +version = "0.39.1" +source = "git+https://github.com/aurora-is-near/sputnikvm.git?tag=v0.39.1#0334a09d6b6e83ff3a8da992e33f29ba95e0c9fe" +dependencies = [ + "auto_impl", + "evm-core", + "primitive-types 0.12.2", + "sha3", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "fiat-crypto" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" + +[[package]] +name = "filetime" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "windows-sys 0.52.0", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll 0.11.0", +] + +[[package]] +name = "h2" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.5", + "slab", + "tokio", + "tokio-util 0.7.10", + "tracing", +] + +[[package]] +name = "hash-db" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57fa0ae458eb99874f54c09f4f9174f8b45fb87e854536a4e608696247f0c23" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +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.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array", + "hmac 0.8.1", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +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 = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +dependencies = [ + "equivalent", + "hashbrown 0.14.4", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is_executable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +dependencies = [ + "winapi", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff1e1486799e3f64129f8ccad108b38290df9cd7015cd31bed17239f0789d6" +dependencies = [ + "serde", + "serde_json", + "thiserror", + "treediff", +] + +[[package]] +name = "json_comments" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if 1.0.0", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.5.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" +dependencies = [ + "autocfg", +] + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.48.0", +] + +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "native-tls" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "near-abi" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" +dependencies = [ + "borsh 0.9.3", + "schemars", + "semver", + "serde", +] + +[[package]] +name = "near-account-id" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35cbb989542587b47205e608324ddd391f0cee1c22b4b64ae49f458334b95907" +dependencies = [ + "borsh 1.3.1", + "serde", +] + +[[package]] +name = "near-chain-configs" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e5a8ace81c09d7eb165dffc1742358a021b2fa761f2160943305f83216003" +dependencies = [ + "anyhow", + "bytesize", + "chrono", + "derive_more", + "near-config-utils 0.20.1", + "near-crypto 0.20.1", + "near-parameters", + "near-primitives", + "num-rational 0.3.2", + "once_cell", + "serde", + "serde_json", + "sha2 0.10.8", + "smart-default", + "tracing", +] + +[[package]] +name = "near-config-utils" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ae1eaab1d545a9be7a55b6ef09f365c2017f93a03063547591d12c0c6d27e58" +dependencies = [ + "anyhow", + "json_comments", + "thiserror", + "tracing", +] + +[[package]] +name = "near-config-utils" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1c9ff519efa8c778d341fa34971dee93e8adf4e8ae51feaefaa63bdf7e496a" +dependencies = [ + "anyhow", + "json_comments", + "thiserror", + "tracing", +] + +[[package]] +name = "near-crypto" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2991d2912218a80ec0733ac87f84fa803accea105611eea209d4419271957667" +dependencies = [ + "blake2", + "borsh 1.3.1", + "bs58 0.4.0", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "hex", + "near-account-id", + "near-config-utils 0.20.1", + "near-stdx 0.20.1", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-crypto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d927e95742aea981b9fd60996fbeba3b61e90acafd54c2c3c2a4ed40065ff03" +dependencies = [ + "blake2", + "borsh 1.3.1", + "bs58 0.4.0", + "c2-chacha", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "hex", + "near-account-id", + "near-config-utils 0.21.2", + "near-stdx 0.21.2", + "once_cell", + "primitive-types 0.10.1", + "rand 0.7.3", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + +[[package]] +name = "near-fmt" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7d998dfc1e04001608899b2498ad5a782c7d036b73769d510de21964db99286" +dependencies = [ + "near-primitives-core", +] + +[[package]] +name = "near-gas" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e75c875026229902d065e4435804497337b631ec69ba746b102954273e9ad1" +dependencies = [ + "borsh 1.3.1", + "schemars", + "serde", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ad81e015f7aced8925d5b9ba3f369b36da9575c15812cfd0786bc1213284ca" +dependencies = [ + "borsh 1.3.1", + "lazy_static", + "log", + "near-chain-configs", + "near-crypto 0.20.1", + "near-jsonrpc-primitives", + "near-primitives", + "reqwest", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ce745e954ae776eef05957602e638ee9581106a3675946fb43c2fe7e38ef03" +dependencies = [ + "arbitrary", + "near-chain-configs", + "near-crypto 0.20.1", + "near-primitives", + "near-rpc-error-macro", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "near-o11y" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20762631bc8253030013bbae9b5f0542691edc1aa6722f1e8141cc9b928ae5b" +dependencies = [ + "actix", + "base64 0.21.7", + "clap 4.5.3", + "near-crypto 0.20.1", + "near-fmt", + "near-primitives-core", + "once_cell", + "opentelemetry", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions", + "prometheus", + "serde", + "serde_json", + "strum 0.24.1", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-opentelemetry", + "tracing-subscriber", +] + +[[package]] +name = "near-parameters" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f16a59b6c3e69b0585be951af6fe42a0ba86c0e207cb8c63badd19efd16680" +dependencies = [ + "assert_matches", + "borsh 1.3.1", + "enum-map", + "near-account-id", + "near-primitives-core", + "num-rational 0.3.2", + "serde", + "serde_repr", + "serde_yaml", + "strum 0.24.1", + "thiserror", +] + +[[package]] +name = "near-primitives" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0462b067732132babcc89d5577db3bfcb0a1bcfbaaed3f2db4c11cd033666314" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "borsh 1.3.1", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext", + "enum-map", + "hex", + "near-crypto 0.20.1", + "near-fmt", + "near-o11y", + "near-parameters", + "near-primitives-core", + "near-rpc-error-macro", + "near-stdx 0.20.1", + "near-vm-runner", + "num-rational 0.3.2", + "once_cell", + "primitive-types 0.10.1", + "rand 0.8.5", + "rand_chacha 0.3.1", + "reed-solomon-erasure", + "serde", + "serde_json", + "serde_with", + "serde_yaml", + "sha3", + "smart-default", + "strum 0.24.1", + "thiserror", + "time", + "tracing", +] + +[[package]] +name = "near-primitives-core" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8443eb718606f572c438be6321a097a8ebd69f8e48d953885b4f16601af88225" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "borsh 1.3.1", + "bs58 0.4.0", + "derive_more", + "enum-map", + "near-account-id", + "num-rational 0.3.2", + "serde", + "serde_repr", + "serde_with", + "sha2 0.10.8", + "strum 0.24.1", + "thiserror", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80fca203c51edd9595ec14db1d13359fb9ede32314990bf296b6c5c4502f6ab7" +dependencies = [ + "quote", + "serde", + "syn 2.0.53", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897a445de2102f6732c8a185d922f5e3bf7fd0a41243ce40854df2197237f799" +dependencies = [ + "fs2", + "near-rpc-error-core", + "serde", + "syn 2.0.53", +] + +[[package]] +name = "near-sandbox-utils" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2de216bb0152bfb64f59016d9e6a5b1ac56dd85f729e5fde08461571e2182c8f" +dependencies = [ + "anyhow", + "binary-install", + "chrono", + "fs2", + "home", + "tokio", +] + +[[package]] +name = "near-sdk" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c2e7c9524308b1b301cca05d875de13b3b20dc8b92e71f3890b380372e4c88" +dependencies = [ + "base64 0.21.7", + "borsh 1.3.1", + "bs58 0.5.1", + "near-account-id", + "near-gas", + "near-sdk-macros", + "near-sys", + "near-token", + "once_cell", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "near-sdk-macros" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e9b23d9d7757ade258921c9cbc7923542e64d9d3b52a6cd91f746c77cb0a0f" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "serde", + "serde_json", + "strum 0.26.2", + "strum_macros 0.26.2", + "syn 2.0.53", +] + +[[package]] +name = "near-stdx" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" + +[[package]] +name = "near-stdx" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a697f311c110d0fabae6c8c49ab0a8eff0ec37df82cc860deba92156e77c43" + +[[package]] +name = "near-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" + +[[package]] +name = "near-token" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b68f3f8a2409f72b43efdbeff8e820b81e70824c49fee8572979d789d1683fb" +dependencies = [ + "borsh 1.3.1", + "serde", +] + +[[package]] +name = "near-vm-runner" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56c80bdb1954808f59bd36a9112377197b38d424991383bf05f52d0fe2e0da5" +dependencies = [ + "base64 0.21.7", + "borsh 1.3.1", + "ed25519-dalek", + "enum-map", + "memoffset", + "near-crypto 0.20.1", + "near-parameters", + "near-primitives-core", + "near-stdx 0.20.1", + "num-rational 0.3.2", + "once_cell", + "prefix-sum-vec", + "ripemd", + "serde", + "serde_repr", + "serde_with", + "sha2 0.10.8", + "sha3", + "strum 0.24.1", + "thiserror", + "tracing", + "zeropool-bn", +] + +[[package]] +name = "near-workspaces" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e597da87d0c1a722e23efb8c24ae42a0ad99a15f37101dad45c15defb051c1" +dependencies = [ + "async-trait", + "base64 0.21.7", + "bs58 0.5.1", + "cargo-near", + "chrono", + "fs2", + "json-patch", + "libc", + "near-account-id", + "near-crypto 0.20.1", + "near-gas", + "near-jsonrpc-client", + "near-jsonrpc-primitives", + "near-primitives", + "near-sandbox-utils", + "near-token", + "rand 0.8.5", + "reqwest", + "serde", + "serde_json", + "sha2 0.10.8", + "tempfile", + "thiserror", + "tokio", + "tokio-retry", + "tracing", + "url", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nom-supreme" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aadc66631948f6b65da03be4c4cd8bd104d481697ecbb9bbd65719b1ec60bc9f" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.4", + "num-complex", + "num-integer", + "num-iter", + "num-rational 0.4.1", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d869c01cc0c455284163fd0092f1f93835385ccab5a98a0dcc497b2f8bf055a9" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.5.0", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "opentelemetry" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" +dependencies = [ + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "opentelemetry-otlp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1a6ca9de4c8b00aa7f1a153bd76cb263287155cec642680d79d98706f3d28a" +dependencies = [ + "async-trait", + "futures", + "futures-util", + "http", + "opentelemetry", + "prost", + "thiserror", + "tokio", + "tonic", + "tonic-build", +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985cc35d832d412224b2cffe2f9194b1b89b6aa5d0bef76d080dce09d90e62bd" +dependencies = [ + "opentelemetry", +] + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parity-scale-codec" +version = "3.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" +dependencies = [ + "arrayvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" +dependencies = [ + "proc-macro-crate 2.0.0", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash", + "sha2 0.10.8", +] + +[[package]] +name = "pdb" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f4d162ecaaa1467de5afbe62d597757b674b51da8bb4e587430c5fdb2af7aa" +dependencies = [ + "fallible-iterator", + "scroll 0.10.2", + "uuid", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.2.5", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +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 = "prefix-sum-vec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa06bd51638b6e76ac9ba9b6afb4164fa647bd2916d722f2623fbb6d1ed8bdba" + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash 0.7.0", + "uint", +] + +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.1", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prometheus" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +dependencies = [ + "cfg-if 1.0.0", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +dependencies = [ + "bytes", + "heck 0.3.3", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +dependencies = [ + "bytes", + "prost", +] + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom 0.2.12", + "libredox", + "thiserror", +] + +[[package]] +name = "reed-solomon-erasure" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a415a013dd7c5d4221382329a5a3482566da675737494935cbbbcdec04662f9d" +dependencies = [ + "smallvec", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-tls", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "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 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[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.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.5.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pki-types" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" + +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "scale-info" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef2175c2907e7c8bc0a9c3f86aeb5ec1f3b275300ad58a44d0c3ae379a5e52e" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b8eb8fd61c5cdd3390d9b2132300a7e7618955b98b8416f118c1b4e144f" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "schemars" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scroll" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +dependencies = [ + "base64 0.21.7", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.5", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "serde_yaml" +version = "0.9.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0623d197252096520c6f2a5e1171ee436e5af99a5d7caa2891e55e61950e6d9" +dependencies = [ + "indexmap 2.2.5", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "smart-default" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.53", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "symbolic-common" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f551f902d5642e58039aee6a9021a61037926af96e071816361644983966f540" +dependencies = [ + "debugid", + "memmap2", + "stable_deref_trait", + "uuid", +] + +[[package]] +name = "symbolic-debuginfo" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165dabf9fc1d6bb6819c2c0e27c8dd0e3068d2c53cf186d319788e96517f0d6" +dependencies = [ + "bitvec", + "dmsort", + "elementtree", + "fallible-iterator", + "flate2", + "gimli 0.26.2", + "goblin", + "lazy_static", + "lazycell", + "nom", + "nom-supreme", + "parking_lot", + "pdb", + "regex", + "scroll 0.11.0", + "serde", + "serde_json", + "smallvec", + "symbolic-common", + "thiserror", + "wasmparser", + "zip 0.5.13", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "thiserror" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[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-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.5", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap 2.2.5", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.2.5", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64 0.13.1", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "prost-derive", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +dependencies = [ + "proc-macro2", + "prost-build", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util 0.7.10", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-subscriber", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", +] + +[[package]] +name = "treediff" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d127780145176e2b5d16611cc25a900150e86e9fd79d3bde6ff3a37359c9cb5" +dependencies = [ + "serde_json", +] + +[[package]] +name = "triehash" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" +dependencies = [ + "hash-db", + "rlp", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f214ce18d8b2cbe84ed3aa6486ed3f5b285cf8d8fbdbce9f3f767a724adc35" +dependencies = [ + "base64 0.21.7", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "rustls-webpki", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.53", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasmparser" +version = "0.83.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xattr" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +dependencies = [ + "libc", + "linux-raw-sys", + "rustix", +] + +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "crc32fast", + "flate2", + "thiserror", +] + +[[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 0.12.1", + "pbkdf2", + "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", +] + +[[package]] +name = "zstd-sys" +version = "2.0.9+zstd.1.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/runtime/near-wallet-contract/implementation/Cargo.toml b/runtime/near-wallet-contract/implementation/Cargo.toml new file mode 100644 index 00000000000..70ef37a20d6 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/Cargo.toml @@ -0,0 +1,37 @@ +[workspace.package] +authors = ["Aurora Labs "] +version = "0.1.0" +edition = "2021" +homepage = "https://github.com/aurora-is-near/eth-wallet-contract" +repository = "https://github.com/aurora-is-near/eth-wallet-contract" +license = "CC0-1.0" + + +[workspace.dependencies] +aurora-engine-transactions = { git = "https://github.com/aurora-is-near/aurora-engine.git", rev = "c03a2d8610cd27a9decb91b3bddb107db2177b29", default-features = false, features = ["contract"]} +base64 = "0.21" +ethabi = { version = "18", default-features = false } +hex = "0.4" +near-sdk = { version = "5.0" } +once_cell = "1.18" +serde = { version = "1", features = ["derive"] } + +# dev-dependencies +anyhow = "1" +aurora-engine-types = { git = "https://github.com/aurora-is-near/aurora-engine.git", rev = "c03a2d8610cd27a9decb91b3bddb107db2177b29", default-features = false } +near-crypto = "0.21" +near-workspaces = "0.10" +rlp = { version = "0.5", default-features = false } +serde_json = "1" +sha3 = "0.10" +tokio = { version = "1", features = ["full"] } + +[workspace] +resolver = "2" +members = [ + "address-registrar", + "wallet-contract", +] + +[profile.release] +panic = 'abort' diff --git a/runtime/near-wallet-contract/implementation/address-registrar/Cargo.toml b/runtime/near-wallet-contract/implementation/address-registrar/Cargo.toml new file mode 100644 index 00000000000..bdc768e8431 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/address-registrar/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "eth-address-registrar" +version.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +hex.workspace = true +near-sdk.workspace = true +serde.workspace = true diff --git a/runtime/near-wallet-contract/implementation/address-registrar/src/lib.rs b/runtime/near-wallet-contract/implementation/address-registrar/src/lib.rs new file mode 100644 index 00000000000..c37e6ab8e96 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/address-registrar/src/lib.rs @@ -0,0 +1,90 @@ +use near_sdk::{ + borsh::{BorshDeserialize, BorshSerialize}, + env, near_bindgen, + store::{lookup_map::Entry, LookupMap}, + AccountId, BorshStorageKey, PanicOnDefault, +}; + +type Address = [u8; 20]; + +#[derive(BorshSerialize, BorshStorageKey)] +#[borsh(crate = "near_sdk::borsh")] +enum StorageKey { + Addresses, +} + +#[near_bindgen] +#[derive(PanicOnDefault, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "near_sdk::borsh")] +pub struct AddressRegistrar { + pub addresses: LookupMap, +} + +#[near_bindgen] +impl AddressRegistrar { + #[init] + pub fn new() -> Self { + Self { addresses: LookupMap::new(StorageKey::Addresses) } + } + + /// Computes the address associated with the given `account_id` and + /// attempts to store the mapping `address -> account_id`. If there is + /// a collision where the given `account_id` has the same address as a + /// previously registered one then the mapping is NOT updated and `None` + /// is returned. Otherwise, the mapping is stored and the address is + /// returned as a hex-encoded string with `0x` prefix. + pub fn register(&mut self, account_id: AccountId) -> Option { + let address = account_id_to_address(&account_id); + + match self.addresses.entry(address) { + Entry::Vacant(entry) => { + let address = format!("0x{}", hex::encode(address)); + let log_message = format!("Added entry {} -> {}", address, account_id); + entry.insert(account_id); + env::log_str(&log_message); + Some(address) + } + Entry::Occupied(entry) => { + let log_message = format!( + "Address collision between {} and {}. Keeping the former.", + entry.get(), + account_id + ); + env::log_str(&log_message); + None + } + } + } + + /// Attempt to look up the account ID associated with the given address. + /// If an entry for that address is found then the associated account id + /// is returned, otherwise `None` is returned. Use the `register` method + /// to add entries to the map. + /// This function will panic if the given address is not the hex-encoding + /// of a 20-byte array. The `0x` prefix is optional. + pub fn lookup(&self, address: String) -> Option { + let address = { + let mut buf = [0u8; 20]; + hex::decode_to_slice(address.strip_prefix("0x").unwrap_or(&address), &mut buf) + .unwrap_or_else(|_| env::panic_str("Invalid hex encoding")); + buf + }; + self.addresses.get(&address).cloned() + } + + /// Computes the address associated with the given `account_id` and + /// returns it as a hex-encoded string with `0x` prefix. This function + /// does not update the mapping stored in this contract. If you want + /// to register an account ID use the `register` method. + pub fn get_address(&self, account_id: AccountId) -> String { + let address = account_id_to_address(&account_id); + format!("0x{}", hex::encode(address)) + } +} + +fn account_id_to_address(account_id: &AccountId) -> Address { + let hash = near_sdk::env::keccak256_array(account_id.as_bytes()); + let mut result = [0u8; 20]; + result.copy_from_slice(&hash[12..32]); + result +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/Cargo.toml b/runtime/near-wallet-contract/implementation/wallet-contract/Cargo.toml new file mode 100644 index 00000000000..fc8e36dbd84 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "eth-wallet-contract" +version.workspace = true +edition.workspace = true +homepage.workspace = true +repository.workspace = true +license.workspace = true + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +aurora-engine-transactions.workspace = true +base64.workspace = true +ethabi.workspace = true +hex.workspace = true +near-sdk.workspace = true +once_cell.workspace = true +serde.workspace = true +serde_json.workspace = true + +[dev-dependencies] +anyhow.workspace = true +aurora-engine-types.workspace = true +near-crypto.workspace = true +near-workspaces.workspace = true +rlp.workspace = true +sha3.workspace = true +tokio.workspace = true diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/ADDRESS_REGISTRAR_ACCOUNT_ID b/runtime/near-wallet-contract/implementation/wallet-contract/src/ADDRESS_REGISTRAR_ACCOUNT_ID new file mode 100644 index 00000000000..258cd5725da --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/ADDRESS_REGISTRAR_ACCOUNT_ID @@ -0,0 +1 @@ +todo diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/error.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/error.rs new file mode 100644 index 00000000000..17aa61f8325 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/error.rs @@ -0,0 +1,167 @@ +use std::fmt; + +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum Error { + AccountNonceExhausted, + AccountId(AccountIdError), + Relayer(RelayerError), + User(UserError), + Caller(CallerError), +} + +/// Errors that should never happen when the Eth Implicit accounts feature +/// is available on Near. These errors relate to parsing a 20-byte address +/// from a Near account ID. +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum AccountIdError { + AccountIdTooShort, + Missing0xPrefix, + InvalidHex, +} + +/// Errors which should never happen if the relayer is honest. +/// If these errors happen then we should ban the relayer (revoke their access key). +/// An external caller (as opposed to a relayer with a Function Call access key) may +/// also trigger these errors by passing bad arguments, but this is not an issue +/// (there is no ban list for external callers) because they are paying the gas fees +/// for their own mistakes. +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum RelayerError { + /// Relayers should always check the nonce before sending + InvalidNonce, + /// Relayers should always encode the transaction correctly + InvalidBase64, + /// Relayers should always send valid transactions + TxParsing(aurora_engine_transactions::Error), + /// Relayers should always send correctly signed transactions + InvalidSender, + /// Relayers should always give the correct target account + InvalidTarget, + /// Relayers should always check the transaction is signed with the correct chain id. + InvalidChainId, +} + +/// Errors that arise from problems in the data signed by the user +/// (i.e. in the Ethereum transaction itself). A careful power-user +/// should never see these errors because they can review the data +/// they are signing. If a user does see these errors then there is +/// likely a bug in the front-end code that is constructing the Ethereum +/// transaction to be signed. +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum UserError { + EvmDeployDisallowed, + ValueTooLarge, + UnknownPublicKeyKind, + InvalidEd25519Key, + InvalidSecp256k1Key, + InvalidAccessKeyAccountId, + UnsupportedAction(UnsupportedAction), + UnknownFunctionSelector, + InvalidAbiEncodedData, + ExcessYoctoNear, +} + +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum UnsupportedAction { + AddFullAccessKey, + CreateAccount, + Delegate, + DeleteAccount, + DeployContract, + Stake, +} + +/// Errors that arise from external accounts calling the Wallet Contract. +/// The `rlp_execute` function is intentionally public so that any account +/// can pay for the fees on behalf of a Wallet Contract key holder. +/// These errors are not a big deal from the perspective of the Wallet Contract +/// because the cost for executing such erroneous transactions are paid for +/// by that external caller. +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum CallerError { + InsufficientAttachedValue, +} + +impl From for Error { + fn from(value: aurora_engine_transactions::Error) -> Self { + Self::Relayer(RelayerError::TxParsing(value)) + } +} + +impl fmt::Display for AccountIdError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::AccountIdTooShort => f.write_str("Error: account ID too short"), + Self::Missing0xPrefix => f.write_str("Error: account ID missing 0x"), + Self::InvalidHex => f.write_str("Error: account ID is not valid hex encoding"), + } + } +} + +impl fmt::Display for RelayerError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::TxParsing(e) => std::write!(f, "Error parsing RLP {}", e.as_str()), + Self::InvalidSender => f.write_str("Error: signature is not from account owner"), + Self::InvalidBase64 => f.write_str("Error: invalid base64 encoding"), + Self::InvalidTarget => { + f.write_str("Error: target does not match to in signed transaction") + } + Self::InvalidNonce => f.write_str("Error: invalid nonce value"), + Self::InvalidChainId => f.write_str("Error: invalid chain id value"), + } + } +} + +impl fmt::Display for UserError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::EvmDeployDisallowed => { + f.write_str("Error: transactions deploying EVM contracts not allowed") + } + Self::ValueTooLarge => { + f.write_str("Error: transaction value must be representable by 128 bits") + } + Self::UnknownPublicKeyKind => f.write_str("Error: unknown public key kind"), + Self::InvalidEd25519Key => f.write_str("Error: invalid ED25519 public key"), + Self::InvalidSecp256k1Key => f.write_str("Error: invalid SECP256k1 public key"), + Self::InvalidAccessKeyAccountId => f.write_str( + "Error: attempt to add function call access key with invalid account id", + ), + Self::UnsupportedAction(a) => { + std::write!(f, "Error unsupported action {:?}", a) + } + Self::UnknownFunctionSelector => f.write_str("Error: unknown function selector"), + Self::InvalidAbiEncodedData => { + f.write_str("Error: invalid ABI encoding in transaction data") + } + Self::ExcessYoctoNear => f.write_str( + "Error: only at most 1_000_000 yoctoNear can be included directly in an action", + ), + } + } +} + +impl fmt::Display for CallerError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InsufficientAttachedValue => { + f.write_str("Error: external calls must attach Near to pay for their transactions") + } + } + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::AccountNonceExhausted => f.write_str("Error: no nonce values remain"), + Self::AccountId(e) => e.fmt(f), + Self::Relayer(e) => e.fmt(f), + Self::User(e) => e.fmt(f), + Self::Caller(e) => e.fmt(f), + } + } +} + +impl std::error::Error for Error {} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/eth_emulation.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/eth_emulation.rs new file mode 100644 index 00000000000..4174e92acc3 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/eth_emulation.rs @@ -0,0 +1,94 @@ +//! This module contains logic for emulating Ethereum standards with the +//! corresponding Near actions. For now only the ERC-20 standard is supported +//! (which corresponds to Near's NEP-141). + +use crate::{ + error::{Error, UserError}, + ethabi_utils, + types::{Action, ExecutionContext}, +}; +use aurora_engine_transactions::NormalizedEthTransaction; +use ethabi::{Address, ParamType}; +use near_sdk::AccountId; + +const FIVE_TERA_GAS: u64 = near_sdk::Gas::from_tgas(5).as_gas(); + +pub const ERC20_BALANCE_OF_SELECTOR: &[u8] = &[0x70, 0xa0, 0x82, 0x31]; +const ERC20_BALANCE_OF_SIGNATURE: [ParamType; 1] = [ParamType::Address]; + +pub const ERC20_TRANSFER_SELECTOR: &[u8] = &[0xa9, 0x05, 0x9c, 0xbb]; +const ERC20_TRANSFER_SIGNATURE: [ParamType; 2] = [ + ParamType::Address, // to + ParamType::Uint(256), // value +]; + +pub fn try_emulation( + target: &AccountId, + tx: &NormalizedEthTransaction, + context: &ExecutionContext, +) -> Result { + if tx.data.len() < 4 { + return Err(Error::User(UserError::InvalidAbiEncodedData)); + } + // In production eth-implicit accounts are top-level, so this suffix will + // always be empty. The purpose of finding a suffix is that it allows for + // testing environments where the wallet contract is deployed to an address + // that is a sub-account. For example, this allows testing on Near testnet + // before the eth-implicit accounts feature is stabilized. + // The suffix is only needed in testing. + let suffix = context + .current_account_id + .as_str() + .find('.') + .map(|index| &context.current_account_id.as_str()[index..]) + .unwrap_or(""); + match &tx.data[0..4] { + ERC20_BALANCE_OF_SELECTOR => { + let (address,): (Address,) = + ethabi_utils::abi_decode(&ERC20_BALANCE_OF_SIGNATURE, &tx.data[4..])?; + // The account ID is assumed to have the same suffix as the current account because + // (1) in production this is correct as all eth-implicit accounts are top-level and + // (2) in testing environments where the addresses are sub-accounts, they are still + // assumed to all be deployed to the same namespace so that they will all have the + // same suffix. + let args = format!(r#"{{"account_id": "0x{}{}"}}"#, hex::encode(address), suffix); + Ok(Action::FunctionCall { + receiver_id: target.to_string(), + method_name: "ft_balance_of".into(), + args: args.into_bytes(), + gas: FIVE_TERA_GAS, + yocto_near: 0, + }) + } + ERC20_TRANSFER_SELECTOR => { + // We intentionally map to `u128` instead of `U256` because the NEP-141 standard + // is to use u128. + let (to, value): (Address, u128) = + ethabi_utils::abi_decode(&ERC20_TRANSFER_SIGNATURE, &tx.data[4..])?; + let args = format!( + r#"{{"receiver_id": "0x{}{}", "amount": "{}", "memo": null}}"#, + hex::encode(to), + suffix, + value + ); + Ok(Action::FunctionCall { + receiver_id: target.to_string(), + method_name: "ft_transfer".into(), + args: args.into_bytes(), + gas: 2 * FIVE_TERA_GAS, + yocto_near: 1, + }) + } + _ => Err(Error::User(UserError::UnknownFunctionSelector)), + } +} + +#[test] +fn test_function_selectors() { + let balance_of_signature = ethabi::short_signature("balanceOf", &ERC20_BALANCE_OF_SIGNATURE); + + let transfer_signature = ethabi::short_signature("transfer", &ERC20_TRANSFER_SIGNATURE); + + assert_eq!(balance_of_signature, ERC20_BALANCE_OF_SELECTOR); // 0x70a08231 + assert_eq!(transfer_signature, ERC20_TRANSFER_SELECTOR); // 0xa9059cbb +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/ethabi_utils.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/ethabi_utils.rs new file mode 100644 index 00000000000..acda0f80a2e --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/ethabi_utils.rs @@ -0,0 +1,250 @@ +use crate::error::{Error, UserError}; +use ethabi::{ethereum_types::U256, Address, ParamType, Token}; + +const INVALID_ABI_DATA: Error = Error::User(UserError::InvalidAbiEncodedData); + +pub fn abi_decode(types: &[ParamType; N], data: &[u8]) -> Result +where + T: AbiTuple, +{ + let tokens = data_to_tokens(types, data)?; + T::try_from_token(tokens) +} + +pub trait AbiTuple: Sized { + fn try_from_token(tokens: [Token; N]) -> Result; +} + +impl AbiTuple<1> for (T,) +where + T: TryFromToken, +{ + fn try_from_token(tokens: [Token; 1]) -> Result { + let (t,) = tokens.into(); + T::try_from_token(t).map(|t| (t,)) + } +} + +impl AbiTuple<2> for (T1, T2) +where + T1: TryFromToken, + T2: TryFromToken, +{ + fn try_from_token(tokens: [Token; 2]) -> Result { + let (t1, t2) = tokens.into(); + Ok((T1::try_from_token(t1)?, T2::try_from_token(t2)?)) + } +} + +impl AbiTuple<3> for (T1, T2, T3) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, +{ + fn try_from_token(tokens: [Token; 3]) -> Result { + let (t1, t2, t3) = tokens.into(); + Ok((T1::try_from_token(t1)?, T2::try_from_token(t2)?, T3::try_from_token(t3)?)) + } +} + +impl AbiTuple<4> for (T1, T2, T3, T4) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, + T4: TryFromToken, +{ + fn try_from_token(tokens: [Token; 4]) -> Result { + let (t1, t2, t3, t4) = tokens.into(); + Ok(( + T1::try_from_token(t1)?, + T2::try_from_token(t2)?, + T3::try_from_token(t3)?, + T4::try_from_token(t4)?, + )) + } +} + +impl AbiTuple<5> for (T1, T2, T3, T4, T5) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, + T4: TryFromToken, + T5: TryFromToken, +{ + fn try_from_token(tokens: [Token; 5]) -> Result { + let (t1, t2, t3, t4, t5) = tokens.into(); + Ok(( + T1::try_from_token(t1)?, + T2::try_from_token(t2)?, + T3::try_from_token(t3)?, + T4::try_from_token(t4)?, + T5::try_from_token(t5)?, + )) + } +} + +impl AbiTuple<6> for (T1, T2, T3, T4, T5, T6) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, + T4: TryFromToken, + T5: TryFromToken, + T6: TryFromToken, +{ + fn try_from_token(tokens: [Token; 6]) -> Result { + let (t1, t2, t3, t4, t5, t6) = tokens.into(); + Ok(( + T1::try_from_token(t1)?, + T2::try_from_token(t2)?, + T3::try_from_token(t3)?, + T4::try_from_token(t4)?, + T5::try_from_token(t5)?, + T6::try_from_token(t6)?, + )) + } +} + +impl AbiTuple<7> for (T1, T2, T3, T4, T5, T6, T7) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, + T4: TryFromToken, + T5: TryFromToken, + T6: TryFromToken, + T7: TryFromToken, +{ + fn try_from_token(tokens: [Token; 7]) -> Result { + let (t1, t2, t3, t4, t5, t6, t7) = tokens.into(); + Ok(( + T1::try_from_token(t1)?, + T2::try_from_token(t2)?, + T3::try_from_token(t3)?, + T4::try_from_token(t4)?, + T5::try_from_token(t5)?, + T6::try_from_token(t6)?, + T7::try_from_token(t7)?, + )) + } +} + +impl AbiTuple<8> for (T1, T2, T3, T4, T5, T6, T7, T8) +where + T1: TryFromToken, + T2: TryFromToken, + T3: TryFromToken, + T4: TryFromToken, + T5: TryFromToken, + T6: TryFromToken, + T7: TryFromToken, + T8: TryFromToken, +{ + fn try_from_token(tokens: [Token; 8]) -> Result { + let (t1, t2, t3, t4, t5, t6, t7, t8) = tokens.into(); + Ok(( + T1::try_from_token(t1)?, + T2::try_from_token(t2)?, + T3::try_from_token(t3)?, + T4::try_from_token(t4)?, + T5::try_from_token(t5)?, + T6::try_from_token(t6)?, + T7::try_from_token(t7)?, + T8::try_from_token(t8)?, + )) + } +} + +trait TryFromToken: Sized { + fn try_from_token(t: Token) -> Result; +} + +impl TryFromToken for u8 { + fn try_from_token(t: Token) -> Result { + const U8_MAX: U256 = U256([u8::MAX as u64, 0, 0, 0]); + let x = t.into_uint().ok_or(INVALID_ABI_DATA)?; + if x <= U8_MAX { + Ok(x.low_u32() as u8) + } else { + Err(INVALID_ABI_DATA) + } + } +} + +impl TryFromToken for u32 { + fn try_from_token(t: Token) -> Result { + const U32_MAX: U256 = U256([u32::MAX as u64, 0, 0, 0]); + let x = t.into_uint().ok_or(INVALID_ABI_DATA)?; + if x <= U32_MAX { + Ok(x.low_u32()) + } else { + Err(INVALID_ABI_DATA) + } + } +} + +impl TryFromToken for u64 { + fn try_from_token(t: Token) -> Result { + const U64_MAX: U256 = U256([u64::MAX, 0, 0, 0]); + let x = t.into_uint().ok_or(INVALID_ABI_DATA)?; + if x <= U64_MAX { + Ok(x.low_u64()) + } else { + Err(INVALID_ABI_DATA) + } + } +} + +impl TryFromToken for u128 { + fn try_from_token(t: Token) -> Result { + const U128_MAX: U256 = U256([u64::MAX, u64::MAX, 0, 0]); + let x = t.into_uint().ok_or(INVALID_ABI_DATA)?; + if x <= U128_MAX { + Ok(x.low_u128()) + } else { + Err(INVALID_ABI_DATA) + } + } +} + +impl TryFromToken for bool { + fn try_from_token(t: Token) -> Result { + t.into_bool().ok_or(INVALID_ABI_DATA) + } +} + +impl TryFromToken for String { + fn try_from_token(t: Token) -> Result { + t.into_string().ok_or(INVALID_ABI_DATA) + } +} + +impl TryFromToken for Address { + fn try_from_token(t: Token) -> Result { + t.into_address().ok_or(INVALID_ABI_DATA) + } +} + +impl TryFromToken for Vec { + fn try_from_token(t: Token) -> Result { + t.into_bytes().ok_or(INVALID_ABI_DATA) + } +} + +impl TryFromToken for Vec { + fn try_from_token(t: Token) -> Result { + let elems = t.into_array().ok_or(INVALID_ABI_DATA)?; + elems.into_iter().map(String::try_from_token).collect() + } +} + +fn data_to_tokens( + types: &[ParamType; N], + data: &[u8], +) -> Result<[ethabi::Token; N], Error> { + let result = ethabi::decode(types.as_slice(), data).map_err(|_| INVALID_ABI_DATA)?; + result.try_into().map_err(|_| INVALID_ABI_DATA) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/internal.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/internal.rs new file mode 100644 index 00000000000..ebcccc11047 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/internal.rs @@ -0,0 +1,269 @@ +use crate::{ + error::{AccountIdError, CallerError, Error, RelayerError, UserError}, + eth_emulation, ethabi_utils, near_action, + types::{ + Action, ExecutionContext, TransactionValidationOutcome, ADD_KEY_SELECTOR, + ADD_KEY_SIGNATURE, DELETE_KEY_SELECTOR, DELETE_KEY_SIGNATURE, FUNCTION_CALL_SELECTOR, + FUNCTION_CALL_SIGNATURE, TRANSFER_SELECTOR, TRANSFER_SIGNATURE, + }, +}; +use aurora_engine_transactions::{EthTransactionKind, NormalizedEthTransaction}; +use base64::Engine; +use ethabi::{ethereum_types::U256, Address}; +use near_sdk::{AccountId, NearToken}; + +// TODO(eth-implicit): Decide on chain id. +pub const CHAIN_ID: u64 = 0x4ea7; +const U64_MAX: U256 = U256([u64::MAX, 0, 0, 0]); +/// Only up to this amount of yoctoNear can be directly mentioned in an action, +/// the rest should be included in the `value` field of the Ethereum transaction. +pub const MAX_YOCTO_NEAR: u32 = 1_000_000; + +/// The largest accepted `value` field of a transaction. +/// Computed as `(2**128 - 1) // 1_000_000` since Near balances are +/// 128-bit numbers, but with 24 decimals instead of 18. So to covert +/// an Ethereum transaction value into a Near value we need to multiply +/// by `1_000_000` and then add back any lower digits that were truncated. +const VALUE_MAX: U256 = U256([10175519178963368024, 18446744073709, 0, 0]); + +/// Given an RLP-encoded Ethereum transaction (bytes encoded in base64), +/// a Near account the transaction is supposed to interact with, the current +/// account ID, and the current nonce, this function will attempt to transform +/// the Ethereum transaction into a Near action. +pub fn parse_rlp_tx_to_action( + tx_bytes_b64: &str, + target: &AccountId, + context: &ExecutionContext, + expected_nonce: &mut u64, +) -> Result<(near_action::Action, TransactionValidationOutcome), Error> { + let tx_bytes = decode_b64(tx_bytes_b64)?; + let tx_kind: EthTransactionKind = tx_bytes.as_slice().try_into()?; + let tx: NormalizedEthTransaction = tx_kind.try_into()?; + let validation_outcome = validate_tx_relayer_data(&tx, target, context, *expected_nonce)?; + + // If the transaction is valid then increment the nonce to prevent replay + *expected_nonce = expected_nonce.saturating_add(1); + + let to = tx.to.ok_or(Error::User(UserError::EvmDeployDisallowed))?.raw(); + let action = if to != context.current_address + && extract_address(target).map(|a| a == to).unwrap_or(false) + { + // If target is another Ethereum implicit account then the action + // must be a transfer (because EOAs are not contracts on Ethereum). + Action::Transfer { receiver_id: target.to_string(), yocto_near: 0 } + } else { + parse_tx_data(target, &tx, context)? + }; + validate_tx_value(&tx, context, &action)?; + + // Call to `low_u128` here is safe because of the validation done in `validate_tx_value` + let near_action = action + .try_into_near_action(tx.value.raw().low_u128().saturating_mul(MAX_YOCTO_NEAR.into()))?; + + Ok((near_action, validation_outcome)) +} + +/// Extracts a 20-byte address from a Near account ID. +/// This is done by assuming the account ID is of the form `^0x[0-9a-f]{40}`, +/// i.e. it starts with `0x` and then hex-encoded 20 bytes. +pub fn extract_address(current_account_id: &AccountId) -> Result { + let hex_str = current_account_id.as_bytes(); + + // The length must be at least 42 characters because it begins with + // `0x` and then a 20-byte hex-encoded string. In production it will + // be exactly 42 characters because eth-implicit accounts will always + // be top-level, but for testing we may have them be sub-accounts. + // In this case then the length will be longer than 42 characters. + if hex_str.len() < 42 { + return Err(Error::AccountId(AccountIdError::AccountIdTooShort)); + } + + if &hex_str[0..2] != b"0x" { + return Err(Error::AccountId(AccountIdError::Missing0xPrefix)); + } + + let mut bytes = [0u8; 20]; + hex::decode_to_slice(&hex_str[2..42], &mut bytes) + .map_err(|_| Error::AccountId(AccountIdError::InvalidHex))?; + + Ok(bytes.into()) +} + +/// Decode a base-64 encoded string into raw bytes. +fn decode_b64(input: &str) -> Result, Error> { + let engine = base64::engine::general_purpose::STANDARD; + engine.decode(input).map_err(|_| Error::Relayer(RelayerError::InvalidBase64)) +} + +/// Coverts any Near account ID into a 20-byte address by taking the last 20 bytes +/// of the keccak256 hash. +pub fn account_id_to_address(account_id: &AccountId) -> Address { + let hash = keccak256(account_id.as_bytes()); + let mut result = [0u8; 20]; + result.copy_from_slice(&hash[12..32]); + result.into() +} + +pub fn keccak256(bytes: &[u8]) -> [u8; 32] { + #[cfg(test)] + { + use sha3::{Digest, Keccak256}; + let hash = Keccak256::digest(bytes); + hash.into() + } + + #[cfg(not(test))] + near_sdk::env::keccak256_array(bytes) +} + +fn parse_tx_data( + target: &AccountId, + tx: &NormalizedEthTransaction, + context: &ExecutionContext, +) -> Result { + if tx.data.len() < 4 { + return Err(Error::User(UserError::InvalidAbiEncodedData)); + } + match &tx.data[0..4] { + FUNCTION_CALL_SELECTOR => { + let (receiver_id, method_name, args, gas, yocto_near): (String, _, _, _, _) = + ethabi_utils::abi_decode(&FUNCTION_CALL_SIGNATURE, &tx.data[4..])?; + if target.as_str() != receiver_id.as_str() { + return Err(Error::Relayer(RelayerError::InvalidTarget)); + } + if yocto_near > MAX_YOCTO_NEAR { + return Err(Error::User(UserError::ExcessYoctoNear)); + } + Ok(Action::FunctionCall { receiver_id, method_name, args, gas, yocto_near }) + } + TRANSFER_SELECTOR => { + let (receiver_id, yocto_near): (String, u32) = + ethabi_utils::abi_decode(&TRANSFER_SIGNATURE, &tx.data[4..])?; + if target.as_str() != receiver_id.as_str() { + return Err(Error::Relayer(RelayerError::InvalidTarget)); + } + if yocto_near > MAX_YOCTO_NEAR { + return Err(Error::User(UserError::ExcessYoctoNear)); + } + Ok(Action::Transfer { receiver_id, yocto_near }) + } + ADD_KEY_SELECTOR => { + let ( + public_key_kind, + public_key, + nonce, + is_full_access, + is_limited_allowance, + allowance, + receiver_id, + method_names, + ) = ethabi_utils::abi_decode(&ADD_KEY_SIGNATURE, &tx.data[4..])?; + Ok(Action::AddKey { + public_key_kind, + public_key, + nonce, + is_full_access, + is_limited_allowance, + allowance, + receiver_id, + method_names, + }) + } + DELETE_KEY_SELECTOR => { + let (public_key_kind, public_key) = + ethabi_utils::abi_decode(&DELETE_KEY_SIGNATURE, &tx.data[4..])?; + Ok(Action::DeleteKey { public_key_kind, public_key }) + } + _ => eth_emulation::try_emulation(target, tx, context), + } +} + +/// Validates the transaction is following the Wallet Contract protocol. +/// This includes checks for: +/// - from address matches current account address +/// - to address is present and matches the target address (or hash of target account ID) +/// - nonce matches expected nonce +/// If this validation fails then the relayer that sent it is faulty and should be banned. +fn validate_tx_relayer_data( + tx: &NormalizedEthTransaction, + target: &AccountId, + context: &ExecutionContext, + expected_nonce: u64, +) -> Result { + if tx.address.raw() != context.current_address { + return Err(Error::Relayer(RelayerError::InvalidSender)); + } + + if tx.chain_id != Some(CHAIN_ID) { + return Err(Error::Relayer(RelayerError::InvalidChainId)); + } + + let to = tx.to.ok_or(Error::User(UserError::EvmDeployDisallowed))?.raw(); + let target_as_address = extract_address(target).ok(); + let to_equals_target = target_as_address.map(|target| to == target).unwrap_or(false); + + // Only valid targets satisfy `to == target` or `to == hash(target)` + if !to_equals_target && to != account_id_to_address(target) { + return Err(Error::Relayer(RelayerError::InvalidTarget)); + } + + let nonce = if tx.nonce <= U64_MAX { + tx.nonce.low_u64() + } else { + return Err(Error::Relayer(RelayerError::InvalidNonce)); + }; + if nonce != expected_nonce { + return Err(Error::Relayer(RelayerError::InvalidNonce)); + } + + // If `to == target` and this is not a self-transaction then the address must not + // be registered in the address registry. The purpose of this check is to prevent + // lazy relayers from skipping this check themselves (relayers are supposed to use + // the address registry to fill in the `target`). + if to_equals_target && to != context.current_address { + Ok(TransactionValidationOutcome::AddressCheckRequired(to)) + } else { + Ok(TransactionValidationOutcome::Validated) + } +} + +fn validate_tx_value( + tx: &NormalizedEthTransaction, + context: &ExecutionContext, + action: &Action, +) -> Result<(), Error> { + if tx.value.raw() > VALUE_MAX { + return Err(Error::User(UserError::ValueTooLarge)); + } + + let total_value = tx + .value + .raw() + .low_u128() + .saturating_mul(MAX_YOCTO_NEAR.into()) + .saturating_add(action.value().as_yoctonear()); + + if total_value > 0 { + let is_self_call = context.predecessor_account_id == context.current_account_id; + let sufficient_attached_deposit = + context.attached_deposit >= NearToken::from_yoctonear(total_value); + if !is_self_call && !sufficient_attached_deposit { + return Err(Error::Caller(CallerError::InsufficientAttachedValue)); + } + } + + Ok(()) +} + +#[test] +fn test_value_max() { + assert_eq!(VALUE_MAX, U256::from(u128::MAX / 1_000_000)); +} + +#[test] +fn test_account_id_to_address() { + let account_id: AccountId = "aurora".parse().unwrap(); + let address = + Address::from_slice(&hex::decode("4444588443c3a91288c5002483449aba1054192b").unwrap()); + assert_eq!(account_id_to_address(&account_id), address); +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/lib.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/lib.rs new file mode 100644 index 00000000000..5e81dde5cad --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/lib.rs @@ -0,0 +1,244 @@ +use crate::{ + error::Error, + types::{ExecuteResponse, ExecutionContext}, +}; +use error::{UnsupportedAction, UserError}; +use near_sdk::{ + borsh::{BorshDeserialize, BorshSerialize}, + env, + json_types::U64, + near_bindgen, AccountId, Allowance, Gas, GasWeight, NearToken, Promise, PromiseOrValue, + PromiseResult, +}; +use types::TransactionValidationOutcome; + +pub mod error; +pub mod eth_emulation; +pub mod ethabi_utils; +pub mod internal; +pub mod near_action; +pub mod types; + +#[cfg(test)] +mod tests; + +const ADDRESS_REGISTRAR_ACCOUNT_ID: &str = std::include_str!("ADDRESS_REGISTRAR_ACCOUNT_ID"); + +#[near_bindgen] +#[derive(Default, BorshDeserialize, BorshSerialize)] +#[borsh(crate = "near_sdk::borsh")] +pub struct WalletContract { + pub nonce: u64, +} + +#[near_bindgen] +impl WalletContract { + /// Return the nonce value currently stored in the contract. + /// Following the Ethereum protocol, only transactions with nonce equal + /// to the current value will be accepted. + /// Additionally, the Ethereum protocol requires the nonce of an account increment + /// by 1 each time a transaction with the correct nonce and a valid signature + /// is submitted (even if that transaction eventually fails). In this way, each + /// nonce value can only be used once (hence the name "nonce") and thus transaction + /// replay is prevented. + pub fn get_nonce(&self) -> U64 { + U64(self.nonce) + } + + /// This is the main entry point into this contract. It accepts an RLP-encoded + /// Ethereum transaction signed by the private key associated with the address + /// for the account where this contract is deployed. RLP is a binary format, + /// so the argument is actually passed as a base64-encoded string. + /// The Ethereum transaction represents a Near action the owner of the address + /// wants to perform. This method decodes that action from the Ethereum transaction + /// and crates a promise to perform that action. + /// Actions on Near are sent to a particular account ID where they are supposed to + /// be executed (for example, a `FunctionCall` action is sent to the contract + /// which will execute the method). In the Ethereum transaction only the address + /// of the target can be specified because it does not have a notion of named accounts + /// like Near has. The `target` field of this method gives the actual account ID + /// that the action will be sent to. The `target` must itself be an eth-implicit + /// account and match the `to` address of the Ethereum transaction; or `target` + /// must hash to the address given in the `to` field of the Ethereum transaction. + /// The output of this function is an `ExecuteResponse` which gives the output + /// of the Near action or an error message if there was a problem during the execution. + #[payable] + pub fn rlp_execute( + &mut self, + target: AccountId, + tx_bytes_b64: String, + ) -> PromiseOrValue { + let current_account_id = env::current_account_id(); + let predecessor_account_id = env::predecessor_account_id(); + let result = inner_rlp_execute( + current_account_id.clone(), + predecessor_account_id, + target, + tx_bytes_b64, + &mut self.nonce, + ); + + match result { + Ok(promise) => PromiseOrValue::Promise(promise), + Err(Error::Relayer(_)) if env::signer_account_id() == current_account_id => { + let promise = create_ban_relayer_promise(current_account_id); + PromiseOrValue::Promise(promise) + } + Err(e) => PromiseOrValue::Value(e.into()), + } + } + + /// Callback after checking if an address is contained in the registrar. + /// This check happens when the target is another eth implicit account to + /// confirm that the relayer really did check for a named account with that address. + #[private] + pub fn address_check_callback( + &mut self, + target: AccountId, + action: near_action::Action, + ) -> PromiseOrValue { + let maybe_account_id: Option = match env::promise_result(0) { + PromiseResult::Failed => { + return PromiseOrValue::Value(ExecuteResponse { + success: false, + success_value: None, + error: Some("Call to Address Registrar contract failed".into()), + }); + } + PromiseResult::Successful(value) => serde_json::from_slice(&value) + .unwrap_or_else(|_| env::panic_str("Unexpected response from account registrar")), + }; + let current_account_id = env::current_account_id(); + let promise = if maybe_account_id.is_some() { + if env::signer_account_id() == current_account_id { + create_ban_relayer_promise(current_account_id) + } else { + return PromiseOrValue::Value(ExecuteResponse { + success: false, + success_value: None, + error: Some("Invalid target: target is address corresponding to existing named account_id".into()), + }); + } + } else { + let ext = WalletContract::ext(current_account_id).with_unused_gas_weight(1); + match action_to_promise(target, action).map(|p| p.then(ext.rlp_execute_callback())) { + Ok(p) => p, + Err(e) => { + return PromiseOrValue::Value(e.into()); + } + } + }; + PromiseOrValue::Promise(promise) + } + + #[private] + pub fn rlp_execute_callback(&mut self) -> ExecuteResponse { + let n = env::promise_results_count(); + let mut success_value = None; + for i in 0..n { + match env::promise_result(i) { + PromiseResult::Failed => { + return ExecuteResponse { + success: false, + success_value: None, + error: Some("Failed Near promise".into()), + }; + } + PromiseResult::Successful(value) => success_value = Some(value), + } + } + ExecuteResponse { success: true, success_value, error: None } + } + + #[private] + pub fn ban_relayer(&mut self) -> ExecuteResponse { + ExecuteResponse { + success: false, + success_value: None, + error: Some("Error: faulty relayer".into()), + } + } +} + +fn inner_rlp_execute( + current_account_id: AccountId, + predecessor_account_id: AccountId, + target: AccountId, + tx_bytes_b64: String, + nonce: &mut u64, +) -> Result { + if *nonce == u64::MAX { + return Err(Error::AccountNonceExhausted); + } + let context = ExecutionContext::new( + current_account_id.clone(), + predecessor_account_id, + env::attached_deposit(), + )?; + + let (action, validation_outcome) = + internal::parse_rlp_tx_to_action(&tx_bytes_b64, &target, &context, nonce)?; + let promise = match validation_outcome { + TransactionValidationOutcome::Validated => { + let ext = WalletContract::ext(current_account_id).with_unused_gas_weight(1); + action_to_promise(target, action)?.then(ext.rlp_execute_callback()) + } + TransactionValidationOutcome::AddressCheckRequired(address) => { + let ext = WalletContract::ext(current_account_id).with_unused_gas_weight(1); + let address_registrar = { + let account_id = ADDRESS_REGISTRAR_ACCOUNT_ID + .trim() + .parse() + .unwrap_or_else(|_| env::panic_str("Invalid address registrar")); + ext_registrar::ext(account_id).with_static_gas(Gas::from_tgas(5)) + }; + let address = format!("0x{}", hex::encode(address)); + address_registrar.lookup(address).then(ext.address_check_callback(target, action)) + } + }; + Ok(promise) +} + +fn action_to_promise(target: AccountId, action: near_action::Action) -> Result { + match action { + near_action::Action::FunctionCall(action) => Ok(Promise::new(target).function_call( + action.method_name, + action.args, + action.deposit, + action.gas, + )), + near_action::Action::Transfer(action) => Ok(Promise::new(target).transfer(action.deposit)), + near_action::Action::AddKey(action) => match action.access_key.permission { + near_action::AccessKeyPermission::FullAccess => { + Err(Error::User(UserError::UnsupportedAction(UnsupportedAction::AddFullAccessKey))) + } + near_action::AccessKeyPermission::FunctionCall(access) => Ok(Promise::new(target) + .add_access_key_allowance_with_nonce( + action.public_key, + access.allowance.and_then(Allowance::limited).unwrap_or(Allowance::Unlimited), + access.receiver_id, + access.method_names.join(","), + action.access_key.nonce, + )), + }, + near_action::Action::DeleteKey(action) => { + Ok(Promise::new(target).delete_key(action.public_key)) + } + } +} + +fn create_ban_relayer_promise(current_account_id: AccountId) -> Promise { + let pk = env::signer_account_pk(); + Promise::new(current_account_id).delete_key(pk).function_call_weight( + "ban_relayer".into(), + Vec::new(), + NearToken::from_yoctonear(0), + Gas::from_tgas(1), + GasWeight(1), + ) +} + +#[near_sdk::ext_contract(ext_registrar)] +trait AddressRegistrar { + fn lookup(&self, address: String) -> Option; +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/near_action.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/near_action.rs new file mode 100644 index 00000000000..4b7f9491270 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/near_action.rs @@ -0,0 +1,61 @@ +//! Partial definition of `Action` for Near protocol. +//! Unfortunately we cannot use `near-primitives` directly in the contract +//! because it uses dependencies that do not compile to Wasm (at least +//! not without some extra feature flags that `near-primitives` currently +//! does not include). +//! Some variants of `near_primitives::Action` are intentionally left out +//! because they are not possible to do with the wallet contract +//! (e.g. `DeleteAccount`). + +use near_sdk::{AccountId, Gas, NearToken, PublicKey}; + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub enum Action { + FunctionCall(FunctionCallAction), + Transfer(TransferAction), + AddKey(AddKeyAction), + DeleteKey(DeleteKeyAction), +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct FunctionCallAction { + pub method_name: String, + pub args: Vec, + pub gas: Gas, + pub deposit: NearToken, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct TransferAction { + pub deposit: NearToken, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct AddKeyAction { + pub public_key: PublicKey, + pub access_key: AccessKey, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct AccessKey { + pub nonce: u64, + pub permission: AccessKeyPermission, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub enum AccessKeyPermission { + FullAccess, + FunctionCall(FunctionCallPermission), +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct FunctionCallPermission { + pub allowance: Option, + pub receiver_id: AccountId, + pub method_names: Vec, +} + +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct DeleteKeyAction { + pub public_key: PublicKey, +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/caller_error.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/caller_error.rs new file mode 100644 index 00000000000..333ff1db6d2 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/caller_error.rs @@ -0,0 +1,105 @@ +//! A suite of tests for code paths handling error cases where the `rlp_execute` function +//! is called by an external account (as opposed to the Wallet Contract calling itself). +//! Since `rlp_execute` is public, it must be impossible for an external account to +//! cause harm to the Wallet Contract by calling this function. + +use crate::{ + error::{CallerError, Error}, + internal::MAX_YOCTO_NEAR, + tests::{ + utils::{self, codec, test_context::TestContext}, + RLP_EXECUTE, + }, + types::{Action, ExecuteResponse}, +}; +use aurora_engine_types::types::Wei; +use near_workspaces::types::NearToken; + +// If an external account is submitting a valid Ethereum transaction signed by +// the user then it is expected that this external account should cover the entire +// cost of that transaction (including any attached $NEAR). +#[tokio::test] +async fn test_insufficient_value() -> anyhow::Result<()> { + let TestContext { worker, wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let external_account = worker.dev_create_account().await?; + + // Create a transaction (NEP-141 transfer) that requires 1 yoctoNear attached. + let account_id = "aurora"; + let action = Action::FunctionCall { + receiver_id: account_id.into(), + method_name: "ft_transfer".into(), + args: r#"{"receiver_id": "some.account", "amount": "1"}"#.into(), + gas: 5, + yocto_near: 1, + }; + let signed_transaction = utils::create_signed_transaction( + 0, + &account_id.parse().unwrap(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = wallet_contract + .external_rlp_execute(&external_account, account_id, &signed_transaction) + .await?; + + assert!(!result.success); + assert_eq!( + result.error, + Some(Error::Caller(CallerError::InsufficientAttachedValue).to_string()) + ); + + // Try again with a transaction that has some attached Wei + let transfer_amount = NearToken::from_near(1).as_yoctonear(); + let action = Action::Transfer { receiver_id: account_id.into(), yocto_near: 0 }; + let signed_transaction = utils::create_signed_transaction( + 1, + &account_id.parse().unwrap(), + Wei::new_u128(transfer_amount / (MAX_YOCTO_NEAR as u128)), + action, + &wallet_sk, + ); + let result = wallet_contract + .external_rlp_execute(&external_account, account_id, &signed_transaction) + .await?; + + assert!(!result.success); + assert_eq!( + result.error, + Some(Error::Caller(CallerError::InsufficientAttachedValue).to_string()) + ); + + // It works if we attach the right amount of Near and does not + // spend any tokens from the Wallet Contract. + let initial_wallet_balance = wallet_contract.inner.as_account().view_account().await?.balance; + let action = Action::Transfer { receiver_id: external_account.id().to_string(), yocto_near: 0 }; + let signed_transaction = utils::create_signed_transaction( + 2, + external_account.id(), + Wei::new_u128(transfer_amount / (MAX_YOCTO_NEAR as u128)), + action, + &wallet_sk, + ); + let result: ExecuteResponse = external_account + .call(wallet_contract.inner.id(), RLP_EXECUTE) + .args_json(serde_json::json!({ + "target": external_account.id(), + "tx_bytes_b64": codec::encode_b64(&codec::rlp_encode(&signed_transaction)) + })) + .max_gas() + .deposit(NearToken::from_yoctonear(transfer_amount)) + .transact() + .await? + .into_result()? + .json()?; + + assert!(result.success); + + let final_wallet_balance = wallet_contract.inner.as_account().view_account().await?.balance; + + assert!(final_wallet_balance >= initial_wallet_balance); + + Ok(()) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/emulation.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/emulation.rs new file mode 100644 index 00000000000..4837564b252 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/emulation.rs @@ -0,0 +1,145 @@ +use crate::{ + internal::{account_id_to_address, CHAIN_ID, MAX_YOCTO_NEAR}, + tests::utils::{crypto, nep141, test_context::TestContext}, +}; +use aurora_engine_types::types::{Address, Wei}; +use near_sdk::json_types::U128; +use near_workspaces::types::NearToken; + +// The Wallet Contract should understand that transactions to other Wallet +// Contract instances are base token transactions. +#[tokio::test] +async fn test_base_token_transfer() -> anyhow::Result<()> { + const TRANSFER_AMOUNT: NearToken = NearToken::from_near(2); + + let TestContext { worker, wallet_contract, wallet_sk, wallet_contract_bytes, .. } = + TestContext::new().await?; + + let (other_wallet, other_address) = + TestContext::deploy_wallet(&worker, &wallet_contract_bytes).await?; + + let initial_wallet_balance = wallet_contract.inner.as_account().view_account().await?.balance; + let initial_other_balance = other_wallet.inner.as_account().view_account().await?.balance; + + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::new(other_address)), + value: Wei::new_u128(TRANSFER_AMOUNT.as_yoctonear() / u128::from(MAX_YOCTO_NEAR)), + data: b"A message for the recipient".to_vec(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = + wallet_contract.rlp_execute(other_wallet.inner.id().as_str(), &signed_transaction).await?; + + assert!(result.success); + + let final_wallet_balance = wallet_contract.inner.as_account().view_account().await?.balance; + let final_other_balance = other_wallet.inner.as_account().view_account().await?.balance; + + // Receiver balance increases + assert_eq!( + final_other_balance.as_yoctonear(), + initial_other_balance.as_yoctonear() + TRANSFER_AMOUNT.as_yoctonear() + ); + // Sender balance decreases (by a little more than the + // `TRANSFER_AMOUNT` due to gas spent to execute the transaction) + let diff = NearToken::from_yoctonear( + initial_wallet_balance.as_yoctonear() + - (final_wallet_balance.as_yoctonear() + TRANSFER_AMOUNT.as_yoctonear()), + ); + assert!(diff < NearToken::from_millinear(2)); + + Ok(()) +} + +// The Wallet Contract should understand the ERC-20 standard and map +// it to NEP-141 function calls. +#[tokio::test] +async fn test_erc20_emulation() -> anyhow::Result<()> { + const MINT_AMOUNT: NearToken = NearToken::from_near(100); + const TRANSFER_AMOUNT: NearToken = NearToken::from_near(32); + + let TestContext { + worker, + wallet_contract, + wallet_sk, + wallet_address, + wallet_contract_bytes, + .. + } = TestContext::new().await?; + + let token_contract = nep141::Nep141::deploy(&worker).await?; + token_contract.mint(wallet_contract.inner.id(), MINT_AMOUNT.as_yoctonear()).await?; + + // Check balance + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::new(account_id_to_address( + &token_contract.contract.id().as_str().parse().unwrap(), + ))), + value: Wei::zero(), + data: [ + crate::eth_emulation::ERC20_BALANCE_OF_SELECTOR.to_vec(), + ethabi::encode(&[ethabi::Token::Address(wallet_address)]), + ] + .concat(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract + .rlp_execute(token_contract.contract.id().as_str(), &signed_transaction) + .await?; + + let balance: U128 = serde_json::from_slice(result.success_value.as_ref().unwrap())?; + assert_eq!(balance.0, token_contract.ft_balance_of(wallet_contract.inner.id()).await?); + + // Do a transfer to another account + let (other_wallet, other_address) = + TestContext::deploy_wallet(&worker, &wallet_contract_bytes).await?; + token_contract.mint(other_wallet.inner.id(), MINT_AMOUNT.as_yoctonear()).await?; + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 1.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::new(account_id_to_address( + &token_contract.contract.id().as_str().parse().unwrap(), + ))), + value: Wei::zero(), + data: [ + crate::eth_emulation::ERC20_TRANSFER_SELECTOR.to_vec(), + ethabi::encode(&[ + ethabi::Token::Address(other_address), + ethabi::Token::Uint(TRANSFER_AMOUNT.as_yoctonear().into()), + ]), + ] + .concat(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract + .rlp_execute(token_contract.contract.id().as_str(), &signed_transaction) + .await?; + + assert!(result.success); + assert_eq!( + MINT_AMOUNT.as_yoctonear() - TRANSFER_AMOUNT.as_yoctonear(), + token_contract.ft_balance_of(wallet_contract.inner.id()).await? + ); + assert_eq!( + MINT_AMOUNT.as_yoctonear() + TRANSFER_AMOUNT.as_yoctonear(), + token_contract.ft_balance_of(other_wallet.inner.id()).await? + ); + + Ok(()) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/mod.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/mod.rs new file mode 100644 index 00000000000..e8d1c5cf0be --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/mod.rs @@ -0,0 +1,9 @@ +mod caller_error; +mod emulation; +mod relayer; +mod sanity; +mod user_error; +mod utils; + +pub const RLP_EXECUTE: &str = "rlp_execute"; +pub const GET_NONCE: &str = "get_nonce"; diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/relayer.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/relayer.rs new file mode 100644 index 00000000000..10b17adaa7c --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/relayer.rs @@ -0,0 +1,283 @@ +use crate::{ + internal::{account_id_to_address, CHAIN_ID}, + tests::{ + utils::{ + self, codec, crypto, nep141, + test_context::{TestContext, WalletContract}, + }, + RLP_EXECUTE, + }, + types::{Action, ExecuteResponse}, +}; +use aurora_engine_types::types::{Address, Wei}; +use near_workspaces::{ + network::Sandbox, + types::{AccessKeyPermission, SecretKey}, + Contract, Worker, +}; + +// A relayer can use its own Near account to send a transaction containing data +// signed by the user which adds a FunctionCall access key to the Wallet +// Contract account. This allows the relayer to send transactions on the user's +// behalf while the user covers the gas costs. +#[tokio::test] +async fn test_register_relayer() -> anyhow::Result<()> { + let TestContext { worker, mut wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let relayer_pk = wallet_contract.register_relayer(&worker).await?; + let key = wallet_contract.inner.as_account().view_access_key(&relayer_pk).await?; + match &key.permission { + AccessKeyPermission::FunctionCall(access) => { + assert_eq!(access.allowance, None); + assert_eq!(access.receiver_id.as_str(), wallet_contract.inner.id().as_str()); + assert_eq!(&access.method_names, &[RLP_EXECUTE]); + } + _ => panic!("Unexpected full access key"), + } + + // Should be able to submit transactions using the new key + utils::deploy_and_call_hello(&worker, &wallet_contract, &wallet_sk, 1).await?; + + // If the relayer is dishonest then its key is revoked. + // In this case the relayer will try to repeat a nonce value. + let result = utils::deploy_and_call_hello(&worker, &wallet_contract, &wallet_sk, 1).await; + let error_message = format!("{:?}", result.unwrap_err()); + assert!(error_message.contains("faulty relayer")); + + assert_revoked_key(&wallet_contract.inner, &relayer_pk).await; + + Ok(()) +} + +// If the relayer sends garbage data to the Wallet Contract then it is banned. +#[tokio::test] +async fn test_relayer_invalid_tx_data() -> anyhow::Result<()> { + let TestContext { worker, mut wallet_contract, .. } = TestContext::new().await?; + + async fn new_relayer( + worker: &Worker, + wc: &mut WalletContract, + ) -> anyhow::Result { + wc.register_relayer(worker).await?; + let sk = wc.inner.as_account().secret_key().clone(); + Ok(sk) + } + + async fn rlp_execute( + relayer_key: &SecretKey, + wc: &WalletContract, + tx_bytes: &[u8], + ) -> anyhow::Result<()> { + let relayer_pk = relayer_key.public_key(); + + let result: ExecuteResponse = wc + .inner + .call(RLP_EXECUTE) + .args_json(serde_json::json!({ + "target": "some.account.near", + "tx_bytes_b64": codec::encode_b64(tx_bytes) + })) + .max_gas() + .transact() + .await? + .into_result()? + .json()?; + + assert!(!result.success); + assert_eq!(result.error.as_deref(), Some("Error: faulty relayer")); + + assert_revoked_key(&wc.inner, &relayer_pk).await; + + Ok(()) + } + + let inputs: [&[u8]; 2] = [b"random_garbage_data", &[]]; + let relayer_keys = { + // Need to generate all the relayer keys first because they are + // going to get banned as we run the different inputs in the later loop. + let mut tmp = Vec::new(); + for _ in 0..(inputs.len()) { + tmp.push(new_relayer(&worker, &mut wallet_contract).await?); + } + tmp + }; + + for (input, sk) in inputs.into_iter().zip(relayer_keys) { + wallet_contract.inner.as_account_mut().set_secret_key(sk.clone()); + rlp_execute(&sk, &wallet_contract, input).await?; + } + + Ok(()) +} + +// Tests case where relayer sends a transaction signed by the wrong account. +#[tokio::test] +async fn test_relayer_invalid_sender() -> anyhow::Result<()> { + let TestContext { worker, mut wallet_contract, wallet_contract_bytes, .. } = + TestContext::new().await?; + + let wrong_wallet_sk = TestContext::deploy_wallet(&worker, &wallet_contract_bytes).await?.0.sk; + let relayer_pk = wallet_contract.register_relayer(&worker).await?; + + let target = "aurora"; + let action = Action::Transfer { receiver_id: target.into(), yocto_near: 0 }; + // Transaction signed by wrong secret key + let signed_transaction = utils::create_signed_transaction( + 0, + &target.parse().unwrap(), + Wei::zero(), + action, + &wrong_wallet_sk, + ); + + let result = wallet_contract.rlp_execute(target, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error.as_deref(), Some("Error: faulty relayer")); + + assert_revoked_key(&wallet_contract.inner, &relayer_pk).await; + + Ok(()) +} + +// Tests the case where the relayer sets the `target` to a named account which does not +// hash to the `to` field of the user's signed Ethereum transaction. +#[tokio::test] +async fn test_relayer_invalid_target() -> anyhow::Result<()> { + let TestContext { worker, mut wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let relayer_pk = wallet_contract.register_relayer(&worker).await?; + + let real_target = "aurora"; + let action = Action::Transfer { receiver_id: real_target.into(), yocto_near: 0 }; + let signed_transaction = utils::create_signed_transaction( + 0, + &real_target.parse().unwrap(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = + wallet_contract.rlp_execute(&format!("other.{real_target}"), &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error.as_deref(), Some("Error: faulty relayer")); + + assert_revoked_key(&wallet_contract.inner, &relayer_pk).await; + + Ok(()) +} + +// Tests the situation where the relayer sets `target == tx.to` when it should have +// looked up the named account corresponding to `tx.to`. In this case the relayer +// should be banned for being lazy. +#[tokio::test] +async fn test_relayer_invalid_address_target() -> anyhow::Result<()> { + let TestContext { + worker, + mut wallet_contract, + wallet_sk, + wallet_address, + address_registrar, + .. + } = TestContext::new().await?; + + // Deploy a NEP-141 contract and register its address. + // Registering should prevent a lazy relayer from setting the target incorrectly. + let token_contract = nep141::Nep141::deploy(&worker).await?; + let register_output: Option = address_registrar + .call("register") + .args_json(serde_json::json!({ + "account_id": token_contract.contract.id().as_str() + })) + .max_gas() + .transact() + .await? + .json()?; + let token_address: [u8; 20] = + hex::decode(register_output.as_ref().unwrap().strip_prefix("0x").unwrap())? + .try_into() + .unwrap(); + assert_eq!( + token_address, + account_id_to_address(&token_contract.contract.id().as_str().parse().unwrap(),).0 + ); + + // Set up a relayer with control to send transactions via the Wallet Contract account. + let relayer_pk = wallet_contract.register_relayer(&worker).await?; + + // The user submits a transaction to interact with the NEP-141 contract. + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::from_array(token_address)), + value: Wei::zero(), + data: [ + crate::eth_emulation::ERC20_BALANCE_OF_SELECTOR.to_vec(), + ethabi::encode(&[ethabi::Token::Address(wallet_address)]), + ] + .concat(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + // Relayer fails to set `target` correctly + let result = + wallet_contract.rlp_execute(register_output.unwrap().as_str(), &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error.as_deref(), Some("Error: faulty relayer")); + + assert_revoked_key(&wallet_contract.inner, &relayer_pk).await; + + Ok(()) +} + +// A relayer sending a transaction signed with the wrong chain id is a ban-worthy offense. +#[tokio::test] +async fn test_relayer_wrong_chain_id() -> anyhow::Result<()> { + let TestContext { worker, mut wallet_contract, wallet_sk, wallet_address, .. } = + TestContext::new().await?; + + let relayer_pk = wallet_contract.register_relayer(&worker).await?; + + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::new(wallet_address)), + value: Wei::zero(), + data: [ + crate::eth_emulation::ERC20_BALANCE_OF_SELECTOR.to_vec(), + ethabi::encode(&[ethabi::Token::Address(wallet_address)]), + ] + .concat(), + chain_id: CHAIN_ID + 1, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract + .rlp_execute(wallet_contract.inner.id().as_str(), &signed_transaction) + .await?; + + assert!(!result.success); + assert_eq!(result.error.as_deref(), Some("Error: faulty relayer")); + + assert_revoked_key(&wallet_contract.inner, &relayer_pk).await; + + Ok(()) +} + +async fn assert_revoked_key( + wallet_contract: &Contract, + relayer_pk: &near_workspaces::types::PublicKey, +) { + let key_query = wallet_contract.as_account().view_access_key(relayer_pk).await; + + let error_message = format!("{:?}", key_query.unwrap_err()); + assert!(error_message.contains("UnknownAccessKey")); +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/hello.wasm b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/hello.wasm new file mode 100755 index 00000000000..4cba2085bf2 Binary files /dev/null and b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/hello.wasm differ diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/nep141.wasm b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/nep141.wasm new file mode 100755 index 00000000000..b501278c161 Binary files /dev/null and b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/res/nep141.wasm differ diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/sanity.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/sanity.rs new file mode 100644 index 00000000000..37b42ab49f0 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/sanity.rs @@ -0,0 +1,74 @@ +use aurora_engine_types::types::Wei; +use near_sdk::NearToken; + +use crate::{ + internal::MAX_YOCTO_NEAR, + tests::utils::{self, test_context::TestContext}, + types::Action, +}; + +// The initial nonce value for a Wallet Contract should be 0. +#[tokio::test] +async fn test_initial_nonce() -> anyhow::Result<()> { + let TestContext { wallet_contract, .. } = TestContext::new().await?; + + let nonce = wallet_contract.get_nonce().await?; + assert_eq!(nonce, 0); + + Ok(()) +} + +// The Wallet Contract should be able to call other Near smart contracts +#[tokio::test] +async fn test_function_call_action_success() -> anyhow::Result<()> { + let TestContext { worker, wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + utils::deploy_and_call_hello(&worker, &wallet_contract, &wallet_sk, 0).await?; + + // After the transaction the nonce is incremented + let nonce = wallet_contract.get_nonce().await?; + assert_eq!(nonce, 1); + + Ok(()) +} + +// The Wallet Contract should be able to send $NEAR to other Near accounts. +#[tokio::test] +async fn test_base_token_transfer_success() -> anyhow::Result<()> { + let TestContext { worker, wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let transfer_amount = NearToken::from_near(2).as_yoctonear() + 1; + let receiver_account = worker.root_account().unwrap(); + + let initial_wallet_balance = + wallet_contract.inner.as_account().view_account().await.unwrap().balance; + let initial_receiver_balance = receiver_account.view_account().await.unwrap().balance; + + let receiver_id = receiver_account.id().as_str().into(); + let action = Action::Transfer { receiver_id, yocto_near: 1 }; + let value = Wei::new_u128(transfer_amount / (MAX_YOCTO_NEAR as u128)); + let signed_transaction = + utils::create_signed_transaction(0, receiver_account.id(), value, action, &wallet_sk); + + let result = + wallet_contract.rlp_execute(receiver_account.id().as_str(), &signed_transaction).await?; + assert!(result.success); + + let final_wallet_balance = + wallet_contract.inner.as_account().view_account().await.unwrap().balance; + let final_receiver_balance = receiver_account.view_account().await.unwrap().balance; + + // Check token balances + assert_eq!( + final_receiver_balance.as_yoctonear() - initial_receiver_balance.as_yoctonear(), + transfer_amount + ); + // Wallet loses a little more $NEAR than the transfer amount + // due to gas spent on the transaction. + let diff = initial_wallet_balance.as_yoctonear() + - final_wallet_balance.as_yoctonear() + - transfer_amount; + assert!(diff < NearToken::from_millinear(2).as_yoctonear()); + + Ok(()) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/user_error.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/user_error.rs new file mode 100644 index 00000000000..b9a11fd93be --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/user_error.rs @@ -0,0 +1,343 @@ +//! A suite of tests for code paths handling cases where the user signed transaction +//! data that is invalid in some way. This is as opposed to errors which arise +//! from faulty relayers. + +use crate::{ + error::{Error, UnsupportedAction, UserError}, + internal::{account_id_to_address, CHAIN_ID}, + tests::utils::{self, crypto, test_context::TestContext}, + types::{Action, FUNCTION_CALL_SELECTOR}, +}; +use aurora_engine_types::types::{Address, Wei}; +use near_workspaces::types::{KeyType, SecretKey}; + +// Transactions which would deploy an EVM contract are not allowed because +// there is no native EVM bytecode interpreter on Near. +#[tokio::test] +async fn test_evm_deploy() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: None, + value: Wei::zero(), + data: Vec::new(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract.rlp_execute("aurora", &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::EvmDeployDisallowed).to_string())); + + Ok(()) +} + +// The Near value of a transaction is equal to `tx.value * 1e6 + action.yocto_near`. +// Near values must be 128-bit numbers. Therefore `tx.value` cannot be larger than +// `u128::MAX // 1e6`. +#[tokio::test] +async fn test_value_too_large() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let account_id = "aurora"; + let action = Action::Transfer { receiver_id: account_id.into(), yocto_near: 0 }; + let signed_transaction = utils::create_signed_transaction( + 0, + &account_id.parse().unwrap(), + Wei::new_u128(u128::MAX), + action, + &wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::ValueTooLarge).to_string())); + + Ok(()) +} + +// Test case where `AddKey`/`DeleteKey` action contains an unknown public key kind +#[tokio::test] +async fn test_unknown_public_key_kind() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let account_id = "aurora"; + let action = Action::DeleteKey { public_key_kind: 2, public_key: b"a_new_key_type".to_vec() }; + let signed_transaction = utils::create_signed_transaction( + 0, + &account_id.parse().unwrap(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::UnknownPublicKeyKind).to_string())); + + let action = Action::AddKey { + public_key_kind: 2, + public_key: b"some_key".to_vec(), + nonce: 0, + is_full_access: false, + is_limited_allowance: false, + allowance: 0, + receiver_id: account_id.into(), + method_names: Vec::new(), + }; + let signed_transaction = utils::create_signed_transaction( + 1, + &account_id.parse().unwrap(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::UnknownPublicKeyKind).to_string())); + + Ok(()) +} + +// Test case where `AddKey`/`DeleteKey` action contains invalid public key bytes +#[tokio::test] +async fn test_invalid_public_key() -> anyhow::Result<()> { + async fn assert_invalid_pk( + ctx: &TestContext, + public_key_kind: u8, + public_key: Vec, + expected_error: UserError, + ) -> anyhow::Result<()> { + let wallet_contract = &ctx.wallet_contract; + let wallet_sk = &ctx.wallet_sk; + + let nonce = wallet_contract.get_nonce().await?; + let account_id = "aurora"; + let action = Action::DeleteKey { public_key_kind, public_key: public_key.clone() }; + let signed_transaction = utils::create_signed_transaction( + nonce, + &account_id.parse().unwrap(), + Wei::zero(), + action, + wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(expected_error.clone()).to_string())); + + let action = Action::AddKey { + public_key_kind, + public_key, + nonce: 0, + is_full_access: false, + is_limited_allowance: false, + allowance: 0, + receiver_id: account_id.into(), + method_names: Vec::new(), + }; + let signed_transaction = utils::create_signed_transaction( + nonce + 1, + &account_id.parse().unwrap(), + Wei::zero(), + action, + wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(expected_error).to_string())); + + Ok(()) + } + + let ctx = TestContext::new().await?; + + assert_invalid_pk(&ctx, 0, Vec::new(), UserError::InvalidEd25519Key).await?; + assert_invalid_pk(&ctx, 0, b"wrong_length".to_vec(), UserError::InvalidEd25519Key).await?; + + assert_invalid_pk(&ctx, 1, Vec::new(), UserError::InvalidSecp256k1Key).await?; + assert_invalid_pk(&ctx, 1, b"wrong_length".to_vec(), UserError::InvalidSecp256k1Key).await?; + + Ok(()) +} + +// Tests case where we try to add an access key with an invalid `receiver_id` +#[tokio::test] +async fn test_invalid_public_key_account_id() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let key = SecretKey::from_random(KeyType::ED25519); + let account_id = "aurora"; + let non_account_id = "---***---"; + let action = Action::AddKey { + public_key_kind: 0, + public_key: key.public_key().key_data().to_vec(), + nonce: 0, + is_full_access: false, + is_limited_allowance: false, + allowance: 0, + receiver_id: non_account_id.into(), + method_names: Vec::new(), + }; + let signed_transaction = utils::create_signed_transaction( + 0, + &account_id.parse().unwrap(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::InvalidAccessKeyAccountId).to_string())); + + Ok(()) +} + +// User's are not allowed to add full access keys to the account. +// This would be too dangerous as it could allow for undefined behaviour +// such as deploying a different contract to an Eth implicit address. +#[tokio::test] +async fn test_cannot_add_full_access_key() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let key = SecretKey::from_random(KeyType::ED25519); + let action = Action::AddKey { + public_key_kind: 0, + public_key: key.public_key().key_data().to_vec(), + nonce: 0, + is_full_access: true, + is_limited_allowance: false, + allowance: 0, + receiver_id: String::new(), + method_names: Vec::new(), + }; + let signed_transaction = utils::create_signed_transaction( + 0, + wallet_contract.inner.id(), + Wei::zero(), + action, + &wallet_sk, + ); + + let result = wallet_contract + .rlp_execute(wallet_contract.inner.id().as_str(), &signed_transaction) + .await?; + + assert!(!result.success); + assert_eq!( + result.error, + Some( + Error::User(UserError::UnsupportedAction(UnsupportedAction::AddFullAccessKey)) + .to_string() + ) + ); + + Ok(()) +} + +// Cases where `tx.data` cannot be parsed into a known +// Action or emulated Ethereum standard. +#[tokio::test] +async fn test_bad_data() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let account_id = "aurora"; + let to = Address::new(account_id_to_address(&account_id.parse().unwrap())); + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 0.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(to), + value: Wei::zero(), + data: hex::decode("deadbeef").unwrap(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::UnknownFunctionSelector).to_string())); + + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 1.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(to), + value: Wei::zero(), + data: [ + FUNCTION_CALL_SELECTOR.to_vec(), + hex::decode("0000000000000000000000000000000000000000000000000000000000000000") + .unwrap(), + ] + .concat(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::InvalidAbiEncodedData).to_string())); + + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: 2.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(to), + value: Wei::zero(), + data: Vec::new(), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + let signed_transaction = crypto::sign_transaction(transaction, &wallet_sk); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::InvalidAbiEncodedData).to_string())); + + Ok(()) +} + +// Test case where the action contains more than 1_000_000 yoctoNear directly. +#[tokio::test] +async fn test_excess_yocto() -> anyhow::Result<()> { + let TestContext { wallet_contract, wallet_sk, .. } = TestContext::new().await?; + + let account_id = "aurora"; + let action = Action::Transfer { + receiver_id: account_id.into(), + yocto_near: crate::internal::MAX_YOCTO_NEAR + 1, + }; + let signed_transaction = utils::create_signed_transaction( + 0, + &account_id.parse().unwrap(), + Wei::new_u64(1), + action, + &wallet_sk, + ); + + let result = wallet_contract.rlp_execute(account_id, &signed_transaction).await?; + + assert!(!result.success); + assert_eq!(result.error, Some(Error::User(UserError::ExcessYoctoNear).to_string())); + + Ok(()) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/codec.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/codec.rs new file mode 100644 index 00000000000..fd56b204da0 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/codec.rs @@ -0,0 +1,65 @@ +use crate::types::Action; +use aurora_engine_transactions::EthTransactionKind; + +pub fn abi_encode(action: Action) -> Vec { + let mut buf = Vec::new(); + match action { + Action::FunctionCall { receiver_id, method_name, args, gas, yocto_near } => { + buf.extend_from_slice(crate::types::FUNCTION_CALL_SELECTOR); + let tokens = &[ + ethabi::Token::String(receiver_id), + ethabi::Token::String(method_name), + ethabi::Token::Bytes(args), + ethabi::Token::Uint(gas.into()), + ethabi::Token::Uint(yocto_near.into()), + ]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + Action::Transfer { receiver_id, yocto_near } => { + buf.extend_from_slice(crate::types::TRANSFER_SELECTOR); + let tokens = + &[ethabi::Token::String(receiver_id), ethabi::Token::Uint(yocto_near.into())]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + Action::AddKey { + public_key_kind, + public_key, + nonce, + is_full_access, + is_limited_allowance, + allowance, + receiver_id, + method_names, + } => { + buf.extend_from_slice(crate::types::ADD_KEY_SELECTOR); + let tokens = &[ + ethabi::Token::Uint(public_key_kind.into()), + ethabi::Token::Bytes(public_key), + ethabi::Token::Uint(nonce.into()), + ethabi::Token::Bool(is_full_access), + ethabi::Token::Bool(is_limited_allowance), + ethabi::Token::Uint(allowance.into()), + ethabi::Token::String(receiver_id), + ethabi::Token::Array(method_names.into_iter().map(ethabi::Token::String).collect()), + ]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + Action::DeleteKey { public_key_kind, public_key } => { + buf.extend_from_slice(crate::types::DELETE_KEY_SELECTOR); + let tokens = + &[ethabi::Token::Uint(public_key_kind.into()), ethabi::Token::Bytes(public_key)]; + buf.extend_from_slice(ðabi::encode(tokens)); + } + }; + buf +} + +pub fn rlp_encode(transaction: &EthTransactionKind) -> Vec { + transaction.into() +} + +pub fn encode_b64(input: &[u8]) -> String { + use base64::Engine; + let engine = base64::engine::general_purpose::STANDARD; + engine.encode(input) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/crypto.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/crypto.rs new file mode 100644 index 00000000000..602c5902b29 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/crypto.rs @@ -0,0 +1,25 @@ +use aurora_engine_transactions::{eip_2930::Transaction2930, EthTransactionKind}; +use aurora_engine_types::U256; +use near_crypto::{SecretKey, Signature}; + +pub fn sign_transaction(transaction: Transaction2930, sk: &SecretKey) -> EthTransactionKind { + let mut rlp_stream = rlp::RlpStream::new(); + rlp_stream.append(&aurora_engine_transactions::eip_2930::TYPE_BYTE); + transaction.rlp_append_unsigned(&mut rlp_stream); + let message_hash = crate::internal::keccak256(rlp_stream.as_raw()); + let signature = sk.sign(&message_hash); + let bytes: [u8; 65] = match signature { + Signature::SECP256K1(x) => x.into(), + _ => panic!(), + }; + let v = bytes[64]; + let r = U256::from_big_endian(&bytes[0..32]); + let s = U256::from_big_endian(&bytes[32..64]); + let signed_transaction = aurora_engine_transactions::eip_2930::SignedTransaction2930 { + transaction, + parity: v, + r, + s, + }; + EthTransactionKind::Eip2930(signed_transaction) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/mod.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/mod.rs new file mode 100644 index 00000000000..d142a7235bf --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/mod.rs @@ -0,0 +1,63 @@ +use crate::{ + internal::{account_id_to_address, CHAIN_ID}, + tests::utils::test_context::WalletContract, + types::Action, +}; +use aurora_engine_transactions::EthTransactionKind; +use aurora_engine_types::types::{Address, Wei}; +use near_crypto::SecretKey; +use near_workspaces::{network::Sandbox, AccountId, Worker}; + +pub mod codec; +pub mod crypto; +pub mod nep141; +pub mod test_context; + +pub async fn deploy_and_call_hello( + worker: &Worker, + wallet_contract: &WalletContract, + wallet_sk: &SecretKey, + nonce: u64, +) -> anyhow::Result<()> { + let hello_bytes = tokio::fs::read("src/tests/res/hello.wasm").await?; + let hello_contract = worker.dev_deploy(&hello_bytes).await?; + + let action = Action::FunctionCall { + receiver_id: hello_contract.id().to_string(), + method_name: "greet".into(), + args: br#"{"name": "Aurora"}"#.to_vec(), + gas: 5_000_000_000_000, + yocto_near: 0, + }; + let signed_transaction = + create_signed_transaction(nonce, hello_contract.id(), Wei::zero(), action, wallet_sk); + + let result = + wallet_contract.rlp_execute(hello_contract.id().as_str(), &signed_transaction).await?; + + if result.success_value.as_deref() != Some(br#""Hello, Aurora!""#.as_slice()) { + anyhow::bail!("Call to hello contract failed: {:?}", result.error); + } + + Ok(()) +} + +pub fn create_signed_transaction( + nonce: u64, + target: &AccountId, + value: Wei, + action: Action, + wallet_sk: &SecretKey, +) -> EthTransactionKind { + let transaction = aurora_engine_transactions::eip_2930::Transaction2930 { + nonce: nonce.into(), + gas_price: 0.into(), + gas_limit: 0.into(), + to: Some(Address::new(account_id_to_address(&target.as_str().parse().unwrap()))), + value, + data: codec::abi_encode(action), + chain_id: CHAIN_ID, + access_list: Vec::new(), + }; + crypto::sign_transaction(transaction, wallet_sk) +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/nep141.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/nep141.rs new file mode 100644 index 00000000000..1e100afe385 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/nep141.rs @@ -0,0 +1,67 @@ +use near_sdk::json_types::U128; +use near_workspaces::{network::Sandbox, types::NearToken, AccountId, Contract, Worker}; + +const STORAGE_DEPOSIT_AMOUNT: u128 = 1_250_000_000_000_000_000_000; + +pub struct Nep141 { + pub contract: Contract, +} + +impl Nep141 { + pub async fn deploy(worker: &Worker) -> anyhow::Result { + let bytes = tokio::fs::read("src/tests/res/nep141.wasm").await?; + let contract = worker.dev_deploy(&bytes).await?; + + contract + .call("new") + .args_json(serde_json::json!({ + "name": "TestToken", + "symbol": "TTT", + "decimals": 24, + })) + .max_gas() + .transact() + .await? + .into_result()?; + + Ok(Self { contract }) + } + + pub async fn mint(&self, account_id: &AccountId, amount: u128) -> anyhow::Result<()> { + self.contract + .call("storage_deposit") + .args_json(serde_json::json!({ + "account_id": account_id.as_str(), + })) + .deposit(NearToken::from_yoctonear(STORAGE_DEPOSIT_AMOUNT)) + .max_gas() + .transact() + .await? + .into_result()?; + + self.contract + .call("mint") + .args_json(serde_json::json!({ + "account_id": account_id.as_str(), + "amount": U128(amount), + })) + .max_gas() + .transact() + .await? + .into_result()?; + + Ok(()) + } + + pub async fn ft_balance_of(&self, account_id: &AccountId) -> anyhow::Result { + let result: U128 = self + .contract + .view("ft_balance_of") + .args_json(serde_json::json!({ + "account_id": account_id.as_str(), + })) + .await? + .json()?; + Ok(result.0) + } +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/test_context.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/test_context.rs new file mode 100644 index 00000000000..b20ac6eaa7b --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/tests/utils/test_context.rs @@ -0,0 +1,235 @@ +use crate::{ + tests::{ + utils::{self, codec}, + GET_NONCE, RLP_EXECUTE, + }, + types::{Action, ExecuteResponse}, +}; +use aurora_engine_transactions::EthTransactionKind; +use aurora_engine_types::types::Wei; +use ethabi::Address; +use near_sdk::json_types::U64; +use near_workspaces::{ + network::Sandbox, + types::{KeyType, NearToken, PublicKey, SecretKey}, + Account, Contract, Worker, +}; +use std::path::{Path, PathBuf}; +use tokio::{process::Command, sync::Mutex}; + +const BASE_DIR: &str = std::env!("CARGO_MANIFEST_DIR"); +const PACKAGE_NAME: &str = std::env!("CARGO_PKG_NAME"); +const INITIAL_BALANCE: NearToken = NearToken::from_near(20); + +// Prevents multiple tests from trying to compile the contracts at the same time. +static LOCK: Mutex<()> = Mutex::const_new(()); + +pub struct WalletContract { + pub inner: Contract, + pub sk: near_crypto::SecretKey, +} + +impl WalletContract { + pub async fn rlp_execute( + &self, + target: &str, + tx: &EthTransactionKind, + ) -> anyhow::Result { + let result: ExecuteResponse = self + .inner + .call(RLP_EXECUTE) + .args_json(serde_json::json!({ + "target": target, + "tx_bytes_b64": codec::encode_b64(&codec::rlp_encode(tx)) + })) + .max_gas() + .transact() + .await? + .into_result()? + .json()?; + + Ok(result) + } + + pub async fn external_rlp_execute( + &self, + caller: &Account, + target: &str, + tx: &EthTransactionKind, + ) -> anyhow::Result { + let result: ExecuteResponse = caller + .call(self.inner.id(), RLP_EXECUTE) + .args_json(serde_json::json!({ + "target": target, + "tx_bytes_b64": codec::encode_b64(&codec::rlp_encode(tx)) + })) + .max_gas() + .transact() + .await? + .into_result()? + .json()?; + + Ok(result) + } + + pub async fn get_nonce(&self) -> anyhow::Result { + let nonce: U64 = self.inner.view(GET_NONCE).await?.json()?; + Ok(nonce.0) + } + + /// Add a new `FunctionCall` access key to the Wallet Contract. + /// The idea is that this allows the relayer to submit transactions signed by + /// the Wallet Contract directly. + pub async fn register_relayer( + &mut self, + worker: &Worker, + ) -> anyhow::Result { + let relayer_account = worker.dev_create_account().await?; + let relayer_key = SecretKey::from_random(KeyType::ED25519); + let relayer_pk = relayer_key.public_key(); + + let action = Action::AddKey { + public_key_kind: 0, + public_key: relayer_pk.key_data().to_vec(), + nonce: 0, + is_full_access: false, + is_limited_allowance: false, + allowance: 0, + receiver_id: self.inner.id().to_string(), + method_names: vec![RLP_EXECUTE.into()], + }; + let nonce = self.get_nonce().await?; + let signed_transaction = + utils::create_signed_transaction(nonce, self.inner.id(), Wei::zero(), action, &self.sk); + + // Call the Wallet Contract from the relayer account to add the key + let result: ExecuteResponse = relayer_account + .call(self.inner.id(), RLP_EXECUTE) + .args_json(serde_json::json!({ + "target": self.inner.id(), + "tx_bytes_b64": codec::encode_b64(&codec::rlp_encode(&signed_transaction)) + })) + .max_gas() + .transact() + .await? + .into_result()? + .json()?; + + assert!(result.success, "Adding Relayer's key failed: {:?}", result.error); + + // Tell near-workspaces to use this new key instead when + // signing transactions from the Wallet Contract + self.inner.as_account_mut().set_secret_key(relayer_key); + + Ok(relayer_pk) + } +} + +pub struct TestContext { + pub worker: Worker, + pub wallet_contract: WalletContract, + pub wallet_sk: near_crypto::SecretKey, + pub wallet_address: Address, + pub address_registrar: Contract, + pub wallet_contract_bytes: Vec, +} + +impl TestContext { + pub async fn new() -> anyhow::Result { + let _guard = LOCK.lock().await; + let worker = near_workspaces::sandbox().await?; + + let registrar_id_path = address_registrar_account_id_path(BASE_DIR); + let original_registrar_id = tokio::fs::read(®istrar_id_path).await?; + let address_registrar = Self::deploy_address_registrar(&worker).await?; + let wallet_contract_bytes = build_contract(BASE_DIR, PACKAGE_NAME).await?; + // Restore address registrar account id file + tokio::fs::write(registrar_id_path, &original_registrar_id).await?; + + let (wallet_contract, wallet_address) = + Self::deploy_wallet(&worker, &wallet_contract_bytes).await?; + let wallet_sk = wallet_contract.sk.clone(); + + Ok(Self { + worker, + wallet_contract, + wallet_sk, + wallet_address, + address_registrar, + wallet_contract_bytes, + }) + } + + async fn deploy_address_registrar(worker: &Worker) -> anyhow::Result { + let base_dir = Path::new(BASE_DIR).parent().unwrap().join("address-registrar"); + let contract_bytes = build_contract(base_dir, "eth-address-registrar").await?; + let contract = worker.dev_deploy(&contract_bytes).await?; + + // Initialize the contract + contract.call("new").transact().await.unwrap().into_result().unwrap(); + + // Update the file where the Wallet Contract gets the address registrar account id from + tokio::fs::write(address_registrar_account_id_path(BASE_DIR), contract.id().as_bytes()) + .await?; + + Ok(contract) + } + + pub async fn deploy_wallet( + worker: &Worker, + contract_bytes: &[u8], + ) -> anyhow::Result<(WalletContract, Address)> { + let wallet_sk = near_crypto::SecretKey::from_random(near_crypto::KeyType::SECP256K1); + let wallet_address = { + let wallet_pk = wallet_sk.public_key(); + let hash = crate::internal::keccak256(wallet_pk.key_data()); + Address::from_slice(&hash[12..32]) + }; + let wallet_account = worker + .root_account()? + .create_subaccount(&format!("0x{}", hex::encode(wallet_address))) + .keys(SecretKey::from_random(KeyType::ED25519)) + .initial_balance(INITIAL_BALANCE) + .transact() + .await? + .result; + let wallet_contract = WalletContract { + inner: wallet_account.deploy(contract_bytes).await?.result, + sk: wallet_sk, + }; + + Ok((wallet_contract, wallet_address)) + } +} + +async fn build_contract>( + base_dir: P, + package_name: &str, +) -> anyhow::Result> { + let output = Command::new("cargo") + .env("RUSTFLAGS", "-C link-arg=-s") + .current_dir(base_dir.as_ref()) + .args(["build", "--target", "wasm32-unknown-unknown", "--release"]) + .output() + .await?; + + if !output.status.success() { + anyhow::bail!("Build failed: {}", String::from_utf8_lossy(&output.stderr)); + } + + let artifact_path = base_dir + .as_ref() + .parent() + .unwrap() + .join("target") + .join("wasm32-unknown-unknown") + .join("release") + .join([package_name.replace('-', "_").as_str(), ".wasm"].concat()); + + let bytes = tokio::fs::read(artifact_path).await?; + Ok(bytes) +} + +fn address_registrar_account_id_path(base_dir: &str) -> PathBuf { + Path::new(base_dir).join("src").join("ADDRESS_REGISTRAR_ACCOUNT_ID") +} diff --git a/runtime/near-wallet-contract/implementation/wallet-contract/src/types.rs b/runtime/near-wallet-contract/implementation/wallet-contract/src/types.rs new file mode 100644 index 00000000000..975e1304a25 --- /dev/null +++ b/runtime/near-wallet-contract/implementation/wallet-contract/src/types.rs @@ -0,0 +1,233 @@ +use crate::{ + error::{Error, UserError}, + near_action::{ + self, AccessKey, AccessKeyPermission, AddKeyAction, DeleteKeyAction, FunctionCallAction, + FunctionCallPermission, TransferAction, + }, +}; +use ethabi::{Address, ParamType}; +use near_sdk::{AccountId, Gas, NearToken, PublicKey}; +use once_cell::sync::Lazy; + +pub const FUNCTION_CALL_SELECTOR: &[u8] = &[0x61, 0x79, 0xb7, 0x07]; +pub const FUNCTION_CALL_SIGNATURE: [ParamType; 5] = [ + ParamType::String, // receiver_id + ParamType::String, // method_name + ParamType::Bytes, // args + ParamType::Uint(64), // gas + ParamType::Uint(32), // yocto_near +]; + +pub const TRANSFER_SELECTOR: &[u8] = &[0x3e, 0xd6, 0x41, 0x24]; +pub const TRANSFER_SIGNATURE: [ParamType; 2] = [ + ParamType::String, // receiver_id + ParamType::Uint(32), // yocto_near +]; + +pub const ADD_KEY_SELECTOR: &[u8] = &[0x75, 0x3c, 0xe5, 0xab]; +// This one needs to be `Lazy` because it requires `Box` (non-const) in the `Array`. +pub static ADD_KEY_SIGNATURE: Lazy<[ParamType; 8]> = Lazy::new(|| { + [ + ParamType::Uint(8), // public_key_kind + ParamType::Bytes, // public_key + ParamType::Uint(64), // nonce + ParamType::Bool, // is_full_access + ParamType::Bool, // is_limited_allowance + ParamType::Uint(128), // allowance + ParamType::String, // receiver_id + ParamType::Array(Box::new(ParamType::String)), // method_names + ] +}); + +pub const DELETE_KEY_SELECTOR: &[u8] = &[0x3f, 0xc6, 0xd4, 0x04]; +pub const DELETE_KEY_SIGNATURE: [ParamType; 2] = [ + ParamType::Uint(8), // public_key_kind + ParamType::Bytes, // public_key +]; + +/// Response given from the `rlp_execute` entry point to the contract. +/// The error information is needed because that method is not meant to panic, +/// therefore success/failure must be communicated via the return value. +/// The reason that method should never panic is to ensure the contract's state +/// can be changed even in error cases. For example, banning a dishonest relayer. +#[derive(Debug, PartialEq, Eq, Clone, serde::Serialize, serde::Deserialize)] +pub struct ExecuteResponse { + pub success: bool, + pub success_value: Option>, + pub error: Option, +} + +impl From for ExecuteResponse { + fn from(value: Error) -> Self { + Self { success: false, success_value: None, error: Some(format!("{value}")) } + } +} + +/// Struct holding environment parameters that are needed to validate transactions +/// before executing them. This struct is used in the `internal` module so that it +/// can be unit tested without mocking up the whole Near runtime. In the Wasm contract, +/// the struct is constructed via functions in `near_sdk::env`. +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct ExecutionContext { + pub current_address: Address, + pub attached_deposit: NearToken, + pub predecessor_account_id: AccountId, + pub current_account_id: AccountId, +} + +impl ExecutionContext { + pub fn new( + current_account_id: AccountId, + predecessor_account_id: AccountId, + attached_deposit: NearToken, + ) -> Result { + let current_address = crate::internal::extract_address(¤t_account_id)?; + Ok(Self { current_address, attached_deposit, predecessor_account_id, current_account_id }) + } +} + +#[must_use] +pub enum TransactionValidationOutcome { + Validated, + AddressCheckRequired(Address), +} + +/// The Near protocol actions represented in a form that is suitable for the +/// Solidity ABI. This allows them to be encoded into the `data` field of an +/// Ethereum transaction in a way that can be parsed by Ethereum tooling. +#[derive(Debug, PartialEq, Eq, Clone)] +pub enum Action { + FunctionCall { + receiver_id: String, + method_name: String, + args: Vec, + gas: u64, + yocto_near: u32, + }, + Transfer { + receiver_id: String, + yocto_near: u32, + }, + AddKey { + public_key_kind: u8, + public_key: Vec, + nonce: u64, + is_full_access: bool, + is_limited_allowance: bool, + allowance: u128, + receiver_id: String, + method_names: Vec, + }, + DeleteKey { + public_key_kind: u8, + public_key: Vec, + }, +} + +impl Action { + pub fn value(&self) -> NearToken { + match self { + Action::FunctionCall { yocto_near, .. } => { + NearToken::from_yoctonear((*yocto_near).into()) + } + Action::Transfer { yocto_near, .. } => NearToken::from_yoctonear((*yocto_near).into()), + Action::AddKey { .. } => NearToken::from_yoctonear(0), + Action::DeleteKey { .. } => NearToken::from_yoctonear(0), + } + } + + pub fn try_into_near_action( + self, + additional_value: u128, + ) -> Result { + let action = match self { + Action::FunctionCall { receiver_id: _, method_name, args, gas, yocto_near } => { + let action = FunctionCallAction { + method_name, + args, + gas: Gas::from_gas(gas), + deposit: NearToken::from_yoctonear( + additional_value.saturating_add(yocto_near.into()), + ), + }; + near_action::Action::FunctionCall(action) + } + Action::Transfer { receiver_id: _, yocto_near } => { + let action = TransferAction { + deposit: NearToken::from_yoctonear( + additional_value.saturating_add(yocto_near.into()), + ), + }; + near_action::Action::Transfer(action) + } + Action::AddKey { + public_key_kind, + public_key, + nonce, + is_full_access, + is_limited_allowance, + allowance, + receiver_id, + method_names, + } => { + let public_key = construct_public_key(public_key_kind, &public_key)?; + let access_key = if is_full_access { + AccessKey { nonce, permission: AccessKeyPermission::FullAccess } + } else { + let allowance = if is_limited_allowance { Some(allowance) } else { None }; + AccessKey { + nonce, + permission: AccessKeyPermission::FunctionCall(FunctionCallPermission { + allowance: allowance.map(NearToken::from_yoctonear), + receiver_id: receiver_id + .parse() + .map_err(|_| Error::User(UserError::InvalidAccessKeyAccountId))?, + method_names, + }), + } + }; + let action = AddKeyAction { public_key, access_key }; + near_action::Action::AddKey(action) + } + Action::DeleteKey { public_key_kind, public_key } => { + let action = DeleteKeyAction { + public_key: construct_public_key(public_key_kind, &public_key)?, + }; + near_action::Action::DeleteKey(action) + } + }; + Ok(action) + } +} + +fn construct_public_key(public_key_kind: u8, public_key: &[u8]) -> Result { + if public_key_kind > 1 { + return Err(Error::User(UserError::UnknownPublicKeyKind)); + } + let mut bytes = Vec::with_capacity(public_key.len() + 1); + bytes.push(public_key_kind); + bytes.extend_from_slice(public_key); + bytes.try_into().map_err(|_| { + if public_key_kind == 0 { + Error::User(UserError::InvalidEd25519Key) + } else { + Error::User(UserError::InvalidSecp256k1Key) + } + }) +} + +#[test] +fn test_function_selectors() { + let function_call_signature = ethabi::short_signature("functionCall", &FUNCTION_CALL_SIGNATURE); + + let transfer_signature = ethabi::short_signature("transfer", &TRANSFER_SIGNATURE); + + let add_key_signature = ethabi::short_signature("addKey", ADD_KEY_SIGNATURE.as_ref()); + + let delete_key = ethabi::short_signature("deleteKey", &DELETE_KEY_SIGNATURE); + + assert_eq!(function_call_signature, FUNCTION_CALL_SELECTOR); // 0x6179b707 + assert_eq!(transfer_signature, TRANSFER_SELECTOR); // 0x3ed64124 + assert_eq!(add_key_signature, ADD_KEY_SELECTOR); // 0x753ce5ab + assert_eq!(delete_key, DELETE_KEY_SELECTOR); // 0x3fc6d404 +} diff --git a/runtime/near-wallet-contract/res/wallet_contract.wasm b/runtime/near-wallet-contract/res/wallet_contract.wasm index d82afe3cc67..8784d9a1542 100755 Binary files a/runtime/near-wallet-contract/res/wallet_contract.wasm and b/runtime/near-wallet-contract/res/wallet_contract.wasm differ diff --git a/runtime/near-wallet-contract/wallet-contract/Cargo.lock b/runtime/near-wallet-contract/wallet-contract/Cargo.lock deleted file mode 100644 index 7184a20c2ae..00000000000 --- a/runtime/near-wallet-contract/wallet-contract/Cargo.lock +++ /dev/null @@ -1,1529 +0,0 @@ -# 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" - -[[package]] -name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom 0.2.11", - "once_cell", - "version_check", -] - -[[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 = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "bitvec" -version = "0.20.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - -[[package]] -name = "blake2" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e37d16930f5459780f5621038b6382b9bb37c19016f39fb6b5808d831f174" -dependencies = [ - "crypto-mac", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "borsh" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" -dependencies = [ - "borsh-derive", - "hashbrown 0.11.2", -] - -[[package]] -name = "borsh-derive" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytesize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" - -[[package]] -name = "c2-chacha" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" -dependencies = [ - "cipher", - "ppv-lite86", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "cipher" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" -dependencies = [ - "generic-array", -] - -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "core-foundation-sys" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" - -[[package]] -name = "cpufeatures" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" -dependencies = [ - "libc", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "curve25519-dalek" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common", -] - -[[package]] -name = "dyn-clone" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" - -[[package]] -name = "easy-ext" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" - -[[package]] -name = "ed25519" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature", -] - -[[package]] -name = "ed25519-dalek" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" -dependencies = [ - "curve25519-dalek", - "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - -[[package]] -name = "getrandom" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "impl-codec" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "161ebdfec3c8e3b52bf61c4f3550a1eea4f9579d10dc1b936f3171ebdcd6c443" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indexmap" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" -dependencies = [ - "equivalent", - "hashbrown 0.14.3", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "js-sys" -version = "0.3.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "near-abi" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "885db39b08518fa700b73fa2214e8adbbfba316ba82dd510f50519173eadaf73" -dependencies = [ - "borsh", - "schemars", - "semver", - "serde", -] - -[[package]] -name = "near-account-id" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" -dependencies = [ - "borsh", - "serde", -] - -[[package]] -name = "near-crypto" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" -dependencies = [ - "arrayref", - "blake2", - "borsh", - "bs58", - "c2-chacha", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "near-account-id", - "once_cell", - "parity-secp256k1", - "primitive-types", - "rand 0.7.3", - "rand_core 0.5.1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - -[[package]] -name = "near-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" -dependencies = [ - "borsh", - "byteorder", - "bytesize", - "chrono", - "derive_more", - "easy-ext", - "hex", - "near-crypto", - "near-primitives-core", - "near-rpc-error-macro", - "near-vm-errors", - "num-rational", - "once_cell", - "primitive-types", - "rand 0.7.3", - "reed-solomon-erasure", - "serde", - "serde_json", - "smart-default", - "strum", - "thiserror", -] - -[[package]] -name = "near-primitives-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d508f0fc340f6461e4e256417685720d3c4c00bb5a939b105160e49137caba" -dependencies = [ - "base64 0.11.0", - "borsh", - "bs58", - "derive_more", - "near-account-id", - "num-rational", - "serde", - "sha2 0.10.8", - "strum", -] - -[[package]] -name = "near-rpc-error-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ee0b41c75ef859c193a8ff1dadfa0c8207bc0ac447cc22259721ad769a1408" -dependencies = [ - "quote", - "serde", - "syn 1.0.109", -] - -[[package]] -name = "near-rpc-error-macro" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e837bd4bacd807073ec5ceb85708da7f721b46a4c2a978de86027fb0034ce31" -dependencies = [ - "near-rpc-error-core", - "serde", - "syn 1.0.109", -] - -[[package]] -name = "near-sdk" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15eb3de2defe3626260cc209a6cdb985c6b27b0bd4619fad97dcfae002c3c5bd" -dependencies = [ - "base64 0.13.1", - "borsh", - "bs58", - "near-abi", - "near-crypto", - "near-primitives", - "near-primitives-core", - "near-sdk-macros", - "near-sys", - "near-vm-logic", - "once_cell", - "schemars", - "serde", - "serde_json", - "wee_alloc", -] - -[[package]] -name = "near-sdk-macros" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4907affc9f5ed559456509188ff0024f1f2099c0830e6bdb66eb61d5b75912c0" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "near-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" - -[[package]] -name = "near-vm-errors" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" -dependencies = [ - "borsh", - "near-account-id", - "near-rpc-error-macro", - "serde", -] - -[[package]] -name = "near-vm-logic" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b534828419bacbf1f7b11ef7b00420f248c548c485d3f0cfda8bb6931152f2" -dependencies = [ - "base64 0.13.1", - "borsh", - "bs58", - "byteorder", - "near-account-id", - "near-crypto", - "near-primitives", - "near-primitives-core", - "near-vm-errors", - "ripemd", - "serde", - "sha2 0.10.8", - "sha3", - "zeropool-bn", -] - -[[package]] -name = "num-bigint" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", - "serde", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "parity-scale-codec" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "373b1a4c1338d9cd3d1fa53b3a11bdab5ab6bd80a20f7f7becd76953ae2be909" -dependencies = [ - "arrayvec 0.7.4", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1557010476e0595c9b568d16dcfb81b93cdeb157612726f5170d31aa707bed27" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parity-secp256k1" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fca4f82fccae37e8bbdaeb949a4a218a1bbc485d11598f193d2a908042e5fc1" -dependencies = [ - "arrayvec 0.5.2", - "cc", - "cfg-if 0.1.10", - "rand 0.7.3", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "primitive-types" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" -dependencies = [ - "fixed-hash", - "impl-codec", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.70" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.11", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "reed-solomon-erasure" -version = "4.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a415a013dd7c5d4221382329a5a3482566da675737494935cbbbcdec04662f9d" -dependencies = [ - "smallvec", -] - -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "rlp" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" -dependencies = [ - "rustc-hex", -] - -[[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.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "schemars" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a28f4c49489add4ce10783f7911893516f15afe45d015608d41faca6bc4d29" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 1.0.109", -] - -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" - -[[package]] -name = "serde" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.193" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "serde_derive_internals" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "serde_json" -version = "1.0.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "smart-default" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133659a15339456eeeb07572eb02a91c91e9815e9cbc89566944d2c8d3efdbf6" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "thiserror" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "uint" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" -dependencies = [ - "byteorder", - "crunchy", - "hex", - "static_assertions", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wallet-contract" -version = "0.1.0" -dependencies = [ - "hex", - "near-sdk", - "rlp", - "serde_json", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "winnow" -version = "0.5.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" -dependencies = [ - "memchr", -] - -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "zeroize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "zeropool-bn" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" -dependencies = [ - "borsh", - "byteorder", - "crunchy", - "lazy_static", - "rand 0.8.5", - "rustc-hex", -] diff --git a/runtime/near-wallet-contract/wallet-contract/Cargo.toml b/runtime/near-wallet-contract/wallet-contract/Cargo.toml deleted file mode 100644 index a7c0259d244..00000000000 --- a/runtime/near-wallet-contract/wallet-contract/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "wallet-contract" -version = "0.1.0" -publish = false -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -hex = "0.4.2" -serde_json = "1.0.68" -near-sdk = "4.1.1" -rlp = "0.4.6" - -[profile.release] -codegen-units = 1 -# Tell `rustc` to optimize for small code size. -opt-level = "z" -strip = true -lto = true -debug = false -panic = "abort" -rpath = false -debug-assertions = false -incremental = false -overflow-checks = true - -[workspace] -members = [] diff --git a/runtime/near-wallet-contract/wallet-contract/src/lib.rs b/runtime/near-wallet-contract/wallet-contract/src/lib.rs deleted file mode 100644 index 193e0942cc9..00000000000 --- a/runtime/near-wallet-contract/wallet-contract/src/lib.rs +++ /dev/null @@ -1,53 +0,0 @@ -//! Temporary implementation of the Wallet Contract. -//! See https://github.com/near/NEPs/issues/518. -//! Must not use in production! -// TODO(eth-implicit) Change to a real Wallet Contract implementation. - -use hex; -use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; -use near_sdk::{env, near_bindgen, AccountId, Promise}; -use rlp::Rlp; - -#[near_bindgen] -#[derive(Default, BorshDeserialize, BorshSerialize)] -pub struct WalletContract {} - -#[near_bindgen] -impl WalletContract { - /// For the sake of this placeholder implementation, we assume simplified version of the `rlp_transaction` - /// that only has 3 values: `To`, `Value`, and `PublicKey`. We assume this is a transfer transaction. - /// The real implementation would obtain the public key from `Signature`. - pub fn execute_rlp(&self, target: AccountId, rlp_transaction: Vec) { - let rlp = Rlp::new(&rlp_transaction); - - let to: String = match rlp.val_at(0) { - Ok(to) => to, - _ => env::panic_str("Missing `to` field in RLP-encoded transaction."), - }; - if target.to_string() != to { - env::panic_str("`target` not equal to transaction's `To` address."); - } - - let value_bytes: Vec = match rlp.val_at(1) { - Ok(value_bytes) => value_bytes, - _ => env::panic_str("Missing `value` field in RLP-encoded transaction."), - }; - let value = u128::from_be_bytes( - value_bytes.try_into().expect("Incorrect `value` field in RLP-encoded transaction."), - ); - - let signer_public_key_bytes: Vec = match rlp.val_at(2) { - Ok(signer_public_key_bytes) => signer_public_key_bytes, - _ => env::panic_str("Signature extraction failed for RLP-encoded transaction."), - }; - - let hash = env::keccak256(&signer_public_key_bytes); - let signer_address = format!("0x{}", hex::encode(&hash[12..32])); - - if signer_address != env::current_account_id().to_string() { - env::panic_str("Public key does not match the Wallet Contract address."); - } - - Promise::new(target).transfer(value); - } -}