diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 93626195..1fa32c3a 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -34,7 +34,7 @@ jobs: - uses: OffchainLabs/actions/run-nitro-test-node@main with: - nitro-testnode-ref: stylus + nitro-testnode-ref: release no-token-bridge: true # no-simple must be false for now as our nitro testnode branch doesn't have that option no-simple: false diff --git a/Cargo.lock b/Cargo.lock index d1ea6f9b..51f33046 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "aho-corasick" @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "bytes", "cfg-if", @@ -23,62 +23,63 @@ dependencies = [ "derive_more", "hex-literal", "itoa", + "paste", "ruint", "tiny-keccak", ] [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", "indexmap", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", "syn-solidity", ] [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ "alloy-primitives", "alloy-sol-macro", @@ -87,9 +88,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" @@ -113,32 +114,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] -name = "bytes" -version = "1.6.0" +name = "byteorder" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "bytes" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] -name = "console_error_panic_hook" -version = "0.1.7" +name = "cc" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ - "cfg-if", - "wasm-bindgen", + "shlex", ] +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -147,12 +153,6 @@ dependencies = [ "serde", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -164,9 +164,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -200,17 +200,31 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version", - "syn 2.0.68", + "syn 2.0.90", + "unicode-xid", ] +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + [[package]] name = "digest" version = "0.10.7" @@ -223,9 +237,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "equivalent" @@ -243,11 +257,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -269,9 +289,9 @@ checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", @@ -279,16 +299,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -315,15 +336,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "log" @@ -339,12 +360,22 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mini-alloc" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "cfg-if", "wasm-bindgen-test", ] +[[package]] +name = "minicov" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27fe9f1cc3c22e1687f9446c2083c4c5fc7f0bcf1c7a86bdbded14985895b4b" +dependencies = [ + "cc", + "walkdir", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -357,9 +388,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "paste" @@ -369,9 +400,32 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.90", +] [[package]] name = "proc-macro-error" @@ -397,11 +451,33 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -422,9 +498,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -465,9 +541,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -477,9 +553,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -488,9 +564,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "ruint" @@ -513,12 +589,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "ryu" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "semver", + "winapi-util", ] [[package]] @@ -527,30 +609,45 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", ] [[package]] @@ -563,26 +660,38 @@ dependencies = [ "keccak", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "stylus-proc" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", "cfg-if", - "convert_case 0.6.0", + "convert_case", "lazy_static", + "paste", + "pretty_assertions", + "prettyplease", + "proc-macro-error", "proc-macro2", "quote", "regex", "sha3", - "syn 1.0.109", + "stylus-sdk", + "syn 2.0.90", "syn-solidity", + "trybuild", ] [[package]] name = "stylus-sdk" -version = "0.6.0" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -611,9 +720,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -622,14 +731,29 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", +] + +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", ] [[package]] @@ -641,6 +765,55 @@ dependencies = [ "crunchy", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml", +] + [[package]] name = "typenum" version = "1.17.0" @@ -655,15 +828,21 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "valuable" @@ -673,52 +852,63 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -726,31 +916,31 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-bindgen-test" -version = "0.3.42" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf62a58e0780af3e852044583deee40983e5886da43a271dd772379987667b" +checksum = "c61d44563646eb934577f2772656c7ad5e9c90fac78aa8013d776fcdaf24625d" dependencies = [ - "console_error_panic_hook", "js-sys", + "minicov", "scoped-tls", "wasm-bindgen", "wasm-bindgen-futures", @@ -759,25 +949,143 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.42" +version = "0.3.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f89739351a2e03cb94beb799d47fb2cac01759b40ec441f7de39b00cbf7ef0" +checksum = "54171416ce73aa0b9c377b51cc3cb542becee1cd678204812e8392e5b0e4a031" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.90", ] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + +[[package]] +name = "yansi" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zeroize" version = "1.8.1" diff --git a/Cargo.toml b/Cargo.toml index 0e6c31bf..4f477984 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = ["stylus-sdk", "stylus-proc", "mini-alloc"] resolver = "2" [workspace.package] -version = "0.6.0" +version = "0.7.0-rc.1" edition = "2021" authors = ["Offchain Labs"] license = "MIT OR Apache-2.0" @@ -12,25 +12,32 @@ repository = "https://github.com/OffchainLabs/stylus-sdk-rs" rust-version = "1.71.0" [workspace.dependencies] -alloy-primitives = { version = "=0.7.6", default-features = false , features = ["native-keccak"] } -alloy-sol-types = { version = "=0.7.6", default-features = false } +alloy-primitives = { version = "=0.8.13", default-features = false , features = ["native-keccak"] } +alloy-sol-types = { version = "=0.8.13", default-features = false } cfg-if = "1.0.0" derivative = { version = "2.2.0", features = ["use_core"] } hex = { version = "0.4.3", default-features = false, features = ["alloc"] } keccak-const = "0.2.0" -lazy_static = "1.4.0" +lazy_static = "1.5.0" sha3 = "0.10.8" # proc macros -syn = { version = "1.0", features = ["full"] } -paste = "1.0.14" -quote = "1.0" -regex = "1.9.1" -proc-macro2 = "1.0" -syn-solidity = "0.7.6" convert_case = "0.6.0" +paste = "1.0.15" +proc-macro-error = "1.0" +proc-macro2 = "1.0" +quote = "1.0" +regex = "1.10.6" +syn = { version = "2.0.77", features = ["full", "visit-mut"] } +syn-solidity = "0.8.3" + +# proc macro dev +pretty_assertions = "1.4.1" +prettyplease = "0.2.22" + +trybuild = "1.0" # members -mini-alloc = { path = "mini-alloc", version = "0.6.0" } +mini-alloc = { path = "mini-alloc", version = "0.7.0-rc.1" } stylus-sdk = { path = "stylus-sdk" } -stylus-proc = { path = "stylus-proc", version = "0.6.0" } +stylus-proc = { path = "stylus-proc", version = "0.7.0-rc.1" } diff --git a/README.md b/README.md index a9f98819..1065f667 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@

The Stylus SDK

- Rust contracts on Arbitrum » + Rust contracts on Arbitrum »

@@ -16,7 +16,7 @@ The Stylus SDK enables smart contract developers to write programs for **Arbitrum chains** written in the [Rust](https://www.rust-lang.org/tools/install) programming language. Stylus programs are compiled to [WebAssembly](https://webassembly.org/) and can then be deployed on-chain to execute alongside Solidity smart contracts. Stylus programs are not only orders of magnitude cheaper and faster but also enable what was thought to be previously impossible for WebAssembly: **EVM-interoperability**. -For information about deploying Rust smart contracts, see the [Cargo Stylus CLI Tool](https://github.com/OffchainLabs/cargo-stylus). For more information about Stylus, see [Stylus: A Gentle Introduction](https://docs.arbitrum.io/stylus/stylus-gentle-introduction). For a simpler intro to Stylus Rust development, see the [Quick Start guide](https://docs.arbitrum.io/stylus/stylus-quickstart). +For information about deploying Rust smart contracts, see the [Cargo Stylus CLI Tool](https://github.com/OffchainLabs/cargo-stylus). For more information about Stylus, see [Stylus: A Gentle Introduction](https://docs.arbitrum.io/stylus/gentle-introduction). For a simpler intro to Stylus Rust development, see the [Quick Start guide](https://docs.arbitrum.io/stylus/quickstart). Comprehensive documentation on the Rust SDK can be found [here](https://docs.arbitrum.io/stylus/rust-sdk-guide). diff --git a/ci/smoke_test.sh b/ci/smoke_test.sh index 5c28f751..fc90590a 100755 --- a/ci/smoke_test.sh +++ b/ci/smoke_test.sh @@ -11,4 +11,6 @@ cargo stylus new counter cd counter echo "[workspace]" >> Cargo.toml -cargo stylus deploy --private-key $PRIV_KEY -e https://stylus-testnet.arbitrum.io/rpc +# Use the nitro testnode private key found from the public mnemonic +# https://github.com/OffchainLabs/nitro-testnode/blob/5986e62e8fc8672858baf0550443991adc23f9c2/scripts/consts.ts#L6 +cargo stylus deploy --private-key 0xb6b15c8cb491557369f3c7d2c287b053eb229daa9c22138887752191c9520659 -e http://localhost:8547 diff --git a/examples/erc20/Cargo.lock b/examples/erc20/Cargo.lock index 2b203bf3..334a949c 100644 --- a/examples/erc20/Cargo.lock +++ b/examples/erc20/Cargo.lock @@ -11,33 +11,51 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloy-json-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "alloy-rlp", "bytes", "cfg-if", "const-hex", "derive_more", + "foldhash", + "hashbrown", "hex-literal", + "indexmap", "itoa", "k256", "keccak-asm", + "paste", "proptest", "rand", "ruint", + "rustc-hash", "serde", + "sha3", "tiny-keccak", ] [[package]] name = "alloy-rlp" -version = "0.3.7" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a43b18702501396fa9bcdeecd533bc85fac75150d308fc0f6800a01e6234a003" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "arrayvec", "bytes", @@ -45,57 +63,68 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", "indexmap", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", "syn-solidity", ] +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce13ff37285b0870d0a0746992a4ae48efaf34b766ae4c2640fa15e5305f8e73" +dependencies = [ + "serde", + "winnow", +] + [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ + "alloy-json-abi", "alloy-primitives", "alloy-sol-macro", "const-hex", @@ -136,7 +165,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -228,9 +257,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "auto_impl" @@ -240,14 +269,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base16ct" @@ -317,15 +346,21 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +dependencies = [ + "serde", +] [[package]] name = "cc" -version = "1.0.104" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -335,9 +370,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -352,12 +387,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -369,9 +398,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -427,15 +456,23 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.18" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 2.0.58", + "syn 2.0.90", + "unicode-xid", ] [[package]] @@ -461,9 +498,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -522,9 +559,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys", @@ -532,9 +569,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -547,6 +584,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" @@ -575,6 +623,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "funty" version = "2.0.0" @@ -603,6 +657,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -616,9 +676,13 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", + "serde", +] [[package]] name = "heck" @@ -631,6 +695,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -658,23 +725,24 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -688,15 +756,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -716,9 +784,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -738,15 +806,15 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" @@ -762,7 +830,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mini-alloc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "cfg-if", ] @@ -798,9 +866,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "parity-scale-codec" @@ -836,9 +904,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", "thiserror", @@ -857,9 +925,12 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primitive-types" @@ -874,9 +945,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -905,11 +976,33 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -942,9 +1035,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -964,6 +1057,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -996,9 +1090,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1008,9 +1102,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1019,9 +1113,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rfc6979" @@ -1045,16 +1139,18 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", + "fastrlp 0.3.1", + "fastrlp 0.4.0", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -1073,6 +1169,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -1090,18 +1192,18 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", @@ -1122,6 +1224,12 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "sec1" version = "0.7.3" @@ -1147,37 +1255,58 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "semver-parser" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" dependencies = [ "pest", ] [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", ] [[package]] @@ -1203,14 +1332,20 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" version = "2.2.0" @@ -1239,24 +1374,26 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stylus-proc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", "cfg-if", - "convert_case 0.6.0", + "convert_case", "lazy_static", + "proc-macro-error", "proc-macro2", "quote", "regex", "sha3", - "syn 1.0.109", + "syn 2.0.90", "syn-solidity", + "trybuild", ] [[package]] name = "stylus-sdk" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -1289,9 +1426,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1300,14 +1437,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] @@ -1316,36 +1453,52 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] @@ -1357,23 +1510,55 @@ dependencies = [ "crunchy", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1382,9 +1567,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -1406,15 +1591,21 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "valuable" @@ -1424,9 +1615,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -1443,11 +1634,20 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] @@ -1518,9 +1718,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1534,6 +1734,27 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -1551,5 +1772,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] diff --git a/examples/erc20/Cargo.toml b/examples/erc20/Cargo.toml index 20c3a336..9a306e20 100644 --- a/examples/erc20/Cargo.toml +++ b/examples/erc20/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy-primitives = "0.7.6" -alloy-sol-types = "0.7.6" +alloy-primitives = "=0.8.13" +alloy-sol-types = "=0.8.13" stylus-sdk = { path = "../../stylus-sdk" } mini-alloc = { path = "../../mini-alloc" } diff --git a/examples/erc20/rust-toolchain.toml b/examples/erc20/rust-toolchain.toml index 4d2dee85..1de01fa4 100644 --- a/examples/erc20/rust-toolchain.toml +++ b/examples/erc20/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" diff --git a/examples/erc20/scripts/yarn.lock b/examples/erc20/scripts/yarn.lock index e1f26a8d..907410d4 100644 --- a/examples/erc20/scripts/yarn.lock +++ b/examples/erc20/scripts/yarn.lock @@ -4,39 +4,39 @@ "@adraffy/ens-normalize@1.10.1": version "1.10.1" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz" integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== "@noble/curves@1.2.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: "@noble/hashes" "1.3.2" "@noble/hashes@1.3.2": version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== "@types/node@18.15.13": version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + resolved "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== aes-js@4.0.0-beta.5: version "4.0.0-beta.5" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + resolved "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz" integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== dotenv@^16.4.5: version "16.4.5" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== ethers@^6.13.0: version "6.13.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.0.tgz#f342958d0f622cf06559f59fbccdc1d30fa64f50" + resolved "https://registry.npmjs.org/ethers/-/ethers-6.13.0.tgz" integrity sha512-+yyQQQWEntY5UVbCv++guA14RRVFm1rSnO1GoLFdrK7/XRWMoktNgyG9UjwxrQqGBfGyFKknNZ81YpUS2emCgg== dependencies: "@adraffy/ens-normalize" "1.10.1" @@ -49,10 +49,10 @@ ethers@^6.13.0: tslib@2.4.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== ws@8.5.0: version "8.5.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + resolved "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz" integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== diff --git a/examples/erc721/Cargo.lock b/examples/erc721/Cargo.lock index 3d336f93..cafdb181 100644 --- a/examples/erc721/Cargo.lock +++ b/examples/erc721/Cargo.lock @@ -11,33 +11,51 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloy-json-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "alloy-rlp", "bytes", "cfg-if", "const-hex", "derive_more", + "foldhash", + "hashbrown", "hex-literal", + "indexmap", "itoa", "k256", "keccak-asm", + "paste", "proptest", "rand", "ruint", + "rustc-hash", "serde", + "sha3", "tiny-keccak", ] [[package]] name = "alloy-rlp" -version = "0.3.5" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b155716bab55763c95ba212806cf43d05bcc70e5f35b02bad20cf5ec7fe11fed" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "arrayvec", "bytes", @@ -45,57 +63,68 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", "indexmap", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", "syn-solidity", ] +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce13ff37285b0870d0a0746992a4ae48efaf34b766ae4c2640fa15e5305f8e73" +dependencies = [ + "serde", + "winnow", +] + [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ + "alloy-json-abi", "alloy-primitives", "alloy-sol-macro", "const-hex", @@ -136,7 +165,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -228,9 +257,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "auto_impl" @@ -240,14 +269,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base16ct" @@ -278,9 +307,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -317,15 +346,21 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +dependencies = [ + "serde", +] [[package]] name = "cc" -version = "1.0.104" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -335,9 +370,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "const-hex" -version = "1.12.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94fb8a24a26d37e1ffd45343323dc9fe6654ceea44c12f2fcb3d7ac29e610bc6" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -352,12 +387,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -369,9 +398,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -427,15 +456,23 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.90", + "unicode-xid", ] [[package]] @@ -461,9 +498,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -522,9 +559,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys", @@ -532,9 +569,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -547,6 +584,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" @@ -575,6 +623,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "funty" version = "2.0.0" @@ -603,6 +657,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -616,9 +676,13 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", + "serde", +] [[package]] name = "heck" @@ -631,6 +695,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -658,23 +725,24 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -688,15 +756,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -716,9 +784,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -732,21 +800,21 @@ checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" @@ -762,7 +830,7 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mini-alloc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "cfg-if", ] @@ -798,9 +866,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "parity-scale-codec" @@ -836,9 +904,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", "thiserror", @@ -857,9 +925,12 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primitive-types" @@ -874,9 +945,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -905,20 +976,42 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", @@ -942,9 +1035,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -964,6 +1057,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -996,9 +1090,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1008,9 +1102,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1019,9 +1113,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rfc6979" @@ -1045,16 +1139,18 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", + "fastrlp 0.3.1", + "fastrlp 0.4.0", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -1073,6 +1169,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -1090,18 +1192,18 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", @@ -1122,6 +1224,12 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "sec1" version = "0.7.3" @@ -1147,37 +1255,58 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "semver-parser" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" dependencies = [ "pest", ] [[package]] name = "serde" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", ] [[package]] @@ -1203,14 +1332,20 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" version = "2.2.0" @@ -1239,24 +1374,26 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stylus-proc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", "cfg-if", - "convert_case 0.6.0", + "convert_case", "lazy_static", + "proc-macro-error", "proc-macro2", "quote", "regex", "sha3", - "syn 1.0.109", + "syn 2.0.90", "syn-solidity", + "trybuild", ] [[package]] name = "stylus-sdk" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -1289,9 +1426,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.58" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1300,14 +1437,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] @@ -1316,36 +1453,52 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" -version = "3.10.1" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] [[package]] @@ -1357,23 +1510,55 @@ dependencies = [ "crunchy", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1382,9 +1567,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -1406,15 +1591,21 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "valuable" @@ -1424,9 +1615,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -1443,20 +1634,29 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -1470,57 +1670,57 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1534,6 +1734,27 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -1551,5 +1772,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn 2.0.90", ] diff --git a/examples/erc721/Cargo.toml b/examples/erc721/Cargo.toml index 71d76c3e..85f70d87 100644 --- a/examples/erc721/Cargo.toml +++ b/examples/erc721/Cargo.toml @@ -4,8 +4,8 @@ version = "0.1.0" edition = "2021" [dependencies] -alloy-primitives = "0.7.6" -alloy-sol-types = "0.7.6" +alloy-primitives = "=0.8.13" +alloy-sol-types = "=0.8.13" stylus-sdk = { path = "../../stylus-sdk" } mini-alloc = { path = "../../mini-alloc" } diff --git a/examples/erc721/rust-toolchain.toml b/examples/erc721/rust-toolchain.toml index 4d2dee85..1de01fa4 100644 --- a/examples/erc721/rust-toolchain.toml +++ b/examples/erc721/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" diff --git a/examples/erc721/scripts/yarn.lock b/examples/erc721/scripts/yarn.lock index e1f26a8d..907410d4 100644 --- a/examples/erc721/scripts/yarn.lock +++ b/examples/erc721/scripts/yarn.lock @@ -4,39 +4,39 @@ "@adraffy/ens-normalize@1.10.1": version "1.10.1" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz" integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== "@noble/curves@1.2.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: "@noble/hashes" "1.3.2" "@noble/hashes@1.3.2": version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== "@types/node@18.15.13": version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + resolved "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== aes-js@4.0.0-beta.5: version "4.0.0-beta.5" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + resolved "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz" integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== dotenv@^16.4.5: version "16.4.5" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== ethers@^6.13.0: version "6.13.0" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.0.tgz#f342958d0f622cf06559f59fbccdc1d30fa64f50" + resolved "https://registry.npmjs.org/ethers/-/ethers-6.13.0.tgz" integrity sha512-+yyQQQWEntY5UVbCv++guA14RRVFm1rSnO1GoLFdrK7/XRWMoktNgyG9UjwxrQqGBfGyFKknNZ81YpUS2emCgg== dependencies: "@adraffy/ens-normalize" "1.10.1" @@ -49,10 +49,10 @@ ethers@^6.13.0: tslib@2.4.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== ws@8.5.0: version "8.5.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.5.0.tgz#bfb4be96600757fe5382de12c670dab984a1ed4f" + resolved "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz" integrity sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg== diff --git a/examples/single_call/Cargo.lock b/examples/single_call/Cargo.lock index 3868100b..71d789b2 100644 --- a/examples/single_call/Cargo.lock +++ b/examples/single_call/Cargo.lock @@ -4,40 +4,58 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] +[[package]] +name = "alloy-json-abi" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a500037938085feed8a20dbfc8fce58c599db68c948cfae711147175dee392c" +dependencies = [ + "alloy-primitives", + "alloy-sol-type-parser", + "serde", + "serde_json", +] + [[package]] name = "alloy-primitives" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f783611babedbbe90db3478c120fb5f5daacceffc210b39adc0af4fe0da70bad" +checksum = "3aeeb5825c2fc8c2662167058347cd0cafc3cb15bcb5cdb1758a63c2dca0409e" dependencies = [ "alloy-rlp", "bytes", "cfg-if", "const-hex", "derive_more", + "foldhash", + "hashbrown", "hex-literal", + "indexmap", "itoa", "k256", "keccak-asm", + "paste", "proptest", "rand", "ruint", + "rustc-hash", "serde", + "sha3", "tiny-keccak", ] [[package]] name = "alloy-rlp" -version = "0.3.4" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d58d9f5da7b40e9bfff0b7e7816700be4019db97d4b6359fe7f94a9e22e42ac" +checksum = "f542548a609dca89fcd72b3b9f355928cf844d4363c5eed9c5273a3dd225e097" dependencies = [ "arrayvec", "bytes", @@ -45,57 +63,68 @@ dependencies = [ [[package]] name = "alloy-sol-macro" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bad41a7c19498e3f6079f7744656328699f8ea3e783bdd10d85788cd439f572" +checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" dependencies = [ "alloy-sol-macro-expander", "alloy-sol-macro-input", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", ] [[package]] name = "alloy-sol-macro-expander" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9899da7d011b4fe4c406a524ed3e3f963797dbc93b45479d60341d3a27b252" +checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" dependencies = [ "alloy-sol-macro-input", "const-hex", "heck", "indexmap", - "proc-macro-error", + "proc-macro-error2", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", "syn-solidity", "tiny-keccak", ] [[package]] name = "alloy-sol-macro-input" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32d595768fdc61331a132b6f65db41afae41b9b97d36c21eb1b955c422a7e60" +checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" dependencies = [ "const-hex", "dunce", "heck", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", "syn-solidity", ] +[[package]] +name = "alloy-sol-type-parser" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce13ff37285b0870d0a0746992a4ae48efaf34b766ae4c2640fa15e5305f8e73" +dependencies = [ + "serde", + "winnow", +] + [[package]] name = "alloy-sol-types" -version = "0.7.6" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a49042c6d3b66a9fe6b2b5a8bf0d39fc2ae1ee0310a2a26ffedd79fb097878dd" +checksum = "cff34e0682d6665da243a3e81da96f07a2dd50f7e64073e382b1a141f5a2a2f6" dependencies = [ + "alloy-json-abi", "alloy-primitives", "alloy-sol-macro", "const-hex", @@ -136,7 +165,7 @@ dependencies = [ "num-bigint", "num-traits", "paste", - "rustc_version 0.4.0", + "rustc_version 0.4.1", "zeroize", ] @@ -228,9 +257,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "auto_impl" @@ -240,14 +269,14 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base16ct" @@ -278,9 +307,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -317,15 +346,21 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +dependencies = [ + "serde", +] [[package]] name = "cc" -version = "1.0.104" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -335,9 +370,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "const-hex" -version = "1.11.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d59688ad0945eaf6b84cb44fedbe93484c81b48970e98f09db8a22832d7961" +checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" dependencies = [ "cfg-if", "cpufeatures", @@ -352,12 +387,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "convert_case" version = "0.6.0" @@ -369,9 +398,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -427,15 +456,23 @@ dependencies = [ [[package]] name = "derive_more" -version = "0.99.17" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ - "convert_case 0.4.0", "proc-macro2", "quote", - "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.90", + "unicode-xid", ] [[package]] @@ -461,9 +498,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecdsa" @@ -512,9 +549,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", "windows-sys", @@ -522,9 +559,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -537,6 +574,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.13.0" @@ -565,6 +613,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "funty" version = "2.0.0" @@ -584,15 +638,21 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -606,9 +666,13 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "foldhash", + "serde", +] [[package]] name = "heck" @@ -621,6 +685,9 @@ name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] [[package]] name = "hex-literal" @@ -648,23 +715,24 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] name = "indexmap" -version = "2.2.6" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -678,15 +746,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -706,9 +774,9 @@ dependencies = [ [[package]] name = "keccak-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47a3633291834c4fbebf8673acbc1b04ec9d151418ff9b8e26dcd79129928758" +checksum = "505d1856a39b200489082f90d897c3f07c455563880bc5952e38eabf731c83b6" dependencies = [ "digest 0.10.7", "sha3-asm", @@ -722,37 +790,37 @@ checksum = "57d8d8ce877200136358e0bbff3a77965875db3af755a11e1fa6b1b3e2df13ea" [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mini-alloc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "cfg-if", ] @@ -778,9 +846,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -788,9 +856,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "parity-scale-codec" @@ -826,9 +894,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", "thiserror", @@ -847,9 +915,12 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primitive-types" @@ -864,9 +935,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ "toml_edit", ] @@ -895,20 +966,42 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" dependencies = [ "bit-set", "bit-vec", @@ -932,9 +1025,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -954,6 +1047,7 @@ dependencies = [ "libc", "rand_chacha", "rand_core", + "serde", ] [[package]] @@ -986,9 +1080,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -998,9 +1092,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1009,9 +1103,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rfc6979" @@ -1035,16 +1129,18 @@ dependencies = [ [[package]] name = "ruint" -version = "1.12.3" +version = "1.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "f5ef8fb1dd8de3870cb8400d51b4c2023854bbafd5431a3ac7e7317243e22d2f" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", + "fastrlp 0.3.1", + "fastrlp 0.4.0", "num-bigint", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", @@ -1063,6 +1159,12 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" +[[package]] +name = "rustc-hash" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -1080,18 +1182,18 @@ dependencies = [ [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.22", + "semver 1.0.24", ] [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", @@ -1112,6 +1214,12 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "sec1" version = "0.7.3" @@ -1137,37 +1245,58 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "semver-parser" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" dependencies = [ "pest", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", +] + +[[package]] +name = "serde_json" +version = "1.0.133" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", ] [[package]] @@ -1193,14 +1322,20 @@ dependencies = [ [[package]] name = "sha3-asm" -version = "0.1.1" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9b57fd861253bff08bb1919e995f90ba8f4889de2726091c8876f3a4e823b40" +checksum = "c28efc5e327c837aa837c59eae585fc250715ef939ac32881bcc11677cd02d46" dependencies = [ "cc", "cfg-if", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signature" version = "2.2.0" @@ -1229,24 +1364,26 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stylus-proc" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", "cfg-if", - "convert_case 0.6.0", + "convert_case", "lazy_static", + "proc-macro-error", "proc-macro2", "quote", "regex", "sha3", - "syn 1.0.109", + "syn 2.0.90", "syn-solidity", + "trybuild", ] [[package]] name = "stylus-sdk" -version = "0.5.2" +version = "0.7.0-rc.1" dependencies = [ "alloy-primitives", "alloy-sol-types", @@ -1290,9 +1427,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -1301,14 +1438,14 @@ dependencies = [ [[package]] name = "syn-solidity" -version = "0.7.6" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d71e19bca02c807c9faa67b5a47673ff231b6e7449b251695188522f1dc44b2" +checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", ] [[package]] @@ -1317,36 +1454,52 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempfile" -version = "3.10.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", "windows-sys", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", ] [[package]] @@ -1358,23 +1511,55 @@ dependencies = [ "crunchy", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", "winnow", ] +[[package]] +name = "trybuild" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" +dependencies = [ + "glob", + "serde", + "serde_derive", + "serde_json", + "target-triple", + "termcolor", + "toml", +] + [[package]] name = "typenum" version = "1.17.0" @@ -1383,9 +1568,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" [[package]] name = "uint" @@ -1407,15 +1592,21 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-segmentation" -version = "1.11.0" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "unicode-xid" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "valuable" @@ -1425,9 +1616,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -1444,24 +1635,34 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "winapi-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys", +] + [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", "windows_i686_gnu", + "windows_i686_gnullvm", "windows_i686_msvc", "windows_x86_64_gnu", "windows_x86_64_gnullvm", @@ -1470,51 +1671,57 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -1528,11 +1735,32 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -1545,5 +1773,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.90", ] diff --git a/examples/single_call/Cargo.toml b/examples/single_call/Cargo.toml index 709a6241..05a192ac 100644 --- a/examples/single_call/Cargo.toml +++ b/examples/single_call/Cargo.toml @@ -7,8 +7,8 @@ keywords = ["arbitrum", "ethereum", "stylus", "alloy"] description = "Stylus single call router contract" [dependencies] -alloy-primitives = "0.7.6" -alloy-sol-types = "0.7.6" +alloy-primitives = "=0.8.13" +alloy-sol-types = "=0.8.13" hex = "0.4.3" stylus-sdk = { path = "../../stylus-sdk" } mini-alloc = { path = "../../mini-alloc" } diff --git a/examples/single_call/rust-toolchain.toml b/examples/single_call/rust-toolchain.toml index 4d2dee85..1de01fa4 100644 --- a/examples/single_call/rust-toolchain.toml +++ b/examples/single_call/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.80.0" +channel = "1.81.0" diff --git a/examples/single_call/scripts/yarn.lock b/examples/single_call/scripts/yarn.lock index e217587c..17001e82 100644 --- a/examples/single_call/scripts/yarn.lock +++ b/examples/single_call/scripts/yarn.lock @@ -4,12 +4,12 @@ "@adraffy/ens-normalize@1.10.1": version "1.10.1" - resolved "https://registry.yarnpkg.com/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz#63430d04bd8c5e74f8d7d049338f1cd9d4f02069" + resolved "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz" integrity sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw== "@ethersproject/abi@^5.1.2": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abi/-/abi-5.7.0.tgz#b3f3e045bbbeed1af3947335c247ad625a44e449" + resolved "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz" integrity sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA== dependencies: "@ethersproject/address" "^5.7.0" @@ -24,7 +24,7 @@ "@ethersproject/abstract-provider@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz#b0a8550f88b6bf9d51f90e4795d48294630cb9ef" + resolved "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz" integrity sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw== dependencies: "@ethersproject/bignumber" "^5.7.0" @@ -37,7 +37,7 @@ "@ethersproject/abstract-signer@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz#13f4f32117868452191a4649723cb086d2b596b2" + resolved "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz" integrity sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ== dependencies: "@ethersproject/abstract-provider" "^5.7.0" @@ -48,7 +48,7 @@ "@ethersproject/address@5.6.1": version "5.6.1" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.6.1.tgz#ab57818d9aefee919c5721d28cd31fd95eff413d" + resolved "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz" integrity sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q== dependencies: "@ethersproject/bignumber" "^5.6.2" @@ -59,7 +59,7 @@ "@ethersproject/address@^5.0.2", "@ethersproject/address@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/address/-/address-5.7.0.tgz#19b56c4d74a3b0a46bfdbb6cfcc0a153fc697f37" + resolved "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz" integrity sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA== dependencies: "@ethersproject/bignumber" "^5.7.0" @@ -70,14 +70,14 @@ "@ethersproject/base64@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/base64/-/base64-5.7.0.tgz#ac4ee92aa36c1628173e221d0d01f53692059e1c" + resolved "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz" integrity sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ== dependencies: "@ethersproject/bytes" "^5.7.0" "@ethersproject/bignumber@^5.6.2", "@ethersproject/bignumber@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bignumber/-/bignumber-5.7.0.tgz#e2f03837f268ba655ffba03a57853e18a18dc9c2" + resolved "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz" integrity sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw== dependencies: "@ethersproject/bytes" "^5.7.0" @@ -86,21 +86,21 @@ "@ethersproject/bytes@^5.6.1", "@ethersproject/bytes@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" + resolved "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== dependencies: "@ethersproject/logger" "^5.7.0" "@ethersproject/constants@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/constants/-/constants-5.7.0.tgz#df80a9705a7e08984161f09014ea012d1c75295e" + resolved "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz" integrity sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA== dependencies: "@ethersproject/bignumber" "^5.7.0" "@ethersproject/hash@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/hash/-/hash-5.7.0.tgz#eb7aca84a588508369562e16e514b539ba5240a7" + resolved "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz" integrity sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g== dependencies: "@ethersproject/abstract-signer" "^5.7.0" @@ -115,7 +115,7 @@ "@ethersproject/keccak256@^5.6.1", "@ethersproject/keccak256@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/keccak256/-/keccak256-5.7.0.tgz#3186350c6e1cd6aba7940384ec7d6d9db01f335a" + resolved "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz" integrity sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg== dependencies: "@ethersproject/bytes" "^5.7.0" @@ -123,26 +123,26 @@ "@ethersproject/logger@^5.6.0", "@ethersproject/logger@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/logger/-/logger-5.7.0.tgz#6ce9ae168e74fecf287be17062b590852c311892" + resolved "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz" integrity sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig== "@ethersproject/networks@^5.7.0": version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/networks/-/networks-5.7.1.tgz#118e1a981d757d45ccea6bb58d9fd3d9db14ead6" + resolved "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz" integrity sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ== dependencies: "@ethersproject/logger" "^5.7.0" "@ethersproject/properties@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/properties/-/properties-5.7.0.tgz#a6e12cb0439b878aaf470f1902a176033067ed30" + resolved "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz" integrity sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw== dependencies: "@ethersproject/logger" "^5.7.0" "@ethersproject/rlp@^5.6.1", "@ethersproject/rlp@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/rlp/-/rlp-5.7.0.tgz#de39e4d5918b9d74d46de93af80b7685a9c21304" + resolved "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz" integrity sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w== dependencies: "@ethersproject/bytes" "^5.7.0" @@ -150,7 +150,7 @@ "@ethersproject/signing-key@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/signing-key/-/signing-key-5.7.0.tgz#06b2df39411b00bc57c7c09b01d1e41cf1b16ab3" + resolved "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz" integrity sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q== dependencies: "@ethersproject/bytes" "^5.7.0" @@ -162,7 +162,7 @@ "@ethersproject/strings@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/strings/-/strings-5.7.0.tgz#54c9d2a7c57ae8f1205c88a9d3a56471e14d5ed2" + resolved "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz" integrity sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg== dependencies: "@ethersproject/bytes" "^5.7.0" @@ -171,7 +171,7 @@ "@ethersproject/transactions@^5.7.0": version "5.7.0" - resolved "https://registry.yarnpkg.com/@ethersproject/transactions/-/transactions-5.7.0.tgz#91318fc24063e057885a6af13fdb703e1f993d3b" + resolved "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz" integrity sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ== dependencies: "@ethersproject/address" "^5.7.0" @@ -186,7 +186,7 @@ "@ethersproject/web@^5.7.0": version "5.7.1" - resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.7.1.tgz#de1f285b373149bee5928f4eb7bcb87ee5fbb4ae" + resolved "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz" integrity sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w== dependencies: "@ethersproject/base64" "^5.7.0" @@ -197,12 +197,12 @@ "@fastify/busboy@^2.0.0": version "2.1.1" - resolved "https://registry.yarnpkg.com/@fastify/busboy/-/busboy-2.1.1.tgz#b9da6a878a371829a0502c9b6c1c143ef6663f4d" + resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== "@metamask/eth-sig-util@^4.0.0": version "4.0.1" - resolved "https://registry.yarnpkg.com/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz#3ad61f6ea9ad73ba5b19db780d40d9aae5157088" + resolved "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz" integrity sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ== dependencies: ethereumjs-abi "^0.6.8" @@ -213,64 +213,64 @@ "@noble/curves@1.2.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + resolved "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz" integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== dependencies: "@noble/hashes" "1.3.2" "@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": version "1.2.0" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz" integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== "@noble/hashes@1.3.2": version "1.3.2" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" + resolved "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== "@noble/secp256k1@1.7.1", "@noble/secp256k1@~1.7.0": version "1.7.1" - resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" + resolved "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz" integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== "@nomicfoundation/edr-darwin-arm64@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.4.0.tgz#bbb43f0e01f40839b0bd38c2c443cb6910ae955f" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.4.0.tgz" integrity sha512-7+rraFk9tCqvfemv9Ita5vTlSBAeO/S5aDKOgGRgYt0JEKZlrX161nDW6UfzMPxWl9GOLEDUzCEaYuNmXseUlg== "@nomicfoundation/edr-darwin-x64@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.4.0.tgz#b1ffcd9142418fd8498de34a7336b3f977907c86" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.4.0.tgz" integrity sha512-+Hrc0mP9L6vhICJSfyGo/2taOToy1AIzVZawO3lU8Lf7oDQXfhQ4UkZnkWAs9SVu1eUwHUGGGE0qB8644piYgg== "@nomicfoundation/edr-linux-arm64-gnu@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.4.0.tgz#8173d16d4f6f2b3e82ba7096d2a1ea3619d8bfa7" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.4.0.tgz" integrity sha512-4HUDMchNClQrVRfVTqBeSX92hM/3khCgpZkXP52qrnJPqgbdCxosOehlQYZ65wu0b/kaaZSyvACgvCLSQ5oSzQ== "@nomicfoundation/edr-linux-arm64-musl@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.4.0.tgz#b1ce293a7c3e0d9f70391e1aef1a82b83b997567" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.4.0.tgz" integrity sha512-D4J935ZRL8xfnP3zIFlCI9jXInJ0loDUkCTLeCEbOf2uuDumWDghKNQlF1itUS+EHaR1pFVBbuwqq8hVK0dASg== "@nomicfoundation/edr-linux-x64-gnu@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.4.0.tgz#4c12c4e4bfd3d837f5663ad7cbf7cb6d5634ef83" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.4.0.tgz" integrity sha512-6x7HPy+uN5Cb9N77e2XMmT6+QSJ+7mRbHnhkGJ8jm4cZvWuj2Io7npOaeHQ3YHK+TiQpTnlbkjoOIpEwpY3XZA== "@nomicfoundation/edr-linux-x64-musl@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.4.0.tgz#8842004aa1a47c504f10863687da28b65dca7baa" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.4.0.tgz" integrity sha512-3HFIJSXgyubOiaN4MWGXx2xhTnhwlJk0PiSYNf9+L/fjBtcRkb2nM910ZJHTvqCb6OT98cUnaKuAYdXIW2amgw== "@nomicfoundation/edr-win32-x64-msvc@0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.4.0.tgz#29d8bbb2edf9912a95f5453855cf17cdcb269957" + resolved "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.4.0.tgz" integrity sha512-CP4GsllEfXEz+lidcGYxKe5rDJ60TM5/blB5z/04ELVvw6/CK9eLcYeku7HV0jvV7VE6dADYKSdQyUkvd0El+A== "@nomicfoundation/edr@^0.4.0": version "0.4.0" - resolved "https://registry.yarnpkg.com/@nomicfoundation/edr/-/edr-0.4.0.tgz#4895ecb6ef321136db837458949c37cce4a29459" + resolved "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.4.0.tgz" integrity sha512-T96DMSogO8TCdbKKctvxfsDljbhFOUKWc9fHJhSeUh71EEho2qR4951LKQF7t7UWEzguVYh/idQr5L/E3QeaMw== dependencies: "@nomicfoundation/edr-darwin-arm64" "0.4.0" @@ -283,19 +283,19 @@ "@nomicfoundation/ethereumjs-common@4.0.4": version "4.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz#9901f513af2d4802da87c66d6f255b510bef5acb" + resolved "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz" integrity sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg== dependencies: "@nomicfoundation/ethereumjs-util" "9.0.4" "@nomicfoundation/ethereumjs-rlp@5.0.4": version "5.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz#66c95256fc3c909f6fb18f6a586475fc9762fa30" + resolved "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz" integrity sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw== "@nomicfoundation/ethereumjs-tx@5.0.4": version "5.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz#b0ceb58c98cc34367d40a30d255d6315b2f456da" + resolved "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz" integrity sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw== dependencies: "@nomicfoundation/ethereumjs-common" "4.0.4" @@ -305,7 +305,7 @@ "@nomicfoundation/ethereumjs-util@9.0.4": version "9.0.4" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz#84c5274e82018b154244c877b76bc049a4ed7b38" + resolved "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz" integrity sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q== dependencies: "@nomicfoundation/ethereumjs-rlp" "5.0.4" @@ -313,7 +313,7 @@ "@nomicfoundation/hardhat-ethers@^3.0.6": version "3.0.6" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.6.tgz#e8ba7f9719de360c03501b85dae4999bb3a7e1c5" + resolved "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.6.tgz" integrity sha512-/xzkFQAaHQhmIAYOQmvHBPwL+NkwLzT9gRZBsgWUYeV+E6pzXsBQsHfRYbAZ3XEYare+T7S+5Tg/1KDJgepSkA== dependencies: debug "^4.1.1" @@ -321,12 +321,12 @@ "@nomicfoundation/hardhat-ignition-ethers@^0.15.5": version "0.15.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.5.tgz#98f945c110e26a120baf015b0d2322d5025273aa" + resolved "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.5.tgz" integrity sha512-W6s1QN9CFxzSVZS6w9Jcj3WLaK32z2FP5MxNU2OKY1Fn9ZzLr+miXbUbWYuRHl6dxrrl6sE8cv33Cybv19pmCg== "@nomicfoundation/hardhat-ignition@^0.15.5": version "0.15.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.5.tgz#6da613732a3d9829a40f6ee6c95fb2db012ebdce" + resolved "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.5.tgz" integrity sha512-Y5nhFXFqt4owA6Ooag8ZBFDF2RAZElMXViknVIsi3m45pbQimS50ti6FU8HxfRkDnBARa40CIn7UGV0hrelzDw== dependencies: "@nomicfoundation/ignition-core" "^0.15.5" @@ -338,7 +338,7 @@ "@nomicfoundation/hardhat-verify@^2.0.8": version "2.0.8" - resolved "https://registry.yarnpkg.com/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.8.tgz#6a77dc03de990a1a3aa8e6dc073c393263dbf258" + resolved "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.8.tgz" integrity sha512-x/OYya7A2Kcz+3W/J78dyDHxr0ezU23DKTrRKfy5wDPCnePqnr79vm8EXqX3gYps6IjPBYyGPZ9K6E5BnrWx5Q== dependencies: "@ethersproject/abi" "^5.1.2" @@ -353,7 +353,7 @@ "@nomicfoundation/ignition-core@^0.15.5": version "0.15.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ignition-core/-/ignition-core-0.15.5.tgz#38d19d29ffd425f7cc2810c45d7a51b31c626067" + resolved "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.5.tgz" integrity sha512-FgvuoIXhakRSP524JzNQ4BviyzBBKpsFaOWubPZ4XACLT4/7vGqlJ/7DIn0D2NL2anQ2qs98/BNBY9WccXUX1Q== dependencies: "@ethersproject/address" "5.6.1" @@ -368,47 +368,47 @@ "@nomicfoundation/ignition-ui@^0.15.5": version "0.15.5" - resolved "https://registry.yarnpkg.com/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.5.tgz#ef9e11ccbffccc2360c02b20f12713756dfc37da" + resolved "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.5.tgz" integrity sha512-ZcE4rIn10qKahR4OqS8rl8NM2Fbg2QYiBXgMgj74ZI0++LlCcZgB5HyaBbX+lsnKHjTXtjYD3b+2mtg7jFbAMQ== "@nomicfoundation/solidity-analyzer-darwin-arm64@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz#3a9c3b20d51360b20affb8f753e756d553d49557" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz" integrity sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw== "@nomicfoundation/solidity-analyzer-darwin-x64@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz#74dcfabeb4ca373d95bd0d13692f44fcef133c28" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz" integrity sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw== "@nomicfoundation/solidity-analyzer-linux-arm64-gnu@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz#4af5849a89e5a8f511acc04f28eb5d4460ba2b6a" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz" integrity sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA== "@nomicfoundation/solidity-analyzer-linux-arm64-musl@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz#54036808a9a327b2ff84446c130a6687ee702a8e" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz" integrity sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA== "@nomicfoundation/solidity-analyzer-linux-x64-gnu@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz#466cda0d6e43691986c944b909fc6dbb8cfc594e" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz" integrity sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g== "@nomicfoundation/solidity-analyzer-linux-x64-musl@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz#2b35826987a6e94444140ac92310baa088ee7f94" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz" integrity sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg== "@nomicfoundation/solidity-analyzer-win32-x64-msvc@0.1.2": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz#e6363d13b8709ca66f330562337dbc01ce8bbbd9" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz" integrity sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA== "@nomicfoundation/solidity-analyzer@^0.1.0", "@nomicfoundation/solidity-analyzer@^0.1.1": version "0.1.2" - resolved "https://registry.yarnpkg.com/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz#8bcea7d300157bf3a770a851d9f5c5e2db34ac55" + resolved "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz" integrity sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA== optionalDependencies: "@nomicfoundation/solidity-analyzer-darwin-arm64" "0.1.2" @@ -421,12 +421,12 @@ "@scure/base@~1.1.0": version "1.1.7" - resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.7.tgz#fe973311a5c6267846aa131bc72e96c5d40d2b30" + resolved "https://registry.npmjs.org/@scure/base/-/base-1.1.7.tgz" integrity sha512-PPNYBslrLNNUQ/Yad37MHYsNQtK67EhWb6WtSvNLLPo7SdVZgkUjD6Dg+5On7zNwmskf8OX7I7Nx5oN+MIWE0g== "@scure/bip32@1.1.5": version "1.1.5" - resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + resolved "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz" integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== dependencies: "@noble/hashes" "~1.2.0" @@ -435,7 +435,7 @@ "@scure/bip39@1.1.1": version "1.1.1" - resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + resolved "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz" integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== dependencies: "@noble/hashes" "~1.2.0" @@ -443,7 +443,7 @@ "@sentry/core@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.30.0.tgz#6b203664f69e75106ee8b5a2fe1d717379b331f3" + resolved "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz" integrity sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg== dependencies: "@sentry/hub" "5.30.0" @@ -454,7 +454,7 @@ "@sentry/hub@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.30.0.tgz#2453be9b9cb903404366e198bd30c7ca74cdc100" + resolved "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz" integrity sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ== dependencies: "@sentry/types" "5.30.0" @@ -463,7 +463,7 @@ "@sentry/minimal@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.30.0.tgz#ce3d3a6a273428e0084adcb800bc12e72d34637b" + resolved "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz" integrity sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw== dependencies: "@sentry/hub" "5.30.0" @@ -472,7 +472,7 @@ "@sentry/node@^5.18.1": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.30.0.tgz#4ca479e799b1021285d7fe12ac0858951c11cd48" + resolved "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz" integrity sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg== dependencies: "@sentry/core" "5.30.0" @@ -487,7 +487,7 @@ "@sentry/tracing@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-5.30.0.tgz#501d21f00c3f3be7f7635d8710da70d9419d4e1f" + resolved "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz" integrity sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw== dependencies: "@sentry/hub" "5.30.0" @@ -498,12 +498,12 @@ "@sentry/types@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.30.0.tgz#19709bbe12a1a0115bc790b8942917da5636f402" + resolved "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz" integrity sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw== "@sentry/utils@5.30.0": version "5.30.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.30.0.tgz#9a5bd7ccff85ccfe7856d493bffa64cabc41e980" + resolved "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz" integrity sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww== dependencies: "@sentry/types" "5.30.0" @@ -511,69 +511,62 @@ "@types/bn.js@^4.11.3": version "4.11.6" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-4.11.6.tgz#c306c70d9358aaea33cd4eda092a742b9505967c" + resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz" integrity sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg== dependencies: "@types/node" "*" "@types/bn.js@^5.1.0": version "5.1.5" - resolved "https://registry.yarnpkg.com/@types/bn.js/-/bn.js-5.1.5.tgz#2e0dacdcce2c0f16b905d20ff87aedbc6f7b4bf0" + resolved "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz" integrity sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A== dependencies: "@types/node" "*" "@types/lru-cache@^5.1.0": version "5.1.1" - resolved "https://registry.yarnpkg.com/@types/lru-cache/-/lru-cache-5.1.1.tgz#c48c2e27b65d2a153b19bfc1a317e30872e01eef" + resolved "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz" integrity sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw== -"@types/node@*": - version "20.14.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.7.tgz#342cada27f97509eb8eb2dbc003edf21ce8ab5a8" - integrity sha512-uTr2m2IbJJucF3KUxgnGOZvYbN0QgkGyWxG6973HCpMYFy2KfcgYuIwkJQMQkt1VbBMlvWRbpshFTLxnxCZjKQ== - dependencies: - undici-types "~5.26.4" - -"@types/node@18.15.13": +"@types/node@*", "@types/node@18.15.13": version "18.15.13" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.13.tgz#f64277c341150c979e42b00e4ac289290c9df469" + resolved "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz" integrity sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q== "@types/pbkdf2@^3.0.0": version "3.1.2" - resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.2.tgz#2dc43808e9985a2c69ff02e2d2027bd4fe33e8dc" + resolved "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz" integrity sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew== dependencies: "@types/node" "*" "@types/secp256k1@^4.0.1": version "4.0.6" - resolved "https://registry.yarnpkg.com/@types/secp256k1/-/secp256k1-4.0.6.tgz#d60ba2349a51c2cbc5e816dcd831a42029d376bf" + resolved "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz" integrity sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ== dependencies: "@types/node" "*" adm-zip@^0.4.16: version "0.4.16" - resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.16.tgz#cf4c508fdffab02c269cbc7f471a875f05570365" + resolved "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz" integrity sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg== aes-js@4.0.0-beta.5: version "4.0.0-beta.5" - resolved "https://registry.yarnpkg.com/aes-js/-/aes-js-4.0.0-beta.5.tgz#8d2452c52adedebc3a3e28465d858c11ca315873" + resolved "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz" integrity sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q== agent-base@6: version "6.0.2" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: debug "4" aggregate-error@^3.0.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" + resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz" integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA== dependencies: clean-stack "^2.0.0" @@ -581,7 +574,7 @@ aggregate-error@^3.0.0: ajv@^8.0.1: version "8.16.0" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.16.0.tgz#22e2a92b94f005f7e0f9c9d39652ef0b8f6f0cb4" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz" integrity sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw== dependencies: fast-deep-equal "^3.1.3" @@ -591,50 +584,50 @@ ajv@^8.0.1: ansi-align@^3.0.0: version "3.0.1" - resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" + resolved "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz" integrity sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w== dependencies: string-width "^4.1.0" ansi-colors@4.1.1: version "4.1.1" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== ansi-colors@^4.1.1: version "4.1.3" - resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" + resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== ansi-escapes@^4.3.0: version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" + resolved "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== dependencies: type-fest "^0.21.3" ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^3.2.1: version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== dependencies: color-convert "^1.9.0" ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" anymatch@~3.1.2: version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + resolved "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" @@ -642,49 +635,49 @@ anymatch@~3.1.2: argparse@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + resolved "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== astral-regex@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" + resolved "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== base-x@^3.0.2: version "3.0.9" - resolved "https://registry.yarnpkg.com/base-x/-/base-x-3.0.9.tgz#6349aaabb58526332de9f60995e548a53fe21320" + resolved "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz" integrity sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ== dependencies: safe-buffer "^5.0.1" binary-extensions@^2.0.0: version "2.3.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + resolved "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz" integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== blakejs@^1.1.0: version "1.2.1" - resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" + resolved "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz" integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== bn.js@^4.11.0, bn.js@^4.11.8, bn.js@^4.11.9: version "4.12.0" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + resolved "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz" integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== boxen@^5.1.2: version "5.1.2" - resolved "https://registry.yarnpkg.com/boxen/-/boxen-5.1.2.tgz#788cb686fc83c1f486dfa8a40c68fc2b831d2b50" + resolved "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz" integrity sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ== dependencies: ansi-align "^3.0.0" @@ -698,7 +691,7 @@ boxen@^5.1.2: brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -706,31 +699,31 @@ brace-expansion@^1.1.7: brace-expansion@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz" integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== dependencies: balanced-match "^1.0.0" braces@~3.0.2: version "3.0.3" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz" integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== dependencies: fill-range "^7.1.1" brorand@^1.1.0: version "1.1.0" - resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + resolved "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== browser-stdout@1.3.1: version "1.3.1" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== browserify-aes@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" + resolved "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz" integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== dependencies: buffer-xor "^1.0.3" @@ -742,14 +735,14 @@ browserify-aes@^1.2.0: bs58@^4.0.0: version "4.0.1" - resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" + resolved "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz" integrity sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw== dependencies: base-x "^3.0.2" bs58check@^2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/bs58check/-/bs58check-2.1.2.tgz#53b018291228d82a5aa08e7d796fdafda54aebfc" + resolved "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz" integrity sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA== dependencies: bs58 "^4.0.0" @@ -758,41 +751,41 @@ bs58check@^2.1.2: buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + resolved "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== buffer-xor@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" + resolved "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz" integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== bytes@3.1.2: version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + resolved "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== camelcase@^6.0.0, camelcase@^6.2.0: version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== cbor@^8.1.0: version "8.1.0" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-8.1.0.tgz#cfc56437e770b73417a2ecbfc9caf6b771af60d5" + resolved "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz" integrity sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg== dependencies: nofilter "^3.1.0" cbor@^9.0.0: version "9.0.2" - resolved "https://registry.yarnpkg.com/cbor/-/cbor-9.0.2.tgz#536b4f2d544411e70ec2b19a2453f10f83cd9fdb" + resolved "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz" integrity sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ== dependencies: nofilter "^3.1.0" chalk@^2.4.2: version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== dependencies: ansi-styles "^3.2.1" @@ -801,7 +794,7 @@ chalk@^2.4.2: chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== dependencies: ansi-styles "^4.1.0" @@ -809,7 +802,7 @@ chalk@^4.0.0, chalk@^4.1.0: chokidar@3.5.3: version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" @@ -824,7 +817,7 @@ chokidar@3.5.3: chokidar@^3.4.0: version "3.6.0" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz" integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== dependencies: anymatch "~3.1.2" @@ -839,12 +832,12 @@ chokidar@^3.4.0: ci-info@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" + resolved "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: version "1.0.4" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.4.tgz#8760e4ecc272f4c363532f926d874aae2c1397de" + resolved "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz" integrity sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q== dependencies: inherits "^2.0.1" @@ -852,17 +845,17 @@ cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: clean-stack@^2.0.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" + resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== cli-boxes@^2.2.1: version "2.2.1" - resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-2.2.1.tgz#ddd5035d25094fce220e9cab40a45840a440318f" + resolved "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz" integrity sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw== cliui@^7.0.2: version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + resolved "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" @@ -871,51 +864,51 @@ cliui@^7.0.2: color-convert@^1.9.0: version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== dependencies: color-name "1.1.3" color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@1.1.3: version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== color-name@~1.1.4: version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== command-exists@^1.2.8: version "1.2.9" - resolved "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.9.tgz#c50725af3808c8ab0260fd60b01fbfa25b954f69" + resolved "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz" integrity sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w== commander@3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/commander/-/commander-3.0.2.tgz#6837c3fb677ad9933d1cfba42dd14d5117d6b39e" + resolved "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz" integrity sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow== concat-map@0.0.1: version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== cookie@^0.4.1: version "0.4.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + resolved "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz" integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" + resolved "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz" integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== dependencies: cipher-base "^1.0.1" @@ -926,7 +919,7 @@ create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: create-hmac@^1.1.4, create-hmac@^1.1.7: version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" + resolved "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz" integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== dependencies: cipher-base "^1.0.3" @@ -938,41 +931,41 @@ create-hmac@^1.1.4, create-hmac@^1.1.7: debug@4, debug@^4.1.1, debug@^4.3.2: version "4.3.5" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== dependencies: ms "2.1.2" debug@4.3.4: version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" decamelize@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + resolved "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz" integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== depd@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + resolved "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz" integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== diff@5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b" + resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== dotenv@^16.4.5: version "16.4.5" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.5.tgz#cdd3b3b604cb327e286b4762e13502f717cb099f" + resolved "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz" integrity sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg== -elliptic@6.5.4: +elliptic@6.5.4, elliptic@^6.5.2, elliptic@^6.5.4: version "6.5.4" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + resolved "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz" integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== dependencies: bn.js "^4.11.9" @@ -983,27 +976,14 @@ elliptic@6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -elliptic@^6.5.2, elliptic@^6.5.4: - version "6.5.5" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.5.tgz#c715e09f78b6923977610d4c2346d6ce22e6dded" - integrity sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enquirer@^2.3.0: version "2.4.1" - resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.4.1.tgz#93334b3fbd74fc7097b224ab4a8fb7e40bf4ae56" + resolved "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz" integrity sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ== dependencies: ansi-colors "^4.1.1" @@ -1011,27 +991,27 @@ enquirer@^2.3.0: env-paths@^2.2.0: version "2.2.1" - resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" + resolved "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz" integrity sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A== escalade@^3.1.1: version "3.1.2" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz" integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== escape-string-regexp@4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== escape-string-regexp@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: version "0.1.3" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz#8d6143cfc3d74bf79bbd8edecdf29e4ae20dd191" + resolved "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz" integrity sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ== dependencies: "@types/pbkdf2" "^3.0.0" @@ -1052,7 +1032,7 @@ ethereum-cryptography@0.1.3, ethereum-cryptography@^0.1.3: ethereum-cryptography@^1.0.3: version "1.2.0" - resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + resolved "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz" integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== dependencies: "@noble/hashes" "1.2.0" @@ -1062,7 +1042,7 @@ ethereum-cryptography@^1.0.3: ethereumjs-abi@^0.6.8: version "0.6.8" - resolved "https://registry.yarnpkg.com/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz#71bc152db099f70e62f108b7cdfca1b362c6fcae" + resolved "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz" integrity sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA== dependencies: bn.js "^4.11.8" @@ -1070,7 +1050,7 @@ ethereumjs-abi@^0.6.8: ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: version "6.2.1" - resolved "https://registry.yarnpkg.com/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz#fcb4e4dd5ceacb9d2305426ab1a5cd93e3163b69" + resolved "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz" integrity sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw== dependencies: "@types/bn.js" "^4.11.3" @@ -1083,7 +1063,7 @@ ethereumjs-util@^6.0.0, ethereumjs-util@^6.2.1: ethers@^6.13.1, ethers@^6.7.0: version "6.13.1" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-6.13.1.tgz#2b9f9c7455cde9d38b30fe6589972eb083652961" + resolved "https://registry.npmjs.org/ethers/-/ethers-6.13.1.tgz" integrity sha512-hdJ2HOxg/xx97Lm9HdCWk949BfYqYWpyw4//78SiwOLgASyfrNszfMUNB2joKjvGUdwhHfaiMMFFwacVVoLR9A== dependencies: "@adraffy/ens-normalize" "1.10.1" @@ -1096,7 +1076,7 @@ ethers@^6.13.1, ethers@^6.7.0: ethjs-util@0.1.6, ethjs-util@^0.1.6: version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" + resolved "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz" integrity sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w== dependencies: is-hex-prefixed "1.0.0" @@ -1104,7 +1084,7 @@ ethjs-util@0.1.6, ethjs-util@^0.1.6: evp_bytestokey@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" + resolved "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz" integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== dependencies: md5.js "^1.3.4" @@ -1112,19 +1092,19 @@ evp_bytestokey@^1.0.3: fast-deep-equal@^3.1.3: version "3.1.3" - resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + resolved "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== fill-range@^7.1.1: version "7.1.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz" integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== dependencies: to-regex-range "^5.0.1" find-up@5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== dependencies: locate-path "^6.0.0" @@ -1132,34 +1112,29 @@ find-up@5.0.0: find-up@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" + resolved "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz" integrity sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ== dependencies: locate-path "^2.0.0" flat@^5.0.2: version "5.0.2" - resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + resolved "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz" integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== follow-redirects@^1.12.1: version "1.15.6" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" + resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== -fp-ts@1.19.3: +fp-ts@1.19.3, fp-ts@^1.0.0: version "1.19.3" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.3.tgz#261a60d1088fbff01f91256f91d21d0caaaaa96f" + resolved "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz" integrity sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg== -fp-ts@^1.0.0: - version "1.19.5" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-1.19.5.tgz#3da865e585dfa1fdfd51785417357ac50afc520a" - integrity sha512-wDNqTimnzs8QqpldiId9OavWK2NptormjXnRJTQecNjzwfyp6P/8s/zG8e4h3ja3oqkKaY72UlTjQYt/1yXf9A== - fs-extra@^0.30.0: version "0.30.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz" integrity sha512-UvSPKyhMn6LEd/WpUaV9C9t3zATuqoqfWc3QdPhPLb58prN9tqYPlPWi8Krxi44loBoUzlobqZ3+8tGpxxSzwA== dependencies: graceful-fs "^4.1.2" @@ -1170,7 +1145,7 @@ fs-extra@^0.30.0: fs-extra@^10.0.0: version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz" integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== dependencies: graceful-fs "^4.2.0" @@ -1179,7 +1154,7 @@ fs-extra@^10.0.0: fs-extra@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" + resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== dependencies: graceful-fs "^4.1.2" @@ -1188,7 +1163,7 @@ fs-extra@^7.0.1: fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: @@ -1198,19 +1173,19 @@ fsevents@~2.3.2: get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" -glob@7.2.0: +glob@7.2.0, glob@^7.1.3: version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== dependencies: fs.realpath "^1.0.0" @@ -1222,7 +1197,7 @@ glob@7.2.0: glob@8.1.0: version "8.1.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-8.1.0.tgz#d388f656593ef708ee3e34640fdfb99a9fd1c33e" + resolved "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz" integrity sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ== dependencies: fs.realpath "^1.0.0" @@ -1231,26 +1206,14 @@ glob@8.1.0: minimatch "^5.0.1" once "^1.3.0" -glob@^7.1.3: - version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" - integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.1.1" - once "^1.3.0" - path-is-absolute "^1.0.0" - graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.1.9, graceful-fs@^4.2.0: version "4.2.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== hardhat@^2.22.5: version "2.22.5" - resolved "https://registry.yarnpkg.com/hardhat/-/hardhat-2.22.5.tgz#7e1a4311fa9e34a1cfe337784eae06706f6469a5" + resolved "https://registry.npmjs.org/hardhat/-/hardhat-2.22.5.tgz" integrity sha512-9Zq+HonbXCSy6/a13GY1cgHglQRfh4qkzmj1tpPlhxJDwNVnhxlReV6K7hCWFKlOrV13EQwsdcD0rjcaQKWRZw== dependencies: "@ethersproject/abi" "^5.1.2" @@ -1299,17 +1262,17 @@ hardhat@^2.22.5: has-flag@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== has-flag@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + resolved "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== hash-base@^3.0.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" + resolved "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz" integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== dependencies: inherits "^2.0.4" @@ -1318,7 +1281,7 @@ hash-base@^3.0.0: hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: version "1.1.7" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + resolved "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== dependencies: inherits "^2.0.3" @@ -1326,12 +1289,12 @@ hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3, hash.js@^1.1.7: he@1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + resolved "https://registry.npmjs.org/he/-/he-1.2.0.tgz" integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== hmac-drbg@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + resolved "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz" integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== dependencies: hash.js "^1.0.3" @@ -1340,7 +1303,7 @@ hmac-drbg@^1.0.1: http-errors@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + resolved "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz" integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== dependencies: depd "2.0.0" @@ -1351,7 +1314,7 @@ http-errors@2.0.0: https-proxy-agent@^5.0.0: version "5.0.1" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + resolved "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz" integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== dependencies: agent-base "6" @@ -1359,29 +1322,29 @@ https-proxy-agent@^5.0.0: iconv-lite@0.4.24: version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== dependencies: safer-buffer ">= 2.1.2 < 3" immer@10.0.2: version "10.0.2" - resolved "https://registry.yarnpkg.com/immer/-/immer-10.0.2.tgz#11636c5b77acf529e059582d76faf338beb56141" + resolved "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz" integrity sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA== immutable@^4.0.0-rc.12: version "4.3.6" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.6.tgz#6a05f7858213238e587fb83586ffa3b4b27f0447" + resolved "https://registry.npmjs.org/immutable/-/immutable-4.3.6.tgz" integrity sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ== indent-string@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" + resolved "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz" integrity sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg== inflight@^1.0.4: version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" @@ -1389,99 +1352,99 @@ inflight@^1.0.4: inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== io-ts@1.10.4: version "1.10.4" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-1.10.4.tgz#cd5401b138de88e4f920adbcb7026e2d1967e6e2" + resolved "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz" integrity sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g== dependencies: fp-ts "^1.0.0" is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + resolved "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + resolved "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + resolved "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-hex-prefixed@1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz#7d8d37e6ad77e5d127148913c573e082d777f554" + resolved "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz" integrity sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA== is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== is-plain-obj@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + resolved "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== is-unicode-supported@^0.1.0: version "0.1.0" - resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" + resolved "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz" integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw== js-sha3@0.8.0: version "0.8.0" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz" integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== js-yaml@4.1.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" json-schema-traverse@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== json-stringify-safe@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" + resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== jsonfile@^2.1.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-2.4.0.tgz#3736a2b428b87bbda0cc83b53fa3d633a35c2ae8" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz" integrity sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw== optionalDependencies: graceful-fs "^4.1.6" jsonfile@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz" integrity sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg== optionalDependencies: graceful-fs "^4.1.6" jsonfile@^6.0.1: version "6.1.0" - resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-6.1.0.tgz#bc55b2634793c679ec6403094eb13698a6ec0aae" + resolved "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz" integrity sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ== dependencies: universalify "^2.0.0" @@ -1490,7 +1453,7 @@ jsonfile@^6.0.1: keccak@^3.0.0, keccak@^3.0.2: version "3.0.4" - resolved "https://registry.yarnpkg.com/keccak/-/keccak-3.0.4.tgz#edc09b89e633c0549da444432ecf062ffadee86d" + resolved "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz" integrity sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q== dependencies: node-addon-api "^2.0.0" @@ -1499,19 +1462,19 @@ keccak@^3.0.0, keccak@^3.0.2: klaw@^1.0.0: version "1.3.1" - resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439" + resolved "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz" integrity sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw== optionalDependencies: graceful-fs "^4.1.9" kleur@^3.0.3: version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" + resolved "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== locate-path@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz" integrity sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA== dependencies: p-locate "^2.0.0" @@ -1519,34 +1482,34 @@ locate-path@^2.0.0: locate-path@^6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + resolved "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz" integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== dependencies: p-locate "^5.0.0" lodash.clonedeep@^4.5.0: version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" integrity sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ== lodash.isequal@^4.5.0: version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" + resolved "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz" integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== lodash.truncate@^4.4.2: version "4.4.2" - resolved "https://registry.yarnpkg.com/lodash.truncate/-/lodash.truncate-4.4.2.tgz#5a350da0b1113b837ecfffd5812cbe58d6eae193" + resolved "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz" integrity sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw== lodash@4.17.21, lodash@^4.17.11: version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-symbols@4.1.0: version "4.1.0" - resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" + resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== dependencies: chalk "^4.1.0" @@ -1554,12 +1517,12 @@ log-symbols@4.1.0: lru_map@^0.3.3: version "0.3.3" - resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd" + resolved "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz" integrity sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ== md5.js@^1.3.4: version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" + resolved "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz" integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== dependencies: hash-base "^3.0.0" @@ -1568,55 +1531,48 @@ md5.js@^1.3.4: memorystream@^0.3.1: version "0.3.1" - resolved "https://registry.yarnpkg.com/memorystream/-/memorystream-0.3.1.tgz#86d7090b30ce455d63fbae12dda51a47ddcaf9b2" + resolved "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz" integrity sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw== minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + resolved "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz" integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== minimalistic-crypto-utils@^1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + resolved "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== -minimatch@5.0.1: +minimatch@5.0.1, minimatch@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz" integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== dependencies: brace-expansion "^2.0.1" -minimatch@^3.0.4, minimatch@^3.1.1: +minimatch@^3.0.4: version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.1.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" - integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.5: version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== mnemonist@^0.38.0: version "0.38.5" - resolved "https://registry.yarnpkg.com/mnemonist/-/mnemonist-0.38.5.tgz#4adc7f4200491237fe0fa689ac0b86539685cade" + resolved "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz" integrity sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg== dependencies: obliterator "^2.0.0" mocha@^10.0.0: version "10.4.0" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-10.4.0.tgz#ed03db96ee9cfc6d20c56f8e2af07b961dbae261" + resolved "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz" integrity sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA== dependencies: ansi-colors "4.1.1" @@ -1642,17 +1598,17 @@ mocha@^10.0.0: ms@2.1.2: version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== ms@2.1.3: version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== ndjson@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/ndjson/-/ndjson-2.0.0.tgz#320ac86f6fe53f5681897349b86ac6f43bfa3a19" + resolved "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz" integrity sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ== dependencies: json-stringify-safe "^5.0.1" @@ -1663,104 +1619,104 @@ ndjson@2.0.0: node-addon-api@^2.0.0: version "2.0.2" - resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32" + resolved "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz" integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA== node-gyp-build@^4.2.0: version "4.8.1" - resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.8.1.tgz#976d3ad905e71b76086f4f0b0d3637fe79b6cda5" + resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz" integrity sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw== nofilter@^3.1.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/nofilter/-/nofilter-3.1.0.tgz#c757ba68801d41ff930ba2ec55bab52ca184aa66" + resolved "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz" integrity sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== obliterator@^2.0.0: version "2.0.4" - resolved "https://registry.yarnpkg.com/obliterator/-/obliterator-2.0.4.tgz#fa650e019b2d075d745e44f1effeb13a2adbe816" + resolved "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz" integrity sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ== once@^1.3.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "https://registry.npmjs.org/once/-/once-1.4.0.tgz" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" os-tmpdir@~1.0.2: version "1.0.2" - resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + resolved "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== p-limit@^1.1.0: version "1.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.3.0.tgz#b86bd5f0c25690911c7590fcbfc2010d54b3ccb8" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz" integrity sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q== dependencies: p-try "^1.0.0" p-limit@^3.0.2: version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + resolved "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz" integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== dependencies: yocto-queue "^0.1.0" p-locate@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz" integrity sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg== dependencies: p-limit "^1.1.0" p-locate@^5.0.0: version "5.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + resolved "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz" integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== dependencies: p-limit "^3.0.2" p-map@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/p-map/-/p-map-4.0.0.tgz#bb2f95a5eda2ec168ec9274e06a747c3e2904d2b" + resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== dependencies: aggregate-error "^3.0.0" p-try@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-1.0.0.tgz#cbc79cdbaf8fd4228e13f621f2b1a237c1b207b3" + resolved "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz" integrity sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww== path-exists@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz" integrity sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ== path-exists@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz" integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-parse@^1.0.6: version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + resolved "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== pbkdf2@^3.0.17: version "3.1.2" - resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.1.2.tgz#dd822aa0887580e52f1a039dc3eda108efae3075" + resolved "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz" integrity sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA== dependencies: create-hash "^1.1.2" @@ -1771,12 +1727,12 @@ pbkdf2@^3.0.17: picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== prompts@^2.4.2: version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" + resolved "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz" integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== dependencies: kleur "^3.0.3" @@ -1784,19 +1740,19 @@ prompts@^2.4.2: punycode@^2.1.0: version "2.3.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + resolved "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz" integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== randombytes@^2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + resolved "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz" integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== dependencies: safe-buffer "^5.1.0" raw-body@^2.4.1: version "2.5.2" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.2.tgz#99febd83b90e08975087e8f1f9419a149366b68a" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz" integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" @@ -1806,7 +1762,7 @@ raw-body@^2.4.1: readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.6.0: version "3.6.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.2.tgz#56a9b36ea965c00c5a93ef31eb111a0f11056967" + resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz" integrity sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA== dependencies: inherits "^2.0.3" @@ -1815,38 +1771,38 @@ readable-stream@3, readable-stream@^3.0.0, readable-stream@^3.6.0: readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== require-from-string@^2.0.0, require-from-string@^2.0.2: version "2.0.2" - resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + resolved "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz" integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== resolve@1.17.0: version "1.17.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" + resolved "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz" integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== dependencies: path-parse "^1.0.6" rimraf@^2.2.8: version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" + resolved "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz" integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== dependencies: hash-base "^3.0.0" @@ -1854,29 +1810,29 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: rlp@^2.2.3: version "2.2.7" - resolved "https://registry.yarnpkg.com/rlp/-/rlp-2.2.7.tgz#33f31c4afac81124ac4b283e2bd4d9720b30beaf" + resolved "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz" integrity sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ== dependencies: bn.js "^5.2.0" safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== "safer-buffer@>= 2.1.2 < 3": version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== scrypt-js@^3.0.0: version "3.0.1" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" + resolved "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== secp256k1@^4.0.1: version "4.0.3" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-4.0.3.tgz#c4559ecd1b8d3c1827ed2d1b94190d69ce267303" + resolved "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz" integrity sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA== dependencies: elliptic "^6.5.4" @@ -1885,34 +1841,34 @@ secp256k1@^4.0.1: semver@^5.5.0: version "5.7.2" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" + resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== semver@^6.3.0: version "6.3.1" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== serialize-javascript@6.0.0: version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" + resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== dependencies: randombytes "^2.1.0" setimmediate@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" + resolved "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz" integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA== setprototypeof@1.2.0: version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + resolved "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz" integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" + resolved "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz" integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== dependencies: inherits "^2.0.1" @@ -1920,12 +1876,12 @@ sha.js@^2.4.0, sha.js@^2.4.8: sisteransi@^1.0.5: version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" + resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== slice-ansi@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" + resolved "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz" integrity sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ== dependencies: ansi-styles "^4.0.0" @@ -1934,7 +1890,7 @@ slice-ansi@^4.0.0: solc@0.7.3: version "0.7.3" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a" + resolved "https://registry.npmjs.org/solc/-/solc-0.7.3.tgz" integrity sha512-GAsWNAjGzIDg7VxzP6mPjdurby3IkGCjQcM8GFYZT6RyaoUZKmMU6Y7YwG+tFGhv7dwZ8rmR4iwFDrrD99JwqA== dependencies: command-exists "^1.2.8" @@ -1949,7 +1905,7 @@ solc@0.7.3: source-map-support@^0.5.13: version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" @@ -1957,31 +1913,31 @@ source-map-support@^0.5.13: source-map@^0.6.0: version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== split2@^3.0.0: version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" + resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== dependencies: readable-stream "^3.0.0" stacktrace-parser@^0.1.10: version "0.1.10" - resolved "https://registry.yarnpkg.com/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz#29fb0cae4e0d0b85155879402857a1639eb6051a" + resolved "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz" integrity sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg== dependencies: type-fest "^0.7.1" statuses@2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + resolved "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz" integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" @@ -1990,54 +1946,54 @@ string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2 string_decoder@^1.1.1: version "1.3.0" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: safe-buffer "~5.2.0" strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-hex-prefix@1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz#0c5f155fef1151373377de9dbb588da05500e36f" + resolved "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz" integrity sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A== dependencies: is-hex-prefixed "1.0.0" strip-json-comments@3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== supports-color@8.1.1: version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== dependencies: has-flag "^4.0.0" supports-color@^5.3.0: version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== dependencies: has-flag "^3.0.0" supports-color@^7.1.0: version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz" integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== dependencies: has-flag "^4.0.0" table@^6.8.0: version "6.8.2" - resolved "https://registry.yarnpkg.com/table/-/table-6.8.2.tgz#c5504ccf201213fa227248bdc8c5569716ac6c58" + resolved "https://registry.npmjs.org/table/-/table-6.8.2.tgz" integrity sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA== dependencies: ajv "^8.0.1" @@ -2048,129 +2004,124 @@ table@^6.8.0: through2@^4.0.0: version "4.0.2" - resolved "https://registry.yarnpkg.com/through2/-/through2-4.0.2.tgz#a7ce3ac2a7a8b0b966c80e7c49f0484c3b239764" + resolved "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz" integrity sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw== dependencies: readable-stream "3" tmp@0.0.33: version "0.0.33" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz" integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== dependencies: os-tmpdir "~1.0.2" to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + resolved "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" toidentifier@1.0.1: version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + resolved "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz" integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tslib@2.4.0: version "2.4.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz" integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== tslib@^1.9.3: version "1.14.1" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== tsort@0.0.1: version "0.0.1" - resolved "https://registry.yarnpkg.com/tsort/-/tsort-0.0.1.tgz#e2280f5e817f8bf4275657fd0f9aebd44f5a2786" + resolved "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz" integrity sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw== tweetnacl-util@^0.15.1: version "0.15.1" - resolved "https://registry.yarnpkg.com/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz#b80fcdb5c97bcc508be18c44a4be50f022eea00b" + resolved "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz" integrity sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw== tweetnacl@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-1.0.3.tgz#ac0af71680458d8a6378d0d0d050ab1407d35596" + resolved "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz" integrity sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw== type-fest@^0.20.2: version "0.20.2" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== type-fest@^0.21.3: version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== type-fest@^0.7.1: version "0.7.1" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" + resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz" integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== - undici@^5.14.0: version "5.28.4" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.28.4.tgz#6b280408edb6a1a604a9b20340f45b422e373068" + resolved "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz" integrity sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g== dependencies: "@fastify/busboy" "^2.0.0" universalify@^0.1.0: version "0.1.2" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" + resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== universalify@^2.0.0: version "2.0.1" - resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d" + resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== unpipe@1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== uri-js@^4.4.1: version "4.4.1" - resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== dependencies: punycode "^2.1.0" util-deprecate@^1.0.1: version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + resolved "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== uuid@^8.3.2: version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== widest-line@^3.1.0: version "3.1.0" - resolved "https://registry.yarnpkg.com/widest-line/-/widest-line-3.1.0.tgz#8292333bbf66cb45ff0de1603b136b7ae1496eca" + resolved "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz" integrity sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg== dependencies: string-width "^4.0.0" workerpool@6.2.1: version "6.2.1" - resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" + resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -2179,37 +2130,32 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== ws@8.17.1: version "8.17.1" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + resolved "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz" integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== ws@^7.4.6: version "7.5.10" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + resolved "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== y18n@^5.0.5: version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + resolved "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yargs-parser@20.2.4: +yargs-parser@20.2.4, yargs-parser@^20.2.2: version "20.2.4" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-unparser@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== dependencies: camelcase "^6.0.0" @@ -2219,7 +2165,7 @@ yargs-unparser@2.0.0: yargs@16.2.0: version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -2232,5 +2178,5 @@ yargs@16.2.0: yocto-queue@^0.1.0: version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..0193dee3 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.83.0" diff --git a/stylus-proc/Cargo.toml b/stylus-proc/Cargo.toml index c5a5b432..24f781e3 100644 --- a/stylus-proc/Cargo.toml +++ b/stylus-proc/Cargo.toml @@ -16,15 +16,24 @@ alloy-sol-types.workspace = true cfg-if.workspace = true convert_case.workspace = true lazy_static.workspace = true +proc-macro-error.workspace = true proc-macro2.workspace = true +quote.workspace = true regex.workspace = true sha3.workspace = true syn.workspace = true syn-solidity.workspace = true -quote.workspace = true +trybuild.workspace = true + +[dev-dependencies] +paste.workspace = true +pretty_assertions.workspace = true +prettyplease.workspace = true +stylus-sdk.workspace = true [features] -export-abi = [] +default = [] +export-abi = ["stylus-sdk/export-abi"] reentrant = [] [package.metadata.docs.rs] diff --git a/stylus-proc/README.md b/stylus-proc/README.md new file mode 100644 index 00000000..820b0d81 --- /dev/null +++ b/stylus-proc/README.md @@ -0,0 +1,38 @@ +# stylus_proc + +Procedural Macros for Stylus SDK + +## Macro usage + +Macro usage should be done through the [stylus-sdk] crate. Refer to the +[documentation] for additional information and examples. + +## Development Considerations + +### Error handling + +The [proc_macro_error] crate is used for error handling to ensure consistency +across rust versions and for convenience. + +Prefer [emit_error!] where possible to allow multiple errors to be displayed to +the user. If an error is reached where compilation must be halted, [abort!] +should be used instead. + +### Testing + +Procedural macro implementations should be written in a way that returns AST +data structures from the [syn] crate before converting them to +[proc_macro::TokenStream]. This allows the implementation to be unit tested +within its module to ensure the generated code is as expected. + +The [trybuild] crate is used to write test cases which should fail to compile. +These tests are located in [tests/fail/] directory. + +[stylus-sdk]: https://crates.io/crates/stylus-sdk +[documentation]: https://crates.io/crates/stylus-proc +[proc_macro_error]: https://crates.io/crates/proc-macro-error +[emit_error!]: https://docs.rs/proc-macro-error/latest/proc_macro_error/macro.emit_error.html +[abort!]: https://docs.rs/proc-macro-error/latest/proc_macro_error/macro.abort.html +[syn]: https://crates.io/crates/syn +[proc_macro::TokenStream]: https://docs.rs/proc-macro/latest/proc_macro/struct.TokenStream.html +[trybuild]: https://crates.io/crates/trybuild diff --git a/stylus-proc/src/calls/mod.rs b/stylus-proc/src/calls/mod.rs deleted file mode 100644 index 3ec558d1..00000000 --- a/stylus-proc/src/calls/mod.rs +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2023-2024, Offchain Labs, Inc. -// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md - -use crate::types::solidity_type_info; -use convert_case::{Case, Casing}; -use proc_macro::TokenStream; -use proc_macro2::Ident; -use quote::quote; -use sha3::{Digest, Keccak256}; -use std::borrow::Cow; -use syn_solidity::{FunctionAttribute, Item, Mutability, SolIdent, Spanned, Visibility}; - -pub fn sol_interface(input: TokenStream) -> TokenStream { - let input = match syn_solidity::parse(input) { - Ok(f) => f, - Err(err) => return err.to_compile_error().into(), - }; - - use crate::types::Purity::*; - let alloy_address = quote!(stylus_sdk::alloy_primitives::Address); - let sol_address = quote!(stylus_sdk::alloy_sol_types::sol_data::Address); - let sol_type = quote!(stylus_sdk::alloy_sol_types::SolType); - let sol_value = quote!(stylus_sdk::alloy_sol_types::SolValue); - let sol_type_value = quote!(stylus_sdk::alloy_sol_types::private::SolTypeValue); - - let mut output = quote!(); - - for item in input.items { - let mut method_impls = quote!(); - - let Item::Contract(contract) = item else { - error!(item.span(), "not an interface") - }; - if !contract.is_interface() { - error!(contract.kind.span(), "not an interface"); - } - if let Some(inherits) = contract.inheritance { - error!(inherits.span(), "inheritance is not currently supported"); - } - - let name = &contract.name; - - for item in contract.body { - let Item::Function(func) = item else { - error!(item.span(), "unsupported interface item"); - }; - // uncomment when Alloy exposes this enum - // if let FunctionKind::Function(_) = func.kind { - // continue; - // } - let Some(name) = &func.name else { - continue; - }; - - // determine the purity - let mut purity = None; - let mut external = false; - for attr in &func.attributes.0 { - match attr { - FunctionAttribute::Mutability(mutability) => { - if purity.is_some() { - error!(attr.span(), "more than one purity attribute specified"); - } - purity = Some(match mutability { - Mutability::Pure(_) => Pure, - Mutability::View(_) => View, - Mutability::Payable(_) => Payable, - Mutability::Constant(_) => { - error!( - mutability.span(), - "constant mutability no longer supported" - ); - } - }); - } - FunctionAttribute::Visibility(vis) => match vis { - Visibility::External(_) => { - external = true; - } - _ => { - error!(vis.span(), "visibility must be `external`"); - } - }, - _ => error!(attr.span(), "unsupported function attribute"), - } - } - if !external { - error!(func.span(), "visibility must be explicty set to `external`"); - } - let purity = purity.unwrap_or(Write); - - // determine which context and kind of call to use - let (context, call) = match purity { - Pure | View => ( - quote! { impl stylus_sdk::call::StaticCallContext }, - quote! { stylus_sdk::call::static_call }, - ), - Write => ( - quote! { impl stylus_sdk::call::NonPayableCallContext }, - quote! { stylus_sdk::call::call }, - ), - Payable => ( - quote! { impl stylus_sdk::call::MutatingCallContext }, - quote! { stylus_sdk::call::call }, - ), - }; - - macro_rules! parse { - ($data:expr) => { - match syn::parse_str(&$data) { - Ok(ty) => ty, - Err(err) => return err.to_compile_error().into(), - } - }; - } - - // get the return type - let return_type = match func.return_type() { - Some(ty) => solidity_type_info(&ty).0, - None => Cow::from("()"), - }; - let return_type: syn::Type = parse!(&return_type); - - let mut selector = Keccak256::new(); - selector.update(name.to_string()); - selector.update("("); - let mut sol_args = vec![]; - let mut rust_args = vec![]; - let mut rust_arg_names = vec![]; - for (i, arg) in func.parameters.iter().enumerate() { - let (sol_path, abi) = solidity_type_info(&arg.ty); - if i > 0 { - selector.update(","); - } - selector.update(&*abi); - - let ty: syn::Type = parse!(&sol_path); - let name = arg - .name - .as_ref() - .map(Cow::Borrowed) - .unwrap_or_else(|| Cow::Owned(SolIdent::new(&format!("argument_{}", i)))); - - rust_args.push(quote! { - #name: <#ty as #sol_type>::RustType - }); - sol_args.push(ty); - rust_arg_names.push(name); - } - selector.update(")"); - - let selector = selector.finalize(); - let selector0 = selector[0]; - let selector1 = selector[1]; - let selector2 = selector[2]; - let selector3 = selector[3]; - - let rust_name = Ident::new(&name.to_string().to_case(Case::Snake), name.span()); - - method_impls.extend(quote! { - pub fn #rust_name(&self, context: #context #(, #rust_args)*) -> - Result<<#return_type as #sol_type>::RustType, stylus_sdk::call::Error> - { - use alloc::vec; - let args = <(#(#sol_args,)*) as #sol_type>::abi_encode_params(&(#(#rust_arg_names,)*)); - let mut calldata = vec![#selector0, #selector1, #selector2, #selector3]; - calldata.extend(args); - let returned = #call(context, self.address, &calldata)?; - Ok(<(#return_type,) as #sol_type>::abi_decode_params(&returned, true)?.0) - } - }); - } - - output.extend(quote! { - pub struct #name { - pub address: #alloy_address, - } - - impl #name { - pub fn new(address: #alloy_address) -> Self { - Self { address } - } - - #method_impls - } - - impl core::ops::Deref for #name { - type Target = #alloy_address; - - fn deref(&self) -> &Self::Target { - &self.address - } - } - - impl #sol_value for #name { - type SolType = #name; - } - - impl #sol_type_value for #name { - #[inline] - fn stv_to_tokens(&self) -> ::Token<'_> { - <#sol_address as #sol_type>::tokenize(&self.address) - } - - #[inline] - fn stv_abi_encoded_size(&self) -> usize { - <#sol_address as #sol_type>::abi_encoded_size(&self.address) - } - - #[inline] - fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { - <#sol_address as #sol_type>::eip712_data_word(&self.address) - } - - #[inline] - fn stv_abi_encode_packed_to(&self, out: &mut alloy_sol_types::private::Vec) { - <#sol_address as #sol_type>::abi_encode_packed_to(&self.address, out) - } - } - - impl #sol_type for #name { - type RustType = #name; - - type Token<'a> = <#sol_address as #sol_type>::Token<'a>; - - const SOL_NAME: &'static str = <#sol_address as #sol_type>::SOL_NAME; - - const ENCODED_SIZE: Option = <#sol_address as #sol_type>::ENCODED_SIZE; - - fn valid_token(token: &Self::Token<'_>) -> bool { - <#sol_address as #sol_type>::valid_token(token) - } - - fn detokenize(token: Self::Token<'_>) -> Self::RustType { - #name::new(#sol_address::detokenize(token)) - } - } - - impl stylus_sdk::abi::AbiType for #name { - type SolType = #name; - - const ABI: stylus_sdk::abi::ConstString = <#alloy_address as stylus_sdk::abi::AbiType>::ABI; - } - }); - } - output.into() -} diff --git a/stylus-proc/src/consts.rs b/stylus-proc/src/consts.rs new file mode 100644 index 00000000..dba0cc7b --- /dev/null +++ b/stylus-proc/src/consts.rs @@ -0,0 +1,35 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Constants for name definitions in generated code. +//! +//! Any generated globals or associated items should use a `__stylus` prefix to avoid name +//! collisions. + +use proc_macro2::{Span, TokenStream}; +use quote::ToTokens; + +/// Name of the entrypoint function that is generated for struct-based contracts. +pub const STRUCT_ENTRYPOINT_FN: ConstIdent = ConstIdent("__stylus_struct_entrypoint"); + +/// Name of the associated function that can be called to assert safe overrides at compile-time. +pub const ASSERT_OVERRIDES_FN: ConstIdent = ConstIdent("__stylus_assert_overrides"); + +/// Name of the associated function that can be called to check safe overriding of a single +/// function. +pub const ALLOW_OVERRIDE_FN: ConstIdent = ConstIdent("__stylus_allow_override"); + +/// Definition of a constant identifier +pub struct ConstIdent(&'static str); + +impl ConstIdent { + pub fn as_ident(&self) -> syn::Ident { + syn::Ident::new(self.0, Span::call_site()) + } +} + +impl ToTokens for ConstIdent { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.as_ident().to_tokens(tokens); + } +} diff --git a/stylus-proc/src/impls/abi_proxy.rs b/stylus-proc/src/impls/abi_proxy.rs new file mode 100644 index 00000000..cf17dece --- /dev/null +++ b/stylus-proc/src/impls/abi_proxy.rs @@ -0,0 +1,213 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Generate implementations of [`stylus_sdk::abi::AbiType`] and all required associated traits by +//! proxying to an existing type which implements these traits. +//! +//! The type being implemented must implement `From` and `Deref`. + +use proc_macro2::TokenStream; +use quote::ToTokens; +use syn::parse_quote; + +use crate::imports::{ + alloy_sol_types::{private::SolTypeValue, SolType, SolValue}, + stylus_sdk::abi::AbiType, +}; + +/// Implementations of all traits required for a [`stylus_sdk::abi::AbiType`]. +#[derive(Debug)] +pub struct ImplAbiProxy { + abi_type: syn::ItemImpl, + sol_type: syn::ItemImpl, + sol_value: syn::ItemImpl, + sol_type_value: syn::ItemImpl, +} + +impl ImplAbiProxy { + /// Generate all the required implementations. + pub fn new(self_ty: &syn::Ident, proxy_ty: &syn::Type, sol_ty: &syn::Type) -> Self { + Self { + abi_type: impl_abi_type(self_ty, proxy_ty), + sol_type: impl_sol_type(self_ty, sol_ty), + sol_value: impl_sol_value(self_ty), + sol_type_value: impl_sol_type_value(self_ty, sol_ty), + } + } +} + +impl ToTokens for ImplAbiProxy { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.abi_type.to_tokens(tokens); + self.sol_type.to_tokens(tokens); + self.sol_value.to_tokens(tokens); + self.sol_type_value.to_tokens(tokens); + } +} + +/// Implement [`stylus_sdk::abi::AbiType`]. +fn impl_abi_type(self_ty: &syn::Ident, proxy_ty: &syn::Type) -> syn::ItemImpl { + parse_quote! { + impl #AbiType for #self_ty { + type SolType = #self_ty; + + const ABI: stylus_sdk::abi::ConstString = <#proxy_ty as #AbiType>::ABI; + } + } +} + +/// Implement [`alloy_sol_types::SolType`]. +fn impl_sol_type(self_ty: &syn::Ident, sol_ty: &syn::Type) -> syn::ItemImpl { + parse_quote! { + impl #SolType for #self_ty { + type RustType = #self_ty; + type Token<'a> = <#sol_ty as #SolType>::Token<'a>; + + const SOL_NAME: &'static str = <#sol_ty as #SolType>::SOL_NAME; + const ENCODED_SIZE: Option = <#sol_ty as #SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = <#sol_ty as #SolType>::PACKED_ENCODED_SIZE; + + fn valid_token(token: &Self::Token<'_>) -> bool { + <#sol_ty as #SolType>::valid_token(token) + } + + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + #sol_ty::detokenize(token).into() + } + } + } +} + +/// Implement [`alloy_sol_types::SolValue`]. +fn impl_sol_value(self_ty: &syn::Ident) -> syn::ItemImpl { + parse_quote! { + impl #SolValue for #self_ty { + type SolType = #self_ty; + } + } +} + +/// Implement [`alloy_sol_types::private::SolTypeValue`]. +fn impl_sol_type_value(self_ty: &syn::Ident, sol_ty: &syn::Type) -> syn::ItemImpl { + parse_quote! { + impl #SolTypeValue for #self_ty { + #[inline] + fn stv_to_tokens(&self) -> ::Token<'_> { + use core::ops::Deref; + <#sol_ty as #SolType>::tokenize(self.deref()) + } + + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + use core::ops::Deref; + <#sol_ty as #SolType>::abi_encoded_size(self.deref()) + } + + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + use core::ops::Deref; + <#sol_ty as #SolType>::abi_packed_encoded_size(self.deref()) + } + + #[inline] + fn stv_eip712_data_word(&self) -> stylus_sdk::alloy_sol_types::Word { + use core::ops::Deref; + <#sol_ty as #SolType>::eip712_data_word(self.deref()) + } + + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut stylus_sdk::alloy_sol_types::private::Vec) { + use core::ops::Deref; + <#sol_ty as #SolType>::abi_encode_packed_to(self.deref(), out) + } + } + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::ImplAbiProxy; + use crate::utils::testing::assert_ast_eq; + + #[test] + fn test_impl_abi_proxy() { + let proxy = ImplAbiProxy::new(&parse_quote!(Foo), &parse_quote!(Bar), &parse_quote!(Baz)); + assert_ast_eq( + proxy.abi_type, + parse_quote! { + impl stylus_sdk::abi::AbiType for Foo { + type SolType = Foo; + + const ABI: stylus_sdk::abi::ConstString = ::ABI; + } + }, + ); + assert_ast_eq( + proxy.sol_type, + parse_quote! { + impl stylus_sdk::alloy_sol_types::SolType for Foo { + type RustType = Foo; + type Token<'a> = ::Token<'a>; + + const SOL_NAME: &'static str = ::SOL_NAME; + const ENCODED_SIZE: Option = ::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = ::PACKED_ENCODED_SIZE; + + fn valid_token(token: &Self::Token<'_>) -> bool { + ::valid_token(token) + } + + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + Baz::detokenize(token).into() + } + } + }, + ); + assert_ast_eq( + proxy.sol_value, + parse_quote! { + impl stylus_sdk::alloy_sol_types::SolValue for Foo { + type SolType = Foo; + } + }, + ); + assert_ast_eq( + proxy.sol_type_value, + parse_quote! { + impl stylus_sdk::alloy_sol_types::private::SolTypeValue for Foo { + #[inline] + fn stv_to_tokens(&self) -> ::Token<'_> { + use core::ops::Deref; + ::tokenize(self.deref()) + } + + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + use core::ops::Deref; + ::abi_encoded_size(self.deref()) + } + + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + use core::ops::Deref; + ::abi_packed_encoded_size(self.deref()) + } + + #[inline] + fn stv_eip712_data_word(&self) -> stylus_sdk::alloy_sol_types::Word { + use core::ops::Deref; + ::eip712_data_word(self.deref()) + } + + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut stylus_sdk::alloy_sol_types::private::Vec) { + use core::ops::Deref; + ::abi_encode_packed_to(self.deref(), out) + } + } + }, + ); + } +} diff --git a/stylus-proc/src/methods/mod.rs b/stylus-proc/src/impls/mod.rs similarity index 50% rename from stylus-proc/src/methods/mod.rs rename to stylus-proc/src/impls/mod.rs index a53efc2c..eacd89c5 100644 --- a/stylus-proc/src/methods/mod.rs +++ b/stylus-proc/src/impls/mod.rs @@ -1,6 +1,6 @@ -// Copyright 2022-2024, Offchain Labs, Inc. +// Copyright 2023-2024, Offchain Labs, Inc. // For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md -pub mod entrypoint; -pub mod error; -pub mod public; +//! Generate trait implementations. + +pub mod abi_proxy; diff --git a/stylus-proc/src/imports.rs b/stylus-proc/src/imports.rs new file mode 100644 index 00000000..8ea00fe6 --- /dev/null +++ b/stylus-proc/src/imports.rs @@ -0,0 +1,95 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Constants for referencing imports within generated code. +//! +//! These constants use a fully qualified path with dependencies nested within [`stylus_sdk`] to +//! ensure compatibility. +//! +//! Usage: +//! ```compile_fail +//! use crate::imports::alloy_primitives::Address; +//! +//! let _ = quote! { +//! let addr = #Address::random(); +//! }; +//! ``` + +#![allow(non_upper_case_globals)] + +use proc_macro2::TokenStream; +use quote::ToTokens; + +pub mod alloy_primitives { + use crate::imports::ConstPath; + + pub const Address: ConstPath = ConstPath("stylus_sdk::alloy_primitives::Address"); +} + +pub mod alloy_sol_types { + use crate::imports::ConstPath; + + pub const SolType: ConstPath = ConstPath("stylus_sdk::alloy_sol_types::SolType"); + pub const SolValue: ConstPath = ConstPath("stylus_sdk::alloy_sol_types::SolValue"); + + pub mod private { + use crate::imports::ConstPath; + + pub const SolTypeValue: ConstPath = + ConstPath("stylus_sdk::alloy_sol_types::private::SolTypeValue"); + } + + pub mod sol_data { + use syn::parse::Parse; + + use crate::imports::ConstPath; + + pub const Address: ConstPath = ConstPath("stylus_sdk::alloy_sol_types::sol_data::Address"); + + /// Build path or type to member of the `alloy_sol_types::sol_data` module. + /// + /// This should not be used on user input, as parsing should be expected to succeed. + pub fn join(name: &str) -> T { + syn::parse_str(&format!("stylus_sdk::alloy_sol_types::sol_data::{name}")).unwrap() + } + } +} + +pub mod stylus_sdk { + pub mod abi { + use crate::imports::ConstPath; + + pub const AbiType: ConstPath = ConstPath("stylus_sdk::abi::AbiType"); + pub const Router: ConstPath = ConstPath("stylus_sdk::abi::Router"); + } +} + +/// Definition of a fully-qualified path for generated code. +pub struct ConstPath(&'static str); + +impl ConstPath { + /// Interpret the path as a [`syn::Type`]. + pub fn as_type(&self) -> syn::Type { + syn::parse_str(self.0).unwrap() + } +} + +impl ToTokens for ConstPath { + fn to_tokens(&self, tokens: &mut TokenStream) { + let path: syn::Path = syn::parse_str(self.0).unwrap(); + path.to_tokens(tokens); + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + #[test] + fn test_const_path() { + assert_eq!( + super::alloy_primitives::Address.as_type(), + parse_quote!(stylus_sdk::alloy_primitives::Address), + ); + } +} diff --git a/stylus-proc/src/lib.rs b/stylus-proc/src/lib.rs index ab0165da..57415807 100644 --- a/stylus-proc/src/lib.rs +++ b/stylus-proc/src/lib.rs @@ -5,7 +5,7 @@ //! //! You can import these via //! -//! ```ignore +//! ``` //! use stylus_sdk::prelude::*; //! ``` //! @@ -17,6 +17,7 @@ #![warn(missing_docs)] use proc_macro::TokenStream; +use proc_macro_error::proc_macro_error; /// Generates a pretty error message. /// Note that this macro is declared before all modules so that they can use it. @@ -30,14 +31,18 @@ macro_rules! error { }}; } -mod calls; -mod methods; -mod storage; +mod consts; +mod impls; +mod imports; +mod macros; mod types; +mod utils; /// Allows a Rust `struct` to be used in persistent storage. /// -/// ```ignore +/// ``` +/// # use stylus_sdk::storage::{StorageAddress, StorageBool}; +/// # use stylus_proc::storage; /// #[storage] /// pub struct Contract { /// owner: StorageAddress, @@ -64,15 +69,17 @@ mod types; /// [overview]: https://docs.arbitrum.io/stylus/reference/rust-sdk-guide#storage /// [sdk]: https://docs.rs/stylus-sdk/latest/stylus_sdk/index.html #[proc_macro_attribute] +#[proc_macro_error] pub fn storage(attr: TokenStream, input: TokenStream) -> TokenStream { - storage::storage(attr, input) + macros::storage(attr, input) } #[doc(hidden)] #[deprecated = "please use `#[storage]` instead"] #[proc_macro_attribute] +#[proc_macro_error] pub fn solidity_storage(attr: TokenStream, input: TokenStream) -> TokenStream { - storage::storage(attr, input) + macros::storage(attr, input) } /// The types in [`#[storage]`][storage] are laid out in the EVM state trie exactly @@ -80,19 +87,21 @@ pub fn solidity_storage(attr: TokenStream, input: TokenStream) -> TokenStream { /// to the same storage slots as they would in EVM programming languages. Hence, it is often nice to /// define types using Solidity syntax, which makes this guarantee easier to see. /// -/// ```ignore +/// ``` +/// # use stylus_proc::sol_storage; /// sol_storage! { /// pub struct Contract { /// address owner; // becomes a StorageAddress /// bool active; // becomes a StorageBool -/// SubStruct sub_struct, +/// SubStruct sub_struct; /// } /// /// pub struct SubStruct { /// // other solidity fields, such as /// mapping(address => uint) balances; // becomes a StorageMap -/// Delegate delegates[]; // becomes a StorageVec +/// Delegate[] delegates; // becomes a StorageVec /// } +/// # pub struct Delegate {} /// } /// ``` /// @@ -121,19 +130,21 @@ pub fn solidity_storage(attr: TokenStream, input: TokenStream) -> TokenStream { /// [overview]: https://docs.arbitrum.io/stylus/reference/rust-sdk-guide#erase-and-deriveerase /// [erc20]: https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/examples/erc20/src/main.rs #[proc_macro] +#[proc_macro_error] pub fn sol_storage(input: TokenStream) -> TokenStream { - storage::sol_storage(input) + macros::sol_storage(input) } /// Facilitates calls to other contracts. /// /// This macro defines a `struct` for each of the Solidity interfaces provided. /// -/// ```ignore +/// ``` +/// # use stylus_proc::sol_interface; /// sol_interface! { /// interface IService { -/// function makePayment(address user) payable returns (string); -/// function getConstant() pure returns (bytes32) +/// function makePayment(address user) external payable returns (string); +/// function getConstant() external pure returns (bytes32); /// } /// /// interface ITree { @@ -147,9 +158,20 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// For example, `IService` will have a `make_payment` method that accepts an [`Address`] and returns a [`B256`]. /// /// Currently only functions are supported, and any other items in the interface will cause an -/// error. +/// error. Additionally, each function must be marked `external`. Inheritance is not supported. /// -/// ```ignore +/// ``` +/// use stylus_sdk::call::{Call, Error}; +/// use alloy_primitives::Address; +/// # use stylus_proc::sol_interface; +/// +/// # sol_interface! { +/// # interface IService { +/// # function makePayment(address user) external payable returns (string); +/// # } +/// # } +/// # mod evm { pub fn gas_left() -> u64 { 100 } } +/// # mod msg { pub fn value() -> alloy_primitives::U256 { 100.try_into().unwrap() } } /// pub fn do_call(account: IService, user: Address) -> Result { /// let config = Call::new() /// .gas(evm::gas_left() / 2) // limit to half the gas left @@ -160,7 +182,11 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// ``` /// /// Observe the casing change. [`sol_interface!`] computes the selector based on the exact name passed in, -/// which should almost always be `CamelCase`. For aesthetics, the rust functions will instead use `snake_case`. +/// which should almost always be `camelCase`. For aesthetics, the rust functions will instead use `snake_case`. +/// +/// Note that structs may be used, as return types for example. Trying to reference structs using +/// the Solidity path separator (`module.MyStruct`) is supported and paths will be converted to +/// Rust syntax (`module::MyStruct`). /// /// # Reentrant calls /// @@ -168,7 +194,10 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// When enabled, cross-contract calls must [`flush`] or [`clear`] the [`StorageCache`] to safeguard state. /// This happens automatically via the type system. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use stylus_sdk::call::Call; +/// # use stylus_proc::{entrypoint, public, sol_interface, storage}; /// sol_interface! { /// interface IMethods { /// function pureFoo() external pure; @@ -178,6 +207,7 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// } /// } /// +/// # #[entrypoint] #[storage] struct Contract {} /// #[public] /// impl Contract { /// pub fn call_pure(&self, methods: IMethods) -> Result<(), Vec> { @@ -189,7 +219,7 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// } /// /// pub fn call_write(&mut self, methods: IMethods) -> Result<(), Vec> { -/// methods.view_foo(self)?; // allows `pure` and `view` methods too +/// methods.view_foo(&mut *self)?; // allows `pure` and `view` methods too /// Ok(methods.write_foo(self)?) /// } /// @@ -209,7 +239,18 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// When writing Stylus libraries, a type might not be [`TopLevelStorage`] and therefore /// `&self` or `&mut self` won't work. Building a [`Call`] from a generic parameter is the usual solution. /// -/// ```ignore +/// ``` +/// use stylus_sdk::{call::{Call, Error}, storage::TopLevelStorage}; +/// use alloy_primitives::Address; +/// # use stylus_proc::sol_interface; +/// +/// # sol_interface! { +/// # interface IService { +/// # function makePayment(address user) external payable returns (string); +/// # } +/// # } +/// # mod evm { pub fn gas_left() -> u64 { 100 } } +/// # mod msg { pub fn value() -> alloy_primitives::U256 { 100.try_into().unwrap() } } /// pub fn do_call( /// storage: &mut impl TopLevelStorage, // can be generic, but often just &mut self /// account: IService, // serializes as an Address @@ -224,7 +265,7 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// } /// ``` /// -/// Note that in the context of an [`#[public]`][public] call, the `&mut impl` argument will correctly +/// Note that in the context of a [`#[public]`][public] call, the `&mut impl` argument will correctly /// distinguish the method as being `write` or `payable`. This means you can write library code that will /// work regardless of whether the `reentrant` feature flag is enabled. /// @@ -238,8 +279,9 @@ pub fn sol_storage(input: TokenStream) -> TokenStream { /// [`B256`]: https://docs.rs/alloy-primitives/latest/alloy_primitives/aliases/type.B256.html /// [`Call`]: https://docs.rs/stylus-sdk/latest/stylus_sdk/call/struct.Call.html #[proc_macro] +#[proc_macro_error] pub fn sol_interface(input: TokenStream) -> TokenStream { - calls::sol_interface(input) + macros::sol_interface(input) } /// Some [`StorageType`] values implement [`Erase`], which provides an [`erase()`] method for clearing state. @@ -250,7 +292,8 @@ pub fn sol_interface(input: TokenStream) -> TokenStream { /// Structs may also be [`Erase`] if all of the fields are. `#[derive(Erase)]` /// lets you do this automatically. /// -/// ```ignore +/// ``` +/// # use stylus_proc::{Erase, sol_storage}; /// sol_storage! { /// #[derive(Erase)] /// pub struct Contract { @@ -277,13 +320,17 @@ pub fn sol_interface(input: TokenStream) -> TokenStream { /// [overview]: https://docs.arbitrum.io/stylus/reference/rust-sdk-guide#storage /// [sdk]: https://docs.rs/stylus-sdk/latest/stylus_sdk/index.html #[proc_macro_derive(Erase)] +#[proc_macro_error] pub fn derive_erase(input: TokenStream) -> TokenStream { - storage::derive_erase(input) + macros::derive_erase(input) } /// Allows an error `enum` to be used in method signatures. /// -/// ```ignore +/// ``` +/// # use alloy_sol_types::sol; +/// # use stylus_proc::{public, SolidityError}; +/// # extern crate alloc; /// sol! { /// error InsufficientBalance(address from, uint256 have, uint256 want); /// error InsufficientAllowance(address owner, address spender, uint256 have, uint256 want); @@ -295,10 +342,12 @@ pub fn derive_erase(input: TokenStream) -> TokenStream { /// InsufficientAllowance(InsufficientAllowance), /// } /// +/// # struct Contract {} /// #[public] /// impl Contract { /// pub fn fallible_method() -> Result<(), Erc20Error> { /// // code that might revert +/// # Ok(()) /// } /// } /// ``` @@ -306,26 +355,30 @@ pub fn derive_erase(input: TokenStream) -> TokenStream { /// Under the hood, the above macro works by implementing `From` for `Vec` /// along with printing code for abi-export. #[proc_macro_derive(SolidityError)] +#[proc_macro_error] pub fn derive_solidity_error(input: TokenStream) -> TokenStream { - methods::error::derive_solidity_error(input) + macros::derive_solidity_error(input) } /// Defines the entrypoint, which is where Stylus execution begins. /// Without it the contract will fail to pass [`cargo stylus check`][check]. /// Most commonly this macro is used to annotate the top level storage `struct`. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use stylus_proc::{entrypoint, public, sol_storage}; /// sol_storage! { /// #[entrypoint] /// pub struct Contract { -/// ... +/// // ... /// } /// /// // only one entrypoint is allowed /// pub struct SubStruct { -/// ... +/// // ... /// } /// } +/// # #[public] impl Contract {} /// ``` /// /// The above will make the public methods of Contract the first to consider during invocation. @@ -337,10 +390,13 @@ pub fn derive_solidity_error(input: TokenStream) -> TokenStream { /// When applied to a free-standing function, a different way of writing smart contracts becomes possible, /// wherein the Stylus SDK's macros and storage types are entirely optional. /// -/// ```ignore +/// ``` +/// # use stylus_sdk::ArbResult; +/// # use stylus_proc::entrypoint; /// #[entrypoint] /// fn entrypoint(calldata: Vec) -> ArbResult { /// // bytes-in, bytes-out programming +/// # Ok(Vec::new()) /// } /// ``` /// @@ -377,8 +433,9 @@ pub fn derive_solidity_error(input: TokenStream) -> TokenStream { /// [public]: macro@public /// [check]: https://github.com/OffchainLabs/cargo-stylus#developing-with-stylus #[proc_macro_attribute] +#[proc_macro_error] pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { - methods::entrypoint::entrypoint(attr, input) + macros::entrypoint(attr, input) } /// Just as with storage, Stylus SDK methods are Solidity ABI-equivalent. This means that contracts written @@ -387,7 +444,14 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// /// This macro makes methods "public" so that other contracts can call them by implementing the [`Router`] trait. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use stylus_sdk::storage::StorageAddress; +/// # use stylus_proc::public; +/// # use alloy_primitives::Address; +/// # struct Contract { +/// # owner: StorageAddress, +/// # } /// #[public] /// impl Contract { /// // our owner method is now callable by other contracts @@ -399,7 +463,8 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// impl Contract { /// // our set_owner method is not /// pub fn set_owner(&mut self, new_owner: Address) -> Result<(), Vec> { -/// ... +/// // ... +/// # Ok(()) /// } /// } /// ``` @@ -410,14 +475,30 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// /// As in Solidity, methods may accept ETH as call value. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use alloy_primitives::Address; +/// # use stylus_proc::{entrypoint, public, storage}; +/// # #[entrypoint] #[storage] struct Contract { #[borrow] erc20: Erc20 } +/// # mod msg { +/// # use alloy_primitives::Address; +/// # pub fn sender() -> Address { Address::ZERO } +/// # pub fn value() -> u32 { 0 } +/// # } /// #[public] /// impl Contract { /// #[payable] -/// pub fn credit(&mut self) -> Result<(), Vec { +/// pub fn credit(&mut self) -> Result<(), Vec> { /// self.erc20.add_balance(msg::sender(), msg::value()) /// } /// } +/// # #[storage] struct Erc20; +/// # #[public] +/// # impl Erc20 { +/// # pub fn add_balance(&self, sender: Address, value: u32) -> Result<(), Vec> { +/// # Ok(()) +/// # } +/// # } /// ``` /// /// In the above, [msg::value][value] is the amount of ETH passed to the contract in wei, which may be used @@ -440,19 +521,26 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// Composition in Rust follows that of Solidity. Types that implement [`Router`], the trait that /// [`#[public]`][public] provides, can be connected via inheritance. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use alloy_primitives::U256; +/// # use stylus_proc::{entrypoint, public, storage}; +/// # #[entrypoint] #[storage] struct Token { #[borrow] erc20: Erc20 } /// #[public] /// #[inherit(Erc20)] /// impl Token { /// pub fn mint(&mut self, amount: U256) -> Result<(), Vec> { -/// ... +/// // ... +/// # Ok(()) /// } /// } /// +/// # #[storage] struct Erc20; /// #[public] /// impl Erc20 { -/// pub fn balance_of() -> Result { -/// ... +/// pub fn balance_of() -> Result> { +/// // ... +/// # Ok(U256::ZERO) /// } /// } /// ``` @@ -479,19 +567,23 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// [`#[storage]`][storage] and [`sol_storage!`][sol_storage] provide a /// `#[borrow]` annotation. /// -/// ```ignore +/// ``` +/// # extern crate alloc; +/// # use stylus_proc::{entrypoint, public, sol_storage}; /// sol_storage! { /// #[entrypoint] /// pub struct Token { /// #[borrow] /// Erc20 erc20; -/// ... +/// // ... /// } /// /// pub struct Erc20 { -/// ... +/// // ... /// } /// } +/// # #[public] impl Token {} +/// # #[public] impl Erc20 {} /// ``` /// /// In the future we plan to simplify the SDK so that [`Borrow`][Borrow] isn't needed and so that @@ -517,7 +609,7 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// which cargo stylus figures out for you. This `main` function is also why the following commonly /// appears in the `main.rs` file of Stylus contracts. /// -/// ```ignore +/// ```no_run /// #![cfg_attr(not(feature = "export-abi"), no_main)] /// ``` /// @@ -555,13 +647,35 @@ pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { /// [cli]: https://github.com/OffchainLabs/cargo-stylus#exporting-solidity-abis /// [dfs]: https://en.wikipedia.org/wiki/Depth-first_search #[proc_macro_attribute] +#[proc_macro_error] pub fn public(attr: TokenStream, input: TokenStream) -> TokenStream { - methods::public::public(attr, input) + macros::public(attr, input) } #[doc(hidden)] #[deprecated = "please use `#[public]` instead"] #[proc_macro_attribute] +#[proc_macro_error] pub fn external(attr: TokenStream, input: TokenStream) -> TokenStream { public(attr, input) } + +/// Implements the AbiType for arbitrary structs, allowing them to be used in external method +/// return types and parameters. This derive is intended to be used within the +/// [alloy_sol_types::sol] macro. +/// +/// ``` +/// # use alloy_sol_types::sol; +/// # use stylus_proc::AbiType; +/// sol! { +/// #[derive(AbiType)] +/// struct Foo { +/// uint256 bar; +/// } +/// } +/// ``` +#[proc_macro_derive(AbiType)] +#[proc_macro_error] +pub fn derive_abi_type(input: TokenStream) -> TokenStream { + macros::derive_abi_type(input) +} diff --git a/stylus-proc/src/macros/derive/abi_type.rs b/stylus-proc/src/macros/derive/abi_type.rs new file mode 100644 index 00000000..ff3b5e14 --- /dev/null +++ b/stylus-proc/src/macros/derive/abi_type.rs @@ -0,0 +1,63 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use proc_macro::TokenStream; +use quote::ToTokens; +use syn::{parse_macro_input, parse_quote}; + +use crate::imports::stylus_sdk::abi::AbiType; + +/// Implementation of the [`#[derive(AbiType)]`][crate::AbiType] macro. +pub fn derive_abi_type(input: TokenStream) -> TokenStream { + let item = parse_macro_input!(input as syn::ItemStruct); + impl_abi_type(&item).into_token_stream().into() +} + +/// Implement [`stylus_sdk::abi::AbiType`] for the given struct. +/// +/// The name is used for the ABI name to match the +/// [`SolType::SOL_NAME`][alloy_sol_types::SolType::SOL_NAME] generated by the +/// [`sol!`][alloy_sol_types::sol] macro. +fn impl_abi_type(item: &syn::ItemStruct) -> syn::ItemImpl { + let name = &item.ident; + let name_str = name.to_string(); + let (impl_generics, ty_generics, where_clause) = item.generics.split_for_impl(); + + parse_quote! { + impl #impl_generics #AbiType for #name #ty_generics #where_clause { + type SolType = Self; + + const ABI: stylus_sdk::abi::ConstString = stylus_sdk::abi::ConstString::new(#name_str); + } + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::impl_abi_type; + use crate::utils::testing::assert_ast_eq; + + #[test] + fn test_impl_abi_type() { + assert_ast_eq( + impl_abi_type(&parse_quote! { + struct Foo + where T: Bar { + a: bool, + b: String, + t: T, + } + }), + parse_quote! { + impl stylus_sdk::abi::AbiType for Foo + where T: Bar { + type SolType = Self; + + const ABI: stylus_sdk::abi::ConstString = stylus_sdk::abi::ConstString::new("Foo"); + } + }, + ) + } +} diff --git a/stylus-proc/src/macros/derive/erase.rs b/stylus-proc/src/macros/derive/erase.rs new file mode 100644 index 00000000..70887b55 --- /dev/null +++ b/stylus-proc/src/macros/derive/erase.rs @@ -0,0 +1,59 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use proc_macro::TokenStream; +use quote::ToTokens; +use syn::{parse_macro_input, parse_quote}; + +/// Implementation of the [`#[derive(Erase)]`][crate::derive_erase] macro. +pub fn derive_erase(input: TokenStream) -> TokenStream { + let node = parse_macro_input!(input as syn::ItemStruct); + impl_erase(&node).into_token_stream().into() +} + +/// Implement [`stylus_sdk::storage::Erase`] for the given struct. +/// +/// Calls `Erase::erase()` on each of the members of the struct. +fn impl_erase(node: &syn::ItemStruct) -> syn::ItemImpl { + let name = &node.ident; + let (impl_generics, ty_generics, where_clause) = node.generics.split_for_impl(); + let fields = node.fields.iter().map(|field| &field.ident); + + parse_quote! { + impl #impl_generics stylus_sdk::storage::Erase for #name #ty_generics #where_clause { + fn erase(&mut self) { + #( + self.#fields.erase(); + )* + } + } + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::*; + use crate::utils::testing::assert_ast_eq; + + #[test] + fn test_impl_erase() { + assert_ast_eq( + impl_erase(&parse_quote! { + struct Foo { + field1: StorageString, + field2: T, + } + }), + parse_quote! { + impl stylus_sdk::storage::Erase for Foo { + fn erase(&mut self) { + self.field1.erase(); + self.field2.erase(); + } + } + }, + ); + } +} diff --git a/stylus-proc/src/macros/derive/mod.rs b/stylus-proc/src/macros/derive/mod.rs new file mode 100644 index 00000000..de6a363b --- /dev/null +++ b/stylus-proc/src/macros/derive/mod.rs @@ -0,0 +1,8 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Implementations of derive macros. + +pub mod abi_type; +pub mod erase; +pub mod solidity_error; diff --git a/stylus-proc/src/macros/derive/solidity_error/export_abi.rs b/stylus-proc/src/macros/derive/solidity_error/export_abi.rs new file mode 100644 index 00000000..4201e37c --- /dev/null +++ b/stylus-proc/src/macros/derive/solidity_error/export_abi.rs @@ -0,0 +1,43 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use syn::parse_quote; + +use super::{DeriveSolidityError, SolidityErrorExtension}; + +#[derive(Debug, Default)] +pub struct InnerTypesExtension { + errors: Vec, +} + +impl SolidityErrorExtension for InnerTypesExtension { + type Ast = syn::ItemImpl; + + fn add_variant(&mut self, field: syn::Field) { + self.errors.push(field); + } + + fn codegen(err: &DeriveSolidityError) -> syn::ItemImpl { + let name = &err.name; + let errors = err._ext.errors.iter(); + parse_quote! { + impl stylus_sdk::abi::export::internal::InnerTypes for #name { + fn inner_types() -> alloc::vec::Vec { + use alloc::{format, vec}; + use core::any::TypeId; + use stylus_sdk::abi::export::internal::InnerType; + use stylus_sdk::alloy_sol_types::SolError; + + vec![ + #( + InnerType { + name: format!("error {};", <#errors as SolError>::SIGNATURE.replace(',', ", ")), + id: TypeId::of::<#errors>(), + } + ),* + ] + } + } + } + } +} diff --git a/stylus-proc/src/macros/derive/solidity_error/mod.rs b/stylus-proc/src/macros/derive/solidity_error/mod.rs new file mode 100644 index 00000000..61670e9e --- /dev/null +++ b/stylus-proc/src/macros/derive/solidity_error/mod.rs @@ -0,0 +1,164 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use cfg_if::cfg_if; +use proc_macro2::TokenStream; +use proc_macro_error::emit_error; +use quote::ToTokens; +use syn::{parse::Nothing, parse_macro_input, parse_quote, Fields}; + +cfg_if! { + if #[cfg(feature = "export-abi")] { + mod export_abi; + type Extension = export_abi::InnerTypesExtension; + } else { + type Extension = (); + } +} + +/// Implementation of the [`#[derive(SolidityError]`][crate::SolidityError] macro. +pub fn derive_solidity_error(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let item = parse_macro_input!(input as syn::ItemEnum); + DeriveSolidityError::from(&item).into_token_stream().into() +} + +#[derive(Debug)] +struct DeriveSolidityError { + name: syn::Ident, + from_impls: Vec, + match_arms: Vec, + _ext: E, +} + +impl DeriveSolidityError { + fn new(name: syn::Ident) -> Self { + Self { + name, + from_impls: Vec::new(), + match_arms: Vec::new(), + _ext: Extension::default(), + } + } + + fn add_variant(&mut self, name: &syn::Ident, field: syn::Field) { + let self_name = &self.name; + let ty = &field.ty; + self.from_impls.push(parse_quote! { + impl From<#ty> for #self_name { + fn from(value: #ty) -> Self { + #self_name::#name(value) + } + } + }); + self.match_arms.push(parse_quote! { + #self_name::#name(e) => stylus_sdk::call::MethodError::encode(e), + }); + #[allow(clippy::unit_arg)] + self._ext.add_variant(field); + } + + fn vec_u8_from_impl(&self) -> syn::ItemImpl { + let name = &self.name; + let match_arms = self.match_arms.iter(); + parse_quote! { + impl From<#name> for alloc::vec::Vec { + fn from(err: #name) -> Self { + match err { + #(#match_arms)* + } + } + } + } + } +} + +impl From<&syn::ItemEnum> for DeriveSolidityError { + fn from(item: &syn::ItemEnum) -> Self { + let mut output = DeriveSolidityError::new(item.ident.clone()); + + for variant in &item.variants { + match &variant.fields { + Fields::Unnamed(e) if variant.fields.len() == 1 => { + let field = e.unnamed.first().unwrap().clone(); + output.add_variant(&variant.ident, field); + } + Fields::Unit => { + emit_error!(variant, "variant not a 1-tuple"); + } + _ => { + emit_error!(variant.fields, "variant not a 1-tuple"); + } + }; + } + + output + } +} + +impl ToTokens for DeriveSolidityError { + fn to_tokens(&self, tokens: &mut TokenStream) { + for from_impl in &self.from_impls { + from_impl.to_tokens(tokens); + } + self.vec_u8_from_impl().to_tokens(tokens); + Extension::codegen(self).to_tokens(tokens); + } +} + +trait SolidityErrorExtension: Default { + type Ast: ToTokens; + + fn add_variant(&mut self, field: syn::Field); + fn codegen(err: &DeriveSolidityError) -> Self::Ast; +} + +impl SolidityErrorExtension for () { + type Ast = Nothing; + + fn add_variant(&mut self, _field: syn::Field) {} + + fn codegen(_err: &DeriveSolidityError) -> Self::Ast { + Nothing + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::DeriveSolidityError; + use crate::utils::testing::assert_ast_eq; + + #[test] + fn test_derive_solidity_error() { + let derived = DeriveSolidityError::from(&parse_quote! { + enum MyError { + Foo(FooError), + Bar(BarError), + } + }); + assert_ast_eq( + &derived.from_impls[0], + &parse_quote! { + impl From for MyError { + fn from(value: FooError) -> Self { + MyError::Foo(value) + } + } + }, + ); + assert_ast_eq( + derived.vec_u8_from_impl(), + parse_quote! { + impl From for alloc::vec::Vec { + fn from(err: MyError) -> Self { + match err { + MyError::Foo(e) => stylus_sdk::call::MethodError::encode(e), + MyError::Bar(e) => stylus_sdk::call::MethodError::encode(e), + } + } + } + }, + ); + } +} diff --git a/stylus-proc/src/macros/entrypoint.rs b/stylus-proc/src/macros/entrypoint.rs new file mode 100644 index 00000000..83a9c996 --- /dev/null +++ b/stylus-proc/src/macros/entrypoint.rs @@ -0,0 +1,200 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use cfg_if::cfg_if; +use proc_macro2::{Ident, Span, TokenStream}; +use proc_macro_error::{abort, emit_error}; +use quote::ToTokens; +use syn::{ + parse::{Parse, ParseStream}, + parse_macro_input, parse_quote, +}; + +use crate::consts::{ASSERT_OVERRIDES_FN, STRUCT_ENTRYPOINT_FN}; + +/// Implementation for the [`#[entrypoint]`][crate::entrypoint] macro. +pub fn entrypoint( + attr: proc_macro::TokenStream, + input: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + if !attr.is_empty() { + emit_error!(Span::mixed_site(), "this macro is not configurable"); + } + + let entrypoint: Entrypoint = parse_macro_input!(input); + entrypoint.into_token_stream().into() +} + +struct Entrypoint { + kind: EntrypointKind, + mark_used_fn: syn::ItemFn, + user_entrypoint_fn: syn::ItemFn, +} +impl Parse for Entrypoint { + fn parse(input: ParseStream) -> syn::Result { + let item: syn::Item = input.parse()?; + let kind = match item { + syn::Item::Fn(item) => EntrypointKind::Fn(EntrypointFn { item }), + syn::Item::Struct(item) => EntrypointKind::Struct(EntrypointStruct { + top_level_storage_impl: top_level_storage_impl(&item), + struct_entrypoint_fn: struct_entrypoint_fn(&item.ident), + assert_overrides_const: assert_overrides_const(&item.ident), + print_abi_fn: print_abi_fn(&item.ident), + item, + }), + _ => abort!(item, "not a struct or fn"), + }; + + Ok(Self { + user_entrypoint_fn: user_entrypoint_fn(kind.entrypoint_fn_name()), + mark_used_fn: mark_used_fn(), + kind, + }) + } +} + +impl ToTokens for Entrypoint { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.kind.to_tokens(tokens); + self.mark_used_fn.to_tokens(tokens); + self.user_entrypoint_fn.to_tokens(tokens); + } +} + +enum EntrypointKind { + Fn(EntrypointFn), + Struct(EntrypointStruct), +} + +impl EntrypointKind { + fn entrypoint_fn_name(&self) -> Ident { + match self { + EntrypointKind::Fn(EntrypointFn { item }) => item.sig.ident.clone(), + EntrypointKind::Struct(EntrypointStruct { item, .. }) => { + let mut ident = STRUCT_ENTRYPOINT_FN.as_ident(); + ident.set_span(item.ident.span()); + ident + } + } + } +} + +impl ToTokens for EntrypointKind { + fn to_tokens(&self, tokens: &mut TokenStream) { + match self { + EntrypointKind::Fn(inner) => inner.to_tokens(tokens), + EntrypointKind::Struct(inner) => inner.to_tokens(tokens), + } + } +} + +struct EntrypointFn { + item: syn::ItemFn, +} + +impl ToTokens for EntrypointFn { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.item.to_tokens(tokens); + } +} + +struct EntrypointStruct { + item: syn::ItemStruct, + top_level_storage_impl: syn::ItemImpl, + struct_entrypoint_fn: syn::ItemFn, + assert_overrides_const: syn::ItemConst, + print_abi_fn: Option, +} + +impl ToTokens for EntrypointStruct { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.item.to_tokens(tokens); + self.top_level_storage_impl.to_tokens(tokens); + self.struct_entrypoint_fn.to_tokens(tokens); + self.assert_overrides_const.to_tokens(tokens); + self.print_abi_fn.to_tokens(tokens); + } +} + +fn top_level_storage_impl(item: &syn::ItemStruct) -> syn::ItemImpl { + let name = &item.ident; + let (impl_generics, ty_generics, where_clause) = item.generics.split_for_impl(); + parse_quote! { + unsafe impl #impl_generics stylus_sdk::storage::TopLevelStorage for #name #ty_generics #where_clause {} + } +} + +fn struct_entrypoint_fn(name: &Ident) -> syn::ItemFn { + parse_quote! { + fn #STRUCT_ENTRYPOINT_FN(input: alloc::vec::Vec) -> stylus_sdk::ArbResult { + stylus_sdk::abi::router_entrypoint::<#name, #name>(input) + } + } +} + +fn assert_overrides_const(name: &Ident) -> syn::ItemConst { + parse_quote! { + const _: () = { + <#name>::#ASSERT_OVERRIDES_FN(); + }; + } +} + +fn mark_used_fn() -> syn::ItemFn { + parse_quote! { + #[no_mangle] + pub unsafe fn mark_used() { + stylus_sdk::evm::pay_for_memory_grow(0); + panic!(); + } + } +} + +fn user_entrypoint_fn(user_fn: Ident) -> syn::ItemFn { + let deny_reentrant = deny_reentrant(); + parse_quote! { + #[no_mangle] + pub extern "C" fn user_entrypoint(len: usize) -> usize { + #deny_reentrant + + let input = stylus_sdk::contract::args(len); + let (data, status) = match #user_fn(input) { + Ok(data) => (data, 0), + Err(data) => (data, 1), + }; + unsafe { stylus_sdk::storage::StorageCache::flush() }; + stylus_sdk::contract::output(&data); + status + } + } +} + +/// Revert on reentrancy unless explicitly enabled +fn deny_reentrant() -> Option { + cfg_if! { + if #[cfg(feature = "reentrant")] { + None + } else { + Some(parse_quote! { + if stylus_sdk::msg::reentrant() { + return 1; // revert + } + }) + } + } +} + +fn print_abi_fn(ident: &syn::Ident) -> Option { + let _ = ident; + cfg_if! { + if #[cfg(feature = "export-abi")] { + Some(parse_quote! { + pub fn print_abi(license: &str, pragma: &str) { + stylus_sdk::abi::export::print_abi::<#ident>(license, pragma); + } + }) + } else { + None + } + } +} diff --git a/stylus-proc/src/macros/mod.rs b/stylus-proc/src/macros/mod.rs new file mode 100644 index 00000000..e48d9972 --- /dev/null +++ b/stylus-proc/src/macros/mod.rs @@ -0,0 +1,18 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +mod derive; +mod entrypoint; +mod public; +mod sol_interface; +mod sol_storage; +mod storage; + +pub use derive::abi_type::derive_abi_type; +pub use derive::erase::derive_erase; +pub use derive::solidity_error::derive_solidity_error; +pub use entrypoint::entrypoint; +pub use public::public; +pub use sol_interface::sol_interface; +pub use sol_storage::sol_storage; +pub use storage::storage; diff --git a/stylus-proc/src/macros/public/attrs.rs b/stylus-proc/src/macros/public/attrs.rs new file mode 100644 index 00000000..a2f19dea --- /dev/null +++ b/stylus-proc/src/macros/public/attrs.rs @@ -0,0 +1,47 @@ +// Copyright 2022-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use syn::{ + parse::{Parse, ParseStream}, + punctuated::Punctuated, + Token, +}; + +/// Inherit from parent contracts. +/// +/// Used for the `#[inherit(Parent1, Parent2]` attribute. +pub struct Inherit { + pub types: Punctuated, +} + +impl Parse for Inherit { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + types: Punctuated::parse_terminated(input)?, + }) + } +} + +/// Selector name overloading for public functions. +/// +/// Used for the `#[selector(name = "...")]` attribute. +#[derive(Debug)] +pub struct Selector { + _name: kw::name, + _eq_token: Token![=], + pub value: syn::LitStr, +} + +impl Parse for Selector { + fn parse(input: ParseStream) -> syn::Result { + Ok(Self { + _name: input.parse()?, + _eq_token: input.parse()?, + value: input.parse()?, + }) + } +} + +mod kw { + syn::custom_keyword!(name); +} diff --git a/stylus-proc/src/macros/public/export_abi.rs b/stylus-proc/src/macros/public/export_abi.rs new file mode 100644 index 00000000..fbf48199 --- /dev/null +++ b/stylus-proc/src/macros/public/export_abi.rs @@ -0,0 +1,168 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use proc_macro2::TokenStream; +use quote::quote; +use syn::parse_quote; + +use crate::types::Purity; + +use super::types::{FnArgExtension, FnExtension, FnKind, InterfaceExtension, PublicImpl}; + +#[derive(Debug)] +pub struct InterfaceAbi; + +impl InterfaceExtension for InterfaceAbi { + type FnExt = FnAbi; + type Ast = syn::ItemImpl; + + fn build(_node: &syn::ItemImpl) -> Self { + InterfaceAbi + } + + fn codegen(iface: &PublicImpl) -> Self::Ast { + let PublicImpl { + generic_params, + self_ty, + where_clause, + inheritance, + funcs, + .. + } = iface; + + let name = match self_ty { + syn::Type::Path(path) => path.path.segments.last().unwrap().ident.clone().to_string(), + _ => todo!(), + }; + + let mut types = Vec::new(); + for item in funcs { + if let Some(ty) = &item.extension.output { + types.push(ty); + } + } + let type_decls = quote! { + let mut seen = HashSet::new(); + for item in ([] as [InnerType; 0]).iter() #(.chain(&<#types as InnerTypes>::inner_types()))* { + if seen.insert(item.id) { + writeln!(f, "\n {}", item.name)?; + } + } + }; + + // write the "is" clause in Solidity + let mut is_clause = match inheritance.is_empty() { + true => quote! {}, + false => quote! { write!(f, " is ")?; }, + }; + is_clause.extend(inheritance.iter().enumerate().map(|(i, ty)| { + let comma = (i > 0).then_some(", ").unwrap_or_default(); + quote! { + write!(f, "{}I{}", #comma, <#ty as GenerateAbi>::NAME)?; + } + })); + + let mut abi = TokenStream::new(); + for func in funcs { + if !matches!(func.kind, FnKind::Function) { + continue; + } + + let sol_name = func.sol_name.to_string(); + let sol_args = func.inputs.iter().enumerate().map(|(i, arg)| { + let comma = (i > 0).then_some(", ").unwrap_or_default(); + let name = arg.extension.pattern_ident.as_ref().map(ToString::to_string).unwrap_or_default(); + let ty = &arg.ty; + quote! { + write!(f, "{}{}{}", #comma, <#ty as AbiType>::EXPORT_ABI_ARG, underscore_if_sol(#name))?; + } + }); + + let sol_outs = if let Some(ty) = &func.extension.output { + quote!(write_solidity_returns::<#ty>(f)?;) + } else { + quote!() + }; + + let sol_purity = match func.purity { + Purity::Write => String::new(), + x => format!(" {x}"), + }; + + abi.extend(quote! { + write!(f, "\n function {}(", #sol_name)?; + #(#sol_args)* + write!(f, ") external")?; + write!(f, #sol_purity)?; + #sol_outs + writeln!(f, ";")?; + }); + } + + parse_quote! { + impl<#generic_params> stylus_sdk::abi::GenerateAbi for #self_ty where #where_clause { + const NAME: &'static str = #name; + + fn fmt_abi(f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + use stylus_sdk::abi::{AbiType, GenerateAbi}; + use stylus_sdk::abi::internal::write_solidity_returns; + use stylus_sdk::abi::export::{underscore_if_sol, internal::{InnerType, InnerTypes}}; + use std::collections::HashSet; + #( + <#inheritance as GenerateAbi>::fmt_abi(f)?; + writeln!(f)?; + )* + write!(f, "interface I{}", #name)?; + #is_clause + write!(f, " {{")?; + #abi + #type_decls + writeln!(f, "}}")?; + Ok(()) + } + } + } + } +} + +#[derive(Debug)] +pub struct FnAbi { + pub output: Option, +} + +impl FnExtension for FnAbi { + type FnArgExt = FnArgAbi; + + fn build(node: &syn::ImplItemFn) -> Self { + let output = match &node.sig.output { + syn::ReturnType::Default => None, + syn::ReturnType::Type(_, ty) => Some(*ty.clone()), + }; + FnAbi { output } + } +} + +#[derive(Debug)] +pub struct FnArgAbi { + pub pattern_ident: Option, +} + +impl FnArgExtension for FnArgAbi { + fn build(node: &syn::FnArg) -> Self { + let pattern_ident = if let syn::FnArg::Typed(pat_type) = node { + pattern_ident(&pat_type.pat) + } else { + None + }; + FnArgAbi { pattern_ident } + } +} + +/// finds the root type for a given arg +fn pattern_ident(pat: &syn::Pat) -> Option { + match pat { + syn::Pat::Ident(pat_ident) => Some(pat_ident.ident.clone()), + syn::Pat::Reference(pat_ref) => pattern_ident(&pat_ref.pat), + _ => None, + } +} diff --git a/stylus-proc/src/macros/public/mod.rs b/stylus-proc/src/macros/public/mod.rs new file mode 100644 index 00000000..ed153e0a --- /dev/null +++ b/stylus-proc/src/macros/public/mod.rs @@ -0,0 +1,238 @@ +// Copyright 2022-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use cfg_if::cfg_if; +use convert_case::{Case, Casing}; +use proc_macro::TokenStream; +use proc_macro_error::emit_error; +use quote::ToTokens; +use syn::{parse_macro_input, spanned::Spanned}; + +use crate::{ + types::Purity, + utils::{ + attrs::{check_attr_is_empty, consume_attr, consume_flag}, + split_item_impl_for_impl, + }, +}; +use types::{ + FnArgExtension, FnExtension, FnKind, InterfaceExtension, PublicFn, PublicFnArg, PublicImpl, +}; + +mod attrs; +mod overrides; +mod types; + +cfg_if! { + if #[cfg(feature = "export-abi")] { + mod export_abi; + type Extension = export_abi::InterfaceAbi; + } else { + type Extension = (); + } +} + +/// Implementation of the [`#[public]`][crate::public] macro. +/// +/// This implementation performs the following steps: +/// - Parse the input as [`syn::ItemImpl`] +/// - Generate AST items within a [`PublicImpl`] +/// - Expand those AST items into tokens for output +pub fn public(attr: TokenStream, input: TokenStream) -> TokenStream { + check_attr_is_empty(attr); + let mut item_impl = parse_macro_input!(input as syn::ItemImpl); + let public_impl = PublicImpl::::from(&mut item_impl); + + let mut output = item_impl.into_token_stream(); + public_impl.to_tokens(&mut output); + output.into() +} + +impl ToTokens for PublicImpl { + fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) { + self.impl_router().to_tokens(tokens); + self.impl_override_checks().to_tokens(tokens); + Extension::codegen(self).to_tokens(tokens); + } +} + +impl From<&mut syn::ItemImpl> for PublicImpl { + fn from(node: &mut syn::ItemImpl) -> Self { + // parse inheritance from #[inherits(...)] attribute + let mut inheritance = Vec::new(); + if let Some(inherits) = consume_attr::(&mut node.attrs, "inherit") { + inheritance.extend(inherits.types); + } + + // collect public functions + let funcs = node + .items + .iter_mut() + .filter_map(|item| match item { + syn::ImplItem::Fn(func) => Some(PublicFn::from(func)), + syn::ImplItem::Const(_) => { + emit_error!(item, "unsupported impl item"); + None + } + _ => { + // allow other item types + None + } + }) + .collect(); + + let (generic_params, self_ty, where_clause) = split_item_impl_for_impl(node); + #[allow(clippy::let_unit_value)] + let extension = ::build(node); + Self { + self_ty, + generic_params, + where_clause, + inheritance, + funcs, + extension, + } + } +} + +impl From<&mut syn::ImplItemFn> for PublicFn { + fn from(node: &mut syn::ImplItemFn) -> Self { + // parse attributes + let payable = consume_flag(&mut node.attrs, "payable"); + let selector_override = + consume_attr::(&mut node.attrs, "selector").map(|s| s.value.value()); + let fallback = consume_flag(&mut node.attrs, "fallback"); + let receive = consume_flag(&mut node.attrs, "receive"); + + let kind = match (fallback, receive) { + (true, false) => { + // Fallback functions may have two signatures, either + // with input calldata and output bytes, or no input and output. + // node.sig. + let has_inputs = node.sig.inputs.len() > 1; + if has_inputs { + FnKind::FallbackWithArgs + } else { + FnKind::FallbackNoArgs + } + } + (false, true) => FnKind::Receive, + (false, false) => FnKind::Function, + (true, true) => { + emit_error!(node.span(), "function cannot be both fallback and receive"); + FnKind::Function + } + }; + + // name for generated rust, and solidity abi + let name = node.sig.ident.clone(); + + if matches!(kind, FnKind::Function) && (name == "receive" || name == "fallback") { + emit_error!( + node.span(), + "receive and/or fallback functions can only be defined using the #[receive] or " + .to_string() + + "#[fallback] attribute instead of names", + ); + } + + let sol_name = syn_solidity::SolIdent::new( + &selector_override.unwrap_or(name.to_string().to_case(Case::Camel)), + ); + + // determine state mutability + let (inferred_purity, has_self) = Purity::infer(node); + let purity = if payable || matches!(kind, FnKind::Receive) { + Purity::Payable + } else { + inferred_purity + }; + + let mut args = node.sig.inputs.iter(); + if inferred_purity > Purity::Pure { + // skip self or storage argument + args.next(); + } + let inputs = match kind { + FnKind::Function => args.map(PublicFnArg::from).collect(), + _ => Vec::new(), + }; + let input_span = node.sig.inputs.span(); + + let output = match &node.sig.output { + syn::ReturnType::Default => None, + syn::ReturnType::Type(_, ty) => Some(*ty.clone()), + }; + let output_span = output + .as_ref() + .map(Spanned::span) + .unwrap_or(node.sig.output.span()); + + let extension = E::build(node); + Self { + name, + sol_name, + purity, + inferred_purity, + kind, + + has_self, + inputs, + input_span, + output_span, + + extension, + } + } +} + +impl From<&syn::FnArg> for PublicFnArg { + fn from(node: &syn::FnArg) -> Self { + match node { + syn::FnArg::Typed(pat_type) => { + let extension = E::build(node); + Self { + ty: *pat_type.ty.clone(), + extension, + } + } + _ => unreachable!(), + } + } +} + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::types::PublicImpl; + + #[test] + fn test_public_consumes_inherit() { + let mut impl_item = parse_quote! { + #[derive(Debug)] + #[inherit(Parent)] + impl Contract { + } + }; + let _public = PublicImpl::from(&mut impl_item); + assert_eq!(impl_item.attrs, vec![parse_quote! { #[derive(Debug)] }]); + } + + #[test] + fn test_public_consumes_payable() { + let mut impl_item = parse_quote! { + #[derive(Debug)] + impl Contract { + #[payable] + #[other] + fn func() {} + } + }; + let _public = PublicImpl::from(&mut impl_item); + let syn::ImplItem::Fn(syn::ImplItemFn { attrs, .. }) = &impl_item.items[0] else { + unreachable!(); + }; + assert_eq!(attrs, &vec![parse_quote! { #[other] }]); + } +} diff --git a/stylus-proc/src/macros/public/overrides.rs b/stylus-proc/src/macros/public/overrides.rs new file mode 100644 index 00000000..0587e277 --- /dev/null +++ b/stylus-proc/src/macros/public/overrides.rs @@ -0,0 +1,110 @@ +// Copyright 2022-2024, Offchain Labs, Inc. +// use crate::consts::{ALLOW_OVERRIDE_FN, ASSERT_OVERRIDES_FN}; +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Ensure that public functions follow safe override rules. + +use proc_macro2::Span; +use syn::parse_quote; + +use super::types::{FnExtension, PublicFn, PublicImpl}; +use crate::consts::{ALLOW_OVERRIDE_FN, ASSERT_OVERRIDES_FN}; + +impl PublicImpl { + pub fn impl_override_checks(&self) -> syn::ItemImpl { + let Self { + self_ty, + generic_params, + where_clause, + .. + } = self; + let selector_consts = self + .funcs + .iter() + .map(PublicFn::selector_const) + .collect::>(); + let override_arms = self.funcs.iter().map(PublicFn::override_arm); + let inheritance_overrides = self.inheritance_overrides(); + let override_checks = self.override_checks(); + parse_quote! { + impl<#generic_params> #self_ty where #where_clause { + /// Whether or not to allow overriding a selector by a child contract and method with + /// the given purity. This is currently implemented as a hidden function to allow it to + /// be `const`. A trait would be better, but `const` is not currently supported for + /// trait fns. + #[doc(hidden)] + pub const fn #ALLOW_OVERRIDE_FN(selector: u32, purity: stylus_sdk::methods::Purity) -> bool { + use stylus_sdk::function_selector; + + #(#selector_consts)* + if !match selector { + #(#override_arms)* + _ => true + } { return false; } + #(#inheritance_overrides)* + true + } + + /// Check the functions defined in an entrypoint for valid overrides. + #[doc(hidden)] + pub const fn #ASSERT_OVERRIDES_FN() { + use stylus_sdk::function_selector; + + #(#selector_consts)* + #(#override_checks)* + } + } + } + } + + fn inheritance_overrides(&self) -> impl Iterator + '_ { + self.inheritance.iter().map(|ty| { + parse_quote! { + if !<#ty>::#ALLOW_OVERRIDE_FN(selector, purity) { + return false; + } + } + }) + } + + fn override_checks(&self) -> impl Iterator + '_ { + self.funcs + .iter() + .map(|func| func.assert_override(&self.self_ty)) + .chain(self.inheritance.iter().map(|ty| { + parse_quote! { + <#ty>::#ASSERT_OVERRIDES_FN(); + } + })) + } +} + +impl PublicFn { + fn override_arm(&self) -> syn::Arm { + let constant = self.selector_name(); + let purity = self.purity.as_path(); + parse_quote! { + #[allow(non_upper_case_globals)] + #constant => #purity.allow_override(purity), + } + } + + fn override_error(&self) -> syn::LitStr { + syn::LitStr::new( + &format!( + "function {} cannot be overriden with function marked {:?}", + self.name, self.purity, + ), + Span::mixed_site(), + ) + } + + fn assert_override(&self, self_ty: &syn::Type) -> syn::Stmt { + let purity = self.purity.as_path(); + let selector_name = self.selector_name(); + let error = self.override_error(); + parse_quote! { + assert!(<#self_ty>::#ALLOW_OVERRIDE_FN(#selector_name, #purity), #error); + } + } +} diff --git a/stylus-proc/src/macros/public/types.rs b/stylus-proc/src/macros/public/types.rs new file mode 100644 index 00000000..77470d28 --- /dev/null +++ b/stylus-proc/src/macros/public/types.rs @@ -0,0 +1,398 @@ +// Copyright 2022-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md +use proc_macro2::{Span, TokenStream}; +use proc_macro_error::emit_error; +use quote::{quote, ToTokens}; +use syn::{ + parse::Nothing, parse_quote, parse_quote_spanned, punctuated::Punctuated, spanned::Spanned, + Token, +}; + +use crate::{ + imports::{ + alloy_sol_types::SolType, + stylus_sdk::abi::{AbiType, Router}, + }, + types::Purity, +}; + +use super::Extension; + +pub struct PublicImpl { + pub self_ty: syn::Type, + pub generic_params: Punctuated, + pub where_clause: Punctuated, + pub inheritance: Vec, + pub funcs: Vec>, + #[allow(dead_code)] + pub extension: E, +} + +impl PublicImpl { + pub fn impl_router(&self) -> syn::ItemImpl { + let Self { + self_ty, + generic_params, + where_clause, + inheritance, + .. + } = self; + let function_iter = self + .funcs + .iter() + .filter(|&func| matches!(func.kind, FnKind::Function)); + let selector_consts = function_iter.clone().map(PublicFn::selector_const); + let selector_arms = function_iter + .map(PublicFn::selector_arm) + .collect::>(); + let inheritance_routes = self.inheritance_routes(); + + let call_fallback = self.call_fallback(); + let inheritance_fallback = self.inheritance_fallback(); + + let (fallback, fallback_purity) = call_fallback.unwrap_or_else(|| { + // If there is no fallback function specified, we rely on any inherited fallback. + ( + parse_quote!({ + #(#inheritance_fallback)* + None + }), + Purity::Payable, // Let the inherited fallback deal with purity. + ) + }); + + let fallback_deny: Option = match fallback_purity { + Purity::Payable => None, + _ => Some(parse_quote! { + if let Err(err) = stylus_sdk::abi::internal::deny_value("fallback") { + return Some(Err(err)); + } + }), + }; + + let call_receive = self.call_receive(); + let inheritance_receive = self.inheritance_receive(); + let receive = call_receive.unwrap_or_else(|| { + parse_quote!({ + #(#inheritance_receive)* + None + }) + }); + + parse_quote! { + impl #Router for #self_ty + where + S: stylus_sdk::storage::TopLevelStorage + core::borrow::BorrowMut, + #( + S: core::borrow::BorrowMut<#inheritance>, + )* + #where_clause + { + type Storage = Self; + + #[inline(always)] + #[deny(unreachable_patterns)] + fn route(storage: &mut S, selector: u32, input: &[u8]) -> Option { + use stylus_sdk::function_selector; + use stylus_sdk::abi::{internal, internal::EncodableReturnType}; + use alloc::vec; + + #[cfg(feature = "export-abi")] + use stylus_sdk::abi::export; + + #(#selector_consts)* + match selector { + #(#selector_arms)* + _ => { + #(#inheritance_routes)* + None + } + } + } + + #[inline(always)] + fn fallback(storage: &mut S, input: &[u8]) -> Option { + #fallback_deny + #fallback + } + + #[inline(always)] + fn receive(storage: &mut S) -> Option<()> { + #receive + } + } + } + } + + fn inheritance_routes(&self) -> impl Iterator + '_ { + self.inheritance.iter().map(|ty| { + parse_quote! { + if let Some(result) = <#ty as #Router>::route(storage, selector, input) { + return Some(result); + } + } + }) + } + + fn call_fallback(&self) -> Option<(syn::Stmt, Purity)> { + let mut fallback_purity = Purity::View; + let fallbacks: Vec = self + .funcs + .iter() + .filter(|&func| { + if matches!(func.kind, FnKind::FallbackWithArgs) + || matches!(func.kind, FnKind::FallbackNoArgs) + { + fallback_purity = func.purity; + return true; + } + false + }) + .map(PublicFn::call_fallback) + .collect(); + if fallbacks.is_empty() { + return None; + } + if fallbacks.len() > 1 { + emit_error!( + "multiple fallbacks", + "contract can only have one #[fallback] method defined" + ); + } + fallbacks + .first() + .cloned() + .map(|func| (func, fallback_purity)) + } + + fn inheritance_fallback(&self) -> impl Iterator + '_ { + self.inheritance.iter().map(|ty| { + parse_quote! { + if let Some(res) = <#ty as #Router>::fallback(storage, input) { + return Some(res); + } + } + }) + } + + fn call_receive(&self) -> Option { + let receives: Vec = self + .funcs + .iter() + .filter(|&func| matches!(func.kind, FnKind::Receive)) + .map(PublicFn::call_receive) + .collect(); + if receives.is_empty() { + return None; + } + if receives.len() > 1 { + emit_error!( + "multiple receives", + "contract can only have one #[receive] method defined" + ); + } + receives.first().cloned() + } + + fn inheritance_receive(&self) -> impl Iterator + '_ { + self.inheritance.iter().map(|ty| { + parse_quote! { + if let Some(res) = <#ty as #Router>::receive(storage) { + return Some(res); + } + } + }) + } +} + +#[derive(Debug)] +pub enum FnKind { + Function, + FallbackWithArgs, + FallbackNoArgs, + Receive, +} + +pub struct PublicFn { + pub name: syn::Ident, + pub sol_name: syn_solidity::SolIdent, + pub purity: Purity, + pub inferred_purity: Purity, + pub kind: FnKind, + + pub has_self: bool, + pub inputs: Vec>, + pub input_span: Span, + pub output_span: Span, + + #[allow(dead_code)] + pub extension: E, +} + +impl PublicFn { + pub fn selector_name(&self) -> syn::Ident { + syn::Ident::new(&format!("__SELECTOR_{}", self.name), self.name.span()) + } + + fn selector_value(&self) -> syn::Expr { + let sol_name = syn::LitStr::new(&self.sol_name.as_string(), self.sol_name.span()); + let arg_types = self.arg_types(); + parse_quote! { + u32::from_be_bytes(function_selector!(#sol_name #(, #arg_types )*)) + } + } + + pub fn selector_const(&self) -> Option { + let name = self.selector_name(); + let value = self.selector_value(); + Some(parse_quote! { + #[allow(non_upper_case_globals)] + const #name: u32 = #value; + }) + } + + fn selector_arm(&self) -> Option { + if !matches!(self.kind, FnKind::Function) { + return None; + } + + let name = &self.name; + let constant = self.selector_name(); + let deny_value = self.deny_value(); + let decode_inputs = self.decode_inputs(); + let storage_arg = self.storage_arg(); + let expand_args = self.expand_args(); + let encode_output = self.encode_output(); + Some(parse_quote! { + #[allow(non_upper_case_globals)] + #constant => { + #deny_value + let args = match <#decode_inputs as #SolType>::abi_decode_params(input, true) { + Ok(args) => args, + Err(err) => { + internal::failed_to_decode_arguments(err); + return Some(Err(Vec::new())); + } + }; + let result = Self::#name(#storage_arg #(#expand_args, )* ); + Some(#encode_output) + } + }) + } + + fn decode_inputs(&self) -> syn::Type { + let arg_types = self.arg_types(); + parse_quote_spanned! { + self.input_span => <(#( #arg_types, )*) as #AbiType>::SolType + } + } + + fn arg_types(&self) -> impl Iterator { + self.inputs.iter().map(|arg| &arg.ty) + } + + fn storage_arg(&self) -> TokenStream { + if self.inferred_purity == Purity::Pure { + quote!() + } else if self.has_self { + quote! { core::borrow::BorrowMut::borrow_mut(storage), } + } else { + quote! { storage, } + } + } + + fn expand_args(&self) -> impl Iterator + '_ { + self.arg_types().enumerate().map(|(index, ty)| { + let index = syn::Index { + index: index as u32, + span: ty.span(), + }; + parse_quote! { args.#index } + }) + } + + fn encode_output(&self) -> syn::Expr { + parse_quote_spanned! { + self.output_span => EncodableReturnType::encode(result) + } + } + + fn deny_value(&self) -> Option { + if self.purity == Purity::Payable { + None + } else { + let name = self.name.to_string(); + Some(parse_quote! { + if let Err(err) = internal::deny_value(#name) { + return Some(Err(err)); + } + }) + } + } + + fn call_fallback(&self) -> syn::Stmt { + let name = &self.name; + let storage_arg = self.storage_arg(); + if matches!(self.kind, FnKind::FallbackNoArgs) { + return parse_quote! { + return Some(Self::#name(#storage_arg)); + }; + } + parse_quote! { + return Some(Self::#name(#storage_arg input)); + } + } + + fn call_receive(&self) -> syn::Stmt { + let name = &self.name; + let storage_arg = self.storage_arg(); + parse_quote! { + return Some(Self::#name(#storage_arg)); + } + } +} + +pub struct PublicFnArg { + pub ty: syn::Type, + #[allow(dead_code)] + pub extension: E, +} + +pub trait InterfaceExtension: Sized { + type FnExt: FnExtension; + type Ast: ToTokens; + + fn build(node: &syn::ItemImpl) -> Self; + fn codegen(iface: &PublicImpl) -> Self::Ast; +} + +pub trait FnExtension { + type FnArgExt: FnArgExtension; + + fn build(node: &syn::ImplItemFn) -> Self; +} + +pub trait FnArgExtension { + fn build(node: &syn::FnArg) -> Self; +} + +impl InterfaceExtension for () { + type FnExt = (); + type Ast = Nothing; + + fn build(_node: &syn::ItemImpl) -> Self {} + + fn codegen(_iface: &PublicImpl) -> Self::Ast { + Nothing + } +} + +impl FnExtension for () { + type FnArgExt = (); + + fn build(_node: &syn::ImplItemFn) -> Self {} +} + +impl FnArgExtension for () { + fn build(_node: &syn::FnArg) -> Self {} +} diff --git a/stylus-proc/src/macros/sol_interface.rs b/stylus-proc/src/macros/sol_interface.rs new file mode 100644 index 00000000..d0b7202a --- /dev/null +++ b/stylus-proc/src/macros/sol_interface.rs @@ -0,0 +1,419 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use convert_case::{Case, Casing}; +use proc_macro2::TokenStream; +use proc_macro_error::emit_error; +use quote::{quote, ToTokens}; +use syn::{parse_macro_input, parse_quote}; +use syn_solidity::{visit, Spanned, Visit}; + +use crate::{ + impls::abi_proxy::ImplAbiProxy, + imports::{ + alloy_primitives::Address as AlloyAddress, + alloy_sol_types::{sol_data::Address as SolAddress, SolType}, + }, + types::{Purity, SolidityTypeInfo}, + utils::build_selector, +}; + +/// Implementation of the [`sol_interface!`][crate::sol_interface] macro. +/// +/// This implementation uses [`SolInterfaceVisitor`] which implements [`syn_solidity::Visit`] to +/// collect interface declarations and convert them to Rust structs with a method for each of the +/// interface's functions. +pub fn sol_interface(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let file = parse_macro_input!(input as syn_solidity::File); + SolInterfaceVisitor::from(&file).into_token_stream().into() +} + +/// Visitor for the [`sol_interface!`][crate::sol_interface] macro. +/// +/// Collects all defined interfaces, doing error checking along the way. +#[derive(Debug, Default)] +struct SolInterfaceVisitor { + interfaces: Vec, +} + +impl From<&syn_solidity::File> for SolInterfaceVisitor { + fn from(file: &syn_solidity::File) -> Self { + let mut visitor = Self::default(); + visitor.visit_file(file); + visitor + } +} + +impl ToTokens for SolInterfaceVisitor { + fn to_tokens(&self, tokens: &mut TokenStream) { + for iface in &self.interfaces { + iface.to_tokens(tokens); + } + } +} + +impl<'ast> Visit<'ast> for SolInterfaceVisitor { + fn visit_file(&mut self, file: &'ast syn_solidity::File) { + for attr in &file.attrs { + emit_error!(attr, "attribute not supported"); + } + visit::visit_file(self, file); + } + + fn visit_item(&mut self, item: &'ast syn_solidity::Item) { + if !matches!(item, syn_solidity::Item::Contract(..)) { + emit_error!(item.span(), "not an interface"); + } + visit::visit_item(self, item); + } + + fn visit_item_contract(&mut self, contract: &'ast syn_solidity::ItemContract) { + if !contract.is_interface() { + emit_error!(contract.span(), "not an interface"); + return; + } + + if let Some(inheritance) = &contract.inheritance { + emit_error!(inheritance.span(), "inheritance not supported"); + } + + self.interfaces.push(Interface::from(contract)); + } +} + +/// Interface defined in the [`sol_interface!`][crate::sol_interface] macro. +#[derive(Debug)] +struct Interface { + item_struct: syn::ItemStruct, + item_impl: syn::ItemImpl, + impl_deref: syn::ItemImpl, + impl_from_address: syn::ItemImpl, + impl_abi_proxy: ImplAbiProxy, +} + +impl Interface { + /// Add a function to the interface definition. + fn add_function( + &mut self, + attrs: &[syn::Attribute], + name: &syn_solidity::SolIdent, + purity: Purity, + params: FunctionParameters, + return_type: syn::Type, + ) { + let rust_name = syn::Ident::new(&name.to_string().to_case(Case::Snake), name.span()); + + // build selector + let selector = build_selector(name, params.params.iter().map(|p| &p.type_info.sol_type)); + let [selector0, selector1, selector2, selector3] = selector; + + // determine which context and kind of call to use + let (context, call) = match purity { + Purity::Pure | Purity::View => ( + quote!(stylus_sdk::call::StaticCallContext), + quote!(stylus_sdk::call::static_call), + ), + Purity::Write => ( + quote!(stylus_sdk::call::NonPayableCallContext), + quote!(stylus_sdk::call::call), + ), + Purity::Payable => ( + quote!(stylus_sdk::call::MutatingCallContext), + quote!(stylus_sdk::call::call), + ), + }; + + let sol_args = params + .params + .iter() + .map(|param| param.type_info.alloy_type.clone()); + let rust_args = params.params.iter().map(|param| -> syn::FnArg { + let FunctionParameter { + name, + type_info: SolidityTypeInfo { alloy_type, .. }, + .. + } = param; + parse_quote!(#name: <#alloy_type as #SolType>::RustType) + }); + let rust_arg_names = params.params.iter().map(|param| param.name.clone()); + + self.item_impl.items.push(parse_quote! { + #(#attrs)* + pub fn #rust_name(&self, context: impl #context #(, #rust_args)*) -> + Result<<#return_type as #SolType>::RustType, stylus_sdk::call::Error> + { + let args = <(#(#sol_args,)*) as #SolType>::abi_encode(&(#(#rust_arg_names,)*)); + let mut calldata = vec![#selector0, #selector1, #selector2, #selector3]; + calldata.extend(args); + let returned = #call(context, self.address, &calldata)?; + Ok(<(#return_type,) as #SolType>::abi_decode_params(&returned, true)?.0) + } + }); + } +} + +impl From<&syn_solidity::ItemContract> for Interface { + fn from(contract: &syn_solidity::ItemContract) -> Self { + let name = contract.name.clone().into(); + let attrs = &contract.attrs; + + let mut iface = Self { + item_struct: parse_quote! { + #(#attrs)* + struct #name { + pub address: #AlloyAddress, + } + }, + item_impl: parse_quote! { + impl #name { + pub fn new(address: #AlloyAddress) -> Self { + Self { address } + } + } + }, + impl_deref: parse_quote! { + impl core::ops::Deref for #name { + type Target = #AlloyAddress; + + fn deref(&self) -> &Self::Target { + &self.address + } + } + }, + impl_from_address: parse_quote! { + impl From<#AlloyAddress> for #name { + fn from(address: #AlloyAddress) -> Self { + Self::new(address) + } + } + }, + impl_abi_proxy: ImplAbiProxy::new( + &name, + &AlloyAddress.as_type(), + &SolAddress.as_type(), + ), + }; + + iface.visit_item_contract(contract); + iface + } +} + +impl ToTokens for Interface { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.item_struct.to_tokens(tokens); + self.item_impl.to_tokens(tokens); + self.impl_deref.to_tokens(tokens); + self.impl_from_address.to_tokens(tokens); + self.impl_abi_proxy.to_tokens(tokens); + } +} + +impl<'ast> Visit<'ast> for Interface { + fn visit_item(&mut self, item: &'ast syn_solidity::Item) { + if !matches!(item, syn_solidity::Item::Function(_)) { + emit_error!(item.span(), "unsupported interface item"); + } + visit::visit_item(self, item); + } + + fn visit_item_function(&mut self, function: &'ast syn_solidity::ItemFunction) { + if !matches!(function.kind, syn_solidity::FunctionKind::Function(_)) { + emit_error!(function.span(), "unsupported function type"); + } + + let Some(name) = &function.name else { + emit_error!(function.span(), "function has no name"); + return; + }; + + // determine the purity and check for external attribute + let mut purity = None; + let mut external = false; + for attr in &function.attributes.0 { + match attr { + syn_solidity::FunctionAttribute::Mutability(mutability) => { + if purity.is_some() { + emit_error!(attr.span(), "more than one purity attribute specified"); + continue; + } + purity = Some(match mutability { + syn_solidity::Mutability::Pure(_) => Purity::Pure, + syn_solidity::Mutability::View(_) => Purity::View, + syn_solidity::Mutability::Payable(_) => Purity::Payable, + syn_solidity::Mutability::Constant(_) => { + emit_error!( + mutability.span(), + "constant mutibility no longer supported" + ); + continue; + } + }); + } + syn_solidity::FunctionAttribute::Visibility(vis) => match vis { + syn_solidity::Visibility::External(_) => external = true, + _ => { + emit_error!(vis.span(), "visibility must be external"); + } + }, + _ => emit_error!(attr.span(), "unsupported function attribute"), + } + } + let purity = purity.unwrap_or(Purity::Write); + if !external { + emit_error!(function.span(), "visibility must be external"); + } + + // build the parameter list + let mut params = FunctionParameters::new(); + params.visit_parameter_list(&function.parameters); + + // get the return type + let return_type = match function.return_type() { + Some(ty) => SolidityTypeInfo::from(&ty).alloy_type, + None => parse_quote!(()), + }; + + self.add_function(&function.attrs, name, purity, params, return_type); + } +} + +struct FunctionParameters { + params: Vec, +} + +impl FunctionParameters { + fn new() -> Self { + Self { params: Vec::new() } + } +} + +impl Visit<'_> for FunctionParameters { + fn visit_variable_declaration(&mut self, var: &syn_solidity::VariableDeclaration) { + let type_info = SolidityTypeInfo::from(&var.ty); + let name = match &var.name { + Some(name) => name.clone().into(), + None => syn::Ident::new(&format!("__argument_{}", self.params.len()), var.span()), + }; + self.params.push(FunctionParameter { name, type_info }); + } +} + +struct FunctionParameter { + name: syn::Ident, + type_info: SolidityTypeInfo, +} + +#[cfg(test)] +mod tests { + use quote::quote; + use syn::parse_quote; + + use super::SolInterfaceVisitor; + use crate::utils::testing::assert_ast_eq; + + #[test] + fn test_sol_interface() { + let file = syn_solidity::parse2(quote! { + #[interface_attr] + interface IService { + #[function_attr] + function makePayment(address user) payable external returns (string); + function getConstant() pure external returns (bytes32); + function getFoo() pure external returns (inner.Foo); + } + + interface ITree { + // Define more interface methods here + } + }) + .unwrap(); + let visitor = SolInterfaceVisitor::from(&file); + assert_ast_eq( + &visitor.interfaces[0].item_struct, + &parse_quote! { + #[interface_attr] + struct IService { + pub address: stylus_sdk::alloy_primitives::Address, + } + }, + ); + assert_ast_eq( + &visitor.interfaces[0].item_impl, + &parse_quote! { + impl IService { + pub fn new(address: stylus_sdk::alloy_primitives::Address) -> Self { + Self { address } + } + + #[function_attr] + pub fn make_payment( + &self, + context: impl stylus_sdk::call::MutatingCallContext, + user: ::RustType, + ) -> + Result<::RustType, stylus_sdk::call::Error> + { + let args = <( + stylus_sdk::alloy_sol_types::sol_data::Address, + ) as stylus_sdk::alloy_sol_types::SolType>::abi_encode(&(user,)); + let mut calldata = vec![48u8, 11u8, 228u8, 252u8]; + calldata.extend(args); + let returned = stylus_sdk::call::call(context, self.address, &calldata)?; + Ok(<( + stylus_sdk::alloy_sol_types::sol_data::String, + ) as stylus_sdk::alloy_sol_types::SolType>::abi_decode_params(&returned, true)?.0) + } + + pub fn get_constant( + &self, + context: impl stylus_sdk::call::StaticCallContext, + ) -> + Result< as stylus_sdk::alloy_sol_types::SolType>::RustType, stylus_sdk::call::Error> + { + let args = <() as stylus_sdk::alloy_sol_types::SolType>::abi_encode(&()); + let mut calldata = vec![241u8, 58u8, 56u8, 166u8]; + calldata.extend(args); + let returned = stylus_sdk::call::static_call(context, self.address, &calldata)?; + Ok(<(stylus_sdk::alloy_sol_types::sol_data::FixedBytes<32>,) as stylus_sdk::alloy_sol_types::SolType>::abi_decode_params(&returned, true)?.0) + } + + pub fn get_foo( + &self, + context: impl stylus_sdk::call::StaticCallContext, + ) -> + Result<::RustType, stylus_sdk::call::Error> + { + let args = <() as stylus_sdk::alloy_sol_types::SolType>::abi_encode(&()); + let mut calldata = vec![36u8, 61u8, 200u8, 218u8]; + calldata.extend(args); + let returned = stylus_sdk::call::static_call(context, self.address, &calldata)?; + Ok(<(inner::Foo,) as stylus_sdk::alloy_sol_types::SolType>::abi_decode_params(&returned, true)?.0) + } + } + }, + ); + assert_ast_eq( + &visitor.interfaces[0].impl_deref, + &parse_quote! { + impl core::ops::Deref for IService { + type Target = stylus_sdk::alloy_primitives::Address; + + fn deref(&self) -> &Self::Target { + &self.address + } + } + }, + ); + assert_ast_eq( + &visitor.interfaces[0].impl_from_address, + &parse_quote! { + impl From for IService { + fn from(address: stylus_sdk::alloy_primitives::Address) -> Self { + Self::new(address) + } + } + }, + ); + } +} diff --git a/stylus-proc/src/macros/sol_storage/mod.rs b/stylus-proc/src/macros/sol_storage/mod.rs new file mode 100644 index 00000000..956d3f70 --- /dev/null +++ b/stylus-proc/src/macros/sol_storage/mod.rs @@ -0,0 +1,45 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, parse_quote, punctuated::Punctuated, Token}; + +use proc::{SolidityField, SolidityFields, SolidityStruct, SolidityStructs}; + +mod proc; + +pub fn sol_storage(input: TokenStream) -> TokenStream { + let SolidityStructs(decls) = parse_macro_input!(input as SolidityStructs); + let mut out = quote!(); + + for decl in decls { + let SolidityStruct { + attrs, + vis, + name, + generics, + fields: SolidityFields(fields), + } = decl; + + let fields: Punctuated<_, Token![,]> = fields + .into_iter() + .map(|SolidityField { attrs, name, ty }| -> syn::Field { + parse_quote! { + #(#attrs)* + pub #name: #ty + } + }) + .collect(); + + out.extend(quote! { + #(#attrs)* + #[stylus_sdk::stylus_proc::storage] + #vis struct #name #generics { + #fields + } + }); + } + + out.into() +} diff --git a/stylus-proc/src/storage/proc.rs b/stylus-proc/src/macros/sol_storage/proc.rs similarity index 100% rename from stylus-proc/src/storage/proc.rs rename to stylus-proc/src/macros/sol_storage/proc.rs diff --git a/stylus-proc/src/macros/storage.rs b/stylus-proc/src/macros/storage.rs new file mode 100644 index 00000000..86177d7c --- /dev/null +++ b/stylus-proc/src/macros/storage.rs @@ -0,0 +1,258 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use proc_macro2::TokenStream; +use proc_macro_error::emit_error; +use quote::{quote, ToTokens}; +use syn::{ + parse_macro_input, parse_quote, punctuated::Punctuated, spanned::Spanned, ItemStruct, Token, + Type, +}; + +use crate::utils::attrs::consume_flag; + +/// Implementation of the [`#[storage]`][crate::storage] macro. +pub fn storage( + attr: proc_macro::TokenStream, + input: proc_macro::TokenStream, +) -> proc_macro::TokenStream { + if !attr.is_empty() { + emit_error!( + TokenStream::from(attr).span(), + "this macro is not configurable" + ); + } + + let mut item = parse_macro_input!(input as ItemStruct); + let storage = Storage::from(&mut item); + let mut output = item.into_token_stream(); + storage.to_tokens(&mut output); + output.into() +} + +#[derive(Debug)] +struct Storage { + name: syn::Ident, + generics: syn::Generics, + fields: Vec, +} + +impl Storage { + fn item_impl(&self) -> syn::ItemImpl { + let name = &self.name; + let (impl_generics, ty_generics, where_clause) = self.generics.split_for_impl(); + let size = TokenStream::from_iter(self.fields.iter().map(StorageField::size)); + parse_quote! { + impl #impl_generics #name #ty_generics #where_clause { + const fn required_slots() -> usize { + use stylus_sdk::storage; + let mut total: usize = 0; + let mut space: usize = 32; + #size + if space != 32 || total == 0 { + total += 1; + } + total + } + } + } + } + + fn impl_storage_type(&self) -> syn::ItemImpl { + let name = &self.name; + let (impl_generics, ty_generics, where_clause) = self.generics.split_for_impl(); + let init = Punctuated::::from_iter( + self.fields.iter().filter_map(StorageField::init), + ); + parse_quote! { + impl #impl_generics stylus_sdk::storage::StorageType for #name #ty_generics #where_clause { + type Wraps<'a> = stylus_sdk::storage::StorageGuard<'a, Self> where Self: 'a; + type WrapsMut<'a> = stylus_sdk::storage::StorageGuardMut<'a, Self> where Self: 'a; + + // start a new word + const SLOT_BYTES: usize = 32; + const REQUIRED_SLOTS: usize = Self::required_slots(); + + unsafe fn new(mut root: stylus_sdk::alloy_primitives::U256, offset: u8) -> Self { + use stylus_sdk::{storage, alloy_primitives}; + debug_assert!(offset == 0); + + let mut space: usize = 32; + let mut slot: usize = 0; + let accessor = Self { + #init + }; + accessor + } + + fn load<'s>(self) -> Self::Wraps<'s> { + stylus_sdk::storage::StorageGuard::new(self) + } + + fn load_mut<'s>(self) -> Self::WrapsMut<'s> { + stylus_sdk::storage::StorageGuardMut::new(self) + } + } + } + } +} + +impl From<&mut syn::ItemStruct> for Storage { + fn from(node: &mut syn::ItemStruct) -> Self { + let name = node.ident.clone(); + let generics = node.generics.clone(); + let fields = node + .fields + .iter_mut() + .enumerate() + .filter_map(|(idx, field)| { + if let syn::Type::Path(..) = &field.ty { + Some(StorageField::new(idx, field)) + } else { + None + } + }) + .collect(); + Self { + name, + generics, + fields, + } + } +} + +impl ToTokens for Storage { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.item_impl().to_tokens(tokens); + self.impl_storage_type().to_tokens(tokens); + for field in &self.fields { + field.impl_borrow(&self.name).to_tokens(tokens); + field.impl_borrow_mut(&self.name).to_tokens(tokens); + } + } +} + +#[derive(Debug)] +struct StorageField { + name: Option, + ty: syn::Type, + accessor: syn::Member, + borrow: bool, +} + +impl StorageField { + fn new(idx: usize, field: &mut syn::Field) -> Self { + check_type(field); + let name = field.ident.clone(); + let ty = field.ty.clone(); + let accessor = field + .ident + .clone() + .map(syn::Member::from) + .unwrap_or_else(|| idx.into()); + + let borrow = consume_flag(&mut field.attrs, "borrow"); + Self { + name, + ty, + accessor, + borrow, + } + } + + fn init(&self) -> Option { + let Some(ident) = &self.name else { + return None; + }; + let ty = &self.ty; + Some(parse_quote! { + #ident: { + let bytes = <#ty as storage::StorageType>::SLOT_BYTES; + let words = <#ty as storage::StorageType>::REQUIRED_SLOTS; + if space < bytes { + space = 32; + slot += 1; + } + space -= bytes; + + let root = root + alloy_primitives::U256::from(slot); + let field = <#ty as storage::StorageType>::new(root, space as u8); + if words > 0 { + slot += words; + space = 32; + } + field + } + }) + } + + fn size(&self) -> TokenStream { + let ty = &self.ty; + quote! { + let bytes = <#ty as storage::StorageType>::SLOT_BYTES; + let words = <#ty as storage::StorageType>::REQUIRED_SLOTS; + + if words > 0 { + total += words; + space = 32; + } else { + if space < bytes { + space = 32; + total += 1; + } + space -= bytes; + } + } + } + + fn impl_borrow(&self, name: &syn::Ident) -> Option { + let Self { ty, accessor, .. } = self; + self.borrow.then(|| { + parse_quote! { + impl core::borrow::Borrow<#ty> for #name { + fn borrow(&self) -> &#ty { + &self.#accessor + } + } + } + }) + } + + fn impl_borrow_mut(&self, name: &syn::Ident) -> Option { + let Self { ty, accessor, .. } = self; + self.borrow.then(|| { + parse_quote! { + impl core::borrow::BorrowMut<#ty> for #name { + fn borrow_mut(&mut self) -> &mut #ty { + &mut self.#accessor + } + } + } + }) + } +} + +fn check_type(field: &syn::Field) { + let Type::Path(ty) = &field.ty else { + unreachable!(); + }; + + let path = &ty.path.segments.last().unwrap().ident; + let not_supported = format!("Type `{path}` not supported for EVM state storage"); + + match path.to_string().as_str() { + x @ ("u8" | "u16" | "u32" | "u64" | "u128" | "i8" | "i16" | "i32" | "i64" | "i128" + | "U8" | "U16" | "U32" | "U64" | "U128" | "I8" | "I16" | "I32" | "I64" | "I128") => { + emit_error!( + &field, + "{not_supported}. Instead try `Storage{}`.", + x.to_uppercase() + ); + } + "usize" => emit_error!(&field, "{not_supported}."), + "isize" => emit_error!(&field, "{not_supported}."), + "bool" => emit_error!(&field, "{not_supported}. Instead try `StorageBool`."), + "f32" | "f64" => emit_error!(&field, "{not_supported}. Consider fixed-point arithmetic."), + _ => {} + } +} diff --git a/stylus-proc/src/methods/entrypoint.rs b/stylus-proc/src/methods/entrypoint.rs deleted file mode 100644 index 78bb63a9..00000000 --- a/stylus-proc/src/methods/entrypoint.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright 2023-2024, Offchain Labs, Inc. -// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md - -use cfg_if::cfg_if; -use proc_macro::TokenStream; -use proc_macro2::{Ident, Span}; -use quote::quote; -use syn::{parse_macro_input, Item}; - -pub fn entrypoint(attr: TokenStream, input: TokenStream) -> TokenStream { - let input: Item = parse_macro_input!(input); - - if !attr.is_empty() { - error!(Span::mixed_site(), "this macro is not configurable"); - } - - let mut output = quote! { #input }; - - let user = match input { - Item::Struct(input) => { - let name = &input.ident; - let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); - - output.extend(quote!{ - unsafe impl #impl_generics stylus_sdk::storage::TopLevelStorage for #name #ty_generics #where_clause {} - - fn entrypoint(input: alloc::vec::Vec) -> stylus_sdk::ArbResult { - use stylus_sdk::{abi::Router, alloy_primitives::U256, console, hex, storage::StorageType}; - use core::convert::TryInto; - use alloc::vec; - - if input.len() < 4 { - console!("calldata too short: {}", hex::encode(input)); - return Err(vec![]); - } - let selector = u32::from_be_bytes(TryInto::try_into(&input[..4]).unwrap()); - let mut storage = unsafe { <#name as StorageType>::new(U256::ZERO, 0) }; - match <#name as Router<_>>::route(&mut storage, selector, &input[4..]) { - Some(res) => res, - None => { - console!("unknown method selector: {selector:08x}"); - Err(vec![]) - }, - } - } - - const _: () = { - <#name>::__stylus_assert_overrides(); - }; - }); - - if cfg!(feature = "export-abi") { - output.extend(quote! { - pub fn print_abi(license: &str, pragma: &str) { - stylus_sdk::abi::export::print_abi::<#name>(license, pragma); - } - }); - } - - Ident::new("entrypoint", name.span()) - } - Item::Fn(input) => input.sig.ident.clone(), - _ => error!(input, "not a struct or fn"), - }; - - // revert on reentrancy unless explicitly enabled - cfg_if! { - if #[cfg(feature = "reentrant")] { - let deny_reentrant = quote! {}; - } else { - let deny_reentrant = quote! { - if stylus_sdk::msg::reentrant() { - return 1; // revert - } - }; - } - } - - output.extend(quote! { - #[no_mangle] - pub unsafe fn mark_used() { - stylus_sdk::evm::pay_for_memory_grow(0); - panic!(); - } - - #[no_mangle] - pub extern "C" fn user_entrypoint(len: usize) -> usize { - #deny_reentrant - - let input = stylus_sdk::contract::args(len); - let (data, status) = match #user(input) { - Ok(data) => (data, 0), - Err(data) => (data, 1), - }; - unsafe { stylus_sdk::storage::StorageCache::flush() }; - stylus_sdk::contract::output(&data); - status - } - }); - - output.into() -} diff --git a/stylus-proc/src/methods/error.rs b/stylus-proc/src/methods/error.rs deleted file mode 100644 index 07e29565..00000000 --- a/stylus-proc/src/methods/error.rs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024, Offchain Labs, Inc. -// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md - -use proc_macro::TokenStream; -use quote::quote; -use syn::{parse_macro_input, Fields, ItemEnum}; - -pub fn derive_solidity_error(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as ItemEnum); - let name = &input.ident; - let mut match_arms = quote!(); - let mut errors = vec![]; - let mut output = quote!(); - for variant in input.variants { - let variant_name = variant.ident; - let error = match variant.fields { - Fields::Unnamed(e) if variant.fields.len() == 1 => e.unnamed.first().unwrap().clone(), - _ => error!(variant.fields, "Variant not a 1-tuple"), - }; - let ty = error.ty.clone(); - match_arms.extend(quote! { - #name::#variant_name(e) => ::stylus_sdk::call::MethodError::encode(e), - }); - output.extend(quote! { - impl From<#ty> for #name { - fn from(value: #ty) -> Self { - #name::#variant_name(value) - } - } - }); - errors.push(error); - } - output.extend(quote! { - impl From<#name> for alloc::vec::Vec { - fn from(err: #name) -> alloc::vec::Vec { - match err { - #match_arms - } - } - } - }); - - if cfg!(feature = "export-abi") { - output.extend(quote! { - impl stylus_sdk::abi::export::internal::InnerTypes for #name { - fn inner_types() -> alloc::vec::Vec { - use alloc::{format, vec}; - use core::any::TypeId; - use stylus_sdk::abi::export::internal::InnerType; - use stylus_sdk::alloy_sol_types::SolError; - - vec![ - #( - InnerType { - name: format!("error {};", <#errors as SolError>::SIGNATURE.replace(',', ", ")), - id: TypeId::of::<#errors>(), - } - ),* - ] - } - } - }); - } - - output.into() -} diff --git a/stylus-proc/src/methods/public.rs b/stylus-proc/src/methods/public.rs deleted file mode 100644 index 19517f15..00000000 --- a/stylus-proc/src/methods/public.rs +++ /dev/null @@ -1,470 +0,0 @@ -// Copyright 2022-2024, Offchain Labs, Inc. -// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md - -use crate::types::Purity; -use convert_case::{Case, Casing}; -use proc_macro::TokenStream; -use proc_macro2::{Ident, Span}; -use quote::{quote, quote_spanned}; -use std::mem; -use syn::{ - parenthesized, - parse::{Parse, ParseStream}, - parse_macro_input, - punctuated::Punctuated, - spanned::Spanned, - FnArg, ImplItem, Index, ItemImpl, LitStr, Pat, PatType, Result, ReturnType, Token, Type, -}; - -pub fn public(attr: TokenStream, input: TokenStream) -> TokenStream { - if !attr.is_empty() { - error!(Span::mixed_site(), "this macro is not configurable"); - } - - let mut input = parse_macro_input!(input as ItemImpl); - let mut selectors = quote!(); - let mut match_selectors = quote!(); - let mut abi = quote!(); - let mut types = vec![]; - let mut override_selectors = quote!(); - let mut selector_consts = vec![]; - - for item in input.items.iter_mut() { - let ImplItem::Method(method) = item else { - continue; - }; - - // see if user chose a purity or selector - let mut purity = None; - let mut override_name = None; - for attr in mem::take(&mut method.attrs) { - let Some(ident) = attr.path.get_ident() else { - method.attrs.push(attr); - continue; - }; - if *ident == "payable" { - if !attr.tokens.is_empty() { - error!(attr.tokens, "attribute does not take parameters"); - } - if purity.is_some() { - error!(attr.path, "more than one payable attribute"); - } - purity = Some(Purity::Payable); - continue; - } - if *ident == "selector" { - if override_name.is_some() { - error!(attr.path, "more than one selector attribute"); - } - let args = match syn::parse2::(attr.tokens.clone()) { - Ok(args) => args, - Err(error) => error!(ident, "{}", error), - }; - override_name = Some(args.name); - continue; - } - method.attrs.push(attr); - } - - use Purity::*; - - // determine purity if not - let mut args = method.sig.inputs.iter().peekable(); - let mut has_self = false; - let needed_purity = match args.peek() { - Some(FnArg::Receiver(recv)) => { - has_self = true; - recv.mutability.into() - } - Some(FnArg::Typed(PatType { ty, .. })) => match &**ty { - Type::Reference(ty) => ty.mutability.into(), - _ => Pure, - }, - _ => Pure, - }; - - // enforce purity - let purity = purity.unwrap_or(needed_purity); - if purity == Pure && purity < needed_purity { - error!(args.next(), "pure method must not access storage"); - } - if purity == View && purity < needed_purity { - error!(args.next(), "storage is &mut, but the method is {purity}"); - } - if needed_purity > Pure { - args.next(); // drop first arg - } - - /// finds the root type for a given arg - fn pattern_ident(pat: Pat) -> Option { - match pat { - Pat::Ident(ident) => Some(ident.ident), - Pat::Reference(pat) => pattern_ident(*pat.pat), - _ => None, - } - } - let args: Vec<_> = args - .map(|arg| match arg { - FnArg::Typed(t) => (pattern_ident(*t.pat.clone()), t.ty.clone()), - _ => unreachable!(), - }) - .collect(); - - let name = &method.sig.ident; - let sol_name = override_name.unwrap_or(name.to_string().to_case(Case::Camel)); - - // deny value when method isn't payable - let mut deny_value = quote!(); - if purity != Payable { - let name = name.to_string(); - deny_value = quote! { - if let Err(err) = internal::deny_value(#name) { - return Some(Err(err)); - } - }; - }; - - // get the needed storage - let storage = if needed_purity == Pure { - quote!() - } else if has_self { - quote! { core::borrow::BorrowMut::borrow_mut(storage), } - } else { - quote! { storage, } - }; - - // get the solidity args - let mut expand_args = vec![]; - for (index, (_, ty)) in args.iter().enumerate() { - let index = Index { - index: index as u32, - span: ty.span(), - }; - expand_args.push(quote! { args.#index }); - } - - // calculate selector - let constant = Ident::new(&format!("SELECTOR_{name}"), name.span()); - let arg_types: &Vec<_> = &args.iter().map(|a| &a.1).collect(); - - let selector = - quote! { u32::from_be_bytes(function_selector!(#sol_name #(, #arg_types )*)) }; - selectors.extend(quote! { - #[allow(non_upper_case_globals)] - const #constant: u32 = #selector; - }); - - let sdk_purity = purity.as_tokens(); - override_selectors.extend(quote! { - #[allow(non_upper_case_globals)] - #constant => #sdk_purity.allow_override(purity), - }); - let error_msg = format!( - "function {} cannot be overriden with function marked {:?}", - name, purity - ); - selector_consts.push((constant.clone(), sdk_purity, error_msg)); - - let in_span = method.sig.inputs.span(); - let decode_inputs = quote_spanned! { in_span => <(#( #arg_types, )*) as AbiType>::SolType }; - - let ret_span = match &method.sig.output { - x @ ReturnType::Default => x.span(), - ReturnType::Type(_, ty) => ty.span(), // right of arrow - }; - let encode_result = quote_spanned! { ret_span => EncodableReturnType::encode(result) }; - - // match against the selector - match_selectors.extend(quote! { - #[allow(non_upper_case_globals)] - #constant => { - #deny_value - let args = match <#decode_inputs as SolType>::abi_decode_params(input, true) { - Ok(args) => args, - Err(err) => { - internal::failed_to_decode_arguments(err); - return Some(Err(vec![])); - } - }; - let result = Self::#name(#storage #(#expand_args, )* ); - Some(#encode_result) - } - }); - - // only collect abi info if enabled - if cfg!(not(feature = "export-abi")) { - continue; - } - - let sol_args = args.iter().enumerate().map(|(i, (ident, ty))| { - let comma = (i > 0).then_some(", ").unwrap_or_default(); - let name = ident.as_ref().map(ToString::to_string).unwrap_or_default(); - quote! { - write!(f, "{}{}{}", #comma, <#ty as AbiType>::EXPORT_ABI_ARG, underscore_if_sol(#name))?; - } - }); - let sol_outs = match &method.sig.output { - ReturnType::Default => quote!(), - ReturnType::Type(_, ty) => quote! { write_solidity_returns::<#ty>(f)?; }, - }; - let sol_purity = match purity { - Write => "".to_string(), - x => format!(" {x}"), - }; - - abi.extend(quote! { - write!(f, "\n function {}(", #sol_name)?; - #(#sol_args)* - write!(f, ") external")?; - write!(f, #sol_purity)?; - #sol_outs - writeln!(f, ";")?; - }); - } - - // collect inherits - let mut inherits = vec![]; - for attr in mem::take(&mut input.attrs) { - if !attr.path.is_ident("inherit") { - input.attrs.push(attr); - continue; - } - let contents: InheritsAttr = match attr.parse_args() { - Ok(contents) => contents, - Err(err) => return proc_macro::TokenStream::from(err.to_compile_error()), - }; - for ty in contents.types { - inherits.push(ty); - } - } - - // try to match against each inherited router - let inherit_routes = inherits.iter().map(|ty| { - quote! { - if let Some(result) = <#ty as Router>::route(storage, selector, input) { - return Some(result); - } - } - }); - - // ensure we can actually borrow the things we inherit - let borrow_clauses = inherits.iter().map(|ty| { - quote! { - S: core::borrow::BorrowMut<#ty> - } - }); - - let self_ty = &input.self_ty; - let generic_params = &input.generics.params; - let where_clauses = input - .generics - .where_clause - .clone() - .map(|c| c.predicates) - .unwrap_or_default(); - - let check_overrides = selector_consts - .iter() - .map(|(selector, purity, msg)| { - quote! { - assert!(<#self_ty>::__stylus_allow_override(#selector, #purity), "{}", #msg); - } - }) - .chain(inherits.iter().map(|ty| { - quote! { - <#ty>::__stylus_assert_overrides(); - } - })); - let inherit_overrides = inherits.iter().map(|ty| { - quote! { - if !<#ty>::__stylus_allow_override(selector, purity) { - return false; - } - } - }); - - // implement Router with inheritance - let mut router = quote! { - #input - - impl stylus_sdk::abi::Router for #self_ty - where - S: stylus_sdk::storage::TopLevelStorage + core::borrow::BorrowMut, - #(#borrow_clauses,)* - #where_clauses - { - type Storage = Self; - - #[inline(always)] - #[deny(unreachable_patterns)] - fn route(storage: &mut S, selector: u32, input: &[u8]) -> Option { - use stylus_sdk::{function_selector, alloy_sol_types::SolType}; - use stylus_sdk::abi::{internal, internal::EncodableReturnType, AbiType, Router}; - use alloc::vec; - - #[cfg(feature = "export-abi")] - use stylus_sdk::abi::export; - - #selectors - match selector { - #match_selectors - _ => { - #(#inherit_routes)* - None - } - } - } - } - - // implement checks for method overriding. - impl<#generic_params> #self_ty where #where_clauses { - #[doc(hidden)] - /// Whether or not to allow overriding a selector by a child contract and method with - /// the given purity. This is currently implemented as a hidden function to allow it to - /// be `const`. A trait would be better, but `const` is not currently supported for - /// trait fns. - pub const fn __stylus_allow_override(selector: u32, purity: stylus_sdk::methods::Purity) -> bool { - use stylus_sdk::function_selector; - #selectors - if !match selector { - #override_selectors - _ => true - } { return false; } - #(#inherit_overrides)* - true - } - - #[doc(hidden)] - /// Check the functions defined in an entrypoint for valid overrides. - pub const fn __stylus_assert_overrides() { - use stylus_sdk::function_selector; - #selectors - #(#check_overrides)* - } - } - }; - - // only collect abi info if enabled - if cfg!(not(feature = "export-abi")) { - return router.into(); - } - - for item in input.items.iter_mut() { - let ImplItem::Method(method) = item else { - continue; - }; - if let ReturnType::Type(_, ty) = &method.sig.output { - types.push(ty); - } - } - - let type_decls = quote! { - let mut seen = HashSet::new(); - for item in ([] as [InnerType; 0]).iter() #(.chain(&<#types as InnerTypes>::inner_types()))* { - if seen.insert(item.id) { - writeln!(f, "\n {}", item.name)?; - } - } - }; - - let name = match *self_ty.clone() { - Type::Path(path) => path.path.segments.last().unwrap().ident.clone().to_string(), - _ => error!(self_ty, "Can't generate ABI for unnamed type"), - }; - - let inherited_abis = inherits.iter().map(|ty| { - quote! { - <#ty as GenerateAbi>::fmt_abi(f)?; - writeln!(f)?; - } - }); - - // write the "is" clause in Solidity - let mut is_clause = match inherits.is_empty() { - true => quote! {}, - false => quote! { write!(f, " is ")?; }, - }; - is_clause.extend(inherits.iter().enumerate().map(|(i, ty)| { - let comma = (i > 0).then_some(", ").unwrap_or_default(); - quote! { - write!(f, "{}I{}", #comma, <#ty as GenerateAbi>::NAME)?; - } - })); - - router.extend(quote! { - impl<#generic_params> stylus_sdk::abi::GenerateAbi for #self_ty where #where_clauses { - const NAME: &'static str = #name; - - fn fmt_abi(f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - use stylus_sdk::abi::{AbiType, GenerateAbi}; - use stylus_sdk::abi::internal::write_solidity_returns; - use stylus_sdk::abi::export::{underscore_if_sol, internal::{InnerType, InnerTypes}}; - use std::collections::HashSet; - #(#inherited_abis)* - write!(f, "interface I{}", #name)?; - #is_clause - write!(f, " {{")?; - #abi - #type_decls - writeln!(f, "}}")?; - Ok(()) - } - } - }); - - router.into() -} - -struct InheritsAttr { - types: Punctuated, -} - -impl Parse for InheritsAttr { - fn parse(input: syn::parse::ParseStream) -> syn::Result { - let types = Punctuated::parse_separated_nonempty(input)?; - Ok(Self { types }) - } -} - -struct SelectorArgs { - name: String, -} - -impl Parse for SelectorArgs { - fn parse(input: ParseStream) -> Result { - let mut name = None; - - let content; - let _ = parenthesized!(content in input); - let input = content; - - if input.is_empty() { - error!(@input.span(), "missing id or text argument"); - } - - while !input.is_empty() { - let ident: Ident = input.parse()?; - let _: Token![=] = input.parse()?; - - match ident.to_string().as_str() { - "name" => { - let lit: LitStr = input.parse()?; - if name.is_some() { - error!(@lit, r#"only one "name" is allowed"#); - } - name = Some(lit.value()); - } - _ => error!(@ident, "Unknown selector attribute"), - } - - // allow a comma - let _: Result = input.parse(); - } - - if let Some(name) = name { - Ok(Self { name }) - } else { - error!(@input.span(), r#""name" is required"#); - } - } -} diff --git a/stylus-proc/src/storage/mod.rs b/stylus-proc/src/storage/mod.rs deleted file mode 100644 index a8c4e585..00000000 --- a/stylus-proc/src/storage/mod.rs +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright 2023-2024, Offchain Labs, Inc. -// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md - -use crate::storage::proc::{SolidityField, SolidityFields, SolidityStruct, SolidityStructs}; -use proc_macro::TokenStream; -use quote::{quote, ToTokens}; -use std::mem; -use syn::{parse_macro_input, punctuated::Punctuated, Index, ItemStruct, Token, Type}; - -mod proc; - -pub fn storage(_attr: TokenStream, input: TokenStream) -> TokenStream { - let mut input = parse_macro_input!(input as ItemStruct); - - let name = &input.ident; - let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); - - let mut init = quote! {}; - let mut size = quote! {}; - let mut borrows = quote! {}; - - for (field_index, field) in input.fields.iter_mut().enumerate() { - // deny complex types - let Type::Path(ty) = &field.ty else { - error!(&field, "Type not supported for EVM state storage"); - }; - - // implement borrows - let attrs = mem::take(&mut field.attrs); - for attr in attrs { - if !attr.path.is_ident("borrow") { - field.attrs.push(attr); - continue; - } - if !attr.tokens.is_empty() { - error!(attr.tokens, "borrow attribute does not take parameters"); - } - let ty = &field.ty; - let accessor = match field.ident.as_ref() { - Some(accessor) => accessor.into_token_stream(), - None => Index::from(field_index).into_token_stream(), - }; - borrows.extend(quote! { - impl core::borrow::Borrow<#ty> for #name { - fn borrow(&self) -> &#ty { - &self.#accessor - } - } - impl core::borrow::BorrowMut<#ty> for #name { - fn borrow_mut(&mut self) -> &mut #ty { - &mut self.#accessor - } - } - }); - } - - let path = &ty.path.segments.last().unwrap().ident; - let not_supported = format!("Type `{path}` not supported for EVM state storage"); - - match path.to_string().as_str() { - x @ ("u8" | "u16" | "u32" | "u64" | "u128" | "i8" | "i16" | "i32" | "i64" | "i128" - | "U8" | "U16" | "U32" | "U64" | "U128" | "I8" | "I16" | "I32" | "I64" - | "I128") => { - error!( - &field, - "{not_supported}. Instead try `Storage{}`.", - x.to_uppercase() - ); - } - "usize" => error!(&field, "{not_supported}."), - "isize" => error!(&field, "{not_supported}."), - "bool" => error!(&field, "{not_supported}. Instead try `StorageBool`."), - "f32" | "f64" => error!(&field, "{not_supported}. Consider fixed-point arithmetic."), - _ => {} - } - - let Some(ident) = &field.ident else { - continue; - }; - - init.extend(quote! { - #ident: { - let bytes = <#ty as storage::StorageType>::SLOT_BYTES; - let words = <#ty as storage::StorageType>::REQUIRED_SLOTS; - if space < bytes { - space = 32; - slot += 1; - } - space -= bytes; - - let root = root + alloy_primitives::U256::from(slot); - let field = <#ty as storage::StorageType>::new(root, space as u8); - if words > 0 { - slot += words; - space = 32; - } - field - }, - }); - - size.extend(quote! { - let bytes = <#ty as storage::StorageType>::SLOT_BYTES; - let words = <#ty as storage::StorageType>::REQUIRED_SLOTS; - - if words > 0 { - total += words; - space = 32; - } else { - if space < bytes { - space = 32; - total += 1; - } - space -= bytes; - } - }); - } - - let expanded = quote! { - #input - - impl #impl_generics #name #ty_generics #where_clause { - const fn required_slots() -> usize { - use stylus_sdk::storage; - let mut total: usize = 0; - let mut space: usize = 32; - #size - if space != 32 || total == 0 { - total += 1; - } - total - } - } - - impl #impl_generics stylus_sdk::storage::StorageType for #name #ty_generics #where_clause { - type Wraps<'a> = stylus_sdk::storage::StorageGuard<'a, Self> where Self: 'a; - type WrapsMut<'a> = stylus_sdk::storage::StorageGuardMut<'a, Self> where Self: 'a; - - // start a new word - const SLOT_BYTES: usize = 32; - const REQUIRED_SLOTS: usize = Self::required_slots(); - - unsafe fn new(mut root: stylus_sdk::alloy_primitives::U256, offset: u8) -> Self { - use stylus_sdk::{storage, alloy_primitives}; - debug_assert!(offset == 0); - - let mut space: usize = 32; - let mut slot: usize = 0; - let accessor = Self { - #init - }; - accessor - } - - fn load<'s>(self) -> Self::Wraps<'s> { - stylus_sdk::storage::StorageGuard::new(self) - } - - fn load_mut<'s>(self) -> Self::WrapsMut<'s> { - stylus_sdk::storage::StorageGuardMut::new(self) - } - } - - #borrows - }; - expanded.into() -} - -pub fn sol_storage(input: TokenStream) -> TokenStream { - let SolidityStructs(decls) = parse_macro_input!(input as SolidityStructs); - let mut out = quote!(); - - for decl in decls { - let SolidityStruct { - attrs, - vis, - name, - generics, - fields: SolidityFields(fields), - } = decl; - - let fields: Punctuated<_, Token![,]> = fields - .into_iter() - .map(|SolidityField { attrs, name, ty }| { - quote! { - #(#attrs)* - pub #name: #ty - } - }) - .collect(); - - out.extend(quote! { - #(#attrs)* - #[stylus_sdk::stylus_proc::storage] - #vis struct #name #generics { - #fields - } - }); - } - - out.into() -} - -pub fn derive_erase(input: TokenStream) -> TokenStream { - let mut input = parse_macro_input!(input as ItemStruct); - let name = &input.ident; - let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); - - let mut erase_fields = quote! {}; - for field in &mut input.fields { - let ident = &field.ident; - erase_fields.extend(quote! { - self.#ident.erase(); - }); - } - quote! { - impl #impl_generics stylus_sdk::storage::Erase for #name #ty_generics #where_clause { - fn erase(&mut self) { - #erase_fields - } - } - } - .into() -} diff --git a/stylus-proc/src/types.rs b/stylus-proc/src/types.rs index 0907483e..f52f9c2a 100644 --- a/stylus-proc/src/types.rs +++ b/stylus-proc/src/types.rs @@ -1,12 +1,10 @@ // Copyright 2023-2024, Offchain Labs, Inc. // For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md +use std::{fmt::Display, num::NonZeroU16, str::FromStr}; -use alloy_sol_types::SolType; -use proc_macro2::TokenStream; -use quote::quote; -use std::{borrow::Cow, fmt::Display, num::NonZeroU16, str::FromStr}; -use syn::Token; -use syn_solidity::Type; +use syn::{parse_quote, Token}; + +use crate::imports::alloy_sol_types::sol_data; /// The purity of a Solidity method #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] @@ -19,12 +17,25 @@ pub enum Purity { impl Purity { /// How to reference this purity from inside a contract. - pub fn as_tokens(&self) -> TokenStream { + pub fn as_path(&self) -> syn::Path { match self { - Purity::Pure => quote! { stylus_sdk::methods::Purity::Pure }, - Purity::View => quote! { stylus_sdk::methods::Purity::View }, - Purity::Write => quote! { stylus_sdk::methods::Purity::Write }, - Purity::Payable => quote! { stylus_sdk::methods::Purity::Payable }, + Purity::Pure => parse_quote!(stylus_sdk::methods::Purity::Pure), + Purity::View => parse_quote!(stylus_sdk::methods::Purity::View), + Purity::Write => parse_quote!(stylus_sdk::methods::Purity::Write), + Purity::Payable => parse_quote!(stylus_sdk::methods::Purity::Payable), + } + } + + /// Infer the purity of the function by inspecting the first argument. Also returns whether the + /// function has a self parameter. + pub fn infer(func: &syn::ImplItemFn) -> (Self, bool) { + match func.sig.inputs.first() { + Some(syn::FnArg::Receiver(recv)) => (recv.mutability.into(), true), + Some(syn::FnArg::Typed(syn::PatType { ty, .. })) => match &**ty { + syn::Type::Reference(ty) => (ty.mutability.into(), false), + _ => (Self::Pure, false), + }, + _ => (Self::Pure, false), } } } @@ -69,72 +80,142 @@ impl From> for Purity { } } -/// Returns the alloy path and ABI for a given Solidity type -pub fn solidity_type_info(ty: &Type) -> (Cow<'static, str>, Cow<'static, str>) { - use alloy_sol_types::sol_data; +/// Alloy type and ABI for a Solidity type +#[derive(Debug)] +pub struct SolidityTypeInfo { + pub alloy_type: syn::Type, + pub sol_type: syn_solidity::Type, +} - macro_rules! abi { - ($format:expr $(,$msg:expr)*) => { - format!($format $(,$msg)*).into() - }; - } - macro_rules! path { - ($format:expr $(,$msg:expr)*) => {{ - let text = format!($format $(,$msg)*); - abi!("stylus_sdk::alloy_sol_types::sol_data::{text}") - }}; - } - macro_rules! simple { - ($ty:ident) => { - (path!(stringify!($ty)), sol_data::$ty::SOL_NAME.into()) - }; - } - match ty { - Type::Bool(_) => simple!(Bool), - Type::Address(_, _) => simple!(Address), - Type::String(_) => simple!(String), - Type::Bytes(_) => simple!(Bytes), - Type::FixedBytes(_, size) => ( - format!("stylus_sdk::alloy_sol_types::sol_data::FixedBytes<{size}>").into(), - abi!("bytes[{size}]"), - ), - Type::Uint(_, size) => { - let size = size.unwrap_or(NonZeroU16::new(256).unwrap()); - (path!("Uint<{size}>"), abi!("uint{size}")) - } - Type::Int(_, size) => { - let size = size.unwrap_or(NonZeroU16::new(256).unwrap()); - (path!("Int<{size}>"), abi!("int{size}")) +impl SolidityTypeInfo { + fn new(alloy_type: syn::Type, sol_type: syn_solidity::Type) -> Self { + Self { + alloy_type, + sol_type, } - Type::Array(ty) => { - let (path, abi) = solidity_type_info(&ty.ty); - match ty.size() { - Some(size) => (path!("FixedArray<{path}, {size}>"), abi!("{abi}[{size}]")), - None => (path!("Array<{path}>"), abi!("{abi}[]")), + } +} + +/// Get type info from given Solidity type +impl From<&syn_solidity::Type> for SolidityTypeInfo { + fn from(sol_type: &syn_solidity::Type) -> Self { + use syn_solidity::Type; + + let alloy_type = match sol_type { + Type::Bool(_) => sol_data::join("Bool"), + Type::Address(_, _) => sol_data::join("Address"), + Type::String(_) => sol_data::join("String"), + Type::Bytes(_) => sol_data::join("Bytes"), + Type::FixedBytes(_, size) => sol_data::join(&format!("FixedBytes<{size}>")), + Type::Uint(_, size) => { + let size = size.unwrap_or(NonZeroU16::new(256).unwrap()); + sol_data::join(&format!("Uint<{size}>")) } - } - Type::Tuple(tup) => { - if tup.types.is_empty() { - ("()".into(), "()".into()) - } else if tup.types.len() == 1 { - solidity_type_info(&tup.types[0]) - } else { - let mut path = "(".to_string(); - let mut abi = "(".to_string(); - for (i, ty) in tup.types.iter().enumerate() { - if i > 0 { - path += ", "; - abi += ","; + Type::Int(_, size) => { + let size = size.unwrap_or(NonZeroU16::new(256).unwrap()); + sol_data::join(&format!("Int<{size}>")) + } + Type::Array(array) => { + let Self { alloy_type, .. } = Self::from(&*array.ty); + match array.size() { + Some(size) => { + parse_quote!(stylus_sdk::alloy_sol_types::sol_data::FixedArray<#alloy_type, #size>) } - let (inner_path, inner_abi) = solidity_type_info(ty); - path += &inner_path; - abi += &inner_abi; + None => parse_quote!(stylus_sdk::alloy_sol_types::sol_data::Array<#alloy_type>), } - path += ")"; - abi += ")"; - (path.into(), abi.into()) } - } - _ => todo!("Solidity type {ty} is not yet implemented in sol_interface!"), + Type::Tuple(tup) => { + if tup.types.is_empty() { + parse_quote! { () } + } else if tup.types.len() == 1 { + return Self::from(&tup.types[0]); + } else { + let type_info = tup.types.iter().map(Self::from); + let alloy_types = type_info.clone().map(|info| info.alloy_type); + parse_quote! { + (#(#alloy_types,)*) + } + } + } + Type::Custom(path) => { + let path = syn::Path { + leading_colon: None, + segments: path.iter().cloned().map(syn::PathSegment::from).collect(), + }; + syn::TypePath { qself: None, path }.into() + } + _ => todo!("Solidity type {sol_type} is not yet implemented in sol_interface!"), + }; + Self::new(alloy_type, sol_type.clone()) } } + +#[cfg(test)] +mod tests { + use syn::parse_quote; + + use super::SolidityTypeInfo; + + macro_rules! sol_type_test { + ($sol:ident, $alloy:ty) => { + sol_type_test!($sol, stringify!($sol), @parse_quote!($alloy)); + }; + ($name:ident, $sol:expr, $alloy:ty) => { + sol_type_test!($name, $sol, @parse_quote!($alloy)); + }; + ($name:ident, $sol:expr, @$alloy:expr) => { + paste::paste! { + #[test] + fn []() { + let sol_type = syn::parse_str($sol).unwrap(); + let info = SolidityTypeInfo::from(&sol_type); + assert_eq!(info.sol_type, sol_type); + assert_eq!(info.sol_type.to_string(), $sol); + assert_eq!( + info.alloy_type, + $alloy, + ); + } + } + }; + } + + sol_type_test!(bool, stylus_sdk::alloy_sol_types::sol_data::Bool); + sol_type_test!(address, stylus_sdk::alloy_sol_types::sol_data::Address); + sol_type_test!(string, stylus_sdk::alloy_sol_types::sol_data::String); + sol_type_test!(bytes, stylus_sdk::alloy_sol_types::sol_data::Bytes); + sol_type_test!( + fixed_bytes, + "bytes10", + stylus_sdk::alloy_sol_types::sol_data::FixedBytes<10> + ); + sol_type_test!(uint160, stylus_sdk::alloy_sol_types::sol_data::Uint<160>); + sol_type_test!(int32, stylus_sdk::alloy_sol_types::sol_data::Int<32>); + #[rustfmt::skip] + sol_type_test!( + array, + "int256[]", + stylus_sdk::alloy_sol_types::sol_data::Array< + stylus_sdk::alloy_sol_types::sol_data::Int<256> + > + ); + #[rustfmt::skip] + sol_type_test!( + fixed_array, + "int256[100]", + stylus_sdk::alloy_sol_types::sol_data::FixedArray< + stylus_sdk::alloy_sol_types::sol_data::Int<256>, + 100usize + > + ); + sol_type_test!( + tuple, + "(uint256,bytes,string)", + @parse_quote! {( + stylus_sdk::alloy_sol_types::sol_data::Uint<256>, + stylus_sdk::alloy_sol_types::sol_data::Bytes, + stylus_sdk::alloy_sol_types::sol_data::String, + )} + ); + sol_type_test!(custom_path, "foo.bar.baz", foo::bar::baz); +} diff --git a/stylus-proc/src/utils/attrs.rs b/stylus-proc/src/utils/attrs.rs new file mode 100644 index 00000000..15a513ee --- /dev/null +++ b/stylus-proc/src/utils/attrs.rs @@ -0,0 +1,63 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Utilities for handling macro attributes. + +use proc_macro2::TokenStream; +use proc_macro_error::emit_error; +use syn::parse::{Nothing, Parse}; + +/// Consume any used attributes, leaving unused attributes in the list. +pub fn consume_attr( + attrs: &mut Vec, + ident_str: &'static str, +) -> Option { + let mut result = None; + for attr in core::mem::take(attrs) { + // skip all other attrs, adding them back to the Vec + if !attr_ident_matches(&attr, ident_str) { + attrs.push(attr); + continue; + } + + if result.is_some() { + emit_error!(attr, "duplicate attribute"); + } + + let tokens = get_attr_tokens(&attr).unwrap_or_default(); + match syn::parse2(tokens) { + Ok(value) => result = Some(value), + Err(err) => { + emit_error!(err.span(), "{}", err); + } + } + } + result +} + +/// Consume a flag attribute (no input tokens) +pub fn consume_flag(attrs: &mut Vec, ident_str: &'static str) -> bool { + consume_attr::(attrs, ident_str).is_some() +} + +/// Check that an attribute stream is empty. +pub fn check_attr_is_empty(attr: impl Into) { + let attr = attr.into(); + if let Err(err) = syn::parse2::(attr) { + emit_error!(err.span(), "{}", err); + } +} + +/// Check if attribute is a simple [`syn::Ident`] and matches a given string +fn attr_ident_matches(attr: &syn::Attribute, value: &'static str) -> bool { + matches!(attr.path().get_ident(), Some(ident) if *ident == value) +} + +/// Get tokens for parsing from a [`syn::Attribute`]. +fn get_attr_tokens(attr: &syn::Attribute) -> Option { + if let syn::Meta::List(syn::MetaList { tokens, .. }) = &attr.meta { + Some(tokens.clone()) + } else { + None + } +} diff --git a/stylus-proc/src/utils/mod.rs b/stylus-proc/src/utils/mod.rs new file mode 100644 index 00000000..d2708dbd --- /dev/null +++ b/stylus-proc/src/utils/mod.rs @@ -0,0 +1,54 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Macro generation utilities. + +use sha3::{Digest, Keccak256}; +use syn::{punctuated::Punctuated, Token}; +use syn_solidity::SolIdent; + +pub mod attrs; + +#[cfg(test)] +pub mod testing; + +/// Like [`syn::Generics::split_for_impl`] but for [`syn::ItemImpl`]. +/// +/// [`syn::Generics::split_for_impl`] does not work in this case because the `name` of the +/// implemented type is not easy to get, but the type including generics is. +pub fn split_item_impl_for_impl( + node: &syn::ItemImpl, +) -> ( + Punctuated, + syn::Type, + Punctuated, +) { + let generic_params = node.generics.params.clone(); + let self_ty = (*node.self_ty).clone(); + let where_clause = node + .generics + .where_clause + .clone() + .map(|c| c.predicates) + .unwrap_or_default(); + (generic_params, self_ty, where_clause) +} + +/// Build [function selector](https://solidity-by-example.org/function-selector/) byte array. +pub fn build_selector<'a>( + name: &SolIdent, + params: impl Iterator, +) -> [u8; 4] { + let mut selector = Keccak256::new(); + selector.update(name.to_string()); + selector.update("("); + for (i, param) in params.enumerate() { + if i > 0 { + selector.update(","); + } + selector.update(param.to_string()); + } + selector.update(")"); + let selector = selector.finalize(); + [selector[0], selector[1], selector[2], selector[3]] +} diff --git a/stylus-proc/src/utils/testing.rs b/stylus-proc/src/utils/testing.rs new file mode 100644 index 00000000..e010327c --- /dev/null +++ b/stylus-proc/src/utils/testing.rs @@ -0,0 +1,19 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Utilities for testing. + +use quote::ToTokens; + +/// Assert equality of two AST nodes, with pretty diff output for failures. +pub fn assert_ast_eq(left: T, right: T) { + let left = pprint(left); + let right = pprint(right); + pretty_assertions::assert_str_eq!(left, right); +} + +fn pprint(node: T) -> String { + let tokens = node.into_token_stream(); + let file = syn::parse2(tokens).unwrap(); + prettyplease::unparse(&file) +} diff --git a/stylus-proc/tests/derive_abi_type.rs b/stylus-proc/tests/derive_abi_type.rs new file mode 100644 index 00000000..3a3d6883 --- /dev/null +++ b/stylus-proc/tests/derive_abi_type.rs @@ -0,0 +1,49 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use stylus_proc::AbiType; +use stylus_sdk::abi::AbiType; +use stylus_sdk::alloy_sol_types::sol; +use stylus_sdk::alloy_sol_types::SolType; + +sol! { + #[derive(Debug, PartialEq, AbiType)] + struct MyStruct { + uint8 bar; + } +} + +#[test] +fn test_abi_type() { + assert_eq!(::ABI.as_str(), "MyStruct"); + assert_eq!( + ::ABI.as_str(), + ::SOL_NAME, + ); +} + +#[test] +fn test_abi_encode() { + let mut expected = [0u8; 32]; + expected[31] = 100; + assert_eq!( + ::abi_encode(&MyStruct { bar: 100 }), + expected, + ); +} + +#[test] +fn test_abi_decode() { + let mut input = [0u8; 32]; + input[31] = 100; + assert_eq!( + ::abi_decode(&input, true), + Ok(MyStruct { bar: 100 }), + ); +} + +#[test] +fn test_derive_abi_type_failures() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/fail/derive_abi_type/missing_sol_macro.rs"); +} diff --git a/stylus-proc/tests/derive_erase.rs b/stylus-proc/tests/derive_erase.rs new file mode 100644 index 00000000..19ff50fe --- /dev/null +++ b/stylus-proc/tests/derive_erase.rs @@ -0,0 +1,11 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use stylus_proc::{storage, Erase}; +use stylus_sdk::storage::{StorageU256, StorageVec}; + +#[storage] +#[derive(Erase)] +pub struct Erasable { + arr: StorageVec, +} diff --git a/stylus-proc/tests/derive_solidity_error.rs b/stylus-proc/tests/derive_solidity_error.rs new file mode 100644 index 00000000..0dee6f63 --- /dev/null +++ b/stylus-proc/tests/derive_solidity_error.rs @@ -0,0 +1,41 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +extern crate alloc; + +use alloy_primitives::{Address, U256}; +use alloy_sol_types::sol; + +use stylus_proc::{public, SolidityError}; + +sol! { + error InsufficientBalance(address from, uint256 have, uint256 want); + error InsufficientAllowance(address owner, address spender, uint256 have, uint256 want); +} + +#[derive(SolidityError)] +pub enum Erc20Error { + InsufficientBalance(InsufficientBalance), + InsufficientAllowance(InsufficientAllowance), +} + +struct Contract {} + +#[public] +impl Contract { + /// Test using the defined error in a result value + pub fn fallible_method() -> Result<(), Erc20Error> { + Err(InsufficientBalance { + from: Address::ZERO, + have: U256::ZERO, + want: U256::ZERO, + } + .into()) + } +} + +#[test] +fn test_derive_solidity_error_failures() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/fail/derive_solidity_error/invalid_variants.rs"); +} diff --git a/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.rs b/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.rs new file mode 100644 index 00000000..439d64ae --- /dev/null +++ b/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.rs @@ -0,0 +1,14 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Compilation will fail if the type is not wrapped in the [`sol!`][alloy_sol_types::sol] macro. + +use stylus_proc::AbiType; +use stylus_sdk::storage::StorageBool; + +#[derive(AbiType)] +struct MyStruct { + bar: StorageBool, +} + +fn main() {} diff --git a/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.stderr b/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.stderr new file mode 100644 index 00000000..a101ade4 --- /dev/null +++ b/stylus-proc/tests/fail/derive_abi_type/missing_sol_macro.stderr @@ -0,0 +1,22 @@ +error[E0277]: the trait bound `MyStruct: SolType` is not satisfied + --> tests/fail/derive_abi_type/missing_sol_macro.rs:9:10 + | +9 | #[derive(AbiType)] + | ^^^^^^^ the trait `SolType` is not implemented for `MyStruct` + | + = help: the following other types implement trait `SolType`: + () + (T1, T2) + (T1, T2, T3) + (T1, T2, T3, T4) + (T1, T2, T3, T4, T5) + (T1, T2, T3, T4, T5, T6) + (T1, T2, T3, T4, T5, T6, T7) + (T1, T2, T3, T4, T5, T6, T7, T8) + and $N others +note: required by a bound in `stylus_sdk::abi::AbiType::SolType` + --> $WORKSPACE/stylus-sdk/src/abi/mod.rs + | + | type SolType: SolType; + | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `AbiType::SolType` + = note: this error originates in the derive macro `AbiType` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.rs b/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.rs new file mode 100644 index 00000000..1f7d7866 --- /dev/null +++ b/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.rs @@ -0,0 +1,20 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +use alloy_sol_types::sol; + +use stylus_proc::SolidityError; + +sol! { + error InsufficientBalance(address from, uint256 have, uint256 want); + error InsufficientAllowance(address owner, address spender, uint256 have, uint256 want); +} + +#[derive(SolidityError)] +enum MyError { + Unit, + Two(InsufficientBalance, InsufficientAllowance), + Named { balance: InsufficientBalance }, +} + +fn main() {} diff --git a/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.stderr b/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.stderr new file mode 100644 index 00000000..86cdf88c --- /dev/null +++ b/stylus-proc/tests/fail/derive_solidity_error/invalid_variants.stderr @@ -0,0 +1,17 @@ +error: variant not a 1-tuple + --> tests/fail/derive_solidity_error/invalid_variants.rs:15:5 + | +15 | Unit, + | ^^^^ + +error: variant not a 1-tuple + --> tests/fail/derive_solidity_error/invalid_variants.rs:16:8 + | +16 | Two(InsufficientBalance, InsufficientAllowance), + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: variant not a 1-tuple + --> tests/fail/derive_solidity_error/invalid_variants.rs:17:11 + | +17 | Named { balance: InsufficientBalance }, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/stylus-proc/tests/fail/public/generated.rs b/stylus-proc/tests/fail/public/generated.rs new file mode 100644 index 00000000..f585e1ff --- /dev/null +++ b/stylus-proc/tests/fail/public/generated.rs @@ -0,0 +1,23 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Compilation failures after macro generation completes. + +extern crate alloc; + +use stylus_proc::public; + +struct UnsupportedType; + +struct Contract {} + +#[public] +impl Contract { + fn unsupported_input(_arg: UnsupportedType) {} + + fn unsupported_output() -> UnsupportedType { + UnsupportedType + } +} + +fn main() {} diff --git a/stylus-proc/tests/fail/public/generated.stderr b/stylus-proc/tests/fail/public/generated.stderr new file mode 100644 index 00000000..d94ed506 --- /dev/null +++ b/stylus-proc/tests/fail/public/generated.stderr @@ -0,0 +1,58 @@ +error[E0277]: the trait bound `UnsupportedType: AbiType` is not satisfied + --> tests/fail/public/generated.rs:16:32 + | +16 | fn unsupported_input(_arg: UnsupportedType) {} + | ^^^^^^^^^^^^^^^ the trait `AbiType` is not implemented for `UnsupportedType` + | + = help: the following other types implement trait `AbiType`: + () + (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + and $N others + +error[E0277]: the trait bound `UnsupportedType: AbiType` is not satisfied + --> tests/fail/public/generated.rs:16:26 + | +16 | fn unsupported_input(_arg: UnsupportedType) {} + | ^^^^ the trait `AbiType` is not implemented for `UnsupportedType`, which is required by `(UnsupportedType,): AbiType` + | + = help: the following other types implement trait `AbiType`: + () + (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + and $N others + = note: required for `(UnsupportedType,)` to implement `AbiType` + +error[E0277]: the trait bound `UnsupportedType: EncodableReturnType` is not satisfied + --> tests/fail/public/generated.rs:18:32 + | +18 | fn unsupported_output() -> UnsupportedType { + | ^^^^^^^^^^^^^^^ the trait `AbiType` is not implemented for `UnsupportedType`, which is required by `UnsupportedType: EncodableReturnType` + | + = help: the following other types implement trait `AbiType`: + () + (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + (G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) + and $N others + = note: required for `UnsupportedType` to implement `EncodableReturnType` + +error: could not evaluate constant pattern + --> tests/fail/public/generated.rs:16:8 + | +16 | fn unsupported_input(_arg: UnsupportedType) {} + | ^^^^^^^^^^^^^^^^^ diff --git a/stylus-proc/tests/fail/public/macro_errors.rs b/stylus-proc/tests/fail/public/macro_errors.rs new file mode 100644 index 00000000..b27c3258 --- /dev/null +++ b/stylus-proc/tests/fail/public/macro_errors.rs @@ -0,0 +1,18 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Compilation should fail for any unsupported attributes or other features. + +extern crate alloc; + +use stylus_proc::public; + +struct Contract {} + +#[public(unsupported)] +impl Contract { + #[payable(unsupported)] + fn test_method() {} +} + +fn main() {} diff --git a/stylus-proc/tests/fail/public/macro_errors.stderr b/stylus-proc/tests/fail/public/macro_errors.stderr new file mode 100644 index 00000000..43013e47 --- /dev/null +++ b/stylus-proc/tests/fail/public/macro_errors.stderr @@ -0,0 +1,11 @@ +error: unexpected token + --> tests/fail/public/macro_errors.rs:12:10 + | +12 | #[public(unsupported)] + | ^^^^^^^^^^^ + +error: unexpected token + --> tests/fail/public/macro_errors.rs:14:15 + | +14 | #[payable(unsupported)] + | ^^^^^^^^^^^ diff --git a/stylus-proc/tests/fail/sol_interface/generated.rs b/stylus-proc/tests/fail/sol_interface/generated.rs new file mode 100644 index 00000000..d5e53b0d --- /dev/null +++ b/stylus-proc/tests/fail/sol_interface/generated.rs @@ -0,0 +1,23 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Compilation failures after macro generation completes. + +extern crate alloc; + +use stylus_proc::sol_interface; + +sol_interface! { + interface IService { + #[function_attr] + function makePayment(address user) payable external returns (string); + function getConstant() pure external returns (bytes32); + } + + #[interface_attr] + interface ITree { + // Define more interface methods here + } +} + +fn main() {} diff --git a/stylus-proc/tests/fail/sol_interface/generated.stderr b/stylus-proc/tests/fail/sol_interface/generated.stderr new file mode 100644 index 00000000..5bd19c4f --- /dev/null +++ b/stylus-proc/tests/fail/sol_interface/generated.stderr @@ -0,0 +1,11 @@ +error: cannot find attribute `function_attr` in this scope + --> tests/fail/sol_interface/generated.rs:12:11 + | +12 | #[function_attr] + | ^^^^^^^^^^^^^ + +error: cannot find attribute `interface_attr` in this scope + --> tests/fail/sol_interface/generated.rs:17:7 + | +17 | #[interface_attr] + | ^^^^^^^^^^^^^^ diff --git a/stylus-proc/tests/fail/sol_interface/macro_errors.rs b/stylus-proc/tests/fail/sol_interface/macro_errors.rs new file mode 100644 index 00000000..665ab3ac --- /dev/null +++ b/stylus-proc/tests/fail/sol_interface/macro_errors.rs @@ -0,0 +1,28 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Compilation should fail for any unsupported Solidity features. + +use stylus_proc::sol_interface; + +sol_interface! { + #![file_attribute] + + interface IParent { + function makePayment(address user) payable external returns (string); + function getConstant() pure external returns (bytes32); + } + + interface IChild is IParent { + } + + contract TestContract { + } + + function sum(uint[] memory arr) pure returns (uint s) { + for (uint i = 0; i < arr.length; i++) + s += arr[i]; + } +} + +fn main() {} diff --git a/stylus-proc/tests/fail/sol_interface/macro_errors.stderr b/stylus-proc/tests/fail/sol_interface/macro_errors.stderr new file mode 100644 index 00000000..840da8b7 --- /dev/null +++ b/stylus-proc/tests/fail/sol_interface/macro_errors.stderr @@ -0,0 +1,23 @@ +error: attribute not supported + --> tests/fail/sol_interface/macro_errors.rs:9:5 + | +9 | #![file_attribute] + | ^^^^^^^^^^^^^^^^^^ + +error: inheritance not supported + --> tests/fail/sol_interface/macro_errors.rs:16:22 + | +16 | interface IChild is IParent { + | ^^ + +error: not an interface + --> tests/fail/sol_interface/macro_errors.rs:19:14 + | +19 | contract TestContract { + | ^^^^^^^^^^^^ + +error: not an interface + --> tests/fail/sol_interface/macro_errors.rs:22:14 + | +22 | function sum(uint[] memory arr) pure returns (uint s) { + | ^^^ diff --git a/stylus-proc/tests/public.rs b/stylus-proc/tests/public.rs new file mode 100644 index 00000000..c8b4c26f --- /dev/null +++ b/stylus-proc/tests/public.rs @@ -0,0 +1,26 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Integration test for the `#[public]` macro +//! +//! Currently this simply checks that a contract using this macro can compile successfully. + +extern crate alloc; + +use stylus_proc::public; + +struct Contract {} + +#[public] +impl Contract { + #[payable] + fn method() {} +} + +#[test] +fn test_public_failures() { + let t = trybuild::TestCases::new(); + #[cfg(not(feature = "export-abi"))] + t.compile_fail("tests/fail/public/generated.rs"); + t.compile_fail("tests/fail/public/macro_errors.rs"); +} diff --git a/stylus-proc/tests/sol_interface.rs b/stylus-proc/tests/sol_interface.rs new file mode 100644 index 00000000..6b05dd90 --- /dev/null +++ b/stylus-proc/tests/sol_interface.rs @@ -0,0 +1,36 @@ +// Copyright 2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md + +//! Integration test for the `sol_interface!` macro + +use stylus_proc::sol_interface; + +mod inner { + use alloy_sol_types::sol; + + sol! { + struct Foo { + uint256 bar; + } + } +} + +sol_interface! { + #[derive(Debug)] + interface IService { + function makePayment(address user) payable external returns (string); + function getConstant() pure external returns (bytes32); + function getFoo() pure external returns (inner.Foo); + } + + interface ITree { + // Define more interface methods here + } +} + +#[test] +fn sol_interface_failures() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/fail/sol_interface/macro_errors.rs"); + t.compile_fail("tests/fail/sol_interface/generated.rs"); +} diff --git a/stylus-sdk/Cargo.toml b/stylus-sdk/Cargo.toml index 5db34a9d..ab33d369 100644 --- a/stylus-sdk/Cargo.toml +++ b/stylus-sdk/Cargo.toml @@ -34,10 +34,11 @@ sha3.workspace = true features = ["default", "docs", "debug", "export-abi"] [features] -default = ["mini-alloc"] +default = ["mini-alloc", "hostio-caching"] export-abi = ["debug", "regex", "stylus-proc/export-abi", "alloy-primitives/tiny-keccak"] debug = [] docs = [] hostio = [] mini-alloc = ["dep:mini-alloc"] reentrant = ["stylus-proc/reentrant"] +hostio-caching = [] diff --git a/stylus-sdk/README.md b/stylus-sdk/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/stylus-sdk/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/stylus-sdk/src/abi/bytes.rs b/stylus-sdk/src/abi/bytes.rs index a93cf5d6..8fdf3f23 100644 --- a/stylus-sdk/src/abi/bytes.rs +++ b/stylus-sdk/src/abi/bytes.rs @@ -27,6 +27,12 @@ impl From> for Bytes { } } +impl From for Bytes { + fn from(value: alloy_primitives::Bytes) -> Self { + Self(value.to_vec()) + } +} + impl Deref for Bytes { type Target = Vec; @@ -69,6 +75,11 @@ impl SolTypeValue for Bytes { 32 + evm_padded_length(self.len()) } + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + 32 + evm_padded_length(self.len()) + } + #[inline] fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { self.0.eip712_data_word() @@ -86,6 +97,7 @@ impl SolType for Bytes { type Token<'a> = PackedSeqToken<'a>; const ENCODED_SIZE: Option = None; + const PACKED_ENCODED_SIZE: Option = None; const SOL_NAME: &'static str = "bytes"; @@ -113,3 +125,91 @@ impl AbiType for Bytes { const EXPORT_ABI_RET: ConstString = Self::ABI.concat(ConstString::new(" memory")); } + +#[cfg(test)] +mod tests { + use alloy_primitives::hex; + + use super::*; + use crate::abi; + + #[test] + fn bytes_sol_type() { + assert_eq!(Bytes::ABI.as_str(), "bytes"); + assert_eq!(Bytes::EXPORT_ABI_ARG.as_str(), "bytes calldata"); + assert_eq!(Bytes::EXPORT_ABI_RET.as_str(), "bytes memory"); + } + + #[test] + fn bytes_abi() { + assert_eq!(Bytes::SOL_NAME, "bytes"); + assert_eq!(Bytes::ENCODED_SIZE, None); + assert!(Bytes::DYNAMIC); + assert_eq!( + ::abi_encoded_size(&Bytes(vec![1, 2, 3, 4])), + 64 + ); + } + + #[test] + fn encode_decode_empty_bytes() { + abi::test_encode_decode_params( + (Bytes(vec![]),), + hex!( + "0000000000000000000000000000000000000000000000000000000000000020" + "0000000000000000000000000000000000000000000000000000000000000000" + ), + ); + } + + #[test] + fn encode_decode_one_byte() { + abi::test_encode_decode_params( + (Bytes(vec![100]),), + hex!( + "0000000000000000000000000000000000000000000000000000000000000020" + "0000000000000000000000000000000000000000000000000000000000000001" + "6400000000000000000000000000000000000000000000000000000000000000" + ), + ); + } + + #[test] + fn encode_decode_several_bytes() { + let mut input = Vec::with_capacity(40); + input.extend([1, 2, 3, 4]); + input.extend([0u8; 32]); + input.extend([5, 6, 7, 8]); + let value = (Bytes(input),); + let encoded = hex!( + "0000000000000000000000000000000000000000000000000000000000000020" + "0000000000000000000000000000000000000000000000000000000000000028" + "0102030400000000000000000000000000000000000000000000000000000000" + "0000000005060708000000000000000000000000000000000000000000000000" + ); + abi::test_encode_decode_params(value, encoded); + } + + #[test] + fn encode_decode_bytes_tuple() { + let mut input = Vec::with_capacity(40); + input.extend([1, 2, 3, 4]); + input.extend([0u8; 32]); + input.extend([5, 6, 7, 8]); + let value = (Bytes(input), Bytes(vec![]), Bytes(vec![1, 2, 3, 4])); + + let encoded = hex!( + "0000000000000000000000000000000000000000000000000000000000000060" + "00000000000000000000000000000000000000000000000000000000000000C0" + "00000000000000000000000000000000000000000000000000000000000000E0" + "0000000000000000000000000000000000000000000000000000000000000028" + "0102030400000000000000000000000000000000000000000000000000000000" + "0000000005060708000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000004" + "0102030400000000000000000000000000000000000000000000000000000000" + ); + + abi::test_encode_decode_params(value, encoded) + } +} diff --git a/stylus-sdk/src/abi/const_string.rs b/stylus-sdk/src/abi/const_string.rs index 67e26e8e..f151efc7 100644 --- a/stylus-sdk/src/abi/const_string.rs +++ b/stylus-sdk/src/abi/const_string.rs @@ -128,9 +128,24 @@ impl Debug for ConstString { } } -#[test] -fn test_from_decimal() { - for i in (0..=100).chain(1000..=1001) { - assert_eq!(ConstString::from_decimal_number(i).as_str(), i.to_string()); +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_from_decimal() { + for i in (0..=100).chain(1000..=1001) { + assert_eq!(ConstString::from_decimal_number(i).as_str(), i.to_string()); + } + } + + #[test] + fn test_concat() { + assert_eq!( + ConstString::new("foo") + .concat(ConstString::new("bar")) + .as_str(), + "foobar" + ); } } diff --git a/stylus-sdk/src/abi/impls.rs b/stylus-sdk/src/abi/impls.rs index fd6ad44b..099033c8 100644 --- a/stylus-sdk/src/abi/impls.rs +++ b/stylus-sdk/src/abi/impls.rs @@ -3,7 +3,7 @@ use super::{AbiType, ConstString}; use alloc::{string::String, vec::Vec}; -use alloy_primitives::{Address, FixedBytes, Signed, Uint}; +use alloy_primitives::{Address, FixedBytes}; use alloy_sol_types::sol_data::{self, ByteCount, IntBitCount, SupportedFixedBytes, SupportedInt}; /// Generates a test to ensure the two-way relationship between Rust Types and Sol Types is bijective. @@ -52,27 +52,8 @@ where test_type!(bytes, "bytes calldata", super::Bytes); -impl AbiType for Uint -where - IntBitCount: SupportedInt, -{ - type SolType = sol_data::Uint; - - const ABI: ConstString = append_dec!("uint", BITS); -} - -test_type!(uint256, "uint256", Uint<256, 4>); - -impl AbiType for Signed -where - IntBitCount: SupportedInt, -{ - type SolType = sol_data::Int; - - const ABI: ConstString = append_dec!("int", BITS); -} - -test_type!(int256, "int256", Signed<256, 4>); +test_type!(uint160, "uint160", alloy_primitives::Uint<160, 3>); +test_type!(uint256, "uint256", alloy_primitives::Uint<256, 4>); macro_rules! impl_int { ($bits:literal, $as_arg:expr, $unsigned:ty, $signed:ty) => { @@ -245,3 +226,78 @@ test_type!( [Vec; 8], ) ); + +#[cfg(test)] +mod tests { + use alloy_primitives::{hex, FixedBytes, U256}; + + use crate::abi::{test_encode_decode_params, Bytes}; + + #[test] + fn encode_tuple_of_single_u8() { + let value = (100u8,); + let encoded = hex!("0000000000000000000000000000000000000000000000000000000000000064"); + test_encode_decode_params(value, encoded) + } + + #[test] + fn encode_tuple_of_single_u256() { + let value = (U256::from(100),); + let encoded = hex!("0000000000000000000000000000000000000000000000000000000000000064"); + test_encode_decode_params(value, encoded) + } + + #[test] + fn encode_tuple_of_two_u8s() { + let value = (100u8, 200u8); + let encoded = hex!( + "0000000000000000000000000000000000000000000000000000000000000064" + "00000000000000000000000000000000000000000000000000000000000000C8" + ); + test_encode_decode_params(value, encoded) + } + + #[test] + fn encode_tuple_of_u8_and_u256() { + let value = (100u8, U256::from(200)); + let encoded = hex!( + "0000000000000000000000000000000000000000000000000000000000000064" + "00000000000000000000000000000000000000000000000000000000000000C8" + ); + test_encode_decode_params(value, encoded) + } + + #[test] + fn encode_tuple_of_five_types() { + let value = ( + 100u8, + vec![U256::from(1), U256::from(2)], + Bytes(vec![1, 2, 3, 4]), + FixedBytes::new([5, 6]), + [vec![true, false, true], vec![false, true, false]], + ); + let encoded = hex!( + "0000000000000000000000000000000000000000000000000000000000000064" + "00000000000000000000000000000000000000000000000000000000000000A0" + "0000000000000000000000000000000000000000000000000000000000000100" + "0506000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000140" + "0000000000000000000000000000000000000000000000000000000000000002" + "0000000000000000000000000000000000000000000000000000000000000001" + "0000000000000000000000000000000000000000000000000000000000000002" + "0000000000000000000000000000000000000000000000000000000000000004" + "0102030400000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000040" + "00000000000000000000000000000000000000000000000000000000000000C0" + "0000000000000000000000000000000000000000000000000000000000000003" + "0000000000000000000000000000000000000000000000000000000000000001" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000001" + "0000000000000000000000000000000000000000000000000000000000000003" + "0000000000000000000000000000000000000000000000000000000000000000" + "0000000000000000000000000000000000000000000000000000000000000001" + "0000000000000000000000000000000000000000000000000000000000000000" + ); + test_encode_decode_params(value, encoded) + } +} diff --git a/stylus-sdk/src/abi/ints.rs b/stylus-sdk/src/abi/ints.rs new file mode 100644 index 00000000..78a4543e --- /dev/null +++ b/stylus-sdk/src/abi/ints.rs @@ -0,0 +1,282 @@ +// Copyright 2023-2024, Offchain Labs, Inc. +// For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/stylus/licenses/COPYRIGHT.md + +//! Support for generic integer types found in [alloy_primitives]. + +use alloy_primitives::{Signed, Uint}; +use alloy_sol_types::{ + private::SolTypeValue, + sol_data::{self, IntBitCount, SupportedInt}, + SolType, +}; + +use super::{AbiType, ConstString}; + +macro_rules! impl_alloy_int { + ($BITS:expr, $LIMBS:expr) => { + impl_alloy_int!($BITS, $LIMBS, sol_data::Uint<$BITS>, sol_data::Int<$BITS>); + }; + (@$BITS:expr, $LIMBS:expr) => { + impl_alloy_int!($BITS, $LIMBS, OverloadUint<$BITS, $LIMBS>, OverloadInt<$BITS, $LIMBS>); + }; + ($BITS:expr, $LIMBS:expr, $uint_ty:ty, $int_ty:ty) => { + impl AbiType for Uint<$BITS, $LIMBS> { + type SolType = $uint_ty; + + const ABI: ConstString = ConstString::new(Self::SolType::SOL_NAME); + } + + impl AbiType for Signed<$BITS, $LIMBS> { + type SolType = $int_ty; + + const ABI: ConstString = ConstString::new(Self::SolType::SOL_NAME); + } + }; +} + +impl_alloy_int!(@8, 1); +impl_alloy_int!(@16, 1); +impl_alloy_int!(24, 1); +impl_alloy_int!(@32, 1); +impl_alloy_int!(40, 1); +impl_alloy_int!(48, 1); +impl_alloy_int!(56, 1); +impl_alloy_int!(@64, 1); +impl_alloy_int!(72, 2); +impl_alloy_int!(80, 2); +impl_alloy_int!(88, 2); +impl_alloy_int!(96, 2); +impl_alloy_int!(104, 2); +impl_alloy_int!(112, 2); +impl_alloy_int!(120, 2); +impl_alloy_int!(@128, 2); +impl_alloy_int!(136, 3); +impl_alloy_int!(144, 3); +impl_alloy_int!(152, 3); +impl_alloy_int!(160, 3); +impl_alloy_int!(168, 3); +impl_alloy_int!(176, 3); +impl_alloy_int!(184, 3); +impl_alloy_int!(192, 3); +impl_alloy_int!(200, 4); +impl_alloy_int!(208, 4); +impl_alloy_int!(216, 4); +impl_alloy_int!(224, 4); +impl_alloy_int!(232, 4); +impl_alloy_int!(240, 4); +impl_alloy_int!(248, 4); +impl_alloy_int!(256, 4); + +pub struct OverloadInt; + +impl SolType for OverloadInt +where + IntBitCount: SupportedInt, + Self: ConvertInt< + Int = as SolType>::RustType, + AlloyInt = Signed, + >, +{ + type RustType = Signed; + type Token<'a> = as SolType>::Token<'a>; + + const SOL_NAME: &'static str = as SolType>::SOL_NAME; + const ENCODED_SIZE: Option = as SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = + as SolType>::PACKED_ENCODED_SIZE; + const DYNAMIC: bool = as SolType>::DYNAMIC; + + #[inline] + fn valid_token(token: &Self::Token<'_>) -> bool { + as SolType>::valid_token(token) + } + + #[inline] + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + ::to_alloy( as SolType>::detokenize(token)) + } +} + +impl SolTypeValue> + for Signed +where + IntBitCount: SupportedInt, + OverloadInt: ConvertInt< + Int = as SolType>::RustType, + AlloyInt = Signed, + >, +{ + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + as ConvertInt>::to_int(*self).stv_abi_encoded_size() + } + + #[inline] + fn stv_to_tokens(&self) -> as SolType>::Token<'_> { + as ConvertInt>::to_int(*self).stv_to_tokens() + } + + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + as ConvertInt>::to_int(*self).stv_abi_packed_encoded_size() + } + + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut alloc::vec::Vec) { + as ConvertInt>::to_int(*self).stv_abi_encode_packed_to(out) + } + + #[inline] + fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { + as ConvertInt>::to_int(*self).stv_eip712_data_word() + } +} + +pub struct OverloadUint; + +impl SolType for OverloadUint +where + IntBitCount: SupportedInt, + Self: + ConvertInt as SolType>::RustType, AlloyInt = Uint>, +{ + type RustType = Uint; + type Token<'a> = as SolType>::Token<'a>; + + const SOL_NAME: &'static str = as SolType>::SOL_NAME; + const ENCODED_SIZE: Option = as SolType>::ENCODED_SIZE; + const PACKED_ENCODED_SIZE: Option = + as SolType>::PACKED_ENCODED_SIZE; + const DYNAMIC: bool = as SolType>::DYNAMIC; + + #[inline] + fn valid_token(token: &Self::Token<'_>) -> bool { + as SolType>::valid_token(token) + } + + #[inline] + fn detokenize(token: Self::Token<'_>) -> Self::RustType { + ::to_alloy( as SolType>::detokenize(token)) + } +} + +impl SolTypeValue> + for Uint +where + IntBitCount: SupportedInt, + OverloadUint: + ConvertInt as SolType>::RustType, AlloyInt = Uint>, +{ + #[inline] + fn stv_abi_encoded_size(&self) -> usize { + as ConvertInt>::to_int(*self).stv_abi_encoded_size() + } + + #[inline] + fn stv_to_tokens(&self) -> as SolType>::Token<'_> { + as ConvertInt>::to_int(*self).stv_to_tokens() + } + + #[inline] + fn stv_abi_packed_encoded_size(&self) -> usize { + as ConvertInt>::to_int(*self).stv_abi_packed_encoded_size() + } + + #[inline] + fn stv_abi_encode_packed_to(&self, out: &mut alloc::vec::Vec) { + as ConvertInt>::to_int(*self).stv_abi_encode_packed_to(out) + } + + #[inline] + fn stv_eip712_data_word(&self) -> alloy_sol_types::Word { + as ConvertInt>::to_int(*self).stv_eip712_data_word() + } +} + +trait ConvertInt { + type Int: TryInto; + type AlloyInt: TryInto; + fn to_int(value: Self::AlloyInt) -> Self::Int { + value + .try_into() + .map_err(|_| "int conversion error") + .unwrap() + } + fn to_alloy(value: Self::Int) -> Self::AlloyInt { + value + .try_into() + .map_err(|_| "int conversion error") + .unwrap() + } +} + +impl ConvertInt for OverloadUint<8, 1> { + type Int = u8; + type AlloyInt = Uint<8, 1>; +} + +impl ConvertInt for OverloadUint<16, 1> { + type Int = u16; + type AlloyInt = Uint<16, 1>; +} + +impl ConvertInt for OverloadUint<32, 1> { + type Int = u32; + type AlloyInt = Uint<32, 1>; +} + +impl ConvertInt for OverloadUint<64, 1> { + type Int = u64; + type AlloyInt = Uint<64, 1>; +} + +impl ConvertInt for OverloadUint<128, 2> { + type Int = u128; + type AlloyInt = Uint<128, 2>; +} + +impl ConvertInt for OverloadInt<8, 1> { + type Int = i8; + type AlloyInt = Signed<8, 1>; +} + +impl ConvertInt for OverloadInt<16, 1> { + type Int = i16; + type AlloyInt = Signed<16, 1>; +} + +impl ConvertInt for OverloadInt<32, 1> { + type Int = i32; + type AlloyInt = Signed<32, 1>; +} + +impl ConvertInt for OverloadInt<64, 1> { + type Int = i64; + type AlloyInt = Signed<64, 1>; +} + +impl ConvertInt for OverloadInt<128, 2> { + type Int = i128; + type AlloyInt = Signed<128, 2>; +} + +#[cfg(test)] +mod tests { + use alloy_primitives::{hex, Uint}; + + use crate::abi::test_encode_decode_params; + + #[test] + fn encode_decode_u24() { + let value = (Uint::<24, 1>::from(10),); + let encoded = hex!("000000000000000000000000000000000000000000000000000000000000000A"); + test_encode_decode_params(value, encoded); + } + + #[test] + fn encode_decode_u160() { + let value = (Uint::<160, 3>::from(999),); + let encoded = hex!("00000000000000000000000000000000000000000000000000000000000003E7"); + test_encode_decode_params(value, encoded); + } +} diff --git a/stylus-sdk/src/abi/mod.rs b/stylus-sdk/src/abi/mod.rs index d7d28e08..55247963 100644 --- a/stylus-sdk/src/abi/mod.rs +++ b/stylus-sdk/src/abi/mod.rs @@ -13,11 +13,20 @@ //! For a Solidity `bytes`, see [`Bytes`]. //! //! [prelude]: crate::prelude +//! -use crate::{storage::TopLevelStorage, ArbResult}; -use alloy_sol_types::SolType; +use alloc::vec::Vec; +use alloy_primitives::U256; use core::borrow::BorrowMut; +use alloy_sol_types::{abi::TokenSeq, private::SolTypeValue, SolType}; + +use crate::{ + console, + storage::{StorageType, TopLevelStorage}, + ArbResult, +}; + pub use bytes::{Bytes, BytesSolType}; pub use const_string::ConstString; @@ -30,6 +39,7 @@ pub mod export; mod bytes; mod const_string; mod impls; +mod ints; #[doc(hidden)] pub mod internal; @@ -48,6 +58,79 @@ where /// Routes add via `#[inherit]` will only execute if no match is found among `Self`. /// This means that it is possible to override a method by redefining it in `Self`. fn route(storage: &mut S, selector: u32, input: &[u8]) -> Option; + + /// Receive function for this contract. Called when no calldata is provided. + /// A receive function may not be defined, in which case this method will return None. + /// Receive functions are always payable, take in no inputs, and return no outputs. + /// If defined, they will always be called when a transaction does not send any + /// calldata, regardless of the transaction having a value attached. + fn receive(storage: &mut S) -> Option<()>; + + /// Called when no receive function is defined. + /// If no #[fallback] function is defined in the contract, then any transactions that do not + /// match a selector will revert. + /// A fallback function may have two different implementations. It can be either declared + /// without any input or output, or with bytes input calldata and bytes output. If a user + /// defines a fallback function with no input or output, then this method will be called + /// and the underlying user-defined function will simply be invoked with no input. + /// A fallback function can be declared as payable. If not payable, then any transactions + /// that trigger a fallback with value attached will revert. + fn fallback(storage: &mut S, calldata: &[u8]) -> Option; +} + +/// Entrypoint used when `#[entrypoint]` is used on a contract struct. +/// Solidity requires specific routing logic for situations in which no function selector +/// matches the input calldata in the form of two different functions named "receive" and "fallback". +/// The purity and type definitions are as follows: +/// +/// - receive takes no input data, returns no data, and is always payable. +/// - fallback offers two possible implementations. It can be either declared without input or return +// parameters, or with input bytes calldata and return bytes memory. +// +// The fallback function MAY be payable. If not payable, then any transactions not matching any +// other function which send value will revert. +// +// The order of routing semantics for receive and fallback work as follows: +// +// - If a receive function exists, it is always called whenever calldata is empty, even +// if no value is received in the transaction. It is implicitly payable. +// - Fallback is called when no other function matches a selector. If a receive function is not +// defined, then calls with no input calldata will be routed to the fallback function. +pub fn router_entrypoint(input: alloc::vec::Vec) -> ArbResult +where + R: Router, + S: StorageType + TopLevelStorage + BorrowMut, +{ + let mut storage = unsafe { S::new(U256::ZERO, 0) }; + + if input.is_empty() { + console!("no calldata provided"); + if R::receive(&mut storage).is_some() { + return Ok(Vec::new()); + } + // Try fallback function with no inputs if defined. + if let Some(res) = R::fallback(&mut storage, &[]) { + return res; + } + // Revert as no receive or fallback were defined. + return Err(Vec::new()); + } + + if input.len() >= 4 { + let selector = u32::from_be_bytes(TryInto::try_into(&input[..4]).unwrap()); + if let Some(res) = R::route(&mut storage, selector, &input[4..]) { + return res; + } else { + console!("unknown method selector: {selector:08x}"); + } + } + + // Try fallback function. + if let Some(res) = R::fallback(&mut storage, &input) { + return res; + } + + Err(Vec::new()) } /// Provides a mapping of Rust to Solidity types. @@ -97,12 +180,66 @@ macro_rules! function_selector { }}; } -#[test] -fn test_function_selector() { - use alloy_primitives::{Address, U256}; - assert_eq!(u32::from_be_bytes(function_selector!("foo")), 0xc2985578); - assert_eq!(function_selector!("foo", Address), [0xfd, 0xf8, 0x0b, 0xda]); +/// ABI decode a tuple of parameters +pub fn decode_params(data: &[u8]) -> alloy_sol_types::Result +where + T: AbiType + SolTypeValue<::SolType>, + for<'a> <::SolType as SolType>::Token<'a>: TokenSeq<'a>, +{ + T::SolType::abi_decode_params(data, true) +} + +/// ABI encode a value +pub fn encode(value: &T) -> Vec +where + T: AbiType + SolTypeValue<::SolType>, +{ + T::SolType::abi_encode(value) +} + +/// ABI encode a tuple of parameters +pub fn encode_params(value: &T) -> Vec +where + T: AbiType + SolTypeValue<::SolType>, + for<'a> <::SolType as SolType>::Token<'a>: TokenSeq<'a>, +{ + T::SolType::abi_encode_params(value) +} + +/// Encoded size of some sol type +pub fn encoded_size(value: &T) -> usize +where + T: AbiType + SolTypeValue<::SolType>, +{ + T::SolType::abi_encoded_size(value) +} + +/// Parform a test of both the encode and decode functions for a given type +/// +/// This is intended for use within unit tests. +#[cfg(test)] +fn test_encode_decode_params(value: T, buffer: B) +where + T: core::fmt::Debug + PartialEq + AbiType + SolTypeValue<::SolType>, + for<'a> <::SolType as SolType>::Token<'a>: TokenSeq<'a>, + B: core::fmt::Debug + AsRef<[u8]>, +{ + let encoded = encode_params(&value); + assert_eq!(encoded, buffer.as_ref()); + + let decoded = decode_params::(buffer.as_ref()).unwrap(); + assert_eq!(decoded, value); +} - const TEST_SELECTOR: [u8; 4] = function_selector!("foo", Address, U256); - assert_eq!(TEST_SELECTOR, 0xbd0d639f_u32.to_be_bytes()); +#[cfg(test)] +mod tests { + #[test] + fn test_function_selector() { + use alloy_primitives::{Address, U256}; + assert_eq!(u32::from_be_bytes(function_selector!("foo")), 0xc2985578); + assert_eq!(function_selector!("foo", Address), [0xfd, 0xf8, 0x0b, 0xda]); + + const TEST_SELECTOR: [u8; 4] = function_selector!("foo", Address, U256); + assert_eq!(TEST_SELECTOR, 0xbd0d639f_u32.to_be_bytes()); + } } diff --git a/stylus-sdk/src/call/context.rs b/stylus-sdk/src/call/context.rs index 1a98c2e4..d52a8b11 100644 --- a/stylus-sdk/src/call/context.rs +++ b/stylus-sdk/src/call/context.rs @@ -29,7 +29,7 @@ where /// Although this reference to [`TopLevelStorage`] is not used, the lifetime is still required /// to ensure safety of the storage cache. /// - /// ```no_run + /// ``` /// use stylus_sdk::call::{Call, Error}; /// use stylus_sdk::{prelude::*, evm, msg, alloy_primitives::Address}; /// extern crate alloc; @@ -93,7 +93,7 @@ impl CallContext for Call { } // allow &self as a context -impl<'a, T> CallContext for &'a T +impl CallContext for &T where T: TopLevelStorage, { @@ -113,10 +113,10 @@ where } // allow &self to be a `pure` and `static` call context -impl<'a, T> StaticCallContext for &'a T where T: TopLevelStorage {} +impl StaticCallContext for &T where T: TopLevelStorage {} // allow &mut self to be a `pure` and `static` call context -impl<'a, T> StaticCallContext for &'a mut T where T: TopLevelStorage {} +impl StaticCallContext for &mut T where T: TopLevelStorage {} // allow &mut self to be a `write` and `payable` call context unsafe impl MutatingCallContext for &mut T @@ -178,7 +178,7 @@ cfg_if! { /// This is not available if `reentrant` feature is enabled, as it may lead to /// vulnerability to reentrancy attacks. See [`Call::new_in`]. /// - /// ```ignore + /// ```no_compile /// use stylus_sdk::call::{Call, Error}; /// use stylus_sdk::{prelude::*, evm, msg, alloy_primitives::Address}; /// extern crate alloc; diff --git a/stylus-sdk/src/call/raw.rs b/stylus-sdk/src/call/raw.rs index 70a873aa..8c36bdbc 100644 --- a/stylus-sdk/src/call/raw.rs +++ b/stylus-sdk/src/call/raw.rs @@ -1,10 +1,7 @@ // Copyright 2023-2024, Offchain Labs, Inc. // For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md -use crate::{ - contract::{read_return_data, RETURN_DATA_LEN}, - hostio, tx, ArbResult, -}; +use crate::{contract::read_return_data, hostio, tx, ArbResult}; use alloy_primitives::{Address, B256, U256}; use cfg_if::cfg_if; @@ -140,7 +137,7 @@ impl RawCall { /// Note: values are clipped to the amount of ink remaining. /// See [`Ink and Gas`] for more information on Stylus's compute-pricing model. /// - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering pub fn ink(mut self, ink: u64) -> Self { self.gas = Some(tx::ink_to_gas(ink)); self @@ -188,7 +185,7 @@ impl RawCall { /// [`flush_storage_cache`]: RawCall::flush_storage_cache /// [`clear_storage_cache`]: RawCall::clear_storage_cache pub fn call(self, contract: Address, calldata: &[u8]) -> ArbResult { - let mut outs_len = 0; + let mut outs_len: usize = 0; let gas = self.gas.unwrap_or(u64::MAX); // will be clamped by 63/64 rule let value = B256::from(self.callvalue); let status = unsafe { @@ -224,8 +221,10 @@ impl RawCall { } }; - unsafe { - RETURN_DATA_LEN.set(outs_len); + cfg_if::cfg_if! { + if #[cfg(feature = "hostio-caching")] { + crate::contract::RETURN_DATA_LEN.set(outs_len); + } } let outs = read_return_data(self.offset, self.size); diff --git a/stylus-sdk/src/call/transfer.rs b/stylus-sdk/src/call/transfer.rs index 616c8f9f..be95236e 100644 --- a/stylus-sdk/src/call/transfer.rs +++ b/stylus-sdk/src/call/transfer.rs @@ -39,9 +39,15 @@ pub fn transfer_eth( /// All gas is supplied, which the recipient may burn. /// If this is not desired, the [`call`](super::call) function may be used directly. /// -/// ```ignore +/// ``` +/// # use stylus_sdk::call::{call, Call, transfer_eth}; +/// # fn wrap() -> Result<(), Vec> { +/// # let value = alloy_primitives::U256::ZERO; +/// # let recipient = alloy_primitives::Address::ZERO; /// transfer_eth(recipient, value)?; // these two are equivalent /// call(Call::new().value(value), recipient, &[])?; // these two are equivalent +/// # Ok(()) +/// # } /// ``` #[cfg(not(feature = "reentrant"))] pub fn transfer_eth(to: Address, amount: U256) -> Result<(), Vec> { diff --git a/stylus-sdk/src/deploy/raw.rs b/stylus-sdk/src/deploy/raw.rs index 6033fc26..43712571 100644 --- a/stylus-sdk/src/deploy/raw.rs +++ b/stylus-sdk/src/deploy/raw.rs @@ -1,11 +1,7 @@ // Copyright 2023-2024, Offchain Labs, Inc. // For licensing, see https://github.com/OffchainLabs/stylus-sdk-rs/blob/main/licenses/COPYRIGHT.md -use crate::{ - call::CachePolicy, - contract::{read_return_data, RETURN_DATA_LEN}, - hostio, -}; +use crate::{call::CachePolicy, contract::read_return_data, hostio}; use alloc::vec::Vec; use alloy_primitives::{Address, B256, U256}; @@ -82,7 +78,7 @@ impl RawDeploy { } let mut contract = Address::default(); - let mut revert_data_len = 0; + let mut revert_data_len: usize = 0; let endowment: B256 = endowment.into(); if let Some(salt) = self.salt { @@ -103,7 +99,11 @@ impl RawDeploy { &mut revert_data_len as *mut _, ); } - RETURN_DATA_LEN.set(revert_data_len); + cfg_if::cfg_if! { + if #[cfg(feature = "hostio-caching")] { + crate::contract::RETURN_DATA_LEN.set(revert_data_len); + } + } if contract.is_zero() { return Err(read_return_data(0, None)); diff --git a/stylus-sdk/src/evm.rs b/stylus-sdk/src/evm.rs index 8aae27b3..1b2213a6 100644 --- a/stylus-sdk/src/evm.rs +++ b/stylus-sdk/src/evm.rs @@ -60,13 +60,13 @@ pub fn pay_for_memory_grow(pages: u16) { wrap_hostio!( /// Gets the amount of gas remaining. See [`Ink and Gas`] for more information on Stylus's compute pricing. /// - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering gas_left evm_gas_left u64 ); wrap_hostio!( /// Gets the amount of ink remaining. See [`Ink and Gas`] for more information on Stylus's compute pricing. /// - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering ink_left evm_ink_left u64 ); diff --git a/stylus-sdk/src/hostio.rs b/stylus-sdk/src/hostio.rs index b6276321..644b89c9 100644 --- a/stylus-sdk/src/hostio.rs +++ b/stylus-sdk/src/hostio.rs @@ -8,17 +8,22 @@ //! high-level equivalents of [`block`](crate::block), [`contract`](crate::contract), //! [`crypto`](crate::crypto), [`evm`](crate::evm), [`msg`](crate::msg), and [`tx`](crate::tx). //! -//! ```ignore -//! use stylus_sdk::hostio; -//! use stylus_sdk::{alloy_primitives::Address, msg}; -//! -//! let mut sender = Address::ZERO; -//! unsafe { -//! hostio::msg_sender(sender.as_mut_ptr()); -//! } -//! -//! assert_eq!(sender, msg::sender()); -//! ``` +#![cfg_attr( + feature = "hostio", + doc = r##" +```no_run +use stylus_sdk::hostio; +use stylus_sdk::{alloy_primitives::Address, msg}; + +let mut sender = Address::ZERO; +unsafe { + hostio::msg_sender(sender.as_mut_ptr()); +} + +assert_eq!(sender, msg::sender()); +``` +"## +)] use cfg_if::cfg_if; @@ -200,7 +205,7 @@ vm_hooks! { /// `read_return_data` hostio. The semantics are equivalent to that of the EVM's [`CREATE`] /// opcode, which notably includes the exact address returned. /// - /// [`Deploying Stylus Programs`]: https://docs.arbitrum.io/stylus/stylus-quickstart + /// [`Deploying Stylus Programs`]: https://docs.arbitrum.io/stylus/quickstart /// [`CREATE`]: https://www.evm.codes/#f0 pub fn create1( code: *const u8, @@ -223,7 +228,7 @@ vm_hooks! { /// via the `read_return_data` hostio. The semantics are equivalent to that of the EVM's /// `[CREATE2`] opcode, which notably includes the exact address returned. /// - /// [`Deploying Stylus Programs`]: https://docs.arbitrum.io/stylus/stylus-quickstart + /// [`Deploying Stylus Programs`]: https://docs.arbitrum.io/stylus/quickstart /// [`CREATE2`]: https://www.evm.codes/#f5 pub fn create2( code: *const u8, @@ -279,7 +284,7 @@ vm_hooks! { /// [`Ink and Gas`] for more information on Stylus's compute pricing. /// /// [`GAS`]: https://www.evm.codes/#5a - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering pub fn evm_ink_left() -> u64; /// The `entrypoint!` macro handles importing this hostio, which is required if the @@ -375,7 +380,7 @@ vm_hooks! { /// Gets the price of ink in evm gas basis points. See [`Ink and Gas`] for more information on /// Stylus's compute-pricing model. /// - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering pub fn tx_ink_price() -> u32; /// Gets the top-level sender of the transaction. The semantics are equivalent to that of the @@ -438,47 +443,91 @@ macro_rules! wrap_hostio { } }; (@simple $(#[$meta:meta])* $name:ident, $cache:ident, $hostio:ident, $ty:ident) => { - $(#[$meta])* - pub fn $name() -> $ty { - unsafe{ $cache.get() } + cfg_if::cfg_if! { + if #[cfg(feature = "hostio-caching")] { + $(#[$meta])* + pub fn $name() -> $ty { + $cache.get() + } + pub(crate) static $cache: hostio::CachedOption<$ty> = hostio::CachedOption::new(|| unsafe { hostio::$hostio() }); + } else { + wrap_hostio!(@simple $(#[$meta])* $name, $hostio, $ty); // uncached + } } - pub(crate) static mut $cache: hostio::CachedOption<$ty> = hostio::CachedOption::new(|| unsafe { hostio::$hostio() }); }; - (@convert $(#[$meta:meta])* $name:ident, $cache:ident, $hostio:ident, $from:ident, $ty:ident) => { + (@convert $(#[$meta:meta])* $name:ident, $hostio:ident, $from:ident, $ty:ident) => { $(#[$meta])* pub fn $name() -> $ty { - unsafe{ $cache.get() } - } - pub(crate) static mut $cache: hostio::CachedOption<$ty> = hostio::CachedOption::new(|| { let mut data = $from::ZERO; unsafe { hostio::$hostio(data.as_mut_ptr()) }; data.into() - }); + } + }; + (@convert $(#[$meta:meta])* $name:ident, $cache:ident, $hostio:ident, $from:ident, $ty:ident) => { + cfg_if::cfg_if! { + if #[cfg(feature = "hostio-caching")] { + $(#[$meta])* + pub fn $name() -> $ty { + $cache.get() + } + pub(crate) static $cache: hostio::CachedOption<$ty> = hostio::CachedOption::new(|| { + let mut data = $from::ZERO; + unsafe { hostio::$hostio(data.as_mut_ptr()) }; + data.into() + }); + } else { + wrap_hostio!(@convert $(#[$meta])* $name, $hostio, $from, $ty); // uncached + } + } }; } pub(crate) use wrap_hostio; +use core::cell::UnsafeCell; +use core::mem::MaybeUninit; + /// Caches a value to avoid paying for hostio invocations. pub(crate) struct CachedOption { - value: Option, + value: UnsafeCell>, + initialized: UnsafeCell, loader: fn() -> T, } impl CachedOption { /// Creates a new [`CachedOption`], which will use the `loader` during `get`. pub const fn new(loader: fn() -> T) -> Self { - let value = None; - Self { value, loader } + Self { + value: UnsafeCell::new(MaybeUninit::uninit()), + initialized: UnsafeCell::new(false), + loader, + } } - /// Sets and overwrites the cached value. - pub fn set(&mut self, value: T) { - self.value = Some(value); + /// # Safety + /// Must only be called from a single-threaded context. + pub fn get(&self) -> T { + unsafe { + if !*self.initialized.get() { + let value = (self.loader)(); + (*self.value.get()).write(value); + *self.initialized.get() = true; + value + } else { + (*self.value.get()).assume_init() + } + } } - /// Gets the value, writing it to the cache if necessary. - pub fn get(&mut self) -> T { - *self.value.get_or_insert_with(|| (self.loader)()) + /// # Safety + /// Must only be called from a single-threaded context. + pub fn set(&self, value: T) { + unsafe { + (*self.value.get()).write(value); + *self.initialized.get() = true; + } } } + +// Required to use in statics even in single-threaded context. +unsafe impl Sync for CachedOption {} diff --git a/stylus-sdk/src/lib.rs b/stylus-sdk/src/lib.rs index 36ceea3c..8c0890c9 100644 --- a/stylus-sdk/src/lib.rs +++ b/stylus-sdk/src/lib.rs @@ -10,7 +10,7 @@ //! //! Some of the features available in the SDK include: //! - **Generic**, storage-backed Rust types for programming **Solidity-equivalent** smart contracts with optimal -//! storage caching. +//! storage caching. //! - Simple macros for writing **language-agnostic** methods and entrypoints. //! - Automatic export of Solidity interfaces for interoperability across programming languages. //! - Powerful **primitive types** backed by the feature-rich [Alloy][alloy]. diff --git a/stylus-sdk/src/storage/array.rs b/stylus-sdk/src/storage/array.rs index 0c71b010..198b9017 100644 --- a/stylus-sdk/src/storage/array.rs +++ b/stylus-sdk/src/storage/array.rs @@ -12,8 +12,14 @@ pub struct StorageArray { } impl StorageType for StorageArray { - type Wraps<'a> = StorageGuard<'a, StorageArray> where Self: 'a; - type WrapsMut<'a> = StorageGuardMut<'a, StorageArray> where Self: 'a; + type Wraps<'a> + = StorageGuard<'a, StorageArray> + where + Self: 'a; + type WrapsMut<'a> + = StorageGuardMut<'a, StorageArray> + where + Self: 'a; const REQUIRED_SLOTS: usize = Self::required_slots(); @@ -39,6 +45,7 @@ impl StorageArray { /// /// Although this type will always have the same length, this method is still provided for /// consistency with [`StorageVec`]. + #[allow(clippy::len_without_is_empty)] pub const fn len(&self) -> usize { N } @@ -115,7 +122,7 @@ impl StorageArray { const fn required_slots() -> usize { let reserved = N * S::REQUIRED_SLOTS; let density = Self::density(); - let packed = (N + density - 1) / density; // ceil division for packed items. + let packed = N.div_ceil(density); if reserved > packed { return reserved; } diff --git a/stylus-sdk/src/storage/bytes.rs b/stylus-sdk/src/storage/bytes.rs index acea361a..9392b2b7 100644 --- a/stylus-sdk/src/storage/bytes.rs +++ b/stylus-sdk/src/storage/bytes.rs @@ -17,8 +17,14 @@ pub struct StorageBytes { } impl StorageType for StorageBytes { - type Wraps<'a> = StorageGuard<'a, StorageBytes> where Self: 'a; - type WrapsMut<'a> = StorageGuardMut<'a, StorageBytes> where Self: 'a; + type Wraps<'a> + = StorageGuard<'a, StorageBytes> + where + Self: 'a; + type WrapsMut<'a> + = StorageGuardMut<'a, StorageBytes> + where + Self: 'a; unsafe fn new(root: U256, offset: u8) -> Self { debug_assert!(offset == 0); @@ -262,8 +268,14 @@ impl<'a> Extend<&'a u8> for StorageBytes { pub struct StorageString(pub StorageBytes); impl StorageType for StorageString { - type Wraps<'a> = StorageGuard<'a, StorageString> where Self: 'a; - type WrapsMut<'a> = StorageGuardMut<'a, StorageString> where Self: 'a; + type Wraps<'a> + = StorageGuard<'a, StorageString> + where + Self: 'a; + type WrapsMut<'a> + = StorageGuardMut<'a, StorageString> + where + Self: 'a; unsafe fn new(slot: U256, offset: u8) -> Self { Self(StorageBytes::new(slot, offset)) diff --git a/stylus-sdk/src/storage/map.rs b/stylus-sdk/src/storage/map.rs index 6bef24ee..baaf7f4d 100644 --- a/stylus-sdk/src/storage/map.rs +++ b/stylus-sdk/src/storage/map.rs @@ -19,8 +19,14 @@ where K: StorageKey, V: StorageType, { - type Wraps<'a> = StorageGuard<'a, StorageMap> where Self: 'a; - type WrapsMut<'a> = StorageGuardMut<'a, StorageMap> where Self: 'a; + type Wraps<'a> + = StorageGuard<'a, StorageMap> + where + Self: 'a; + type WrapsMut<'a> + = StorageGuardMut<'a, StorageMap> + where + Self: 'a; unsafe fn new(slot: U256, offset: u8) -> Self { debug_assert!(offset == 0); diff --git a/stylus-sdk/src/storage/mod.rs b/stylus-sdk/src/storage/mod.rs index 1aae2ca7..bc64dacc 100644 --- a/stylus-sdk/src/storage/mod.rs +++ b/stylus-sdk/src/storage/mod.rs @@ -24,7 +24,7 @@ use crate::hostio; use alloy_primitives::{Address, BlockHash, BlockNumber, FixedBytes, Signed, Uint, B256, U256}; -use alloy_sol_types::sol_data::{ByteCount, SupportedFixedBytes}; +use alloy_sol_types::sol_data::{ByteCount, IntBitCount, SupportedFixedBytes, SupportedInt}; use core::{cell::OnceCell, marker::PhantomData, ops::Deref}; pub use array::StorageArray; @@ -141,13 +141,19 @@ alias_bytes! { // TODO: drop L after SupportedInt provides LIMBS (waiting for clarity reasons) // https://github.com/rust-lang/rust/issues/76560 #[derive(Debug)] -pub struct StorageUint { +pub struct StorageUint +where + IntBitCount: SupportedInt, +{ slot: U256, offset: u8, cached: OnceCell>, } -impl StorageUint { +impl StorageUint +where + IntBitCount: SupportedInt, +{ /// Gets the underlying [`alloy_primitives::Uint`] in persistent storage. pub fn get(&self) -> Uint { **self @@ -160,7 +166,10 @@ impl StorageUint { } } -impl StorageType for StorageUint { +impl StorageType for StorageUint +where + IntBitCount: SupportedInt, +{ type Wraps<'a> = Uint; type WrapsMut<'a> = StorageGuardMut<'a, Self>; @@ -184,19 +193,28 @@ impl StorageType for StorageUint { } } -impl<'a, const B: usize, const L: usize> SimpleStorageType<'a> for StorageUint { +impl<'a, const B: usize, const L: usize> SimpleStorageType<'a> for StorageUint +where + IntBitCount: SupportedInt, +{ fn set_by_wrapped(&mut self, value: Self::Wraps<'a>) { self.set(value); } } -impl Erase for StorageUint { +impl Erase for StorageUint +where + IntBitCount: SupportedInt, +{ fn erase(&mut self) { self.set(Self::Wraps::ZERO); } } -impl Deref for StorageUint { +impl Deref for StorageUint +where + IntBitCount: SupportedInt, +{ type Target = Uint; fn deref(&self) -> &Self::Target { @@ -205,7 +223,10 @@ impl Deref for StorageUint { } } -impl From> for Uint { +impl From> for Uint +where + IntBitCount: SupportedInt, +{ fn from(value: StorageUint) -> Self { *value } @@ -217,13 +238,19 @@ impl From> for Uint { // TODO: drop L after SupportedInt provides LIMBS (waiting for clarity reasons) // https://github.com/rust-lang/rust/issues/76560 #[derive(Debug)] -pub struct StorageSigned { +pub struct StorageSigned +where + IntBitCount: SupportedInt, +{ slot: U256, offset: u8, cached: OnceCell>, } -impl StorageSigned { +impl StorageSigned +where + IntBitCount: SupportedInt, +{ /// Gets the underlying [`Signed`] in persistent storage. pub fn get(&self) -> Signed { **self @@ -236,7 +263,10 @@ impl StorageSigned { } } -impl StorageType for StorageSigned { +impl StorageType for StorageSigned +where + IntBitCount: SupportedInt, +{ type Wraps<'a> = Signed; type WrapsMut<'a> = StorageGuardMut<'a, Self>; @@ -259,19 +289,28 @@ impl StorageType for StorageSigned { } } -impl<'a, const B: usize, const L: usize> SimpleStorageType<'a> for StorageSigned { +impl<'a, const B: usize, const L: usize> SimpleStorageType<'a> for StorageSigned +where + IntBitCount: SupportedInt, +{ fn set_by_wrapped(&mut self, value: Self::Wraps<'a>) { self.set(value); } } -impl Erase for StorageSigned { +impl Erase for StorageSigned +where + IntBitCount: SupportedInt, +{ fn erase(&mut self) { self.set(Self::Wraps::ZERO) } } -impl Deref for StorageSigned { +impl Deref for StorageSigned +where + IntBitCount: SupportedInt, +{ type Target = Signed; fn deref(&self) -> &Self::Target { @@ -280,7 +319,10 @@ impl Deref for StorageSigned { } } -impl From> for Signed { +impl From> for Signed +where + IntBitCount: SupportedInt, +{ fn from(value: StorageSigned) -> Self { *value } @@ -656,8 +698,14 @@ impl From for BlockHash { /// We implement `StorageType` for `PhantomData` so that storage types can be generic. impl StorageType for PhantomData { - type Wraps<'a> = Self where Self: 'a; - type WrapsMut<'a> = Self where Self: 'a; + type Wraps<'a> + = Self + where + Self: 'a; + type WrapsMut<'a> + = Self + where + Self: 'a; const REQUIRED_SLOTS: usize = 0; const SLOT_BYTES: usize = 0; diff --git a/stylus-sdk/src/storage/traits.rs b/stylus-sdk/src/storage/traits.rs index 3080b2f9..aec66b4a 100644 --- a/stylus-sdk/src/storage/traits.rs +++ b/stylus-sdk/src/storage/traits.rs @@ -297,6 +297,7 @@ pub trait GlobalStorage { offset: usize, value: Uint, ) { + debug_assert!(B % 8 == 0); debug_assert!(B / 8 + offset <= 32); if B == 256 { diff --git a/stylus-sdk/src/storage/vec.rs b/stylus-sdk/src/storage/vec.rs index f59896f7..e2231e51 100644 --- a/stylus-sdk/src/storage/vec.rs +++ b/stylus-sdk/src/storage/vec.rs @@ -16,8 +16,14 @@ pub struct StorageVec { } impl StorageType for StorageVec { - type Wraps<'a> = StorageGuard<'a, StorageVec> where Self: 'a; - type WrapsMut<'a> = StorageGuardMut<'a, StorageVec> where Self: 'a; + type Wraps<'a> + = StorageGuard<'a, StorageVec> + where + Self: 'a; + type WrapsMut<'a> + = StorageGuardMut<'a, StorageVec> + where + Self: 'a; unsafe fn new(slot: U256, offset: u8) -> Self { debug_assert!(offset == 0); diff --git a/stylus-sdk/src/tx.rs b/stylus-sdk/src/tx.rs index 13fa59a7..be1b67af 100644 --- a/stylus-sdk/src/tx.rs +++ b/stylus-sdk/src/tx.rs @@ -19,14 +19,14 @@ wrap_hostio! { /// Gets the price of ink in evm gas basis points. See [`Ink and Gas`] for more information on /// Stylus's compute-pricing model. /// - /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas + /// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering ink_price INK_PRICE tx_ink_price u32 } /// Converts evm gas to ink. See [`Ink and Gas`] for more information on /// Stylus's compute-pricing model. /// -/// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas +/// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering pub fn gas_to_ink(gas: u64) -> u64 { gas.saturating_mul(ink_price().into()) } @@ -34,7 +34,7 @@ pub fn gas_to_ink(gas: u64) -> u64 { /// Converts ink to evm gas. See [`Ink and Gas`] for more information on /// Stylus's compute-pricing model. /// -/// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/stylus-gas +/// [`Ink and Gas`]: https://docs.arbitrum.io/stylus/concepts/gas-metering pub fn ink_to_gas(ink: u64) -> u64 { ink / ink_price() as u64 }