Skip to content

A king-of-the-hill style competition, where players optimize gas challenges.

License

Notifications You must be signed in to change notification settings

waterfall-mkt/curta-golf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curta Golf

Website - Docs - Twitter

A king-of-the-hill style competition, where players optimize gas challenges.

The goal of players is to view Courses (challenges) and try to implement the most optimized solution for it. If the solution is valid, a Par Token with the corresponding metadata will be minted to their address. If it's the most efficient, they will be crowned the "King," and King NFT will be transferred to them.

Deployments

Chain Chain ID Contract Deploy
Base 8453 CurtaGolf 0xb8d97B24935C70cD931bbc6150e2596570997cE9
Par 0x6B780314f95452E37D88A2F950Bbd3885851fD10
PurityChecker 0xE03Bbdb59444581f54f6823F0091FdF738E3Ce62

Usage

This project uses Foundry as its development/testing framework.

Installation

First, make sure you have Foundry installed. Then, run the following commands to clone the repo and install its dependencies:

git clone https://github.com/waterfall-mkt/curta-golf.git
cd curta-golf
forge install

Testing

To run tests, run the following command:

forge test

To test the metadata output for King and Art, run the following commands:

forge script script/metadata/PrintKingArt.s.sol:PrintKingArtScript --via-ir -vvv
forge script script/metadata/PrintPartArt.s.sol:PrintPartArtScript --via-ir -vvv

Coverage

To view coverage, run the following command:

forge coverage

To generate a report, run the following command:

forge coverage --report lcov

Note

It may be helpful to use an extension like Coverage Gutters to display the coverage over the code.

Deploying

There are three core contracts that get deployed in Deploy.s.sol: PurityChecker.sol, Par.sol, and CurtaGolf.sol. We also make use of three external libraries. These are: Perlin.sol, ParArt.sol, and KingArt.sol. Perlin.sol is used by KingArt.sol, which is used by KingERC721.sol, which is inherited by CurtaGolf.sol, and ParArt.sol is used by Par.sol. We include these in foundry.toml if we don't want them to be deployed alongside the contracts that use them. Otherwise, as an example, Perlin.sol and KingArt.sol would be deployed alongside CurtaGolf.sol.

A standard example for deploying everything would look like this:

forge script script/Deploy.s.sol:Deploy \
--rpc-url <rpc_url> \
--sender <sender> \
--account <account> \
--broadcast

If libraries have already been deployed we would do:

forge script script/Deploy.s.sol:Deploy \
--rpc-url <rpc_url> \
--sender <sender> \
--account <account> \
--broadcast \
--libraries src/utils/Perlin.sol:Perlin:<address> \
--libraries src/utils/metadata/KingArt.sol:KingArt:<address> \
--libraries src/utils/metadata/ParArt.sol:ParArt:<address>

Note

When using forge verify-contract to verify a contract on a contract with libraries, the --libraries arg needs to be supplied in the form --libraries <remapped path to lib>:<library name>:<address>.

Acknowledgements