Contracts in Fabric are simple agreements between two or more peers.
Fabric Contracts consist of several key components.
- Initial Contract State
- Contract Messages
- Contract Script (Taproot Program)
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();