{Solidity:log}
Custom Errors in Solidity
Posted by Solidity Team on April 21, 2021
Starting from Solidity v0.8.4, there is a convenient and gas-efficient way to explain to users why an operation failed through the use of custom errors. Until now, you could already use strings to give more information about failures (e.g., revert("Insufficient funds.");), but they are rather expensive, especially when it comes to deploy cost, and it is difficult to use dynamic information in them. Custom errors are defined using the error statement, which can be used inside and outside of contracts (including interfaces and libraries). Example The following contract...
Read moreAnnouncing Solidity Version Collectibles & Community Governance 💎
Posted by Franziska Heintel on April 1, 2021
⚠️ Attention: This post is an April Fools' Day joke. Please consume it at your own risk. We will not distribute any Solidity NFTs in the foreseeable future. Stay safe. Today, we are excited to announce a little surprise we’ve been working on silently for the last couple of weeks. We heard that you really like crypto-related collectibles and we listened. You will soon be able to own a digital piece of Solidity’s history: We’re tokenizing each Solidity version as an NFT!...
Read moreSolidity 0.8.3 Release Announcement
Posted by Solidity Team on March 23, 2021
Solidity v0.8.3 fixes the Solidity Optimizer Keccak Caching Bug, which is present in all prior versions of Solidity, and, in addition, includes two improvements to the optimizer which can provide a big gas benefit when writing structs that cover a full storage slot to storage. Important Bugfixes Solidity Optimizer Keccak Caching Bug On March 20, 2021, a bug in Solidity’s bytecode optimizer was found by differential fuzzing. The bug is fixed with this version. The bug is present in all prior versions of...
Read moreSolidity Optimizer Keccak Caching Bug
Posted by Solidity Team on March 23, 2021
On March 20, 2021, a bug in Solidity's bytecode optimizer was found by differential fuzzing. The bug is fixed with version 0.8.3 released on March 23, 2021. The bug is present in all prior versions of Solidity. We assigned the bug a severity level of "medium". Technical Details Summary: The bytecode optimizer incorrectly re-used previously evaluated Keccak-256 hashes. You are unlikely to be affected if you do not compute Keccak-256 hashes in inline assembly. Solidity's bytecode optimizer has a step that can compute Keccak-256 hashes, if the...
Read moreSolidity 0.8.2 Release Announcement
Posted by Solidity Team on March 2, 2021
Solidity v0.8.2 adds an optimizer stage that can inline small amounts of code to save gas and provides more means to work with code documentation by exporting inline comments and allowing custom natspec tags. Notable New Features Inliner This release adds a simple inliner to the low-level optimizer of Solidity. It can inline short functions that do not contain control-flow branches or opcodes with side-effects. If you want to learn more about the inliner, read this post. Custom Natspec and Exported Documentation It is now possible to use documentation...
Read moreSaving Gas with Simple Inlining
Posted by Christian Reitwiessner on March 2, 2021
Solidity v0.8.2 adds a simple inliner to the low-level optimizer of Solidity. In this post, we examine how it works and take a look at synergies with other steps of the optimizer. Low-Level Inliner The Low-Level Inliner is a component of the low-level optimizer of the Solidity compiler. To save gas, it can inline short functions that do not contain control-flow branches or opcodes with side-effects. The decision to inline or not is based on the trade-off parameter "runs": The combined code deposit cost and execution...
Read moreContributing to Solidity 101
Posted by Franziska Heintel on February 15, 2021
The Solidity programming language is an open-source project governed by a core team. We rely on the community’s feedback, input and contributions to make the language as effective, safe and useful as possible. In this post, we will walk you through the various different ways how you can get involved contributing to Solidity! Do not hesitate to contact us in case anything is left unclear after reading the post. Overview of Contribution Opportunities There are plenty of options how you can contribute to...
Read moreAn Introduction to Solidity's Fuzz Testing Approach
Posted by Bhargava Shastry on February 10, 2021
Security vulnerabilities and bugs detract from software quality. To discover them early, at best before they are released, we have adopted fuzz testing: feeding randomly generated programs to the Solidity compiler and observing the compilation runtime and code generated. Since Q1 2019, the Solidity compiler is fuzz tested via Google's open-source software fuzz (oss-fuzz) framework. In this post, we briefly describe the work that has been done on this front, and work that is currently in progress. Fuzzer Overview Broadly speaking, we have developed two...
Read moreLaunching the Solidity Forum 🗃️
Posted by Franziska Heintel on February 1, 2021
In our effort to foster exchange of information, encourage more developers to give feedback about Solidity and join the discussions on language design and future direction of the compiler, we are happy to launch the Solidity forum today! Moving forward the Solidity forum will be the dedicated place to discuss topics and questions related to… The design of the Solidity programming language. The Solidity compiler. Useful Solidity tips and code snippets. Solidity documentation and its translation. Discussions and announcements about Solidity releases. It will not be the...
Read moreSolidity 0.8.1 Release Announcement
Posted by Solidity Team on January 27, 2021
Solidity v0.8.1 introduces many new features for the SMTChecker (see below), updates the emscripten version for building soljson.js to 2.0.12, allows to catch panic errors and adds other small improvements. Notable New Features SMTChecker Counterexamples and Synthesis of External Functions The SMTChecker already reports transaction traces as counterexamples to failing verification targets, but 0.8.1 adds internal calls, msg.value and synthesized unknown code called externally in the form of reentrant calls to counterexamples. A recent blog post presents that topic in more detail. How to select SMTChecker targets Prior to 0.8.1, the SMTChecker...
Read more