Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ethers with alloy #65

Merged
merged 12 commits into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ common-rs/Cargo.lock
prt/lua_poc/outputs/
prt/lua_poc/pixels/
node_modules
prt/contract-bindings/src/contract
prt/contract-bindings/Cargo.lock
**/contract-bindings/src/contract
**/contract-bindings/Cargo.lock
prt/machine-emulator-sdk
17 changes: 17 additions & 0 deletions cartesi-rollups/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
BINDINGS_DIR := ./contract-bindings/src/contract
SRC_DIR := ./contracts
BINDINGS_FILTER := 'DaveConsensus'

help:
@echo ' clean - clean the generated bindings'
@echo ' bind - generate Rust bindings from Solidity code'

clean:
@rm -rf $(BINDINGS_DIR)

bind:
@forge bind --alloy --select $(BINDINGS_FILTER) \
--module --bindings-path $(BINDINGS_DIR) \
--root $(SRC_DIR)

.PHONY: help bind clean
19 changes: 19 additions & 0 deletions cartesi-rollups/contract-bindings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "cartesi-dave-contracts"

version = "0.1.0"

authors = [
"Gabriel Coutinho de Paula <[email protected]>",
"Stephen Chen <[email protected]>",
]
description = "Cartesi Dave contract bindings"
edition = "2021"
homepage = "https://github.com/cartesi/dave"
license-file = "LICENSE"
readme = "README.md"
repository = "https://github.com/cartesi/dave"

[dependencies]
alloy = { version = "0.3.1", features = ["sol-types", "contract"] }

8 changes: 8 additions & 0 deletions cartesi-rollups/contract-bindings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Dave Contract bindings for Rust

## Generate Rust bindings

Run make command from [parent directory](../)
```
make bind
```
2 changes: 2 additions & 0 deletions cartesi-rollups/contract-bindings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod contract;
pub use contract::*;
Loading
Loading