Quickstart Hero

Contract Extensions

Get started as a Primodium developer by cloning the example building-upgrade-bounty (opens in a new tab) world extension.

git clone https://github.com/primodiumxyz/developer
cd developer/examples/building-upgrade-bounty

World extensions refer to player smart contracts that extend the functionality of Primodium's core contracts, which are documented in the world extensions guide.

Game Design

You can contribute to Primodium's design and balancing by submitting pull requests to /contract-source/config/prototypeConfig.ts (opens in a new tab), which contains the main configuration for game prototypes in Primodium.

For example, the following code block from the above file defines the prototype data for IronPlateFactory, a building that produces IronPlates from iron mines. There are four fields that you can immediately modify to your own needs:

  • P_RequiredBaseLevel denotes the base level required to construct or upgrade the building.
  • P_RequiredResources denotes the resources required to construct or upgrade the building.
  • P_RequiredDependency denotes the existing production rate required for the building to produce.
  • P_Production specifies the production resources and denotes its production rate.
  // ...
  IronPlateFactory: {
    tables: {
      P_Blueprint: { value: getBlueprint(2, 2) },
      P_MaxLevel: { value: 7n },
    levels: {
      1: {
        // Requires Main Base Level 1 to construct.
        P_RequiredBaseLevel: { value: 1n },
        // `Copper` is required to construct or upgrade.
        P_RequiredResources: getResourceValues({ Copper: 200 }),
        // `IronPlateFactory` requires a minimum `Iron` production rate of `0.2` per second to produce `IronPlates`.
        P_RequiredDependency: getResourceValue({ Iron: 0.2 }),
        // `IronPlates` are produced at a rate of `0.08` per second.
        P_Production: getResourceValues({ IronPlate: 0.08 }),
      // ...
  // ...

See /contract-source/config/enums.ts (opens in a new tab) for the resource types available in Primodium. The following prototype config in TypeScript is generated into Solidity on compilation.

export enum EResource {
  Iron = 1,
  // ...


See the Primodium source guide for details on how to reference Primodium's source in your world extensions.