[feature request] exact solc compiler version string on solc.version()
- Dominant language
- TypeScript
- Stars
- 1.5k
- Forks
- 349
- Avg merge
- 8m
- Merged PRs (30d)
- 1
Description
It would be handy to add another API like
```solidity
var versions = solc.version('0.5.7');
/*versions outputs [{
{
"path": "soljson-v0.5.7-nightly.2019.3.21+commit.ebb8c175.js",
"version": "0.5.7",
"prerelease": "nightly.2019.3.21",
"build": "commit.ebb8c175",
"longVersion": "0.5.7-nightly.2019.3.21+commit.ebb8c175",
"keccak256": "0xb8c40183cad60589ad1bbec54df5cd9e84c16899a6fbf09d42ccfbc1e9a41157",
"urls": [
"bzzr://1bdd502109be82a214deaac122c27731d3c42cd5855532493ef5050bb5197a25"
]
},
...
{
"path": "soljson-v0.5.7+commit.6da8b019.js",
"version": "0.5.7",
"build": "commit.6da8b019",
"longVersion": "0.5.7+commit.6da8b019",
"keccak256": "0x20fdb5337e832c6d0fa736d8506241e5a6cf0ccd3d6611069d920cff5a9bc2c4",
"urls": [
"bzzr://b1a85faf1d9909bb38d44b2d34d0c9aac0a0d4cbbee45ad063c75221e4ee68b6"
]
}
*/
var solcVersion = solc.version('0.5.7', ['major', 'nightly']);
// solcVersion, if given major option, should be:
/* [
{
"path": "soljson-v0.5.7+commit.6da8b019.js",
"version": "0.5.7",
"build": "commit.6da8b019",
"longVersion": "0.5.7+commit.6da8b019",
"keccak256": "0x20fdb5337e832c6d0fa736d8506241e5a6cf0ccd3d6611069d920cff5a9bc2c4",
"urls": [
"bzzr://b1a85faf1d9909bb38d44b2d34d0c9aac0a0d4cbbee45ad063c75221e4ee68b6"
]
}
]
*/
```
one example use case that could benefits from this is solcjs loadRemote during CI based on contract's requirement, where the CI config script doesn't necessary know the long Version of the solc.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the solc.version() and solcjs loadRemote entry points mentioned in the issue, then trace how compiler versions are selected. Done means the API can return the requested exact long version and filter results by options such as major or nightly, including the metadata fields shown in the examples.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- solidity, typescript
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100