Skip to content

Commit

Permalink
changelog, readme, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdefinitelyahuman committed Jul 27, 2019
1 parent bb6c870 commit b1ff12f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
0.4.2
-----

- Fix link_code to support 0.5.x
- Remove trailing whitespace on solcx.get_version_string - fixes windows 0.5.x bug

0.4.1
-----

Expand Down
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Py-solc-x allows the use of multiple versions of solc and installs them as neede

## Supported Versions

Py-solc-x can install the following `solc` versions:
Py-solc-x can install the following solc versions:

* Linux and Windows: `>=0.4.11`
* OSX: `>=0.5.0`
Expand Down Expand Up @@ -52,18 +52,15 @@ Version('0.5.7+commit.6da8b019.Linux.gpp')
>>>
```

To install the highest compatible version based on the pragma version string:

```python
>>> from solcx import install_solc_pragma
>>> install_solc_pragma('^0.4.20 || >0.5.5 <0.7.0')
```

To set the version based on the pragma version string - this will use the highest compatible version installed, if you have a compatible version installed, or it will install the highest compatible version:
You can also set the version based on the pragma version string. The highest compatible version will be used:

```python
>>> from solcx import set_solc_version_pragma
>>> set_solc_version_pragma('^0.4.20 || >0.5.5 <0.7.0')
Using solc version 0.5.8
>>> set_solc_version_pragma('^0.4.20 || >0.5.5 <0.7.0', check_new=True)
Using solc version 0.5.8
Newer compatible solc version exists: 0.5.10
```

To view available and installed versions:
Expand All @@ -73,7 +70,14 @@ To view available and installed versions:
>>> get_installed_solc_versions()
['v0.4.25', 'v0.5.3']
>>> get_available_solc_versions()
['v0.5.8', 'v0.5.7', 'v0.5.6', 'v0.5.5', 'v0.5.4', 'v0.5.3', 'v0.5.2', 'v0.5.1', 'v0.5.0', 'v0.4.25', 'v0.4.24', 'v0.4.23', 'v0.4.22', 'v0.4.21', 'v0.4.20', 'v0.4.19', 'v0.4.18', 'v0.4.17', 'v0.4.16', 'v0.4.15', 'v0.4.14', 'v0.4.13', 'v0.4.12', 'v0.4.11']
['v0.5.10', 'v0.5.9', 'v0.5.8', 'v0.5.7', 'v0.5.6', 'v0.5.5', 'v0.5.4', 'v0.5.3', 'v0.5.2', 'v0.5.1', 'v0.5.0', 'v0.4.25', 'v0.4.24', 'v0.4.23', 'v0.4.22', 'v0.4.21', 'v0.4.20', 'v0.4.19', 'v0.4.18', 'v0.4.17', 'v0.4.16', 'v0.4.15', 'v0.4.14', 'v0.4.13', 'v0.4.12', 'v0.4.11']
```

To install the highest compatible version based on the pragma version string:

```python
>>> from solcx import install_solc_pragma
>>> install_solc_pragma('^0.4.20 || >0.5.5 <0.7.0')
```

## Standard JSON Compilation
Expand Down Expand Up @@ -105,7 +109,7 @@ Use the `solcx.compile_standard` function to make use of the [standard-json](htt
## Legacy Combined JSON compilation

```python
>>> from solcx import compile_source, compile_files, link_code
>>> from solcx import compile_source, compile_files
>>> compile_source("contract Foo { function Foo() {} }")
{
'Foo': {
Expand Down Expand Up @@ -145,8 +149,14 @@ Use the `solcx.compile_standard` function to make use of the [standard-json](htt
},
},
}
>>> unlinked_code = "606060405260768060106000396000f3606060405260e060020a6000350463e7f09e058114601a575b005b60187f0c55699c00000000000000000000000000000000000000000000000000000000606090815273__TestA_________________________________90630c55699c906064906000906004818660325a03f41560025750505056"
>>> link_code(unlinked_code, {'TestA': '0xd3cda913deb6f67967b99d67acdfa1712c293601'})
```

## Unlinked Libraries

```python
>>> from solcx import link_code
>>> unlinked_bytecode = "606060405260768060106000396000f3606060405260e060020a6000350463e7f09e058114601a575b005b60187f0c55699c00000000000000000000000000000000000000000000000000000000606090815273__TestA_________________________________90630c55699c906064906000906004818660325a03f41560025750505056"
>>> link_code(unlinked_bytecode, {'TestA': '0xd3cda913deb6f67967b99d67acdfa1712c293601'})
... "606060405260768060106000396000f3606060405260e060020a6000350463e7f09e058114601a575b005b60187f0c55699c00000000000000000000000000000000000000000000000000000000606090815273d3cda913deb6f67967b99d67acdfa1712c29360190630c55699c906064906000906004818660325a03f41560025750505056"
```

Expand All @@ -157,7 +167,7 @@ Use the `solcx.compile_standard` function to make use of the [standard-json](htt
You can use this like:

```python
>>> from solcx import compile_source, compile_files, link_code
>>> from solcx import compile_files

>>> compile_files([source_file_path], import_remappings=["zeppeling=/my-zeppelin-checkout-folder"])
```
Expand All @@ -170,14 +180,14 @@ This project was recently forked from [py-solc](https://github.com/ethereum/py-s

### Tests

Py-solc-x is tested on Linux and Windows with solc versions ``>=0.4.11``.

To run the test suite:

```bash
$ pytest tests/
```

Tests are still a work in progress. The old (some failing) ``py-solc`` tests are available [here](https://github.com/iamdefinitelyahuman/py-solc-x/tree/master/tests-old).

## License

This project is licensed under the [MIT license](LICENSE).
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='py-solc-x',
version='0.4.1',
version='0.4.2',
description="""Python wrapper around the solc binary with 0.5.x support""",
long_description_markdown_filename='README.md',
author='Ben Hauser (forked from py-solc by Piper Merriam)',
Expand Down

0 comments on commit b1ff12f

Please sign in to comment.