Skip to content

Releases: elementrem/solidity

Elementrem Solidity Programming Language 0.4.18

07 Nov 20:49
01dcd70
Compare
Choose a tag to compare
  • Implement the Standard JSON Input / Output API
  • Support interface contracts.
  • C API (jsonCompiler): Add the compileStandard() method to process a Standard JSON I/O.
  • Commandline interface: Add the --standard-json parameter to process a Standard JSON I/O.
  • Commandline interface: Support --allow-paths to define trusted import paths. Note: the
    path(s) of the supplied source file(s) is always trusted.
  • Inline Assembly: Storage variable access using _slot and _offset suffixes.
  • Inline Assembly: Disallow blocks with unbalanced stack.
  • Static analyzer: Warn about statements without effects.
  • Static analyzer: Warn about unused local variables, parameters, and return parameters.
  • Syntax checker: issue deprecation warning for unary '+'
  • Assembly: Add CREATE2 (EIP86), STATICCALL (EIP214), RETURNDATASIZE and RETURNDATACOPY (EIP211) instructions.
  • Assembly: Display auxiliary data in the assembly output.
  • Assembly: Renamed SHA3 to KECCAK256.
  • AST: export all attributes to JSON format.
  • C API (jsonCompiler): Use the Standard JSON I/O internally.
  • Code Generator: Added the Whiskers template system.
  • Inline Assembly: for and switch statements.
  • Inline Assembly: Function definitions and function calls.
  • Inline Assembly: Introduce keccak256 as an opcode. sha3 is still a valid alias.
  • Inline Assembly: Present proper error message when not supplying enough arguments to a functional
    instruction.
  • Inline Assembly: Warn when instructions shadow Solidity variables.
  • Inline Assembly: Warn when using jumps.
  • Remove obsolete Why3 output.
  • Type Checker: Enforce strict UTF-8 validation.
  • Type Checker: Warn about copies in storage that might overwrite unexpectedly.
  • Type Checker: Warn about type inference from literal numbers.
  • Static Analyzer: Warn about deprecation of callcode.
  • Syntax Checker: Deprecated throw in favour of require(), assert() and revert().
  • Type Checker: Warn if a local storage reference variable does not explicitly use the keyword storage.
  • C API (jsonCompiler): Export the license method.
  • Code Generator: Optimise the fallback function, by removing a useless jump.
  • Inline Assembly: Show useful error message if trying to access calldata variables.
  • Inline Assembly: Support variable declaration without initial value (defaults to 0).
  • Metadata: Only include files which were used to compile the given contract.
  • Type Checker: Disallow value transfers to contracts without a payable fallback function.
  • Type Checker: Include types in explicit conversion error message.
  • Type Checker: Raise proper error for arrays too large for ABI encoding.
  • Type checker: Warn if using this in a constructor.
  • Type checker: Warn when existing symbols, including builtins, are overwritten.
  • Type Checker: Show unimplemented function if trying to instantiate an abstract class.
  • ABI JSON: Include new field stateMutability with values pure, view, nonpayable and payable.
  • Analyzer: Experimental partial support for Z3 SMT checker ("SMTChecker").
  • Build System: Shared libraries (libdevcore, libevmasm, libsolidity and liblll) are no longer produced during the build process.
  • Code generator: Experimental new implementation of ABI encoder that can encode arbitrarily nested arrays ("ABIEncoderV2")
  • Metadata: Store experimental flag in metadata CBOR.
  • Parser: Display previous visibility specifier in error if multiple are found.
  • Parser: Introduce pure and view keyword for functions, constant remains an alias for view and pureness is not enforced yet, so use with care.
  • Static Analyzer: Warn about large storage structures.
  • Syntax Checker: Support pragma experimental ; to turn on experimental features.
  • Type Checker: More detailed error message for invalid overrides.
  • Type Checker: Warn about shifting a literal.
  • Assembly Parser: Support multiple assignment (x, y := f()).
  • Code Generator: Keep a single copy of encoding functions when using the experimental "ABIEncoderV2".
  • Code Generator: Partial support for passing structs as arguments and return parameters (requires pragma experimental ABIEncoderV2; for now).
  • General: Support pragma experimental "v0.5.0"; to activate upcoming breaking changes.
  • General: Added .selector member on external function types to retrieve their signature.
  • Optimizer: Add new optimization step to remove unused JUMPDESTs.
  • Static Analyzer: Warn when using deprecated builtins sha3 and suicide
    (replaced by keccak256 and selfdestruct, introduced in 0.4.2 and 0.2.0, respectively).
  • Syntax Checker: Warn if no visibility is specified on contract functions.
  • Type Checker: Display helpful warning for unused function arguments/return parameters.
  • Type Checker: Do not show the same error multiple times for events.
  • Type Checker: Greatly reduce the number of duplicate errors shown for duplicate constructors and functions.
  • Type Checker: Warn on using literals as tight packing parameters in keccak256, sha3, sha256 and ripemd160.
  • Type Checker: Enforce view and pure.
  • Type Checker: Enforce view / constant with error as experimental 0.5.0 feature.
  • Type Checker: Enforce fallback functions to be external as experimental 0.5.0 feature.
  • Code Generator: Always use all available gas for calls as experimental 0.5.0 feature
    (previously, some amount was retained in order to work in pre-Tangerine-Whistle
    EVM versions)
  • Parser: Better error message for unexpected trailing comma in parameter lists.
  • Standard JSON: Support the outputSelection field for selective compilation of supplied sources.
  • Syntax Checker: Unary + is now a syntax error as experimental 0.5.0 feature.
  • Type Checker: Disallow non-pure constant state variables as experimental 0.5.0 feature.
  • Type Checker: Do not add members of address to contracts as experimental 0.5.0 feature.
  • Type Checker: Force interface functions to be external as experimental 0.5.0 feature.
  • Type Checker: Require storage or memory keyword for local variables as experimental 0.5.0 feature.

Binaries
https://github.com/elementrem/solc-bin/tree/master/bin

Elementrem Solidity Programming Language 0.4.10

06 Apr 20:25
Compare
Choose a tag to compare

Features:

  • Inline assembly: support both suicide and selfdestruct opcodes
  • Inline assembly: issue warning if stack is not balanced after block.
  • Include keccak256() as an alias to sha3().
  • Support shifting constant numbers.
  • Do-while loops: support for a do while (); control structure
  • Inline assembly: support invalidJumpLabel as a jump label.
  • Type checker: now more eagerly searches for a common type of an inline array with mixed types
  • Code generator: generates a runtime error when an out-of-range value is converted into an enum type.
  • Type checker: Warn when msg.value is used in non-payable function.
  • Code generator: Inject the Swarm hash of a metadata file into the bytecode.
  • Code generator: Replace expensive memcpy precompile by simple assembly loop.
  • Optimizer: Some dead code elimination.
  • Optimiser: Performance improvements.
  • Output: Print assembly in new standardized Solidity assembly format.
  • Compiler interface: Contracts and libraries can be referenced with a file: prefix to make them unique.
  • Compiler interface: Report source location for "stack too deep" errors.
  • AST: Use deterministic node identifiers.
  • Inline assembly: introduce invalid (EIP141) as an opcode.
  • Type system: Introduce type identifier strings.
  • Type checker: Warn about invalid checksum for addresses and deduce type from valid ones.
  • Metadata: Do not include platform in the version number.
  • Metadata: Add option to store sources as literal content.
  • Code generator: Extract array utils into low-level functions.
  • Code generator: Internal errors (array out of bounds, etc.) now cause a reversion by using an invalid
  • instruction (0xfe - EIP141) instead of an invalid jump. Invalid jump is still kept for explicit throws.
  • Add assert(condition), which throws if condition is false (meant for internal errors).
  • Add require(condition), which throws if condition is false (meant for invalid input).
  • Commandline interface: Do not overwrite files unless forced.
  • Introduce .transfer(value) for sending Ether.
  • Code generator: Support revert() to abort with rolling back, but not consuming all gas.
  • Inline assembly: Support revert (EIP140) as an opcode.
  • Parser: Support scientific notation in numbers (e.g. 2e8 and 200e-2).
  • Type system: Support explicit conversion of external function to address.
  • Type system: Warn if base of exponentiation is literal (result type might be unexpected).
  • Type system: Warn if constant state variables are not compile-time constants.

Fixes:

  • Commandline interface: Disallow unknown options in solc.
  • Name resolver: Allow inheritance of enum definitions.
  • Type checker: Proper type checking for bound functions.
  • Type checker: fixed crash related to invalid fixed point constants
  • Type checker: fixed crash related to invalid literal numbers.
  • Type checker: super.x does not look up x in the current contract.
  • Code generator: expect zero stack increase after super as an expression.
  • Code generator: fix an internal compiler error for L.Foo for enum Foo defined in library L.
  • Code generator: allow inheritance of enum definitions.
  • Inline assembly: support the address opcode.
  • Inline assembly: fix parsing of assignment after a label.
  • Inline assembly: external variables of unsupported type (such as this, super, etc.) are properly detected as unusable.
  • Inline assembly: support variables within modifiers.
  • Optimizer: fix related to stale knowledge about SHA3 operations
  • Type checker: forbid signed exponential that led to an incorrect use of EXP opcode.
  • Code generator: properly clean higher order bytes before storing in storage.
  • Inline assembly: calculate stack height warning correctly even when local variables are used.
  • Code generator: check for value transfer in non-payable constructors.
  • Parser: disallow empty enum definitions.
  • Type checker: disallow conversion between different enum types.
  • Interface JSON: do not include trailing new line.
  • Code generator: throw if calling the identity precompile failed during memory (array) copying.
  • Type checker: string literals that are not valid UTF-8 cannot be converted to string type
  • Code generator: any non-zero value given as a boolean argument is now converted into 1.
  • AST Json Converter: replace VariableDefinitionStatement nodes with VariableDeclarationStatement
  • AST Json Converter: fix the camel case in ElementaryTypeNameExpression
  • AST Json Converter: replace public field with visibility in the function definition nodes
  • Remappings: Prefer longer context over longer prefix.
  • Type checker, code generator: enable access to events of base contracts' names.
  • Imports: import ".dir/a" is not a relative path. Relative paths begin with directory . or ...
  • Type checker: disallow inheritances of different kinds (e.g. a function and a modifier) of members of the same name
  • Code generator: Allow recursive structs.
  • Inline assembly: Disallow variables named like opcodes.
  • Type checker: Allow multiple events of the same name (but with different arities or argument types)
  • Natspec parser: Fix error with @param parsing and whitespace.
  • Commandline interface: Always escape filenames (replace /, : and . with _).
  • Commandline interface: Do not try creating paths . and ...
  • Commandline interface: Allow long library names.
  • Parser: Disallow octal literals.
  • Type system: Fix a crash caused by continuing on fatal errors in the code.
  • Type system: Disallow compound assignment for tuples.
  • Type system: Detect cyclic dependencies between constants.
  • Type system: Disallow arrays with negative length.
  • Type system: Fix a crash related to invalid binary operators.
  • Type system: Disallow var declaration with empty tuple type.
  • Type system: Correctly convert function argument types to pointers for member functions.
  • Type system: Move privateness of constructor into AST itself.
  • Inline assembly: Charge one stack slot for non-value types during analysis.
  • Assembly output: Print source location before the operation it refers to instead of after.
  • Optimizer: Stop trying to optimize tricky constants after a while.

Binary install step by step (Ubuntu Xenial 16.04)

  • Download and extract the following files.
    Elementrem-Solidity-0.4.10.tar.gz
    Elementrem-solidity-dependencies(0.4.10).tar.gz
  1. Move the bin, lib, and share directories to the /usr directory.
  2. Install the following dependencies: (You can find it at the release of https://github.com/elementrem/solidity.)
	sudo dpkg -i libboost-program-options1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
	sudo dpkg -i libjsoncpp1_1.7.2-1_amd64.deb
	sudo dpkg -i libboost-system1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
	sudo dpkg -i libboost-filesystem1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
	sudo apt-get -y install libboost-filesystem-dev
	sudo dpkg -i libboost-filesystem-dev_1.58.0.1ubuntu1_amd64.deb
  1. In gele console
> admin.setSolc("/usr/bin/solc")
"solc, the solidity compiler commandline interface\nVersion: 0.4.10-develop.2017.4.4+commit.63bb23e8.mod.Linux.g++\n\npath: /usr/bin/solc"
> ele.getCompilers()
["Solidity"]

Elementrem Solidity Programming Language 0.4.2

03 Oct 01:05
Compare
Choose a tag to compare

Changes:

  • Add payable to all functions that want to receive Element (including the constructor and the fallback function).
  • Change _ to _; in modifiers.
  • Functions that want to receive Element have to specify the new payable modifier (otherwise they throw).
  • Contracts that want to receive Element with a plain "send" have to implement a fallback function with the payable modifier. Contracts now throw if no payable fallback function is defined and no function matches the signature.
  • Failing contract creation through "new" throws.
  • Division / modulus by zero throws.
  • Function call throws if target contract does not have code
  • Modifiers are required to contain _ (use if (false) _ as a workaround if needed).
  • Modifiers: return does not skip part in modifier after _ .
  • Placeholder statement _ in modifier now requires explicit ; .
  • ecrecover now returns zero if the input is malformed (it previously returned garbage).
  • The constant keyword cannot be used for constructors or the fallback function.
  • Removed --interface (Solidity interface) output option
  • JSON AST: General cleanup, renamed many nodes to match their C++ names.
  • JSON output: srcmap-runtime renamed to srcmapRuntime .
  • Moved (and reworked) standard library contracts from inside the compiler to github.com/elementrem/solidity/std ( import "std"; or import owned; do not work anymore).
  • Confusing and undocumented keyword after was removed.
  • New reserved words: abstract , hex , interface , payable , pure , static , view .

Features:

  • Hexadecimal string literals: hex"ab1248fe"
  • Internal: Inline assembly usable by the code generator.
  • Commandline interface: Using - as filename allows reading from stdin.
  • Interface JSON: Fallback function is now part of the ABI.
  • Interface: Version string now semver compatible.
  • Code generator: Do not provide "new account gas" if we know the called account exists.

Bugfixes:

  • JSON AST: Nodes were added at wrong parent
  • Why3 translator: Crash fix for exponentiation
  • Commandline Interface: linking libraries with underscores in their name.
  • Type Checker: Fallback function cannot return data anymore.
  • Code Generator: Fix crash when sha3() was used on unsupported types.
  • Code Generator: Manually set gas stipend for .send(0) .
  • Code Generator: Fix library functions being called from payable functions.
  • Type Checker: Fixed a crash about invalid array types.

You should make sure whether the solidity compiler is applied or not.

> ele.getCompilers()
["Solidity"]

If the solidity is not applied, You can apply it manually.

> admin.setSolc("./solc") //solc path
"solc, the solidity compiler commandline interface\nVersion: 0.4.2 develop.2016.10.2+commit.3ba4422c.Linux.g++\n\npath: ./solc"

Deploying simple contract – Step by Step

You can also build(binaries) from source

The Solidity Programming Language 0.3.6

14 Aug 15:29
Compare
Choose a tag to compare

This is the first release from the solidity-standalone repository. Solidity is a high-level language whose syntax is similar to that of JavaScript and it is designed to compile to code for the Elementrem Virtual Machine


Install step by step (Ubuntu Xenial 16.04)

tar -xvzf ./linux-ubuntu-xenial-solc-0.3.6-compilier.tar.gz
sudo dpkg -i libboost-program-options1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
sudo dpkg -i libjsoncpp1_1.7.2-1_amd64.deb
  • Install Solidity
    sudo dpkg -i solc_0.3.6-0ubuntu1~xenial_amd64.deb

If Installation failed:
Downalod Solidity Dependency

tar -xvzf ./solc-0.3.6-dependency.tar.gz
sudo dpkg -i libboost-system1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
sudo dpkg -i libboost-filesystem1.58.0_1.58.0+dfsg-5ubuntu3_amd64.deb
sudo apt-get -y install libboost-filesystem-dev
sudo apt-get -f -y install
sudo dpkg -i libboost-filesystem-dev_1.58.0.1ubuntu1_amd64.deb
sudo dpkg -i solc_0.3.6-0ubuntu1~xenial_amd64.deb

You should make sure whether the solidity compiler is applied or not.

> ele.getCompilers()
["Solidity"]

If the solidity is not applied, You can apply it manually.

> admin.setSolc("/usr/bin/solc")
"solc, the solidity compiler commandline interface\nVersion: 0.3.6-0/None-Linux/g++\n\npath: /usr/bin/solc"

Deploying simple contract – Step by Step