Home

Awesome

Cosmic Cowboys Contracts

This repo contains the Solidity smart contracts for Cosmic Cowboys, a dynamic on-chain game that gives life to NPC using ERC-6551 and AI.

ℹ️ To see the repo for the front end app portion of this project, please visit polluterofminds/cosmic-cowboys-app

The project consists of several elements:

With this repo we deploy all the previously mentioned contracts and mint 20 NPC characters, give each their own Tokenbound Account, and mint currency and items to those accounts. The end result will also give env variables that can be used for the front end portion of the app.

Deploying

Fist clone this repo and install dependences

git clone https://github.com/stevedylandev/cosmic-cowboys-contracts && cd cosmic-cowboys-contracts && npm install

To deploy the contracts you can create a .env file with the following variables:

PRIVATE_KEY=
ALCHEMY_URL=
ALCHEMY_URL_BASE=
ALCHEMY_KEY=
ALCHEMY_KEY_BASE=
SEPOLIA_URL=
SEPOLIA_KEY=
ETHERSCAN_API_KEY=

Depending what networks you want to deploy to you can alter those variables.

Once ready you can deploy with your choice of network like goerli

npx hardhat run scripts/deployContracts.js --network goerli

Once you run this it will deploy all contracts as well as setup the NPCs for the game.