npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jcc-solidity-utils

v0.0.21

Published

jcc solidity utils

Downloads

58

Readme

jcc-solidity-utils

smart contract utilities for MOAC and Ethereum blockchain

ERC20Factory 部署

以 MOAC 工具部署为例,以太坊工具部署类似

# 创建一个不可动态发行的ERC20通证
jcc_moac_tool --config ~/.jcc_moac_tool/config.test.json \
  --keystore ~/.jcc_moac_tool/0x1234567 \
  --deploy ERC20Factory.json --gas_limit 2000000 \
  --parameters '"SWT COIN","SWTC",18,600000000000,false'

# 部署成功后,测试下
jcc_moac_tool --config ~/.jcc_moac_tool/config.test.json \
  --abi ERC20Factory.json --contractAddr "0x7fb0564d2e838b487979698ee9c6d0fd4aabccda" \
  --method "name"

# 部署一个可以动态增发的
jcc_moac_tool --config ~/.jcc_moac_tool/config.test.json \
  --keystore ~/.jcc_moac_tool/0x1234567 \
  --deploy ERC20Factory.json --gas_limit 2000000 \
  --parameters '"EOS","EOS",18,1000000,true'

# 查询发行量-动态增发的初始值是0,创建指定的参数为最大值
jcc_moac_tool --config ~/.jcc_moac_tool/config.test.json \
  --abi ERC20Factory.json --contractAddr "0x8bbff1ee41772dd6c585056edfebafeebacaa704" \
  --method "totalSupply"

# 动态增发
jcc_moac_tool --config ~/.jcc_moac_tool/config.test.json \
  --keystore ~/.jcc_moac_tool/0x1234567 \
  --abi ERC20Factory.json --contractAddr "0x8bbff1ee41772dd6c585056edfebafeebacaa704" \
  --method "mint" --parameters '"0x1234567", chain3.toSha("10000")' --gas_limit 100000
# 增发后,重新查询供应量

JCCChainList

遵循 BIP44 标准的链定义合约,供 DAPP 查询使用

测试链地址: 0x4d9f2cf99f5f94573f22288af698089a3bd4e2f1 主链地址: 0x761e87f055428d053bb1e666e84ebed94584bdfc

# 通过id查询
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCChainList.json --contractAddr "0x761e87f055428d053bb1e666e84ebed94584bdfc" \
  --method "getById" --parameters '314'

# 通过名称查询
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCChainList.json --contractAddr "0x761e87f055428d053bb1e666e84ebed94584bdfc" \
  --method "getBySymbol" --parameters '"MOAC"'

# 查询登记数量
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCChainList.json --contractAddr "0x761e87f055428d053bb1e666e84ebed94584bdfc" \
  --method "count"

# 查询登记列表
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCChainList.json --contractAddr "0x761e87f055428d053bb1e666e84ebed94584bdfc" \
  --method "getList" --parameters '0,3'

JCCTokenList

通证定义合约,跨链映射合约,供合约和 DAPP 查询使用

测试链地址: 0x4a0d4349e1f32f603fdaaf2c8a083b155baf59c2 主链地址: 0x7df74d3a1e379e0bb83cd0363cfc670df750acfe

# 通过id查询
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCTokenList.json --contractAddr "0x7df74d3a1e379e0bb83cd0363cfc670df750acfe" \
  --method "getById" --parameters '1'

# 通过名称查询
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCTokenList.json --contractAddr "0x7df74d3a1e379e0bb83cd0363cfc670df750acfe" \
  --method "getBySymbol" --parameters '314,"MOAC"'

# 查询登记数量
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCTokenList.json --contractAddr "0x7df74d3a1e379e0bb83cd0363cfc670df750acfe" \
  --method "count"

# 查询登记数量
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCTokenList.json --contractAddr "0x7df74d3a1e379e0bb83cd0363cfc670df750acfe" \
  --method "getList" --parameters '0,3'

# 查询跨链等价通证
jcc_moac_tool --config ~/.jcc_moac_tool/config.json \
  --abi JCCTokenList.json --contractAddr "0x7df74d3a1e379e0bb83cd0363cfc670df750acfe" \
  --method "getCrossList" --parameters '"0xc145773dfe9aef11e528b35df510775c3f6dcfc2678940204a56efbc0398e49a"'
# 跨链查询输出如下:
[
  [
    [
      {
        "_hex": "0x03"
      },
      {
        "_hex": "0x04"
      },
      {
        "_hex": "0x3c"
      },
      # 原生通证的origin字段为0
      "0x0000000000000000000000000000000000000000000000000000000000000000",
      "0x9BD4810a407812042F938d2f69f673843301cfa6/",
      "JCC"
    ],
    [
      {
        "_hex": "0x04"
      },
      {
        "_hex": "0x05"
      },
      {
        "_hex": "0x013b"
      },
      # 映射通证的origin字段为原生通证的chainid+issuer的sha3哈希
      "0xc145773dfe9aef11e528b35df510775c3f6dcfc2678940204a56efbc0398e49a",
      "jGa9J9TkqtBcUoHe2zqhVFFbgUVED6o9or/",
      "JJCC"
    ]
  ]
]