Welcome to Proof of Code!
Proof of Code is a free crypto coding competition with weekly prize pools, focusing initially on Solidity problems.
Hosted by BVM, the leading Rollup-As-A-Service platform on Bitcoin, allowing anyone to launch their own blockchains on Bitcoin at low cost!
More info about Proof of Code: BVMPoC
To register for Proof Of Code, please sign in
at BVMPoC.
To solve problems, follow these steps:
Clone this repository using the command:
git clone https://github.com/TrustlessComputer/poc-practice.git
Navigate to the project directory and install the required dependencies:
cd poc-practice
npm install
Note: This repository requires node.js version 20.11.1 or higher.
Go to BVMPoC.
Click Sign in
using your Twitter or Gmail account.
Export your private key from the website.
Create a .env
file in the root directory of the project and add your private key as follows:
ZKNET_DEPLOYER_PRIVATE_KEY=YOUR_PRIVATE_KEY
To set your username, run the following command:
npx hardhat set-username --username YOUR_USERNAME
Each problem is located in its own folder. For example, the problem APlusB
can be found in the APlusB folder. The problem must be solved using Solidity.
For the APlusB
problem, you will find two files: APlusB.sol and IAPlusB.sol. To solve the APlusB
problem, modify the solve
function in APlusB.sol.
Note: Please do not modify the getProblemName
or getProblemID
functions.
To compile your solution, run the following command:
npx hardhat compile
To deploy your solution, run the deployment script with the following command:
npx hardhat deploy --problem-name PROBLEM_NAME
The --problem-name
parameter means the problem name you want to deploy, and it is required.
For example, to deploy the APlusB
solution, run the following command:
npx hardhat deploy --problem-name APlusB
Note: The competition and practice sessions are completely free to join, you won’t have to pay anything. All gas fees are automatically covered in the backend.
To test your solution, you must modify the input.json file with the input data you want to test. For example, to test the APlusB
solution, modify the input.json file as follows:
{
"a": 2,
"b": 3
}
Then, run the following command to test your solution:
npx hardhat testSolution --tx <TRANSACTION_HASH>
Note:
The --tx
parameter means the transaction hash of the contract deployment, and it is required. This parameter can be found after deploying the contract solution in step 7.
You can submit your solution by using the following command:
npx hardhat submit --tx <TRANSACTION_HASH>
Note:
The --tx
parameter means the transaction hash of the contract deployment, and it is required. This parameter can be found after deploying the contract solution in step 7.
Join the Proof of Code community: PoC Community.