Giter VIP home page Giter VIP logo

irc100's Introduction

irc100 protocol

Token Economic

  • Token: iOSI
  • Supply: 880000000
  • limit: 1000

See Actions below:

  • Deploy: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/deploy ["IOSI", "880000000", "1000"]
  • Mint: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/mint ["IOSI", "1000"]
  • Transfer: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/transfer ["IOSI", "1", "address"]
  • List: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/list ["IOSI", "1", "100"]
  • Unlist: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/unlist ["IOSI", "1"]
  • Buy: Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx/buy ["IOSI", "1"]

Mint with nodejs

  1. Install Node.js
  2. Create a directory,such as IRC100Mint
  3. Open IRC100Mint, execute command: npm init
  4. Execute command: npm install iost
  5. Create an index.js file,copy the code below
  6. Run: node index.js
import iost from 'iost';
import bs58 from 'bs58';

const {IOST, RPC, HTTPProvider, Tx, KeyPair} = iost;

async function main() {
  const rpc = new RPC(new HTTPProvider('http://18.209.137.246:30001'));
  const instance = new IOST();
  instance.setRPC(rpc);

  const account = new iost.Account("Input your name");
  const kp = new KeyPair(bs58.decode("Your secret key"));
  account.addKeyPair(kp, "owner");
  account.addKeyPair(kp, "active");
  instance.setAccount(account);

  const mintCount = 10; // max is 10, otherwise will killed
  const tx = new Tx(1, buyCount * 45000);
  tx.actions = Array.from({ length: mintCount }).map(() => ({
    contract: 'Contract6vU3ZWL57jQeFpbuqUxQfL5PGeFJekWrDG2WVGjWqrKx',
    actionName: 'mint',
    data: JSON.stringify(['IOSI', '1000'])
  }))
  tx.amount_limit = [{
    token: 'iost',
    value: 'unlimited'
  }];

  instance.signAndSend(tx).on('pending', console.log).on('success', console.log).on('failed', console.error);
}

main().catch(console.error);

Monitor

get transaction tx_receipt

deploy

{op: "deploy", tick: "IOSI", max: "880000000", lim: "1000" }

mint

{op: "mint", tick: "IOSI", amt: "1000", id: "1" }

transfer

{op: "transfer", tick: "IOSI", id: "1", lim: "1000", from: "abc", to: "def" }

list

{op: "list", tick: "IOSI", id: "1", owner: "abc", price: "100" }

unlist

{op: "unlist", tick: "IOSI", id: "1", owner: "abc" }

buy

{op: "buy", tick: "IOSI", id: "1", owner: "abc", price: "100", buyer: "abc", seller: "def" }

irc100's People

Contributors

zzcwoshizz avatar pishontron 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.