1.3.0 • Published 3 years ago

spacexcalibur-contracts v1.3.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 years ago

SpaceXcalibur Contracts

GitHub GitHub top language Lines of code Amazing! Discord

The optimistic Solidity smart contracts for SpaceXcalibur.

  • Install with npm install
  • Test with npx hardhat test
  • Deploy to local network with npx hardhat deploy --network localhost
  • Deploy to Optimistic Kovan testnet with npx hardhat deploy --network optimistic

Architecture

The game map contains "celestials" (celestial objects). Each kind of celestial object is managed by a contract. The contract hierarchy is:

  • Celestial - common ancestor for all celestials
    • ResourceCelestial - ancestor for celestials that generate resources to be collected
      • Planet - generates terrestrial wood

The contract for a specific kind of celestial (e.g. Planet) stores the data for all celestials of that particular kind. It also lets player interact with the celestial. In the case of Planet, the player can build an extractor on the planet (to generate terrestrial wood) and then collect the accrued wood at a later point in time.

The Items contract implements EIP-1155 (multi-tokens) and holds player balances for every resource and items in the game.

The Galaxy contract lists all existing celestials — it's used to load the game map for players. These celestials are not indexed in any way, their attributes are stored in the contract for their specific kind.

Events

  • event Build(uint128 x, uint128 y, address player, CelestialKind kind);
    • signature: Build(uint128, uint128, address, uint8)
    • emitted whenever a building is built on a celestial (currently: building extractors on resource celestials)
1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago