diff --git a/Cargo.lock b/Cargo.lock index 1f6a78552dd..daecb8fc7f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # 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.0" @@ -434,6 +440,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" @@ -581,6 +593,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" + [[package]] name = "base64" version = "0.12.3" @@ -665,16 +683,28 @@ dependencies = [ "typenum", ] +[[package]] +name = "bitvec" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7774144344a4faa177370406a7ff5f1da24303817368584c6206c8303eb07848" +dependencies = [ + "funty 1.1.0", + "radium 0.6.2", + "tap", + "wyz 0.2.0", +] + [[package]] name = "bitvec" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ - "funty", - "radium", + "funty 2.0.0", + "radium 0.7.0", "tap", - "wyz", + "wyz 0.5.1", ] [[package]] @@ -695,7 +725,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", @@ -703,6 +733,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" @@ -908,6 +947,12 @@ 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" @@ -1067,10 +1112,10 @@ dependencies = [ "log", "near-async", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-network", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "openssl-probe", @@ -1234,7 +1279,7 @@ dependencies = [ "clap", "near-chain-configs", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "rand 0.8.5", @@ -1645,6 +1690,19 @@ dependencies = [ "memchr", ] +[[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 = "curve25519-dalek" version = "4.1.1" @@ -1827,7 +1885,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", ] @@ -1870,6 +1928,12 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "dyn-clone" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545b22097d44f8a9581187cdf93de7a71e4722bf51200cfaba810865b49a495d" + [[package]] name = "dynasm" version = "1.2.3" @@ -1929,13 +1993,36 @@ 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 1.6.4", +] + [[package]] name = "ed25519" version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "signature", + "signature 2.2.0", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek 3.2.1", + "ed25519 1.5.3", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", ] [[package]] @@ -1944,10 +2031,10 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ - "curve25519-dalek", - "ed25519", + "curve25519-dalek 4.1.1", + "ed25519 2.2.3", "rand_core 0.6.4", - "sha2", + "sha2 0.10.6", "subtle", ] @@ -2123,7 +2210,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d81b511929c2669eaf64e36471cf27c2508133e62ade9d49e608e8d675e7854" dependencies = [ - "bitvec", + "bitvec 1.0.1", "dissimilar", "num-traits", "prefix-sum-vec", @@ -2145,6 +2232,9 @@ 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", ] @@ -2218,6 +2308,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2022715d62ab30faffd124d40b76f4134a550a87792276512b18d63272333394" +[[package]] +name = "funty" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" + [[package]] name = "funty" version = "2.0.0" @@ -2362,9 +2458,9 @@ dependencies = [ "clap", "csv", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-network", - "near-primitives", + "near-primitives 0.0.0", "nearcore", "serde", "serde_json", @@ -2380,9 +2476,9 @@ dependencies = [ "indicatif", "near-chain", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "near-test-contracts", "near-vm-runner", @@ -2739,6 +2835,26 @@ dependencies = [ "version_check", ] +[[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.103", +] + [[package]] name = "indexer-example" version = "0.0.0" @@ -2827,7 +2943,7 @@ dependencies = [ "near-chunks", "near-client", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-fmt", "near-jsonrpc", @@ -2836,8 +2952,8 @@ dependencies = [ "near-network", "near-o11y", "near-performance-metrics", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-stdx", "near-store", "near-telemetry", @@ -2851,6 +2967,7 @@ dependencies = [ "parking_lot 0.12.1", "primitive-types", "rand 0.8.5", + "rlp", "serde", "serde_json", "smart-default", @@ -2955,7 +3072,7 @@ name = "keypair-generator" version = "0.0.0" dependencies = [ "clap", - "near-crypto", + "near-crypto 0.0.0", "nearcore", ] @@ -3292,6 +3409,12 @@ 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.16" @@ -3368,14 +3491,14 @@ dependencies = [ "near-chain-configs", "near-chunks", "near-client", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-jsonrpc", "near-jsonrpc-client", "near-network", "near-o11y", "near-performance-metrics", - "near-primitives", + "near-primitives 0.0.0", "near-store", "near-telemetry", "nearcore", @@ -3419,6 +3542,28 @@ dependencies = [ "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 1.0.9", + "serde", +] + +[[package]] +name = "near-account-id" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d258582a1878e6db67400b0504a5099db85718d22c2e07f747fe1706ae7150" +dependencies = [ + "borsh 0.9.3", + "serde", +] + [[package]] name = "near-account-id" version = "1.0.0-alpha.4" @@ -3448,11 +3593,11 @@ dependencies = [ "clap", "near-chain", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-network", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-store", "near-test-contracts", "nearcore", @@ -3474,7 +3619,7 @@ dependencies = [ "futures", "near-o11y", "near-performance-metrics", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "serde", "serde_json", @@ -3511,14 +3656,14 @@ dependencies = [ "near-chain-configs", "near-chain-primitives", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-network", "near-o11y", "near-performance-metrics", "near-performance-metrics-macros", "near-pool", - "near-primitives", + "near-primitives 0.0.0", "near-store", "num-rational", "once_cell", @@ -3540,14 +3685,14 @@ dependencies = [ "chrono", "derive_more", "near-config-utils", - "near-crypto", + "near-crypto 0.0.0", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "num-rational", "once_cell", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "smart-default", "tracing", ] @@ -3557,8 +3702,8 @@ name = "near-chain-primitives" version = "0.0.0" dependencies = [ "chrono", - "near-crypto", - "near-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", "thiserror", "tracing", ] @@ -3580,14 +3725,14 @@ dependencies = [ "near-chain", "near-chain-configs", "near-chunks-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-network", "near-o11y", "near-performance-metrics", "near-performance-metrics-macros", "near-pool", - "near-primitives", + "near-primitives 0.0.0", "near-store", "once_cell", "rand 0.8.5", @@ -3602,7 +3747,7 @@ name = "near-chunks-primitives" version = "0.0.0" dependencies = [ "near-chain-primitives", - "near-primitives", + "near-primitives 0.0.0", ] [[package]] @@ -3628,7 +3773,7 @@ dependencies = [ "near-chain-primitives", "near-chunks", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-dyn-configs", "near-epoch-manager", "near-network", @@ -3636,7 +3781,7 @@ dependencies = [ "near-performance-metrics", "near-performance-metrics-macros", "near-pool", - "near-primitives", + "near-primitives 0.0.0", "near-store", "near-telemetry", "num-rational", @@ -3667,8 +3812,8 @@ dependencies = [ "near-chain-configs", "near-chain-primitives", "near-chunks-primitives", - "near-crypto", - "near-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", "serde", "serde_json", "strum", @@ -3695,12 +3840,12 @@ dependencies = [ "borsh 1.0.0", "bs58", "c2-chacha", - "curve25519-dalek", + "curve25519-dalek 4.1.1", "derive_more", - "ed25519-dalek", + "ed25519-dalek 2.1.0", "hex", "hex-literal", - "near-account-id", + "near-account-id 1.0.0-alpha.4", "near-config-utils", "near-stdx", "once_cell", @@ -3709,12 +3854,38 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "subtle", "tempfile", "thiserror", ] +[[package]] +name = "near-crypto" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e75673d69fd7365508f3d32483669fe45b03bfb34e4d9363e90adae9dfb416c" +dependencies = [ + "arrayref", + "blake2", + "borsh 0.9.3", + "bs58", + "c2-chacha", + "curve25519-dalek 3.2.1", + "derive_more", + "ed25519-dalek 1.0.1", + "near-account-id 0.14.0", + "once_cell", + "parity-secp256k1", + "primitive-types", + "rand 0.7.3", + "rand_core 0.5.1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + [[package]] name = "near-database-tool" version = "0.0.0" @@ -3726,7 +3897,7 @@ dependencies = [ "near-chain", "near-chain-configs", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "rand 0.8.5", @@ -3743,7 +3914,7 @@ dependencies = [ "anyhow", "near-chain-configs", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "prometheus", "serde", @@ -3763,8 +3934,8 @@ dependencies = [ "near-cache", "near-chain-configs", "near-chain-primitives", - "near-crypto", - "near-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", "near-store", "num-rational", "primitive-types", @@ -3784,7 +3955,7 @@ dependencies = [ "near-chain", "near-chain-configs", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "tracing", @@ -3800,7 +3971,7 @@ dependencies = [ "near-chain", "near-chain-configs", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "rayon", @@ -3812,7 +3983,7 @@ dependencies = [ name = "near-fmt" version = "0.0.0" dependencies = [ - "near-primitives-core", + "near-primitives-core 0.0.0", ] [[package]] @@ -3826,11 +3997,11 @@ dependencies = [ "hex", "near-chain", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-mirror", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "rayon", @@ -3850,11 +4021,11 @@ dependencies = [ "futures", "near-chain-configs", "near-client", - "near-crypto", + "near-crypto 0.0.0", "near-dyn-configs", "near-indexer-primitives", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "node-runtime", @@ -3870,7 +4041,7 @@ dependencies = [ name = "near-indexer-primitives" version = "0.0.0" dependencies = [ - "near-primitives", + "near-primitives 0.0.0", "serde", "serde_json", ] @@ -3894,8 +4065,8 @@ dependencies = [ "near-jsonrpc-primitives", "near-network", "near-o11y", - "near-primitives", - "near-rpc-error-macro", + "near-primitives 0.0.0", + "near-rpc-error-macro 0.0.0", "once_cell", "serde", "serde_json", @@ -3910,7 +4081,7 @@ name = "near-jsonrpc-adversarial-primitives" version = "0.0.0" dependencies = [ "near-network", - "near-primitives", + "near-primitives 0.0.0", "serde", ] @@ -3922,7 +4093,7 @@ dependencies = [ "awc", "futures", "near-jsonrpc-primitives", - "near-primitives", + "near-primitives 0.0.0", "serde", "serde_json", ] @@ -3938,7 +4109,7 @@ dependencies = [ "near-jsonrpc", "near-jsonrpc-primitives", "near-jsonrpc-tests", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "serde", "serde_json", @@ -3952,9 +4123,9 @@ dependencies = [ "arbitrary", "near-chain-configs", "near-client-primitives", - "near-crypto", - "near-primitives", - "near-rpc-error-macro", + "near-crypto 0.0.0", + "near-primitives 0.0.0", + "near-rpc-error-macro 0.0.0", "serde", "serde_json", "thiserror", @@ -3971,12 +4142,12 @@ dependencies = [ "near-actix-test-utils", "near-chain-configs", "near-client", - "near-crypto", + "near-crypto 0.0.0", "near-jsonrpc", "near-jsonrpc-primitives", "near-network", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "once_cell", "serde", @@ -3987,9 +4158,9 @@ dependencies = [ name = "near-mainnet-res" version = "0.0.0" dependencies = [ - "near-account-id", + "near-account-id 1.0.0-alpha.4", "near-chain-configs", - "near-primitives", + "near-primitives 0.0.0", "serde_json", ] @@ -4003,7 +4174,7 @@ dependencies = [ "borsh 1.0.0", "bs58", "clap", - "ed25519-dalek", + "ed25519-dalek 2.1.0", "hex", "hkdf", "near-chain", @@ -4011,14 +4182,14 @@ dependencies = [ "near-chain-primitives", "near-client", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-indexer", "near-indexer-primitives", "near-network", "near-o11y", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-store", "nearcore", "once_cell", @@ -4028,7 +4199,7 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "strum", "thiserror", "tokio", @@ -4057,12 +4228,12 @@ dependencies = [ "itertools", "lru", "near-async", - "near-crypto", + "near-crypto 0.0.0", "near-fmt", "near-o11y", "near-performance-metrics", "near-performance-metrics-macros", - "near-primitives", + "near-primitives 0.0.0", "near-stable-hasher", "near-store", "once_cell", @@ -4100,9 +4271,9 @@ dependencies = [ "bencher", "clap", "itoa", - "near-crypto", + "near-crypto 0.0.0", "near-fmt", - "near-primitives-core", + "near-primitives-core 0.0.0", "once_cell", "opentelemetry", "opentelemetry-otlp", @@ -4157,7 +4328,7 @@ dependencies = [ "near-jsonrpc", "near-network", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "prometheus", "tokio", @@ -4169,9 +4340,9 @@ name = "near-pool" version = "0.0.0" dependencies = [ "borsh 1.0.0", - "near-crypto", + "near-crypto 0.0.0", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "rand 0.8.5", ] @@ -4193,11 +4364,11 @@ dependencies = [ "enum-map", "hex", "insta", - "near-crypto", + "near-crypto 0.0.0", "near-fmt", "near-o11y", - "near-primitives-core", - "near-rpc-error-macro", + "near-primitives-core 0.0.0", + "near-rpc-error-macro 0.0.0", "near-stdx", "near-vm-runner", "num-rational", @@ -4218,6 +4389,35 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-primitives" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ad1a9a1640539c81f065425c31bffcfbf6b31ef1aeaade59ce905f5df6ac860" +dependencies = [ + "borsh 0.9.3", + "byteorder", + "bytesize", + "chrono", + "derive_more", + "easy-ext", + "hex", + "near-crypto 0.14.0", + "near-primitives-core 0.14.0", + "near-rpc-error-macro 0.14.0", + "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.0.0" @@ -4229,17 +4429,34 @@ dependencies = [ "derive_more", "enum-map", "insta", - "near-account-id", + "near-account-id 1.0.0-alpha.4", "num-rational", "serde", "serde_json", "serde_repr", "serde_with", - "sha2", + "sha2 0.10.6", "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 0.9.3", + "bs58", + "derive_more", + "near-account-id 0.14.0", + "num-rational", + "serde", + "sha2 0.10.6", + "strum", +] + [[package]] name = "near-rosetta-rpc" version = "0.0.0" @@ -4253,15 +4470,15 @@ dependencies = [ "futures", "hex", "insta", - "near-account-id", + "near-account-id 1.0.0-alpha.4", "near-actix-test-utils", "near-chain-configs", "near-client", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-network", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "node-runtime", "paperclip", "serde", @@ -4282,17 +4499,74 @@ dependencies = [ "syn 2.0.32", ] +[[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.103", +] + [[package]] name = "near-rpc-error-macro" version = "0.0.0" dependencies = [ "fs2", - "near-rpc-error-core", + "near-rpc-error-core 0.0.0", "serde", "serde_json", "syn 2.0.32", ] +[[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 0.14.0", + "serde", + "syn 1.0.103", +] + +[[package]] +name = "near-sdk" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15eb3de2defe3626260cc209a6cdb985c6b27b0bd4619fad97dcfae002c3c5bd" +dependencies = [ + "base64 0.13.0", + "borsh 0.9.3", + "bs58", + "near-abi", + "near-crypto 0.14.0", + "near-primitives 0.14.0", + "near-primitives-core 0.14.0", + "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.103", +] + [[package]] name = "near-stable-hasher" version = "0.0.0" @@ -4309,9 +4583,9 @@ dependencies = [ "near-network", "near-o11y", "near-ping", - "near-primitives", + "near-primitives 0.0.0", "once_cell", - "sha2", + "sha2 0.10.6", "tokio", "tracing", ] @@ -4329,8 +4603,8 @@ dependencies = [ "near-client", "near-jsonrpc", "near-o11y", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-store", "nearcore", "once_cell", @@ -4367,10 +4641,10 @@ dependencies = [ "near-chain", "near-chain-configs", "near-chunks", - "near-crypto", + "near-crypto 0.0.0", "near-fmt", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-stdx", "near-vm-runner", "num_cpus", @@ -4388,6 +4662,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397688591acf8d3ebf2c2485ba32d4b24fc10aad5334e3ad8ec0b7179bfdf06b" + [[package]] name = "near-telemetry" version = "0.0.0" @@ -4398,7 +4678,7 @@ dependencies = [ "near-o11y", "near-performance-metrics", "near-performance-metrics-macros", - "near-primitives", + "near-primitives 0.0.0", "once_cell", "openssl", "serde", @@ -4428,7 +4708,7 @@ dependencies = [ "near-chain", "near-chain-configs", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "tracing", @@ -4508,6 +4788,40 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-vm-errors" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0da466a30f0446639cbd788c30865086fac3e8dcb07a79e51d2b0775ed4261e" +dependencies = [ + "borsh 0.9.3", + "near-account-id 0.14.0", + "near-rpc-error-macro 0.14.0", + "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.0", + "borsh 0.9.3", + "bs58", + "byteorder", + "near-account-id 0.14.0", + "near-crypto 0.14.0", + "near-primitives 0.14.0", + "near-primitives-core 0.14.0", + "near-vm-errors", + "ripemd", + "serde", + "sha2 0.10.6", + "sha3", + "zeropool-bn", +] + [[package]] name = "near-vm-runner" version = "0.0.0" @@ -4519,16 +4833,16 @@ dependencies = [ "bolero", "borsh 1.0.0", "clap", - "ed25519-dalek", + "ed25519-dalek 2.1.0", "enum-map", "expect-test", "finite-wasm", "hex", "loupe", "memoffset 0.8.0", - "near-crypto", - "near-primitives", - "near-primitives-core", + "near-crypto 0.0.0", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-stdx", "near-test-contracts", "near-vm-compiler", @@ -4549,7 +4863,7 @@ dependencies = [ "serde_json", "serde_repr", "serde_with", - "sha2", + "sha2 0.10.6", "sha3", "strum", "thiserror", @@ -4577,7 +4891,7 @@ version = "0.0.0" dependencies = [ "arbitrary", "libfuzzer-sys", - "near-primitives", + "near-primitives 0.0.0", "near-test-contracts", "near-vm-runner", "wasm-smith", @@ -4702,7 +5016,7 @@ dependencies = [ "near-client", "near-client-primitives", "near-config-utils", - "near-crypto", + "near-crypto 0.0.0", "near-dyn-configs", "near-epoch-manager", "near-jsonrpc", @@ -4712,7 +5026,7 @@ dependencies = [ "near-o11y", "near-performance-metrics", "near-pool", - "near-primitives", + "near-primitives 0.0.0", "near-rosetta-rpc", "near-store", "near-telemetry", @@ -4753,7 +5067,7 @@ dependencies = [ "near-chain-configs", "near-client", "near-config-utils", - "near-crypto", + "near-crypto 0.0.0", "near-database-tool", "near-dyn-configs", "near-epoch-sync-tool", @@ -4765,7 +5079,7 @@ dependencies = [ "near-o11y", "near-performance-metrics", "near-ping", - "near-primitives", + "near-primitives 0.0.0", "near-state-parts", "near-state-parts-dump-check", "near-store", @@ -4823,10 +5137,10 @@ dependencies = [ "hex", "indicatif", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-o11y", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-store", "near-test-contracts", "near-vm-runner", @@ -4839,7 +5153,7 @@ dependencies = [ "rayon", "serde", "serde_json", - "sha2", + "sha2 0.10.6", "tempfile", "testlib", "thiserror", @@ -5185,6 +5499,44 @@ dependencies = [ "syn 1.0.103", ] +[[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 0.20.4", + "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.103", +] + +[[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 = "parity-wasm" version = "0.41.0" @@ -5416,6 +5768,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" dependencies = [ "fixed-hash", + "impl-codec", "uint", ] @@ -5651,6 +6004,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" + [[package]] name = "radium" version = "0.7.0" @@ -5942,10 +6301,10 @@ version = "0.0.0" dependencies = [ "clap", "integration-tests", - "near-crypto", + "near-crypto 0.0.0", "near-jsonrpc-client", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "nearcore", "tokio", ] @@ -6008,6 +6367,15 @@ dependencies = [ "libc", ] +[[package]] +name = "rlp" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1190dcc8c3a512f1eef5d09bb8c84c7f39e1054e174d1795482e18f5272f2e73" +dependencies = [ + "rustc-hex", +] + [[package]] name = "rocksdb" version = "0.21.0" @@ -6036,10 +6404,10 @@ dependencies = [ "insta", "libc", "near-chain-configs", - "near-crypto", + "near-crypto 0.0.0", "near-fmt", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "near-test-contracts", "near-vm-runner", @@ -6069,10 +6437,10 @@ dependencies = [ "near-chain-configs", "near-client", "near-client-primitives", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "near-test-contracts", "nearcore", @@ -6141,7 +6509,7 @@ dependencies = [ "serde", "serde-xml-rs", "serde_derive", - "sha2", + "sha2 0.10.6", "thiserror", "time", "tokio", @@ -6276,6 +6644,30 @@ dependencies = [ "winapi", ] +[[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.103", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -6411,6 +6803,17 @@ dependencies = [ "syn 2.0.32", ] +[[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.103", +] + [[package]] name = "serde_ignored" version = "0.1.3" @@ -6535,6 +6938,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" @@ -6607,6 +7023,12 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + [[package]] name = "signature" version = "2.2.0" @@ -6709,7 +7131,7 @@ dependencies = [ "near-chain-configs", "near-chain-primitives", "near-epoch-manager", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "serde", @@ -6750,12 +7172,12 @@ dependencies = [ "near-chain", "near-chain-configs", "near-client", - "near-crypto", + "near-crypto 0.0.0", "near-epoch-manager", "near-network", "near-o11y", - "near-primitives", - "near-primitives-core", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", "near-store", "near-test-contracts", "nearcore", @@ -6790,7 +7212,7 @@ dependencies = [ "anyhow", "near-chain-configs", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "node-runtime", "serde_json", @@ -6808,7 +7230,7 @@ dependencies = [ "near-client", "near-epoch-manager", "near-o11y", - "near-primitives", + "near-primitives 0.0.0", "near-store", "nearcore", "serde_json", @@ -6979,8 +7401,8 @@ version = "0.0.0" dependencies = [ "near-chain", "near-chain-configs", - "near-crypto", - "near-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", "near-test-contracts", "node-runtime", "once_cell", @@ -7628,6 +8050,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wallet-contract" +version = "0.0.0" +dependencies = [ + "hex", + "near-sdk", + "rlp", + "serde_json", +] + [[package]] name = "want" version = "0.3.0" @@ -8255,6 +8687,18 @@ dependencies = [ "winapi", ] +[[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.2.5" @@ -8520,6 +8964,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "wyz" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" + [[package]] name = "wyz" version = "0.5.1" @@ -8596,9 +9046,23 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +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 = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.32", +] [[package]] name = "zeropool-bn" @@ -8606,6 +9070,7 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" dependencies = [ + "borsh 0.9.3", "byteorder", "crunchy", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index 94d3545128d..ea775484359 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,6 +59,8 @@ members = [ "runtime/near-vm/compiler-test-derive", "runtime/near-vm-runner", "runtime/near-vm-runner/fuzz", + "runtime/near-wallet-contract", + "runtime/near-wallet-contract/wallet-contract", "runtime/runtime", "runtime/runtime-params-estimator", "runtime/runtime-params-estimator/estimator-warehouse", @@ -227,6 +229,7 @@ near-primitives-core = { path = "core/primitives-core" } near-rosetta-rpc = { path = "chain/rosetta-rpc" } near-rpc-error-core = { path = "tools/rpctypegen/core" } near-rpc-error-macro = { path = "tools/rpctypegen/macro" } +near-sdk = "4.1.1" near-stable-hasher = { path = "utils/near-stable-hasher" } near-state-parts = { path = "tools/state-parts" } near-state-parts-dump-check = { path = "tools/state-parts-dump-check" } @@ -288,6 +291,7 @@ reqwest = { version = "0.11.14", features = ["blocking"] } ripemd = "0.1.1" rkyv = "0.7.31" rlimit = "0.7" +rlp = "0.4.6" rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "jemalloc"] } runtime-tester = { path = "test-utils/runtime-tester" } rusqlite = { version = "0.29.0", features = ["bundled", "chrono", "functions"] } diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 8bc7f68e47e..254e0b49f4f 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -25,6 +25,7 @@ once_cell.workspace = true parking_lot.workspace = true primitive-types.workspace = true rand.workspace = true +rlp.workspace = true serde.workspace = true serde_json.workspace = true smart-default.workspace = true diff --git a/integration-tests/src/tests/client/features/delegate_action.rs b/integration-tests/src/tests/client/features/delegate_action.rs index 920ae6009aa..00ba2993515 100644 --- a/integration-tests/src/tests/client/features/delegate_action.rs +++ b/integration-tests/src/tests/client/features/delegate_action.rs @@ -8,15 +8,15 @@ use crate::tests::standard_cases::fee_helper; use near_chain::ChainGenesis; use near_chain_configs::Genesis; use near_client::test_utils::TestEnv; -use near_crypto::{KeyType, PublicKey, Signer}; +use near_crypto::{KeyType, PublicKey, SecretKey, Signer}; use near_primitives::account::{ id::AccountType, AccessKey, AccessKeyPermission, FunctionCallPermission, }; use near_primitives::checked_feature; use near_primitives::config::ActionCosts; use near_primitives::errors::{ - ActionError, ActionErrorKind, ActionsValidationError, InvalidAccessKeyError, InvalidTxError, - TxExecutionError, + ActionError, ActionErrorKind, ActionsValidationError, FunctionCallError, InvalidAccessKeyError, + InvalidTxError, TxExecutionError, }; use near_primitives::test_utils::{ create_user_test_signer, eth_implicit_test_account, near_implicit_test_account, @@ -26,6 +26,7 @@ use near_primitives::transaction::{ DeployContractAction, FunctionCallAction, StakeAction, TransferAction, }; use near_primitives::types::{AccountId, Balance}; +use near_primitives::utils::derive_eth_implicit_account_id; use near_primitives::version::{ProtocolFeature, ProtocolVersion, PROTOCOL_VERSION}; use near_primitives::views::{ AccessKeyPermissionView, ExecutionStatusView, FinalExecutionOutcomeView, FinalExecutionStatus, @@ -34,6 +35,7 @@ use near_test_contracts::{ft_contract, smallest_rs_contract}; use nearcore::config::GenesisExt; use nearcore::test_utils::TestEnvNightshadeSetupExt; use nearcore::NEAR_BASE; +use rlp::RlpStream; use testlib::runtime_utils::{ add_account_with_access_key, add_contract, add_test_contract, alice_account, bob_account, carol_account, eve_dot_alice_account, @@ -945,3 +947,74 @@ fn meta_tx_create_eth_implicit_account() { } meta_tx_create_implicit_account(eth_implicit_test_account()); } + +fn meta_tx_call_wallet_contract(authorized: bool) { + let genesis = Genesis::test(vec![alice_account(), bob_account(), carol_account()], 3); + let relayer = alice_account(); + let node = RuntimeNode::new_from_genesis(&relayer, genesis); + let sender = bob_account(); + + 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(); + + let initial_amount = 50 * NEAR_BASE; + let actions = vec![Action::Transfer(TransferAction { deposit: initial_amount })]; + node.user() + .meta_tx(sender.clone(), eth_implicit_account.clone(), relayer.clone(), actions) + .unwrap() + .assert_success(); + + let target = carol_account(); + let transfer_amount = NEAR_BASE; + let initial_balance = node.view_balance(&target).expect("failed looking up balance"); + + let mut stream = RlpStream::new_list(3); + stream.append(&target.as_str()); + // The RLP trait `Encodable` is not implemented for `u128`. + 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(); + + let args = serde_json::json!({ + "target": target.to_string(), + "rlp_transaction": rlp_encoded_data, + }) + .to_string() + .into_bytes(); + + let actions = vec![Action::FunctionCall(Box::new(FunctionCallAction { + method_name: "execute_rlp".to_owned(), + args, + gas: 30_000_000_000_000, + deposit: 0, + }))]; + let tx_result = node.user().meta_tx(sender, eth_implicit_account, relayer, actions).unwrap(); + let wallet_contract_call_result = &tx_result.receipts_outcome[1].outcome.status; + + if authorized { + tx_result.assert_success(); + let final_balance = node.view_balance(&target).expect("failed looking up balance"); + assert_eq!(final_balance, initial_balance + transfer_amount); + } else { + 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); + } +} + +#[test] +fn meta_tx_call_wallet_contract_authorized() { + meta_tx_call_wallet_contract(true); +} + +#[test] +fn meta_tx_call_wallet_contract_unauthorized() { + meta_tx_call_wallet_contract(false); +} diff --git a/integration-tests/src/tests/standard_cases/mod.rs b/integration-tests/src/tests/standard_cases/mod.rs index e358f8294a9..1483f882a69 100644 --- a/integration-tests/src/tests/standard_cases/mod.rs +++ b/integration-tests/src/tests/standard_cases/mod.rs @@ -330,7 +330,7 @@ pub fn test_send_money(node: impl Node) { ); } -pub fn transfer_tokens_implicit_account(node: impl Node, public_key: PublicKey) { +pub fn transfer_tokens_to_implicit_account(node: impl Node, public_key: PublicKey) { let account_id = &node.account_id().unwrap(); let node_user = node.user(); let root = node_user.get_state_root(); diff --git a/integration-tests/src/tests/standard_cases/runtime.rs b/integration-tests/src/tests/standard_cases/runtime.rs index c939a0b0e14..3fa8e5d8e68 100644 --- a/integration-tests/src/tests/standard_cases/runtime.rs +++ b/integration-tests/src/tests/standard_cases/runtime.rs @@ -120,7 +120,7 @@ fn test_send_money_runtime() { fn test_transfer_tokens_near_implicit_account_runtime() { let node = create_runtime_node(); let public_key = node.user().signer().public_key(); - transfer_tokens_implicit_account(node, public_key); + transfer_tokens_to_implicit_account(node, public_key); } #[test] @@ -130,7 +130,7 @@ fn test_transfer_tokens_eth_implicit_account_runtime() { } let node = create_runtime_node(); let secret_key = SecretKey::from_seed(KeyType::SECP256K1, "test"); - transfer_tokens_implicit_account(node, secret_key.public_key()); + transfer_tokens_to_implicit_account(node, secret_key.public_key()); } #[test] diff --git a/runtime/near-vm/tests/lib/compiler-test-derive/src/lib.rs.orig b/runtime/near-vm/tests/lib/compiler-test-derive/src/lib.rs.orig index aa50ac8a040..f858e180615 100644 --- a/runtime/near-vm/tests/lib/compiler-test-derive/src/lib.rs.orig +++ b/runtime/near-vm/tests/lib/compiler-test-derive/src/lib.rs.orig @@ -1,8 +1,5 @@ -<<<<<<< HEAD -======= #[cfg(not(test))] extern crate proc_macro; ->>>>>>> 27e96cad2 (compiler-test-derive: Switch to proc_macro exclusively) use proc_macro::TokenStream; use quote::quote; use std::path::PathBuf; diff --git a/runtime/near-wallet-contract/Cargo.toml b/runtime/near-wallet-contract/Cargo.toml index 23c6745f00b..ff2dae083bc 100644 --- a/runtime/near-wallet-contract/Cargo.toml +++ b/runtime/near-wallet-contract/Cargo.toml @@ -4,7 +4,7 @@ version.workspace = true authors.workspace = true edition.workspace = true rust-version.workspace = true -description = "A temporary Wallet Contract placeholder." +description = "Builds and exposes a temporary Wallet Contract wasm file." repository.workspace = true license.workspace = true publish = false diff --git a/runtime/near-wallet-contract/LICENSE-APACHE b/runtime/near-wallet-contract/LICENSE-APACHE deleted file mode 120000 index 0eb30ff1b50..00000000000 --- a/runtime/near-wallet-contract/LICENSE-APACHE +++ /dev/null @@ -1 +0,0 @@ -../../licenses/LICENSE-APACHE \ No newline at end of file diff --git a/runtime/near-wallet-contract/LICENSE-MIT b/runtime/near-wallet-contract/LICENSE-MIT deleted file mode 120000 index df3ae884029..00000000000 --- a/runtime/near-wallet-contract/LICENSE-MIT +++ /dev/null @@ -1 +0,0 @@ -../../licenses/LICENSE-MIT \ No newline at end of file diff --git a/runtime/near-wallet-contract/README.md b/runtime/near-wallet-contract/README.md index c1d765bd982..ef1993baa23 100644 --- a/runtime/near-wallet-contract/README.md +++ b/runtime/near-wallet-contract/README.md @@ -6,7 +6,6 @@ Must not use in production! To use the contract you need to make sure that this crate was compiled. The contract is built via `build.rs` and WASM file is generated to the `./res` directory. -You might want to `touch build.rs` before `cargo build` to force cargo to generate the WASM file. If you want to use the contract from rust core, add diff --git a/runtime/near-wallet-contract/build.rs b/runtime/near-wallet-contract/build.rs index b437f93c5f4..94559c185c5 100644 --- a/runtime/near-wallet-contract/build.rs +++ b/runtime/near-wallet-contract/build.rs @@ -10,12 +10,8 @@ fn main() { } fn try_main() -> Result<(), Error> { - build_contract("./wallet-contract", &["--features", "latest_protocol"], "wallet_contract")?; - build_contract( - "./wallet-contract", - &["--features", "latest_protocol,nightly"], - "nightly_wallet_contract", - )?; + build_contract("./wallet-contract", &[], "wallet_contract")?; + build_contract("./wallet-contract", &["--features", "nightly"], "nightly_wallet_contract")?; Ok(()) } diff --git a/runtime/near-wallet-contract/res/nightly_wallet_contract.wasm b/runtime/near-wallet-contract/res/nightly_wallet_contract.wasm index 55eaf301197..32b2a0c5eff 100755 Binary files a/runtime/near-wallet-contract/res/nightly_wallet_contract.wasm and b/runtime/near-wallet-contract/res/nightly_wallet_contract.wasm differ diff --git a/runtime/near-wallet-contract/res/wallet_contract.wasm b/runtime/near-wallet-contract/res/wallet_contract.wasm index 2d543deef9b..b13371acede 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 da8e6da6d49..00000000000 --- a/runtime/near-wallet-contract/wallet-contract/Cargo.lock +++ /dev/null @@ -1,1525 +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 = "base64" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[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 = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" - -[[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.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[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 = "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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" - -[[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.62" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" -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 = [ - "base64 0.21.0", - "near-sdk", - "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.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" -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 index 71b037f5c6a..46d3bcc4a17 100644 --- a/runtime/near-wallet-contract/wallet-contract/Cargo.toml +++ b/runtime/near-wallet-contract/wallet-contract/Cargo.toml @@ -1,33 +1,25 @@ [package] name = "wallet-contract" -version = "0.1.0" -authors = ["Near Inc "] +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +description = "A placeholder implementation of the Wallet Contract." +repository.workspace = true +license.workspace = true publish = false -edition = "2021" + +[lints] +workspace = true [lib] crate-type = ["cdylib"] [dependencies] -base64 = "0.21" -serde_json = "1" -near-sdk = "4.1.1" - -[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 - -[workspace] -members = [] +hex.workspace = true +serde_json.workspace = true +near-sdk.workspace = true +rlp.workspace = true [features] nightly = [] -latest_protocol = [] diff --git a/runtime/near-wallet-contract/wallet-contract/src/lib.rs b/runtime/near-wallet-contract/wallet-contract/src/lib.rs index aced207aadf..3954e1ff523 100644 --- a/runtime/near-wallet-contract/wallet-contract/src/lib.rs +++ b/runtime/near-wallet-contract/wallet-contract/src/lib.rs @@ -1,18 +1,50 @@ //! 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::{near_bindgen, AccountId, Promise, Balance}; +use near_sdk::{env, near_bindgen, AccountId, Promise}; +use rlp::Rlp; #[near_bindgen] #[derive(Default, BorshDeserialize, BorshSerialize)] -pub struct WalletContract { } +pub struct WalletContract {} #[near_bindgen] impl WalletContract { - pub fn transfer(&self, to: AccountId, amount: Balance){ - Promise::new(to).transfer(amount); - } + 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` equals the 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); + } } diff --git a/runtime/runtime/src/actions.rs b/runtime/runtime/src/actions.rs index 7d311601b9a..84cee3e3a15 100644 --- a/runtime/runtime/src/actions.rs +++ b/runtime/runtime/src/actions.rs @@ -759,7 +759,7 @@ fn receipt_required_gas(apply_state: &ApplyState, receipt: &Receipt) -> Result