I would like to use this thread to announce new Solidity language features as soon as they arrive in the develop branch of cpp-ethereum. The compiler should be stable and tested at all times, but we can not always prevent bugs from sneaking in. If you encounter anything strange, please do not hesitate and open an
issue in github.
Just now, interaction between contracts was added. It is now possible to create contracts from within Solidity. For an example, please see the
tutorial.
Comments
The keyword "const" has been changed to "constant". Depending on the version of the compiler or the source you use, this might hit you as "Expected token LBRACE".
When will we be able to send ether along with a method call to another contract and along with contract creation?
Any idea what the syntax will be so I can write it into my contract right now?
Error: Compiled contract not found.
Any idea what's wrong? My contract is reeaally long. 250 lines. That's the only thing I can think of.
I had 2 contracts in my code, and I needed to have the full contract of one of them before the call to new.
https://github.com/ethereum/cpp-ethereum/wiki/Solidity-Tutorial#contract-inheritance
Beware that arrays as function parameters only work in external functions for now.
I hope we also can save arrays on the storage.
Note, however, that by the recent changes in gas costs, SHA is only slightly cheaper than loading from storage and modifying storage is more than 100 times more costly than the SHA, and using a new storage slot is almost 1000 times the cost of a SHA.
- storage is now tightly packed, so it acutally does make sense to use uint8 and such
- there is a decent optimizer that reads in blocks and completely re-generates them (make sure to activate it!)
- storage variables can be declared constant and do not take space in storage (only in code)
- accessor functions are generated for array types
I also updated the browser based compiler to the most recent version. The UI will likely also receive an overhaul in the next days.For the "construction" part, the two summands are the gas used for executing the constructor(s) and the code storing fee, respectively. If another function is called internally, its gas cost is added to the actual function, but the costs of externally called functions are not added.
As this would be quite problematic for send() or non-typesafe calls like call() or callcode(), these functions do not propagate the failure condition but rather return a boolean indicating whether the call succeeded (true) or not (false).
Eventually, Solidity will also receive a throw keyword to manually cause this failure condition and perhaps also try { } catch { }, although try/catch will have rather limited functionality.
Furthermore, the Tutorial has been partly re-worked.