{"_id":"@dexon-foundation/dsolc","_rev":"6-b85156de1876c0d2ff96167c3fc6f38c","name":"@dexon-foundation/dsolc","dist-tags":{"latest":"0.5.2"},"versions":{"0.4.25":{"name":"@dexon-foundation/dsolc","version":"0.4.25","description":"Solidity compiler","main":"index.js","bin":{"solcjs":"solcjs"},"scripts":{"lint":"semistandard","prepublish":"node downloadCurrentVersion.js && node verifyVersion.js","pretest":"npm run lint","test":"tape ./test/index.js","coverage":"istanbul cover node_modules/tape/bin/tape ./test/index.js","coveralls":"npm run coverage && coveralls <coverage/lcov.info"},"repository":{"type":"git","url":"git+https://github.com/dexon-foundation/dsolc-js.git"},"keywords":["dexon","ethereum","solidity","compiler"],"author":{"name":"chriseth"},"license":"MIT","bugs":{"url":"https://github.com/dexon-foundation/dsolc-js/issues"},"homepage":"https://github.com/dexon-foundation/dsolc-js#readme","dependencies":{"fs-extra":"^0.30.0","memorystream":"^0.3.1","require-from-string":"^1.1.0","semver":"^5.3.0","yargs":"^4.7.1"},"devDependencies":{"coveralls":"^3.0.0","ethereumjs-util":"^5.1.4","istanbul":"^0.4.5","semistandard":"^11.0.0","tape":"^4.5.1","tape-spawn":"^1.4.2"},"semistandard":{"ignore":["soljson.js"]},"gitHead":"9a826c5be90f8e4ec4fb1d948d187f0a2b2eb883","_id":"@dexon-foundation/dsolc@0.4.25","_npmVersion":"6.4.0","_nodeVersion":"8.11.3","_npmUser":{"name":"boczeratul","email":"boczeratul@gmail.com"},"dist":{"integrity":"sha512-y9GS/bef2xTz90VhmrtBZY5PRaSmcrkE9v39EdWF07TSVA3ZRtPdq2OWeJdbWRU10ozlxokgaNtKq+V0lg/pkw==","shasum":"33f5169420eaa187942b8d88da05d481ec68614f","tarball":"https://registry.npmjs.org/@dexon-foundation/dsolc/-/dsolc-0.4.25.tgz","fileCount":10,"unpackedSize":8309933,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb89M9CRA9TVsSAnZWagAAkjAQAIh31lJpUOp2hKJ4xA3I\nQZlwXQCKNNyzuOyctH1c3rWCROr3ySbI3zXRbinSLcYdGWK0lG7sdl9pZafT\nm3fJO5yo1Z0c1tH9Z75BKhQZP+4/rHUzRo1MclQORkFWKklKC7L8fXygDDe1\ndF3UR7xSMCadJMO2JzEpKYgBH/iKLEPeE5skMQiE1yOnW4/0xMwWIeSGkDwo\nPT0VNfPCw/hZyqBagSibxJ8WRd9TQ1jmxms6wNpol8qd9383VuaNDsbOliDl\ncNxY2bWxzFU4guecVHYn4Il04dDsB495D3jfsZOUIs+oAHHDmPttPfZo1xD4\nf6G6cDpvcifpf8c/kAF0nPRz7TVpst3ELoAQ4c3fYb5T5uLIcMP2WiSsmo9m\n1W7SuNhFkqCr8vw1ZpbsdJcJxX3B38se43BKyb8we0+OHv2FjbaO4hVjCQ2d\nHaMQ0Cp27NDDL+woA1+y8oAZtQzCqvQ85hxK0sFLKZyEW4N2a4aiAakaAzQd\nRBbyH24u5YMDi3c9eTIlQF2UejbQOYPK1jI70yTL66geBOe5vUFCRQkxeCIy\nPN2mrppvj+HiR9Ft7WcWje/LLa5nsyeEuNVFde3LpRGuxoNZzg1d91hOTXuJ\nVEFPo+HyMGY/J1/kfhckZN35UKY6oNZjjzQ9OCuhyRfR0KVru1oa/HVr33ZZ\n3Fs+\r\n=fCMd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLogSpwmeg+wjrVzbM4qi/JQgP31jEn39ylAmTo0leKAIgSLMofa9+Mv2Mab6mJ+JRQqpthAR86b7Mf0CAEEP6SOk="}]},"maintainers":[{"name":"boczeratul","email":"boczeratul@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dsolc_0.4.25_1542705980929_0.2316059823529517"},"_hasShrinkwrap":false},"0.5.0":{"name":"@dexon-foundation/dsolc","version":"0.5.0","description":"DEXON-flavored Solidity compiler","main":"index.js","bin":{"dsolcjs":"dsolcjs"},"scripts":{"lint":"semistandard","prepublish":"node downloadCurrentVersion.js && node verifyVersion.js","pretest":"npm run lint","test":"tape ./test/index.js","coverage":"istanbul cover node_modules/tape/bin/tape ./test/index.js","coveralls":"npm run coverage && coveralls <coverage/lcov.info"},"repository":{"type":"git","url":"git+https://github.com/dexon-foundation/dsolc-js.git"},"keywords":["dexon","ethereum","solidity","compiler"],"author":{"name":"chriseth"},"license":"MIT","bugs":{"url":"https://github.com/dexon-foundation/dsolc-js/issues"},"homepage":"https://github.com/dexon-foundation/dsolc-js#readme","dependencies":{"command-exists":"^1.2.8","fs-extra":"^0.30.0","keccak":"^1.0.2","memorystream":"^0.3.1","require-from-string":"^2.0.0","semver":"^5.5.0","tmp":"0.0.33","yargs":"^11.0.0"},"devDependencies":{"coveralls":"^3.0.0","ethereumjs-util":"^5.2.0","istanbul":"^0.4.5","semistandard":"^12.0.0","tape":"^4.9.1","tape-spawn":"^1.4.2"},"semistandard":{"ignore":["soljson.js"]},"gitHead":"e7b59ea7f85cac6f950ecbc8054ab14ab4f3024f","_id":"@dexon-foundation/dsolc@0.5.0","_npmVersion":"6.4.0","_nodeVersion":"8.11.3","_npmUser":{"name":"boczeratul","email":"boczeratul@gmail.com"},"dist":{"integrity":"sha512-MI4xgHR3BVyts16D7bv+CiId0rJqbvxjscqKm6+yhPOwgNR+Q3XWXatgajvh/etH8yFyHg+fL4Ybu4utUUVDig==","shasum":"b81edb22c8d4ef84140d27ef604fc2f14b1d396c","tarball":"https://registry.npmjs.org/@dexon-foundation/dsolc/-/dsolc-0.5.0.tgz","fileCount":10,"unpackedSize":36243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDz7uCRA9TVsSAnZWagAAim4P/11jEyw24g17bjdrTLn6\n0gq45D3reyhsPqvbIgcgTvX6VY8CNXV8j9bbSCwIWIH4LYapaSpAkpFyGg7h\nIJUbR+KgfyvCagPTn+88zF0wInY7Wogqt0Q9mqF4rlmd/LaiVXwcloKhPIz/\ntmC9L0qtXh2PggNcIFyy0+Mt/My7RDaEvoYEnowErM0om/vxpvQgEm94xFwD\nh7Ge52zv5uHtJ1P4GmrDZK1HyQac4eqzRZPOxh0WqcjJ5Hm/I4EwIgtBYqbb\nKcK5NYAWKH4AHXdgK0lWEzxyzLK2/BlH9pfXcTVOF+beytvy9eCM5mSZXp3d\ntHsupClwqZWRKfuXjlz1eQDdRW/qBPf+efwwSdNY0X3vrCnYNZDCWgShOoXd\n7/3eTLkPEwbTaefVkg8cX6wlMU7Q5QSY19khMlR+DrtLkI5c4gcbQzSDeW1q\ncxwUsReHOz9lqADb5R9WK981XloEDB2D0Xz1y7wfr6WZldBSJ9mFd6JIpEPp\nH140dU1z8eLlRuUmG8Ko53aSHn6xZfkDAq9hQ5pZVwwwxc7cIisbembF3PlW\n0poNUoWqCBZqnZp0YLadrtN0XoYIxuwFUcHBZzRuU+QynXEAMQmXhlRopq70\nPQjqN1YgJONqJUhW7gfdk7gUgp9W70fVQ9q+SKXnIK6MrNeyIrDgWp87kzd5\newE2\r\n=oaWQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG7ijVnG9AD2tMXLZOwAJvl/si2IzFTBA+zkCIzEPPReAiANjMvoxFaHMccWcP0Rp3CwNrJyTHqq5tUWcf+5hi3xOw=="}]},"maintainers":[{"email":"boczeratul@gmail.com","name":"boczeratul"},{"email":"dev@cobinhood.com","name":"cobinhood-dev"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dsolc_0.5.0_1544503021639_0.6938448640424348"},"_hasShrinkwrap":false},"0.5.1":{"name":"@dexon-foundation/dsolc","version":"0.5.1","description":"DEXON-flavored Solidity compiler","main":"index.js","bin":{"dsolcjs":"dsolcjs"},"scripts":{"lint":"semistandard","prepublish":"node downloadCurrentVersion.js && node verifyVersion.js","pretest":"npm run lint","test":"tape ./test/index.js","coverage":"istanbul cover node_modules/tape/bin/tape ./test/index.js","coveralls":"npm run coverage && coveralls <coverage/lcov.info"},"repository":{"type":"git","url":"git+https://github.com/dexon-foundation/dsolc-js.git"},"keywords":["dexon","ethereum","solidity","compiler"],"author":{"name":"chriseth"},"license":"MIT","bugs":{"url":"https://github.com/dexon-foundation/dsolc-js/issues"},"homepage":"https://github.com/dexon-foundation/dsolc-js#readme","dependencies":{"command-exists":"^1.2.8","fs-extra":"^0.30.0","keccak":"^1.0.2","memorystream":"^0.3.1","require-from-string":"^2.0.0","semver":"^5.5.0","tmp":"0.0.33","yargs":"^11.0.0"},"devDependencies":{"coveralls":"^3.0.0","ethereumjs-util":"^5.2.0","istanbul":"^0.4.5","semistandard":"^12.0.0","tape":"^4.9.1","tape-spawn":"^1.4.2"},"semistandard":{"ignore":["soljson.js"]},"gitHead":"88b82316f0542a153e2567fdfd1b8f2341d4661e","_id":"@dexon-foundation/dsolc@0.5.1","_npmVersion":"6.4.0","_nodeVersion":"8.11.3","_npmUser":{"name":"boczeratul","email":"boczeratul@gmail.com"},"dist":{"integrity":"sha512-EF3x99KSSjQsD+GZTSoR5maBzTyKQsqZY38xkgvi3DF1AZiFTcaVPKFhzT4yNyp3bXRLzEyiyagQiESkBpQmMA==","shasum":"c69fe2858f8e12db581117182a05a2c6b6fc9ef6","tarball":"https://registry.npmjs.org/@dexon-foundation/dsolc/-/dsolc-0.5.1.tgz","fileCount":10,"unpackedSize":36243,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcDz8KCRA9TVsSAnZWagAAZIUQAIeywdXOvy9sXP1v2G1/\naobpArFzpLlbCZ+1jitt5MSxEuO9an/gY6uEs01DXJoCnesY484yhb+jVQoc\naLBkXHvhNoH35Wi83ffD1o+tuXqpqXQa0axUZJRDDdYi5W0DoDoAAz2DRwGA\nyrtnqenudg8OyEU5IsOHIb4mFXTlgfuV7IrZVOdJ0CRtSy5LjUm+OqkdWzt/\n0eaggVj4TXx6Xc9AHI+JwaUwOyP9H2RQLRz2x6C+1rCRPFBWTIeSsDHyU9tO\nGfNg0Md2X9tKWQoF5I4HMMPIon3EdiZcJF9IAAb4qKB9q0qRd9OrdeSYbIGG\nnJ6hDHRnL8nnpUpeLjGwpsLbw35guhRMmUPfdJVzzG7QEHAstB6Hd2h0PRKo\n/L71xBkENZq+/rsOn8+9KHKuuiLAlORivWXFO4LUBKSFm+zqYBbdSaAkry2R\nlnBWjKBafLI7RKps3/4YYcFC6qIDRQf4dqzpHqC3IoE+e0G+wXhWREDvitUW\nx2LJASB6gbg5zmdiW8pSK0x1voa8eQNWWmMqJkn4n6aD5xk9cC1lqBx1KeEQ\n+85gVRDVlz8L+WlSDqd0BmMqLdHkflyFa7XQFmmwYSPNkZo3y4TAQuwwf8RP\nlDmVLMGwLGrNjDmTk3y9ARotFZ7bUMbi0aUnnueUB5Cj+r55m3/yw50gtx/Y\naw+r\r\n=u2NA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDTTZbjifx4g8EiM15j295Njj7yF2UZiDMtsOCr85xhEAiEA2tp4p89SHw2W8B2UZDtgR0EisHTbbWGCA/iO467rHe4="}]},"maintainers":[{"email":"boczeratul@gmail.com","name":"boczeratul"},{"email":"dev@cobinhood.com","name":"cobinhood-dev"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dsolc_0.5.1_1544503050027_0.820164768053069"},"_hasShrinkwrap":false},"0.5.2":{"name":"@dexon-foundation/dsolc","version":"0.5.2","description":"DEXON-flavored Solidity compiler","main":"index.js","bin":{"dsolcjs":"dsolcjs"},"scripts":{"lint":"semistandard","prepublish":"node downloadCurrentVersion.js && node verifyVersion.js","pretest":"npm run lint","test":"tape ./test/index.js","coverage":"istanbul cover node_modules/tape/bin/tape ./test/index.js","coveralls":"npm run coverage && coveralls <coverage/lcov.info"},"repository":{"type":"git","url":"git+https://github.com/dexon-foundation/dsolc-js.git"},"keywords":["dexon","ethereum","solidity","compiler"],"author":{"name":"chriseth"},"license":"MIT","bugs":{"url":"https://github.com/dexon-foundation/dsolc-js/issues"},"homepage":"https://github.com/dexon-foundation/dsolc-js#readme","dependencies":{"command-exists":"^1.2.8","fs-extra":"^0.30.0","keccak":"^1.0.2","memorystream":"^0.3.1","require-from-string":"^2.0.0","semver":"^5.5.0","tmp":"0.0.33","yargs":"^11.0.0"},"devDependencies":{"coveralls":"^3.0.0","ethereumjs-util":"^5.2.0","istanbul":"^0.4.5","semistandard":"^12.0.0","tape":"^4.9.1","tape-spawn":"^1.4.2"},"semistandard":{"ignore":["soljson.js"]},"gitHead":"fef5406b803e19e97250c6b2dc7bfeda7051e5a8","_id":"@dexon-foundation/dsolc@0.5.2","_nodeVersion":"8.10.0","_npmVersion":"6.8.0","dist":{"integrity":"sha512-J4GWCfAra6k/+OLsOX5qmpJ/HZ7wAiEPZ/xGC0KFam85+tdtgevXvma6C19Ejzjsu9wIMRAPds2/8zxtNXF+fQ==","shasum":"1e47977dda5ad63fa50974c0b38976c8ccadb92a","tarball":"https://registry.npmjs.org/@dexon-foundation/dsolc/-/dsolc-0.5.2.tgz","fileCount":11,"unpackedSize":37901,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchHLpCRA9TVsSAnZWagAAZBYP/1FNUwxI5kDVLSlBcZI4\nPsgMu85zMhzx5VcAnfSaZCg3+YpbYSMHUkV+Ut8Rvy9S3LRrBorqLkElN5Qu\npgTYHIG79ACtxrSLfIFmbAwn6Fr0+vbHzwR4bIfh2dBLwKvVnOleQVLfSwBc\nDExxzKMYlqOZBWgXM/jBpqm/nGOk84CSBrJTZbDi/tEeGCD1WKMtoC4aJ4eL\n3C88PZt5vr0s2DXMrTmM+RbB5i8ZDLzlV29pCd3mxBfTD6UPbOSN9dx/CajT\nd6ib7Dicn1Yv28fZGGt+D50hiEE/6TB2aM81vaMpDRYR8Sy8+wdi/HZzsoIc\nMhT0/7bAXVBrtNeWBr6PAxT2Z/WJnr1tcfxCWxE7Qv0lm2vJIyctXmlxq5Vr\nqMi2wIgq2vxDomC3Q+W8WbDhzLbSFWXdxqconq0ILrbLT/nie2SCfJxW/190\ngiPutD2adMM5p+7EOLCbyEqx87Oo5jYClpLpQXcuCz7o12EU49RvgyiYgIJa\nrgxcgZioVIzperpaJUtRlwYO6R63GcJgZFNfrqlbB7oOeDp33bKp0hSfblSj\nFUFeoKFW/jVjU750SIgweAtaraC+hxt0xfmUjrKHBvN++r94Ymc7RuxSmZhk\nse4RBKfGk0MujJUQsH+TxQRQHJ0x15gesKPHxSBTCE3Hk/dGxILy+krLC0uB\nhRo5\r\n=vxZp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG2qMILeuovMB8ZT6sNaVNzL/sVGw6Ncr+/3O6m56e9gAiBbgl4tm1Gpvej6h71oneWt5hMfe34fVJ7sWl0lsyp7lA=="}]},"maintainers":[{"email":"boczeratul@gmail.com","name":"boczeratul"},{"email":"chaoweichiu@gmail.com","name":"chaoweichiu"},{"email":"dev@cobinhood.com","name":"cobinhood-dev"}],"_npmUser":{"name":"chaoweichiu","email":"chaoweichiu@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dsolc_0.5.2_1552184040654_0.7425088000910225"},"_hasShrinkwrap":false}},"time":{"created":"2018-11-20T09:26:20.764Z","0.4.25":"2018-11-20T09:26:21.156Z","modified":"2022-04-05T04:12:31.938Z","0.5.0":"2018-12-11T04:37:01.847Z","0.5.1":"2018-12-11T04:37:30.173Z","0.5.2":"2019-03-10T02:14:00.781Z"},"maintainers":[{"email":"boczeratul@gmail.com","name":"boczeratul"},{"email":"chaoweichiu@gmail.com","name":"chaoweichiu"},{"email":"dev@cobinhood.com","name":"cobinhood-dev"}],"description":"DEXON-flavored Solidity compiler","homepage":"https://github.com/dexon-foundation/dsolc-js#readme","keywords":["dexon","ethereum","solidity","compiler"],"repository":{"type":"git","url":"git+https://github.com/dexon-foundation/dsolc-js.git"},"author":{"name":"chriseth"},"bugs":{"url":"https://github.com/dexon-foundation/dsolc-js/issues"},"license":"MIT","readme":"[![Build Status](https://img.shields.io/travis/ethereum/solc-js.svg?branch=master&style=flat-square)](https://travis-ci.org/ethereum/solc-js)\n[![CircleCI](https://img.shields.io/circleci/project/github/ethereum/solc-js/master.svg?style=flat-square)](https://circleci.com/gh/ethereum/solc-js/tree/master)\n[![Coverage Status](https://img.shields.io/coveralls/ethereum/solc-js.svg?style=flat-square)](https://coveralls.io/r/ethereum/solc-js)\n\n# dsolc-js\nJavaScript bindings for the [DEXON-flavored Solidity compiler](https://github.com/dexon-foundation/dsolidity).\n\nUses the Emscripten compiled Solidity found in the [dsolc-bin repository](https://github.com/dexon-foundation/dsolc-bin).\n\n## Node.js Usage\n\nTo use the latest stable version of the Solidity compiler via Node.js you can install it via npm:\n\n```bash\nnpm install @dexon-foundation/dsolc\n```\n\n### Usage on the Command-Line\n\nIf this package is installed globally (`npm install -g @dexon-foundation/dsolc`), a command-line tool called `dsolcjs` will be available.\n\nTo see all the supported features, execute:\n\n```bash\ndsolcjs --help\n```\n\nNote: this commandline interface is not compatible with `dsolc` provided by the Solidity compiler package and thus cannot be\nused in combination with an Ethereum client via the `eth.compile.solidity()` RPC method. Please refer to the\n[Solidity compiler documentation](https://solidity.readthedocs.io/) for instructions to install `dsolc`.\n\n### Usage in Projects\n\nThere are two ways to use `dsolc`:\n1) Through a high-level API giving a uniform interface to all compiler versions\n2) Through a low-level API giving access to all the compiler interfaces, which depend on the version of the compiler\n\n#### High-level API\n\nThe high-level API consists of a single method, `compile`, which expects the [Compiler Standard Input and Output JSON](https://solidity.readthedocs.io/en/v0.5.0/using-the-compiler.html#compiler-input-and-output-json-description).\n\nIt also accepts an optional callback function to resolve unmet dependencies. This callback receives a path and must synchronously return either an error or the content of the dependency as a string.\nIt cannot be used together with callback-based, asynchronous, filesystem access. A workaround is to collect the names of dependencies, return an error, and keep re-running the compiler until all\nof them are resolved.\n\n*Note*: as an intermittent backwards compatibility feature, between versions 0.5.0 and 0.5.2, `compileStandard` and `compileStandardWrapper` also exists and behave like `compile` does.\n\n#### Example usage without the import callback\n\nExample:\n```javascript\nvar dsolc = require('@dexon-foundation/dsolc')\n\nvar input = {\n\tlanguage: 'Solidity',\n\tsources: {\n\t\t'test.sol': {\n\t\t\tcontent: 'contract C { function f() public { } }'\n\t\t}\n\t},\n\tsettings: {\n\t\toutputSelection: {\n\t\t\t'*': {\n\t\t\t\t'*': [ '*' ]\n\t\t\t}\n\t\t}\n\t}\n}\n\nvar output = JSON.parse(dsolc.compile(JSON.stringify(input)))\n\n// `output` here contains the JSON output as specified in the documentation\nfor (var contractName in output.contracts['test.sol']) {\n\tconsole.log(contractName + ': ' + output.contracts['test.sol'][contractName].evm.bytecode.object)\n}\n```\n\n#### Example usage with import callback\n\n```javascript\nvar dsolc = require('@dexon-foundation/dsolc')\n\nvar input = {\n\tlanguage: 'Solidity',\n\tsources: {\n\t\t'test.sol': {\n\t\t\tcontent: 'import \"lib.sol\"; contract C { function f() public { L.f(); } }'\n\t\t}\n\t},\n\tsettings: {\n\t\toutputSelection: {\n\t\t\t'*': {\n\t\t\t\t'*': [ '*' ]\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction findImports (path) {\n\tif (path === 'lib.sol')\n\t\treturn { contents: 'library L { function f() internal returns (uint) { return 7; } }' }\n\telse\n\t\treturn { error: 'File not found' }\n}\n\nvar output = JSON.parse(dsolc.compile(JSON.stringify(input), findImports))\n\n// `output` here contains the JSON output as specified in the documentation\nfor (var contractName in output.contracts['test.sol']) {\n\tconsole.log(contractName + ': ' + output.contracts['test.sol'][contractName].evm.bytecode.object)\n}\n```\n\n#### Low-level API\n\nThe low-level API is as follows:\n- `dsolc.lowlevel.compileSingle`: the original entry point, supports only a single file\n- `dsolc.lowlevel.compileMulti`: this supports multiple files, introduced in 0.1.6\n- `dsolc.lowlevel.compileCallback`: this supports callbacks, introduced in 0.2.1\n- `dsolc.lowlevel.compileStandard`: this works just like `compile` above, but is only present in compilers after (and including) 0.4.11\n\nFor examples how to use them, please refer to the README of the above mentioned dsolc-js releases.\n\n### Using with Electron\n\n**Note:**\nIf you are using Electron, `nodeIntegration` is on for `BrowserWindow` by default. If it is on, Electron will provide a `require` method which will not behave as expected and this may cause calls, such as `require('@dexon-foundation/dsolc')`, to fail.\n\nTo turn off `nodeIntegration`, use the following:\n\n```javascript\nnew BrowserWindow({\n\twebPreferences: {\n\t\tnodeIntegration: false\n\t}\n})\n```\n\n### Using a Legacy Version\n\nIn order to compile contracts using a specific version of Solidity, the `dsolc.loadRemoteVersion(version, callback)` method is available. This returns a new `dsolc` object that uses a version of the compiler specified. \n\nYou can also load the \"binary\" manually and use `setupMethods` to create the familiar wrapper functions described above:\n`var dsolc = dsolc.setupMethods(require(\"/my/local/soljson.js\"))`.\n\n### Using the Latest Development Snapshot\n\nBy default, the npm version is only created for releases. This prevents people from deploying contracts with non-release versions because they are less stable and harder to verify. If you would like to use the latest development snapshot (at your own risk!), you may use the following example code.\n\n```javascript\nvar dsolc = require('@dexon-foundation/dsolc')\n\n// getting the development snapshot\ndsolc.loadRemoteVersion('latest', function (err, solcSnapshot) {\n\tif (err) {\n\t\t// An error was encountered, display and quit\n\t} else {\n\t\t// NOTE: Use `solcSnapshot` here with the same interface `solc` has\n\t}\n})\n```\n\n### Linking Bytecode\n\nWhen using libraries, the resulting bytecode will contain placeholders for the real addresses of the referenced libraries. These have to be updated, via a process called linking, before deploying the contract.\n\nThe `linker` module (`require('@dexon-foundation/dsolc/linker')`) offers helpers to accomplish this.\n\nThe `linkBytecode` method provides a simple helper for linking:\n\n```javascript\nvar linker = require('@dexon-foundation/dsolc/linker')\n\nbytecode = linker.linkBytecode(bytecode, { 'MyLibrary': '0x123456...' })\n```\n\nAs of Solidity 0.4.11 the compiler supports [standard JSON input and output](https://solidity.readthedocs.io/en/develop/using-the-compiler.html#compiler-input-and-output-json-description) which outputs a *link references* map. This gives a map of library names to offsets in the bytecode to replace the addresses at. It also doesn't have the limitation on library file and contract name lengths.\n\nThere is a method available in the `linker` module called `findLinkReferences` which can find such link references in bytecode produced by an older compiler:\n\n```javascript\nvar linker = require('@dexon-foundation/dsolc/linker')\n\nvar linkReferences = linker.findLinkReferences(bytecode)\n```\n\n### Updating the ABI\n\nThe ABI generated by Solidity versions can differ slightly, due to new features introduced.  There is a tool included which aims to translate the ABI generated by an older Solidity version to conform to the latest standard.\n\nIt can be used as:\n```javascript\nvar abi = require('@dexon-foundation/dsolc/abi')\n\nvar inputABI = [{\"constant\":false,\"inputs\":[],\"name\":\"hello\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"type\":\"function\"}]\nvar outputABI = abi.update('0.3.6', inputABI)\n// Output contains: [{\"constant\":false,\"inputs\":[],\"name\":\"hello\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"payable\":true,\"type\":\"function\"},{\"type\":\"fallback\",\"payable\":true}]\n\n```\n\n### Formatting old JSON assembly output\n\nThere is a helper available to format old JSON assembly output into a text familiar to earlier users of Remix IDE.\n\n```\nvar translate = require('@dexon-foundation/dsolc/translate')\n\n// assemblyJSON refers to the JSON of the given assembly and sourceCode is the source of which the assembly was generated from\nvar output = translate.prettyPrintLegacyAssemblyJSON(assemblyJSON, sourceCode)\n```\n\n## Browser Usage\n\nAdd the version of `solc` you want to use into `index.html`:\n\n```html\n<script type=\"text/javascript\" src=\"https://solc-bin.ethereum.org/bin/{{ SOLC VERSION }}.js\"></script>\n```\n\n(Alternatively use `https://solc-bin.ethereum.org/bin/soljson-latest.js` to get the latests version.)\n\nThis will load `solc` into the global variable `window.Module`. Then use this inside Javascript as:\n\n```javascript\nvar wrapper = requrie('solc/wrapper')\nvar solc = wrapper(window.Module)\n\n```\n\nOr in ES6 syntax:\n```javascript\nimport * as wrapper from 'solc/wrapper'\nconst solc = wrapper(window.Module)\n```\n\nAlternatively, to iterate the releases, one can load `list.js` from `solc-bin`:\n```html\n<script type=\"text/javascript\" src=\"https://solc-bin.ethereum.org/bin/list.js\"></script>\n```\n\nThis will result in two global variables, `windows.soljsonReleases` listing all releases and `window.soljsonSources` listing all nightly builds and releases.\n","readmeFilename":"README.md"}