0.2.5 • Published 8 months ago

@powco/smart-contracts v0.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Scrypt Smart Contracts

Quick access to all known smart contracts on powco at your fingertips

npm version CircleCI Bitcoin SV Visual Studio Code TypeScript Mocha

npm install --save @powco/smart-contracts

Each contract added to ./src/contracts/ is compiled and its artifact.json pre-loaded so you can use the contract class immediately right out of the box

import { TimeLockP2PKH } from '@powco/smart-contracts'

import { DevIssue } from '@powco/smart-contracts'

import { PersonalInterest } from '@powco/smart-contracts'

import { EventTicket } from '@powco/smart-contracts'

The goal is to accumulate source code for all known useful scrypt smart contracts, and eventually allow for loading smart contract code classes directly from the blockchain.

Adding Your Contracts

Simply write your contract in the same format as the others in src/contracts, which conform to the convention laid out by the scrypt-cli project generator.

Usage in Development

If you are developing a new contract and want to test support in your app before publishing a pull request to this repo, you can import the code into your project like this:

  • First build the code

npm install && npm run build

  • Then in your typescript project
import { MySmartContract } from '/local/path/to/@powco/smart-contracts'

Remember to run npm run build after any change to your contract in development

Build

npm run build

Testing Locally

npm run test

Run Bitcoin Testnet Tests

npm run testnet
0.2.5

8 months ago

0.2.4

8 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.0.13

10 months ago

0.0.12

10 months ago

0.0.11

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.1

10 months ago