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

seele-contract-core

v1.0.6

Published

This command line tool greatly simplifies the compiling and deploying process of multiple seele solidity contracts.

Downloads

11

Readme

Description

This command line tool greatly simplifies the compiling and deploying process of multiple seele solidity contracts.

Installation

# as command line tool
npm i -g seele-contract-core

# as module
npm i seele-contract-core

Usage

# initiate contract
scc init -n mycontract
# creates the following tree
# .
# ├── abi
# ├── byt.json
# ├── conf.json
# ├── deploy.json
# └── src
#
#
# 2 directories, 3 files
# copy your solidity source code files to ./src
# toggle configurations in conf.json

# only compile
scc make -c -n mycontract
# only deploy
scc make -d -n mycontract
# compile and deploy
scc make -cd -n mycontract

Or in code

const path = require('path')
const scc = require('seele-contract-core')

async function sccexample(){
  const root    = await process.cwd()
  const dirname = 'yourContract'
  const project = '.contract'
  scc.init(root, dirname, project)

  const dir = path.join(root, dirname, project)
  const contract = scc.ContractBase(dir)

  // contract.compile()

  // contract.deploy()

  // compile and deploy
  new Promise((resolve, reject)=>{
    resolve('');
  })
  .then((d)=>{
    return contract.compile();
  })
  .then((d)=>{
    return contract.deploy();
  })
  .catch((e)=>{
    console.log(e);
  });
}

API

In your conf.json

  • compiler
    • version: currently only v0.4.24 is made available
  • shard: seele currently has four shards, the network used will be determined through the shard of transactions.privateKey and transactions.fromAddress pair.
  • transactions
    • limit: gas limit of each transaction.
    • depth: wait for how many blocks after transaction packaged.
    • privateKey: private key used for signing transactions.
    • fromAddress: address of signature private key.
  • addressBook:
    • To skip certain contract deployment. Ex: if I've already deployed "SafeMath.sol" at "0xce8b79448f41224413b6e13f5ae624b901070022"
      "addressBook": {
        "SafeMath.sol": "0xce8b79448f41224413b6e13f5ae624b901070022",
      },
    Instead of deploying the contract with another transaction, the contract address will be reused in the next iteration of deployment.
  • constructors:
    • If a contract happen to have a constructor to be a payable contract, the structure to use would be the following
      "myContract.sol": [
        [
          "address[]",
          "uint256"
        ], //abi
        [
          [
            "0x627306090abab3a6e1400e9345bc60c78a8bef57",
            "0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db"
          ],
          "0x416e6e6965",
        ], //value
        1000 //payable amount, 1000 fan
      ]