/*****************************************************
0000000 0000000
0001100 Crypts and Caverns x Realms 0001100
0001100 Lure Adventurers to their demise 0001100
0003300 0003300
*****************************************************/
This repository houses the code for our integration with Realms. If you're looking for the main Crypts and Caverns contracts which are already deployed, you'll find them here.
There are three main sections to the project:
contracts- Contains all smart contracts and interfacesscripts- Contains scripts to develop and ad hoc test. For example,mainnet/build.jswill deploy the staking contract, stake a dungeon, and verify that its owner is still correct.test- Contains tests for our contracts. Most tests will be integration tests and we will likely have 'edge case' tests such as staking/unstaking 1000 dungeons at a time. TBD How we handle cross-chain tests from Mainnet->Starknet.
Mainnet files are written in solidity and located in the mainnet folder of each section.
We use hardhat to compile, test, and deploy contracts on the Ethereum blockchain.
Ethereum contracts end in .sol and are housed in the ./contracts/mainnet folder.
- Installation
npm install
-
Build / Compile Start a local node in one terminal:
npm run nodeRun the build script:npm run buildornpm run buildwatch -
Test
npm run test
- Deploy
*Uncomment out the 'deploy' lines in
hardhat.config.js
npx hardhat deply --network rinkeby
Starknet is a Layer 2 that uses zkRollup technology to offer a low-gas, fast-transaction rollup built on top of ethereum. Transactions are batched and submitted to L1 over time.
Starknet uses the language 'Cairo' which is similar to Solidity but has its own quirks.
Starknet contracts end in .cairo and are housed in the ./contracts/starknet folder.
We use hardhat and the starknet-hardhat-plugin to compile and deploy Cairo contracts.
- Install hardhat and dependencies:
npm install - Install starknet-devnet local node:
pip install starknet-devnet - Install cairo-lang:
pip install cairo-lang
For all of these on one line: npm install; pip install starknet-devnet; pip install cairo-lang
We use hardhat-starknet to build and compile our Cairo contracts.
- Run
npm run nodestarknetin a terminal to start a local node. This will listen for queries. - Run
npm run buildstarknetin another terminal to compile and run cairo contracts.
??? (Fill in when we get here)
- Run
npm run nodestarknetin a terminal to start a local node. This will listen for queries. - Run
npm run teststarknetin another terminal to compile and run tests.