定制 muvon/bitclout-creator-coin 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

muvon/bitclout-creator-coin

Composer 安装命令:

composer require muvon/bitclout-creator-coin

包简介

Implementation of creator coin curve of BitClout

README 文档

README

This package allows to follow the bonding curve of creator coins of BitClout project

Installation

To install it just use composer

composer require muvon/bitclout-creator-coin

Usage

First initialiization

  1. You can create brand new creator coin just by passing reward basis points before you go to buy and sell

    use Muvon\Bitclout\CreatorCoin;
    $Coin = CreatorCoin::create(0); // pass reward basis points
  2. You can initialize creator coin by locked amount and coins sold

    use Muvon\Bitclout\CreatorCoin;
    $Coin = CreatorCoin::create(0); // pass reward basis points
    // Watermark is optional
    $Coin->init(1000, 1000, 0); // locked, supply and watermark in nanos

Emulate buys

One you created object you can buy and sell using buy and sell methods

Lets buy for 1 $CLOUT

$Coin->buy(1 * 10 ** 9);

// Check rate, locked and supply
var_dump($Coin->getLocked());
var_dump($Coin->getSupply());
var_dump($Coin->getRate());

// Check info about minting of last buy
var_dump($Coin->getLastBuy());

Sell is easy as buy just pass creator coins in nanos

$Coin->sell(1 * 10 ** 9);

Strategies

BitClout fixed some issues and fully changed creator coin stretegies after initial launch. To control emulation of it you need to pass strategy byself or set block height by method.

// Latest strategy when founder get reward in $CLOUT
$Coin->setStrategy('reward');

// salamon bug fix strategy when founder always get reward in coins
$Coin->setStrategy('minting');

// Watermark is a initial strategy of BitClout blockchain, once supply reached no more reward minted for creator
$Coin->setStrategy('watermark');

// Or just set it with block height
$Coin->setStrategyByHeight(1000);

Tests

  • Buy new creator
  • Sell creator coin
  • Watermark strategy
  • Init locked supply

统计信息

  • 总下载量: 12
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固