Upgrade to Pro — share decks privately, control downloads, hide ads and more …

IOST ハンズオン

Avatar for YutaSugimura YutaSugimura
September 01, 2019

IOST ハンズオン

Avatar for YutaSugimura

YutaSugimura

September 01, 2019
Tweet

More Decks by YutaSugimura

Other Decks in Programming

Transcript

  1. Contract1 name: トークンのシンボル fullName: トークンの名前 decimal: 少数点以下の桁数 totalSupply: 最⼤発⾏枚数 admin:

    このコントラクトのオーナー(先ほど作ったアカウント名) お好きな設定に変更する (a-z, 0-9, _)のみ
  2. Contract3 トークンの作成 IOST Blockchain API https://developers.iost.io/docs/en/3-smart-contract/IOST-Blockchain-API.html init内部にデプロイ時に 実⾏される関数を書いていく IRC20にあったcreateを使って トークンを作成する

    Blockchain.callWithAuth(“token.iost”, “create”, [args]) create(tokenSymbol, issuer, totalSupply, configJson) // string, string, number, json blockchainは元々⽤意されているAPI 詳しくは⬇ ೝূΛ൐͏Ҿ਺෇͖ͰίϯτϥΫτΛݺͼग़͠
  3. Contract5 _checkToken, _amountを使⽤ トークンの発⾏する関数作成 2. blockchain.callWithAuthを使ってissueを実⾏ issue(tokenSymbol, to, amountStr) //string,

    string, string https://developers.iost.io/docs/en/3-smart-contract/IOST-Blockchain-API.html IOST Blockchain API: https://developers.iost.io/docs/en/3-smart-contract/Token.html IRC20:
  4. Contract6 _checkToken, _amount 送⾦を⾏う為の関数作成 blockchain.callWithAuthを使ってtransferを実⾏ transfer(tokenSymbol, from, to, amountStr, memo)

    //string, string, string, string, string https://developers.iost.io/docs/en/3-smart-contract/IOST-Blockchain-API.html IOST Blockchain API: https://developers.iost.io/docs/en/3-smart-contract/Token.html IRC20:
  5. Contract8 _call, _checkTokenを使⽤ 残⾼確認する関数を作成 IRC20 balanceOf balanceOf(tokenSymbol, from) //string, string

    https://developers.iost.io/docs/en/3-smart-contract/IOST-Blockchain-API.html IOST Blockchain API: https://developers.iost.io/docs/en/3-smart-contract/Token.html IRC20: