This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0). Commercial use is not permitted without a separate license from Unstoppable Games, Inc.
For the avoidance of doubt: The licensor considers non-commercial use under this license to include deployments or uses that collect funds solely to recover the reasonable costs of operating, maintaining, or administering the software, provided that such use is not primarily intended for or directed toward commercial advantage or monetary compensation, and that no profit is distributed to operators, contributors, or participants.
This project uses historical version 2.1.1 of cairo, 0.6.2 of scarb and 1.76.0 of Rust. These cairo and scarb versions are no longer readily available using the https://sh.starkup.sh path. We need to build them using Rust.
Rust is easiest obtained by installing rustup. This tool allows you to obtain complete toolchains for specific versions of Rust. After install, invoke the following commands to set your local environment to use version 1.76.0 of Rust:
rustup toolchain install 1.76.0
rustup override set 1.76.0
To build cairo:
git clone https://github.com/starkware-libs/cairo.git
cd cairo
git checkout v2.1.1
cargo build --all --release
To build scarb:
git clone https://github.com/software-mansion/scarb.git
cd scarb
git checkout v0.6.2
cargo build --all --release
You need to set $PATH_TO_CAIRO/target/release and $PATH_TO_SCARB/target/release directories into your PATH
environment variable to be able to easily access the cairo and scarb CLI commands.
Environment should be now set up for proceeding with building the project and running test-contracts.
npm install(will run submodule update automatically to obtain the dependency librarycubit)- Must setup
.envto includeSIERRA_COMPILER_PATH, currently dependent on v2.1.1 - Relies on
starknet-devnetversion 0.7.2 to be installed in localpyenvfor integration testing - Unzip
devnet.dump.zipin./test/seedsto./test/seeds/devnet.dumpfor integration testing
This step depends on the cairo and scarb builds to be accessible in your PATH.
npm run build
This step depends on the cairo-test command from the cairo build to be accessible in your PATH.
npm run test-contracts
- Ensure that Docker Desktop is installed and started
- Build contracts (see above)
npm run test-integration(integration tests with Ibis)
- After changes to contracts, run
npm run buildto build the contracts - Clear the
./test/seedsdirectory - Start devnet with
starknet-devnet --timeout 5000 --seed 12345 --initial-balance 10000000000000000000000000 --dump-path ./test/seeds/devnet.dump --dump-on exit - Run
npm run manager updateAll -- --network devnet - Run
npm run manager updateConfigs -- --network devnet --type all - When complete, exit with
CTRL+Cto generate thedevnet.dumpfile in./test/seeds - Move
devnet.ibis.contracts.jsonfrom./cacheto./test/seeds
npm run manager update -- --name <contractName> --network <networkName> --account <accountNamenpm run manager updateAll -- --network <networkName> --account <accountName
- manually run
add_grantonAsteroidcontract with{ account: dispatcher.address, role: 2 } - manually run
add_grantonCrewmatecontract with{ account: dispatcher.address, role: 2 } - manually run
add_grantonCrewcontract with{ account: dispatcher.address, role: 2 } - manually
run_systemwithSeedHabitatonDispatcher - manually set
Ethercontract viaregister_contractonDispatcherto0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7 - manually set
ReceivablesAccountviaregister_contractonDispatcher
For asteroids:
- run
seedAsteroidsscript vianpm run manager - manually
set_l1_bridge_addressonAsteroid - manually
setL2BridgeContracton L1 AsteroidBridge to L2 Asteroid address - manually
setL2BridgeSelectoron L1 AsteroidBridge togetSelector('bridge_from_l1') - manually set
ASTEROID_BASE_PRICE_ETHconstant viaregister_constantonDispatcher - manually set
ASTEROID_LOT_PRICE_ETHconstant viaregister_constantonDispatcher
For crewmates:
- run
seedCrewmatesscript vianpm run manager - manually
set_l1_bridge_addressonCrewmate - manually
setL2BridgeContracton L1 CrewmateBridge to L2 Crewmate address - manually
setL2BridgeSelectoron L1 CrewmateBridge togetSelector('bridge_from_l1') - manually set
ADALIAN_PRICE_ETHconstant viaregister_constantonDispatcher
- manually
add_grantonShipwith{ account: dispatcher.address, role: 2 } - manually
set_l1_bridge_addressonShipwith L1 ShipBridge proxy address - manually
set_l1_bridge_addressonCrewwith L1 CrewBridge proxy address - manually
set_l1_bridgeonSwaywith L1 SwayBridge address - manually
set_l1_sway_volume_addressonSwaywith L1 SwayVolume proxy address - manaully
updateBeneficiaryonSwayGovernor
- ensure all constants are set:
TIME_ACCELERATION,ADALIAN_PRICE_ETH,ASTEROID_BASE_PRICE_ETH,ASTEROID_LOT_PRICE_ETH - manually set
LAUNCH_TIMEconstant to the launch timestamp withregister_constanton `Dispatcher - manually
launchSway contract on L1