Giter Club home page Giter Club logo

auto-emissions's Introduction

Solana Automatic Token Emissions

Introduction

AutoEmissions is Carta for cryptocurrency projects. The product allows a user to manage their Token Emission Schedule and distribute token allocations to various individuals such as employees, advisors, and investors in an automated capacity.

Quick start

Setup Environment

  1. Clone the repository from https://github.com/solana-labs/auto-emissions.git.
  2. Install the latest Solana tools from https://docs.solana.com/cli/install-solana-cli-tools. If you already have Solana tools, run solana-install update to get the latest compatible version.
  3. Install the latest Rust stable from https://rustup.rs/. If you already have Rust, run rustup update to get the latest version.
  4. Install the latest Anchor framework from https://www.anchor-lang.com/docs/installation. If you already have Anchor, run avm update to get the latest version.

Rustfmt is used to format the code. It requires nightly features to be activated:

  1. Install nightly rust toolchain. https://rust-lang.github.io/rustup/installation/index.html#installing-nightly
  2. Execute git config core.hooksPath .githooks to activate pre-commit hooks.

[Optional] Vscode setup

  1. Install rust-analyzer extension
  2. If formatting doesn't work, make sure that rust-analyzer.rustfmt.extraArgs is set to +nightly

Build

First, generate a new key for the program address with solana-keygen new -o <PROG_ID_JSON>. Then replace the existing program ID with the newly generated address in Anchor.toml and programs/auto-emissions/src/lib.rs.

Also, ensure the path to your wallet in Anchor.toml is correct. Alternatively, when running Anchor deploy or test commands, you can specify your wallet with --provider.wallet argument. The wallet's pubkey will be set as an upgrade authority upon initial deployment of the program. It is strongly recommended to make upgrade authority a multisig when deploying to the mainnet.

To build the program run anchor build command from the root auto-emissions directory:

cd auto-emissions
anchor build

Test

Unit tests are executed with the cargo test command:

cargo test -- --nocapture

Integration tests can be started as follows:

npm install
anchor test -- --features test

By default, integration tests are executed on a local validator, so it won't cost you any SOL.

Deploy

To deploy the program to the devnet and upload the IDL use the following commands:

anchor deploy --provider.cluster devnet --program-keypair <PROG_ID_JSON>
anchor idl init --provider.cluster devnet --filepath ./target/idl/auto_emissions.json <PROGRAM ID>

Initialize

Before the first use of the AutoEmissions program it must be initialized with the init instruction.

Support

If you are experiencing technical difficulties while working with the AutoEmissions codebase, open an issue on Github. For more general questions about programming on Solana blockchain use StackExchange.

If you find a bug in the code, you can raise an issue on Github. But if this is a security issue, please don't disclose it on Github or in public channels. Send information to [email protected] instead.

Contributing

Contributions are very welcome. Please refer to the Contributing guidelines for more information.

License

Solana AutoEmissions codebase is released under Apache License 2.0.

Disclaimer

By accessing or using Solana AutoEmissions or any of its components, you accept and agree with the Disclaimer.

auto-emissions's People

Contributors

askibin 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.