All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ergoplatform.appkit.ErgoContract Maven / Gradle / Ivy

The newest version!
package org.ergoplatform.appkit;

import sigmastate.Values;

/**
 * Representation of ErgoScript contract using source code and named constants.
 * This information is enough to compile contract into {@link Values.ErgoTree}.
 * Once constructed the instances are immutable.
 * Methods which do transformations produce new instances.
 */
public interface ErgoContract {
    /**
     * Returns named constants used to compile this contract.
     */
    Constants getConstants();

    /**
     * Returns a source code of ErgoScript contract.
     */
    String getErgoScript();

    /**
     * Creates a new contract by substituting the constant {@code name} with the new {@code value}.
     */
    ErgoContract substConstant(String name, Object value);

    /**
     * Returns the underlying ErgoTree used by this contract
     */
    Values.ErgoTree getErgoTree();

    /**
     * Get the base58 encoded address that represents this contract
     */
    Address toAddress();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy