Skip to content

Commit

Permalink
Fix issues with smart contract bounty example (#188)
Browse files Browse the repository at this point in the history
* Add the whole Solidity repos
* Fix adder bounty targets in Makefile
* Fix import paths of adder example
  • Loading branch information
guidanoli authored Nov 6, 2024
1 parent e0ffaa6 commit 98c25da
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ COPY --from=riscv64-build-stage /opt/build/bwrapbox/seccomp-filter.bpf /usr/lib/

# install forge-std
ARG FORGE_STD_VERSION=1.9.3
ADD https://github.com/foundry-rs/forge-std.git#v${FORGE_STD_VERSION}:src /usr/share/forge-lib/forge-std/src
ADD https://github.com/foundry-rs/forge-std.git#v${FORGE_STD_VERSION} /usr/share/forge-lib/forge-std

# install openzeppelin-contracts
ARG OPENZEPPELIN_VERSION=5.1.0
ADD https://github.com/OpenZeppelin/openzeppelin-contracts.git#v${OPENZEPPELIN_VERSION}:contracts /usr/share/forge-lib/openzeppelin-contracts/contracts
ADD https://github.com/OpenZeppelin/openzeppelin-contracts.git#v${OPENZEPPELIN_VERSION} /usr/share/forge-lib/openzeppelin-contracts

# install forge-deploy-lib
ARG FORGE_DEPLOY_LIB_VERSION=0.0.0
ADD https://github.com/crypto-bug-hunters/forge-deploy-lib.git#v${FORGE_DEPLOY_LIB_VERSION}:src /usr/share/forge-lib/forge-deploy-lib/src
ADD https://github.com/crypto-bug-hunters/forge-deploy-lib.git#v${FORGE_DEPLOY_LIB_VERSION} /usr/share/forge-lib/forge-deploy-lib

RUN useradd --home-dir /bounty bounty
RUN mkdir -p /bounties /bounty
Expand Down
7 changes: 3 additions & 4 deletions tests/bounties/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,14 @@ ADDER_VERSIONS= safe unsafe
all: $(patsubst %,dist/adder-%-bounty.tar.xz,$(ADDER_VERSIONS))

dist/adder-%-bounty.tar.xz: \
build/adder-%-bounty/script/Deploy.s.sol \
build/adder-%-bounty/script/Setup.s.sol \
src/adder/start.sh \
src/adder/foundry.toml \
src/adder/src/IAdder.sol \
src/adder/src/%/Adder.sol \
src/adder/script/LibDeployments.sol \
src/adder/script/Test.s.sol
src/adder/script/Assertion.s.sol
tar $(TAR_OPTS) $@ $^

build/adder-%-bounty/script/Deploy.s.sol: src/adder/script/%/Deploy.s.sol
build/adder-%-bounty/script/Setup.s.sol: src/adder/script/%/Setup.s.sol
mkdir -p $(@D)
cp $< $@
2 changes: 1 addition & 1 deletion tests/bounties/src/adder/script/Assertion.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.27;

import {DeploymentReaderScript} from "forge-deploy-lib/DeploymentScript.sol";
import {DeploymentReaderScript} from "forge-deploy-lib/src/DeploymentScript.sol";

import {IAdder} from "src/IAdder.sol";

Expand Down
2 changes: 1 addition & 1 deletion tests/bounties/src/adder/script/safe/Setup.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.27;

import {DeploymentWriterScript} from "forge-deploy-lib/DeploymentScript.sol";
import {DeploymentWriterScript} from "forge-deploy-lib/src/DeploymentScript.sol";

import {SafeAdder} from "src/safe/Adder.sol";

Expand Down
2 changes: 1 addition & 1 deletion tests/bounties/src/adder/script/unsafe/Exploit.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.27;

import {DeploymentReaderScript} from "forge-deploy-lib/DeploymentScript.sol";
import {DeploymentReaderScript} from "forge-deploy-lib/src/DeploymentScript.sol";

import {IAdder} from "src/IAdder.sol";

Expand Down
2 changes: 1 addition & 1 deletion tests/bounties/src/adder/script/unsafe/Setup.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.27;

import {DeploymentWriterScript} from "forge-deploy-lib/DeploymentScript.sol";
import {DeploymentWriterScript} from "forge-deploy-lib/src/DeploymentScript.sol";

import {UnsafeAdder} from "src/unsafe/Adder.sol";

Expand Down

0 comments on commit 98c25da

Please sign in to comment.