Skip to content

Commit

Permalink
update infra
Browse files Browse the repository at this point in the history
  • Loading branch information
samczsun-paradigm committed Aug 17, 2022
1 parent fc40857 commit 46974f8
Show file tree
Hide file tree
Showing 66 changed files with 62 additions and 1,508 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
### Configuration

You'll need to update the following environment variables:
* `RPC_URL` to a valid Ethereum JSON-RPC endpoint
* `ETH_RPC_URL` to a valid Ethereum JSON-RPC endpoint
* `PYTHONPATH` to point to mpwn

You'll also need to manually install the following:
* `solc-select install 0.4.16 0.4.24 0.5.12 0.6.12 0.7.0 0.7.6 0.8.0`
* `pip install ecdsa sha3`
* `pip install ecdsa pysha3 web3`

### Build everything

Expand Down
2 changes: 1 addition & 1 deletion babycrypto/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ctf/challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/base:latest

COPY deploy/ /home/ctf/

Expand Down
4 changes: 1 addition & 3 deletions babyrev/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM ctf/eth_challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/eth-base:latest

COPY deploy/ /home/ctf/

RUN python3 -m pip install -r /home/ctf/requirements.txt
2 changes: 1 addition & 1 deletion babyrev/public/deploy/compiled.bin

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions babyrev/public/deploy/requirements.txt

This file was deleted.

4 changes: 1 addition & 3 deletions babysandbox/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM ctf/eth_challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/eth-base:latest

COPY deploy/ /home/ctf/

RUN python3 -m pip install -r /home/ctf/requirements.txt
2 changes: 1 addition & 1 deletion babysandbox/public/deploy/compiled.bin
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contracts":{"contracts/BabySandbox.sol:BabySandbox":{"bin":"608060405234801561001057600080fd5b5061012b806100206000396000f3fe608060405260043610601c5760003560e01c8063522bb704146021575b600080fd5b606060048036036020811015603557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506062565b005b30331415609a57600080600080845af46000811460845760018114608e576098565b3d6000803e3d6000fd5b3d6000803e3d6000f35b505b61f0005a101560a857600080fd5b366000803760008036600030614000fa60c057600080fd5b6000803660008030614000f16000811460de576001811460e75760f1565b3d6000803e60f1565b3d6000803e3d6000f35b505056fea2646970667358221220d97dc60b7232c41e2c2615e49f5d7c4f6cdeb4b80516f4c42c25b0d56beb461964736f6c63430007000033"},"contracts/Setup.sol:Setup":{"bin":"608060405234801561001057600080fd5b5060405161001d9061007e565b604051809103906000f080158015610039573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061008b565b61014b8061018d83390190565b60f4806100996000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80631984916f14603757806364d98f6e146069575b600080fd5b603d6087565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606f60ab565b60405180821515815260200191505060405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000543b9050600081149150509056fea2646970667358221220adc56909bce09b48ac4d0d6a65512a13d72bd378836fbcec666ef4ab0e67175964736f6c63430007000033608060405234801561001057600080fd5b5061012b806100206000396000f3fe608060405260043610601c5760003560e01c8063522bb704146021575b600080fd5b606060048036036020811015603557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506062565b005b30331415609a57600080600080845af46000811460845760018114608e576098565b3d6000803e3d6000fd5b3d6000803e3d6000f35b505b61f0005a101560a857600080fd5b366000803760008036600030614000fa60c057600080fd5b6000803660008030614000f16000811460de576001811460e75760f1565b3d6000803e60f1565b3d6000803e3d6000f35b505056fea2646970667358221220d97dc60b7232c41e2c2615e49f5d7c4f6cdeb4b80516f4c42c25b0d56beb461964736f6c63430007000033"}},"version":"0.7.0+commit.9e61f92b.Darwin.appleclang"}
{"contracts":{"contracts/BabySandbox.sol:BabySandbox":{"bin":"608060405234801561001057600080fd5b5061012b806100206000396000f3fe608060405260043610601c5760003560e01c8063522bb704146021575b600080fd5b606060048036036020811015603557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506062565b005b30331415609a57600080600080845af46000811460845760018114608e576098565b3d6000803e3d6000fd5b3d6000803e3d6000f35b505b61f0005a101560a857600080fd5b366000803760008036600030614000fa60c057600080fd5b6000803660008030614000f16000811460de576001811460e75760f1565b3d6000803e60f1565b3d6000803e3d6000f35b505056fea26469706673582212209cf199f1c6ff71940414574a68675f849d525a4acedb4fde4b8843df77baa85864736f6c63430007000033"},"contracts/Setup.sol:Setup":{"bin":"608060405234801561001057600080fd5b5060405161001d9061007e565b604051809103906000f080158015610039573d6000803e3d6000fd5b506000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061008b565b61014b8061018d83390190565b60f4806100996000396000f3fe6080604052348015600f57600080fd5b506004361060325760003560e01c80631984916f14603757806364d98f6e146069575b600080fd5b603d6087565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606f60ab565b60405180821515815260200191505060405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000543b9050600081149150509056fea264697066735822122022dbaf817138d58d523bb9433aa015ecd1670e10293ad321657960b70b0473c364736f6c63430007000033608060405234801561001057600080fd5b5061012b806100206000396000f3fe608060405260043610601c5760003560e01c8063522bb704146021575b600080fd5b606060048036036020811015603557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506062565b005b30331415609a57600080600080845af46000811460845760018114608e576098565b3d6000803e3d6000fd5b3d6000803e3d6000f35b505b61f0005a101560a857600080fd5b366000803760008036600030614000fa60c057600080fd5b6000803660008030614000f16000811460de576001811460e75760f1565b3d6000803e60f1565b3d6000803e3d6000f35b505056fea26469706673582212209cf199f1c6ff71940414574a68675f849d525a4acedb4fde4b8843df77baa85864736f6c63430007000033"}},"version":"0.7.0+commit.9e61f92b.Darwin.appleclang"}
41 changes: 0 additions & 41 deletions babysandbox/public/deploy/requirements.txt

This file was deleted.

4 changes: 1 addition & 3 deletions bank/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM ctf/eth_challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/eth-base:latest

COPY deploy/ /home/ctf/

RUN python3 -m pip install -r /home/ctf/requirements.txt
2 changes: 1 addition & 1 deletion bank/public/deploy/compiled.bin

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions bank/public/deploy/requirements.txt

This file was deleted.

4 changes: 1 addition & 3 deletions bouncer/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM ctf/eth_challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/eth-base:latest

COPY deploy/ /home/ctf/

RUN python3 -m pip install -r /home/ctf/requirements.txt
2 changes: 1 addition & 1 deletion bouncer/public/deploy/compiled.bin

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions bouncer/public/deploy/requirements.txt

This file was deleted.

4 changes: 1 addition & 3 deletions broker/public/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
FROM ctf/eth_challenge_base:latest
FROM gcr.io/paradigmxyz/ctf/eth-base:latest

COPY deploy/ /home/ctf/

RUN python3 -m pip install -r /home/ctf/requirements.txt
2 changes: 1 addition & 1 deletion broker/public/deploy/compiled.bin

Large diffs are not rendered by default.

41 changes: 0 additions & 41 deletions broker/public/deploy/requirements.txt

This file was deleted.

8 changes: 4 additions & 4 deletions build
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ build_challenge() {
name="$1"
solcv="${2:-}"

tag="gcr.io/paradigm-ctf/$name:latest"
tag="gcr.io/paradigm-ctf/2021/$name:latest"

if [ ! -z "$solcv" ]; then
pushd "$name/public"
ROOT_DIR="$(cd .. && pwd)"
if ! solc-select versions | grep "$solcv" >/dev/null 2>&1; then
solc-select install "$solcv"
fi
SOLC_VERSION="$solcv" solc "private=$ROOT_DIR/private/" "public=$ROOT_DIR/public/contracts" --combined-json bin contracts/Setup.sol > deploy/compiled.bin
sed -i.bak "s^${ROOT_DIR}^^g" deploy/compiled.bin && rm deploy/compiled.bin.bak
popd
Expand All @@ -23,9 +26,6 @@ build_challenge() {
fi
}

(cd challenge_base && docker build -t ctf/challenge_base:latest .)
(cd eth_challenge_base && docker build -t ctf/eth_challenge_base:latest .)

declare -a chals=(
"babycrypto"
"bank 0.4.24"
Expand Down
23 changes: 0 additions & 23 deletions challenge_base/00-create-xinetd-service

This file was deleted.

3 changes: 0 additions & 3 deletions challenge_base/99-start-xinetd

This file was deleted.

20 changes: 0 additions & 20 deletions challenge_base/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions challenge_base/entrypoint.sh

This file was deleted.

3 changes: 0 additions & 3 deletions challenge_base/handler.sh

This file was deleted.

8 changes: 0 additions & 8 deletions eth_challenge_base/98-start-gunicorn

This file was deleted.

17 changes: 0 additions & 17 deletions eth_challenge_base/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions eth_challenge_base/eth_sandbox/__init__.py

This file was deleted.

11 changes: 0 additions & 11 deletions eth_challenge_base/eth_sandbox/auth.py

This file was deleted.

0 comments on commit 46974f8

Please sign in to comment.