amanusk / cairo-paradigm-ctf

Solutions and scripts for Cairo Challenges of Paradigm CTF 2022
11 stars 0 forks source link
cairo cairo-lang ctf-solutions ctf-writeups starknet

Running Cairo paradigm CTF solutions locally

This repository contains solutions for the Cairo challenges of the 2022 Paradigm-CTF

Creating env instructions

python3 -m venv ./venv
source ./venv/bin/activate
pip install -requirements ./requirements.txt
cd ./paradigm-ctf-infrastructure/images/cairo-challenge-base
python -m cairo_sandbox.server

Compiling the contracts

The compiled contrats have already been place in the correct direcotry.

Compiling the contrats from source:

Contracts can be compiled by running nile compile. This generates both the compiled contract files and abis in the artifacts dir

Although the generated files have a .json extension, the individual challenge scripts expect the file to be named .cairo

mv artifacts/almost_erc20.json compiled/almost_erc20.cairo

Copy the files to the infrastructure directory: (for example)

cp ./artifacts/almost_erc20.json paradigm-ctf-infrastructure/images/cairo-challenge-base/compiled/almost_erc20.cairo

Running individual challanges

cd ./paradigm-ctf-infrastructure/images/cairo-challenge-base
python -m cairo_sandbox.proxy-chal.py

Run the solution script

Run the solution script with

python ./scripts/cairo-auction.py

Thanks

If you like it then you shoulda put a start ⭐ on it

Twitter: @amanusk_

License

MIT