0.0.1 • Published 3 years ago

as-tetcore v0.0.1

Weekly downloads
3
License
Apache-2.0
Repository
-
Last release
3 years ago

AS-Tetcore

A collection of resources to develop proof of concept projects for Tetcore in AssemblyScript. AssemblyScript compiles a strict subset of TypeScript to WebAssembly using Binaryen.

At the moment, this repository is mainly home for a collection of smart contract examples and a small smart contract library to write contracts for Tetcores contracts pallet, but it might be extended with more examples in the future.

Setup

This repository is using yarn and yarn workspaces. You also need a fairly up-to-date version of node.

./packages

The packages folder contains the PoC libraries and projects.

./contracts

The contracts folder contains a number of example contracts that make use of the as-contracts package. The compiled example contracts in the contracts folder can be deployed and executed on any Tetcore chain that includes the contracts pallet.

Getting started

  1. Clone the whole as-tetcore repository.
$ git clone https://github.com/tetcoin/as-tetcore.git
  1. Install all dependencies
$ yarn
  1. Compile all packages, projects and contract examples to wasm
$ yarn build

To clean up all workspaces in the repository, run:

$ yarn clean

Write your own contract

The @tetcore/as-contracts and @tetcore/as-utils packages are not being published to the npmjs registry. That's why you need to add the complete as-tetcore repository as a dependency directly from git.

$ yarn add https://github.com/tetcoin/as-tetcore.git

// or

$ npm install https://github.com/tetcoin/as-tetcore.git

In your projects, you can then import the as-contracts functions directly from the node_modules folder

The recommended way of writing smart contracts is using the Rust Smart Contract Language ink!.

Another way of writing Smart Contracts for Tetcore is using the Solidity to Wasm compiler Solang.

Disclaimer

Everything in this repository is highly experimental and should not be used for any professional or financial purposes.

License

The entire code within this repository is licensed under the GNU GENERAL PUBLIC LICENSE 3.0. Please contact us if you have questions about the licensing of our products.

0.0.1

3 years ago