File tree 7 files changed +742
-329
lines changed
7 files changed +742
-329
lines changed Original file line number Diff line number Diff line change 47
47
run : forge build --sizes
48
48
49
49
- name : Check bindings are correct
50
- run : forge bind --bindings-path ./crates/bindings --root ./contracts --crate-name bindings --skip-cargo-toml
50
+ run : forge bind --bindings-path ./crates/bindings --root ./contracts --crate-name bindings --skip-cargo-toml --alloy
Original file line number Diff line number Diff line change 1
1
[workspace ]
2
- members = [
3
- " app" ,
4
- " crates/bindings" ,
5
- ]
2
+ members = [" app" , " crates/bindings" ]
6
3
7
4
[workspace .dependencies ]
8
- bindings = { path = " crates/bindings" }
5
+ foundry-contracts = { path = " crates/bindings" }
Original file line number Diff line number Diff line change @@ -6,7 +6,10 @@ edition = "2021"
6
6
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
7
8
8
[dependencies ]
9
- bindings = { workspace = true }
10
- ethers = { version = " 2" , default-features = false , features = [" rustls" ] }
9
+ foundry-contracts.workspace = true
11
10
eyre = " 0.6"
12
- tokio = { version = " 1.19" , features = [" macros" , " rt-multi-thread" ] }
11
+ tokio = { version = " 1.19" , features = [" macros" , " rt-multi-thread" ] }
12
+ alloy = { git = " https://github.com/alloy-rs/alloy" , features = [
13
+ " providers" ,
14
+ " node-bindings" ,
15
+ ] }
Original file line number Diff line number Diff line change 1
- use bindings :: counter :: Counter ;
2
-
3
- use ethers :: { prelude :: Middleware , providers:: test_provider :: GOERLI , types :: Address } ;
4
-
1
+ use alloy :: {
2
+ primitives :: Address ,
3
+ providers:: { builder , Provider } ,
4
+ } ;
5
5
use eyre:: Result ;
6
- use std :: sync :: Arc ;
6
+ use foundry_contracts :: counter :: Counter ;
7
7
8
8
#[ tokio:: main]
9
9
async fn main ( ) -> Result < ( ) > {
10
- let provider = GOERLI . provider ( ) ;
11
- let provider = Arc :: new ( provider) ;
10
+ let provider = builder ( ) . with_recommended_fillers ( ) . on_anvil_with_wallet ( ) ;
12
11
13
12
let address = "0x0000000000000000000000000000000000000000" . parse :: < Address > ( ) ?;
14
13
15
- let contract = Counter :: new ( address, provider) ;
16
- let blk = contract. client ( ) . get_block_number ( ) . await ?;
14
+ let _contract = Counter :: new ( address, provider. clone ( ) ) ;
15
+
16
+ let blk = provider. get_block_number ( ) . await ?;
17
17
println ! ( "Hello, world! {}" , blk) ;
18
18
Ok ( ( ) )
19
19
}
Original file line number Diff line number Diff line change 1
1
[package ]
2
- name = " bindings "
2
+ name = " foundry-contracts "
3
3
version = " 0.1.0"
4
4
edition = " 2021"
5
5
6
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
-
8
6
[dependencies ]
9
- ethers = { version = " 2" , default-features = false , features = [" abigen" ] }
10
- serde = " 1"
7
+ alloy = { git = " https://github.com/alloy-rs/alloy" , features = [
8
+ " sol-types" ,
9
+ " contract" ,
10
+ ] }
You can’t perform that action at this time.
0 commit comments