This tool facilitates the deployment of ErgoNames contracts with customizable values. It also allows you to compile contract addresses, enabling verification of any contract values or constants.
An additional feature, particularly useful for contract testing, is the clone ability. This allows you to clone any box from the mainnet to the testnet with a custom ERG value. This is especially helpful for testing contracts that require boxes only available on mainnet, such as the USD oracle.
- Copy
config.json.example
toconfig.json
and fill in the values. - Most defaults are set up; the primary requirement is the mnemonic.
- The mnemonic is not necessary for contract compiling.
- The mnemonic password can be left blank if the mnemonic is not encrypted (which is usually the case).
- The
addressIndex
can be left as0
. If you have multiple addresses in your wallet, you can change this to the index of the address you want to use.
- Install Scala
- Install sbt
- Run the following command in the project's root directory:
sbt "runMain app.Main"
- Install Java
- Download the latest release
- Run the jar file using the following command structure:
java -jar ergonames-deployment-*.jar --conf <path to conf> <additional flags>
-
Cloning a box:
java -jar ergonames-deployment-*.jar --conf <path to conf> --clone --boxID <boxId> --nanoErgs <optional, else box value will be exactly copied>
-
Initializing Contracts:
java -jar ergonames-deployment-*.jar --conf <path to conf> --initialize --metadataPath <metadataPath> --poolsPath <poolsPath> --contractSaveFilePath <optional, where contract addresses are saved>
-
Compiling Registry Contract:
java -jar ergonames-deployment-*.jar --conf <path to conf> --registry --metadataPath <metadataPath>
- Ensure Scala and sbt are installed
- Run the following command in the project's root directory:
sbt clean assembly
- The generated jar file will be located in the project's root directory
--initialize
: Initialize all Ergonames contracts--registry
: Compile the registry contract--clone
: Clone a box from mainnet to testnet--issuer
: Compile the issuer contract--config
: Compile the config contract--subnames
: Compile the subnames contract
--conf
: Path to the configuration file (required)--dryrun
: Test the transaction without submitting it to the network--metadataPath
: Path to metadata file (required for some operations)--poolsPath
: Path to pools configuration file (required for some operations)--contractSaveFilePath
: Path to save compiled contracts (optional)--collectionTokenId
: ID of the collection token (required for some operations)--registrySingletonTokenId
: ID of the registry singleton token (required for some operations)--commitContractAddress
: Address of the commit contract (required for some operations)--boxId
: ID of the box to clone (required for clone operation)--nanoErgs
: Custom ERG value for cloned box (optional for clone operation)