Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tronwebcompiler

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tronwebcompiler

Describe tronwebcompiler here

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

tronwebcompiler

tron solidity compiler

Installation

npm install --save tronwebcompiler

Usage:

import getCompiler from tronwebcompiler

let test = async function(){
    let compile = await getCompiler();
    let resource = '
    contract Ballot {
                        
                        function test(int32 num1, int32 num2)  constant returns (int32) {
                           
                                return num1*num2;
                           } 
                    }'
    
                    
    
}

let optimize = 1;
let result = compile(source, optimize);
let arrContract = [];
let arrByteCode = [];
let arrAbi = [];
for(var name in result.contracts){
    arrContract.push(name);
    if(result.contracts[name].bytecode){
        bytecode = result.contracts[name].bytecode;
        arrByteCode.push(bytecode);
        var metadata = JSON.parse(result.contracts[name].metadata);
        abi = JSON.stringify(metadata.output.abi);
        arrAbi.push(abi);
    }
}



FAQs

Package last updated on 16 Aug 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc