https://github.com/alincode/solcjs-core
https://github.com/alincode/solcjs-core
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alincode/solcjs-core
- Owner: alincode
- License: mit
- Created: 2019-01-18T15:58:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T14:19:21.000Z (over 6 years ago)
- Last Synced: 2025-10-03T18:47:31.949Z (10 months ago)
- Language: JavaScript
- Size: 151 KB
- Stars: 2
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# solcjs core

[](https://codecov.io/gh/alincode/solcjs-core)
[](https://david-dm.org/alincode/solcjs-core)
### Install
```sh
npm install solcjs-core
```
### Usage
```js
const solcjsCore = require('solcjs-core');
```
* getVersion
```js
let version = await solcjsCore.getVersion();
```
```js
let version = await solcjsCore.getVersion('v0.5.1-stable-2018.12.03');
```
* solc
```js
let compiler = await solcjsCore.solc();
const sourceCode = `
pragma solidity >0.4.99 <0.6.0;
library OldLibrary {
function someFunction(uint8 a) public returns(bool);
}
contract NewContract {
function f(uint8 a) public returns (bool) {
return OldLibrary.someFunction(a);
}
}
`;
let output = await compiler(sourceCode);
```
## License
MIT © [alincode](https://github.com/alincode/solcjs-core)