Skip to content

curio-research/treaty-contracts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Treaty V0 Contracts

Treaty is a fully on-chain 4X strategy game. In Treaty, players are able to express and enforce social contracts (i.e. treaties) through code.

This repository contains the core smart contracts, tests, and deployment code for the game.

For more details, see Treaty Technical Overview from our blog.

Treaty

Codebase structure

  • contracts directory contains game smart contracts using the Diamond standard.
  • tasks directory contains game constants, map generation, and deployment-related code.
  • test directory contains tests for contracts using Foundry.

How to use

Setup

To use, first follow the following steps:

  1. Install Foundry, a modular toolkit for Ethereum applications, here.

  2. Clone this codebase.

  3. Run yarn install to install dependencies.

  4. Run git submodule update --init --recursive to install all submodules.

  5. Run yarn link curio-vault to link the vault repo needed for some data structures.

Local deployment and test

Then, to deploy the contracts locally:

  1. Adjust parameters in tasks/constants.ts.

  2. Spin up a local network using npx hardhat node.

  3. In a separate terminal, deploy using npx hardhat deploy.

To run Foundry tests, simply run yarn ft.

Contribution

Creating your own treaty is simple! Go to contracts/treaties folder and create MyTreaty.sol:

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import {CurioTreaty} from "contracts/standards/CurioTreaty.sol";
import {CurioERC20} from "contracts/standards/CurioERC20.sol";

contract MyTreaty is CurioTreaty {
    ...
}

We will soon add more support for you to use your custom treaties in game or to improve the core contracts. For now, join our Discord to discuss new features, treaties, or changes.

About Curio

Curio Research is an on-chain gaming lab. Visit our website and Twitter for more information about us.

Join our Discord to get support and connect with the community!

Licensing

Treaty is licensed under MIT.