Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 623 Bytes

CONTRACTS.md

File metadata and controls

23 lines (18 loc) · 623 Bytes

Fabric Contracts

Contracts in Fabric are simple agreements between two or more peers.

Contract Elements

Fabric Contracts consist of several key components.

  • Initial Contract State
  • Contract Messages
  • Contract Script (Taproot Program)

Using @fabric/core/types/contract

The Contract type can be imported from @fabric/core using the following JavaScript:

const Contract = require('@fabric/core/types/contract`);

To deploy the contract, fund the deposit address generated by:

const Contract = require('@fabric/core/types/contract`);
const contract = new Contract();

contract.deploy();