Skip to content

Commit

Permalink
chore(docker): add back foundry
Browse files Browse the repository at this point in the history
  • Loading branch information
0xfourzerofour committed Oct 26, 2023
1 parent 53d11dd commit 4525355
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cross.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ pre-build = [
"apt-get -y install apt-transport-https ca-certificates",
"curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -",
"echo 'deb https://dl.yarnpkg.com/debian/ stable main' | tee /etc/apt/sources.list.d/yarn.list",
"apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn"
"apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn",
"curl -L https://foundry.paradigm.xyz | bash",
". /root/.bashrc",
"foundryup"
]
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg -
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
RUN apt-get update && apt-get -y upgrade && apt-get install -y libclang-dev pkg-config protobuf-compiler nodejs yarn rsync

SHELL ["/bin/bash", "-c"]
RUN curl -L https://foundry.paradigm.xyz | bash
ENV PATH="/root/.foundry/bin:${PATH}"
RUN foundryup

RUN cargo install cargo-chef --locked

WORKDIR /app
Expand Down
12 changes: 12 additions & 0 deletions crates/types/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ fn main() -> Result<(), Box<dyn error::Error>> {
}

fn generate_contract_bindings() -> Result<(), Box<dyn error::Error>> {
generate_abis()?;
MultiAbigen::from_abigens([
abigen_of("IEntryPoint")?,
abigen_of("EntryPoint")?,
Expand All @@ -50,6 +51,17 @@ fn abigen_of(contract: &str) -> Result<Abigen, Box<dyn error::Error>> {
)?)
}

fn generate_abis() -> Result<(), Box<dyn error::Error>> {
run_command(
Command::new("forge")
.arg("build")
.arg("--root")
.arg("./contracts"),
"https://getfoundry.sh/",
"generate ABIs",
)
}

fn update_submodules() -> Result<(), Box<dyn error::Error>> {
run_command(
Command::new("git").arg("submodule").arg("update"),
Expand Down

0 comments on commit 4525355

Please sign in to comment.