Skip to content

Commit

Permalink
[Doc] Update README, Changelog, and documents for 0.1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hydai committed Apr 29, 2020
1 parent 5fe6e44 commit db6a689
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 12 deletions.
27 changes: 27 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
[//]: # (SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception)

### 0.1.0 (2020-04-29)

Language Features:

* Solidity:
* Support abi.encode and abi.encodePacked. (including array type) [Experimental]

Compiler Features:

* Support optimization options:
* `--O0`: Disable optimizations
* `--O1`: Enable trivial optimizations
* `--O2`: Enable default optimizations
* `--O3`: Enable expensive optimizations
* `--Os`: Enable default optimizations for size
* `--Oz`: Enable expensive optimizations for size
* Support EVM backend via [EVM\_LLVM 8](https://github.com/etclabscore/evm_llvm/tree/evm_80)
* In current stage, SOLL will generate LLVM IR for EVM backend target only.
* Developers should use generated LLVM IR files and compile them with llc from EVM\_LLVM 8 to get EVM bytecodes.
* Disable integer lowering when using EVM backend. Only allow 256 bits integer type.

Bugfixes:

* Fix bad APInt trunc in parser
* Fix bad array size and index trunc in codegen
* Fix syntax error on `revert()` and array access

### 0.0.6 (2020-03-31)

Language Features:
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ To get started with our demonstration, you will need to prepare two components a
> docker pull secondstate/soll
```

- Get Source Code from Github and checkout to the latest version, 0.0.6.
- Get Source Code from Github and checkout to the latest version, 0.1.0.
```bash
> git clone --recursive https://github.com/second-state/soll.git
> cd soll
> git checkout 0.0.6
> git checkout 0.1.0
```

## 3.2 Launch Environment
Expand Down Expand Up @@ -203,6 +203,12 @@ at block: 1115129 (Tue, 07 Apr 2020 06:51:46 UTC)
// Initialize txhash for storing transaction hash of deployed contract.
> var txhash = "0x";

// Create deployment parameters
> var params = {
from: fromAccount,
data: bytecode,
gas: 5000000
};

// Deploy smart contract
> contract.new(params,
Expand Down
4 changes: 2 additions & 2 deletions doc/guides/DevGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ soll
> docker pull secondstate/soll
```

- Get Source Code from Github and checkout to the latest version, 0.0.6.
- Get Source Code from Github and checkout to the latest version, 0.1.0.
```bash
> git clone --recursive https://github.com/second-state/soll.git
> cd soll
> git checkout 0.0.6
> git checkout 0.1.0
```

### Launch Docker Environment
Expand Down
102 changes: 97 additions & 5 deletions doc/guides/FeatureGuideForSolidity.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,104 @@

In this guide, we will list all Solidity language features and briefly summarize the current status and limitations about SOLL implementation.

Below will describe some unimplemented language features.
### Supported Language Features

- Contract declaration
- Constructor without parameters
- Type support
- Value types: `bool`, `int`, `uint`, `address`
- Literal types: `Address Literals`, `Rational and Integer Literals`, `String Literals`, `Hexadecimal Literals`
- Mapping types: `mapping`
- String types: `string`
- Array types:
- Support compile-time fixed size array
- Fixed-Size *byte arrays*
- Dynamically-Size *byte arrays*
- Struct types
- Support both implicit/explicit type casting
- Storage declaration
- Event declaration and emit event statements
- Support keywords `event`, `emit`
- Function declaration
- Visibility: `public`, `private`, `internal`, `external`
- State Mutability `view`, `pure`
- Support `payable`
- Support fallback function declaration and keyword `fallback`
- Units and Globally Available Variables
- Ether Units: `ether`, `finney`, `szabo`, `wei`
- Time Units: `weeks`, `days`, `hours`, `minutes`, `seconds`
- Members of Address Types:
- `<address>.balance (uint256)`
- `<address payable>.transfer(uint256 amount)`
- `<address payable>.send(uint256 amount) returns (bool)`
- Block and Transaction Properties:
- `blockhash(uint blockNumber) returns (bytes32)`
- `block.coinbase (address payable)`
- `block.difficulty (uint)`
- `block.gaslimit (uint)`
- `block.number (uint)`
- `block.timestamp (uint)`
- `gasleft() returns (uint256)`
- `msg.data (bytes calldata)`
- `msg.sender (address payable)`
- `msg.sig (bytes4)`
- `msg.value (uint)`
- `now (uint)`
- `tx.gasprice (uint)`
- `tx.origin (address payable)`
- ABI Encoding and Decoding Functions(*Experimental, Unstable*):
- `abi.encode(...) returns (bytes memory)`
- `abi.encodePacked(...) returns (bytes memory)`
- Contract Related: `this`
- Error handling
- Support `require()`, `revert()`
- Grammar and statements
- Binary operators
- Unary operators
- Exponentiation operators
- Condition statements: `if`, `else`
- Function call statements
- Loop statements: `while`, `do..while`, `for` and nested loop statements are also supported.

### Unimplemented Language Features / Known Issues

- Library declaration
- Modifier declaration
- Multiple classes
- Keyword `library` is not yet supported.
- Types
- Contract types
- Function types
- Enums
- Fixed Point Numbers
- Dynamic size arrays
- Units and Globally Available Variables
- ABI Encoding and Decoding Functions:
- `abi.decode(bytes memory encodedData, (...)) returns (...)`
- `abi.encodeWithSelector(bytes4 selector, ...) returns (bytes memory)`
- `abi.encodeWithSignature(string memory signature, ...) returns (bytes memory)`
- Mathematical and Cryptographic Functions:
- `addmod(uint x, uint y, uint k) returns (uint)`
- `mulmod(uint x, uint y, uint k) returns (uint)`
- `keccak256(bytes memory) returns (bytes32)`
- `sha256(bytes memory) returns (bytes32)`
- `ripemd160(bytes memory) returns (bytes20)`
- `ecrecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) returns (address)`
- Members of Address Types:
- `<address>.call(bytes memory) returns (bool, bytes memory)`
- `<address>.delegatecall(bytes memory) returns (bool, bytes memory)`
- `<address>.staticcall(bytes memory) returns (bool, bytes memory)`
- Contract related: `selfdestruct(address payable recipient)`
- Type Information: `type(C).creationCode`, `type(C).runtimeCode`
- Modifier declaration and usage
- Keyword `modifier` is not yet supported.
- Developers should extend their modifier logic into function body directly
- Multiple contracts declartion.
- Developers can declare only one contract in a single file.
- Contract inheritance
- Constructor with parameter
- Return multiple value
- Keyword `is` is not yet supported.
- Constructor with parameters
- Because Ewasm deployer does not support deployment with constructor’s parameters.
- Tuple declaration
- Grammar `()` is not yet supported.
- Multiple function return values
- Due to the lack support of tuple, functions cannot return multiple values.
- Inline assembly
6 changes: 3 additions & 3 deletions doc/guides/FeatureGuideForYul.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ Below will describe some under implement language features.
| | extcodesize | |
| | extcodecopy | |
| | extcodehash | |
| | *datasize (see below) | |
| | *dataoffset (see below) | |
| | \*datasize (see below) | |
| | \*dataoffset (see below) | |
| | discard | |
| | discardu256 | |
| | splitu256tou64 | |
| | combineu64tou256 | |

> `datasize` and `dataoffset` in our implementation have a constraint.
> They both couldn't be used apply on object itself.
> They both couldn't be used apply on object itself.

0 comments on commit db6a689

Please sign in to comment.