1.2.0 • Published 1 year ago

@antchain/mysolidity v1.2.0

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@antchain/mysolidity

Solidity smart contract compiler for AntChain.

Usage In Command

npm i @antchain/mysolidity -g
mysolc compile <your sol file path>

Ant you can use arg for some setting like:

mysolc compile solidity/index.sol --debug --targetName test --solcConfig {\"optimizer\":{\"runs\":400}}

mysolc help compile to find more info, and use DEBUG=antchain:* for view detail log.

Usage In NodeJS

npm i @antchain/mysolidity --save-dev
const { compile } = require('@antchain/mysolidity');

compile({
  contractEntryPath: 'path/to/YourContract.sol',
  targetPath: 'path/to/dist',
  targetName: 'index',
  debug: true,
  solcConfig: {
    optimizer: {
      enabled: true,
      runs: 200,
    },
  },
});

Usage In Browser

npm i @antchain/mysolidity --save-dev
import { compileWithWebWorker } from '@antchain/mysolidity/browser';

const result = await compileWithWebWorker({
  files: [
    {
      sourceName: 'index.sol',
      content: `your code here`,
    },
  ],
  entryName: 'index.sol',
});

Docs

https://opendocs.antchain.antgroup.com/myfish/contract-deploy