0.0.5 • Published 4 years ago

buidler-erasure v0.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

buidler

buidler-erasure

Buidler plugin for Erasure protocol

What

This plugin will help you integrate your dapp with the erasure protocol by letting you easily invoke erasure's contracts and interact with them.

Installation

This plugin relies on the smart contracts of the erasure protocol.

npm install buidler-erasure ethers github:erasureprotocol/erasure-protocol#master

And add the following statement to your buidler.config.js:

usePlugin("buidler-erasure");

Required plugins

Tasks

This plugin adds the following tasks to Buidler:

  • erasure:deploy-full: Deploy the whole platform
  • erasure:create-instance: Creates a new instance from a factory
  • erasure:create-agreement: Creates an Simple Agreement
  • erasure:stake: Stake NMR in an Simple Griefing Agreement
  • erasure:copy-contracts: Temporal task. Copy the erasure protocol contracts into your project's sources folder.

Environment extensions

This plugin extends the Buidler Runtime Environment by adding the following elements:

  erasure: {
    deploySetup: ErasureDeploySetup;
    getDeployedAddresses(name: string): Promise<string[]>;
    getDeployedContracts(contractName: string): Promise<Contract[]>;
    saveDeployedContract(name: string, instance: any): void;
    getContractInstance(name: string, address: string, account: string | Signer): Contract;
  }
  • deploySetup: the erasure deploy setup.
  • getDeployedAddresses: a function that retrieves the deployed addresses of a given contract name.
  • getDeployedContracts: a function that retrieves the deployed contracts of a given contract name.
  • saveDeployedContract: store a contract's address into the deployment state.
  • getContractInstance: retrieves an instance of a contract attached to an address

Configuration

There is no configuration required for this plugin.

Usage

You must copy the erasure protocol contracts into your sources folder. You can do it manually:

cp node_modules/erasure-protocol/contracts/**/*.sol <source_folder>

Or use a (temporal) task I've created to do this:

npx buidler erasure:copy-contracts

I'm working on a solution to avoid this.

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago