Giter VIP home page Giter VIP logo

kadena_repl_sandbox's Introduction

Sandbox for Kadena REPL

Introduction

This package helps to create a "Plug & Play" sandbox for easy development of Pact Smart Contracts off-chain, with all standards contracts preloaded and ready.

The goal is to simulate the Kadena environment as it can be found on-chain:

  • Namespaces
  • Coin-contract and fungible-v2 interfaces
  • Official Kadena utilities
  • Third party utilities
  • Marmalade interfaces and contracts

How-to

  1. Make sure that the Pact interpreter in installed.
  1. Create your REPL file which:
  • load the main sandbox script kda-env/init.repl: (load "kda-env/init.repl")
  • declare or load and test your contracts
  1. Optionally, you can comment some lines in init.repl to disable some features.
  2. Launch your REPL file with the pact executable.

An example can be found: example.repl and example.pact and can be launched:

$ pact example.repl
Standard namespaces initialized
Kadena contracts initialized
Utils library contracts initialized
Marmalade contracts initialized
Hello bob: You have currently 1000.0 KDA
Load successful

Description

Pact

Based on Pact 4.4.1, and currently on-chains contracts (12/02/2022)

Bootstrap modules

basic-guards: Implements two simple guards (used to initialize the namespaces): GUARD_SUCCESS and GUARD_FAILURE

repl-coin-tools: Implements 2 functions to create and mint coin accounts.(env-enable-repl-natives) must be enabled to make this module work.

Namespaces

The following namespaces are created:

  • util
  • free
  • kip
  • user
  • marmalade

There is no enabled policy, and the module ns is not loaded. There is no guard on the namespaces.

Fungible-v2 and coin

The coin contract v5 is installed.

The followings accounts are pre-funded for test purpose:

Account Key Balance
alice alice-key 1000.0
bob bob-key 1000.0
carol carol-key 1000.0
dave dave-key 1000.0

If you need more accounts, you can create a new ones with (repl-coin-tools.fund-account name key-name balance)

Marmalade

The version RC1 of marmalade is installed:

Contracts:

  • poly-fungible-v2 and token-policy-v1 interfaces in NS kip
  • manifest contract in NS kip
  • ledger in NS marmalade
  • 3 default policy contracts in NS marmalade

Pact Util library

The version 0.3 of unofficial Pact Util library:

kadena_repl_sandbox's People

Contributors

cryptopascal31 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.