## Index

### Variables

- argumentDarc
- commandEvolve
- commandEvolveUnrestricted
- contractID
- ruleEvolve
- ruleEvolveUnrestricted
- ruleSign

### Functions

- evolve
- spawnCoin
- spawnDarc

## Variables

### Const argumentDarc

argumentDarc: "darc" = "darc"

- Defined in src/v2/byzcoin/contracts/darcContract.ts:18

### Const commandEvolve

commandEvolve: "evolve" = "evolve"

- Defined in src/v2/byzcoin/contracts/darcContract.ts:16

### Const commandEvolveUnrestricted

commandEvolveUnrestricted: "evolve_unrestricted" = "evolve_unrestricted"

- Defined in src/v2/byzcoin/contracts/darcContract.ts:17

### Const contractID

contractID: "darc" = "darc"

- Defined in src/v2/byzcoin/contracts/darcContract.ts:15

DarcContract represents a darc taken from an instance. It has all necessary constants to interact with a darc contract on byzcoin.

### Const ruleEvolve

ruleEvolve: string = "invoke:" + contractID + "." + commandEvolve

- Defined in src/v2/byzcoin/contracts/darcContract.ts:20

### Const ruleEvolveUnrestricted

ruleEvolveUnrestricted: string = "invoke:" + contractID + "." +commandEvolveUnrestricted

- Defined in src/v2/byzcoin/contracts/darcContract.ts:21

### Const ruleSign

ruleSign: "_sign" = Darc.ruleSign

- Defined in src/v2/byzcoin/contracts/darcContract.ts:19

## Functions

### evolve

- evolve(tx: TransactionBuilder, oldDarc: Darc, updates: IDarcAttr, unrestricted?: boolean): Darc

- - Defined in src/v2/byzcoin/contracts/darcContract.ts:34

  Creates an instruction in the transaction with either an update of the description and/or an update of the rules.

  #### Parameters

  - ##### tx: TransactionBuilder

    where the instruction will be appended to

  - ##### oldDarc: Darc

    that needs to be evolved

  - ##### updates: IDarcAttr

    contains a description update and/or rules to be merged

  - ##### Default value unrestricted: boolean = false

    if true, will create an unrestricted evolve that allows to create new rules

  #### Returns Darc

  the new DARC as it will appear on ByzCoin if the transaction is accepted

### spawnCoin

- spawnCoin(tx: TransactionBuilder, did: InstanceID, name: Buffer, preHash?: Buffer): InstanceID

- - Defined in src/v2/byzcoin/contracts/darcContract.ts:54

  Creates the instruction necessary to spawn a new coin using this darc.

  #### Parameters

  - ##### tx: TransactionBuilder

    where the instruction will be appended to

  - ##### did: InstanceID

    baseID of the darc that can spawn coins

  - ##### name: Buffer

    of the coin

  - ##### Optional preHash: Buffer

    used to calculate the ID of the coin, if given

  #### Returns InstanceID

### spawnDarc

- spawnDarc(tx: TransactionBuilder, did: InstanceID, newDarc: Darc): void

- - Defined in src/v2/byzcoin/contracts/darcContract.ts:71

  Spawns a new darc. The darc given by did must have a `spawn:darc` rule.

  #### Parameters

  - ##### tx: TransactionBuilder

    where the instruction will be appended to

  - ##### did: InstanceID

    baseID of the darc that can spawn other darcs

  - ##### newDarc: Darc

    to be spawned

  #### Returns void

Generated using TypeDoc