diff options
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 4 | ||||
-rw-r--r-- | README.md | 65 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 12 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 1 | ||||
-rw-r--r-- | libsolidity/codegen/ExpressionCompiler.cpp | 6 |
5 files changed, 60 insertions, 28 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 196cbb32..0cc0edec 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -6,12 +6,12 @@ about: Bug reports about the Solidity Compiler. ## Prerequisites - First, many thanks for taking part in the community. We really appreciate that. -- We realize there is a lot of data requested here. We ask only that you do your best to provide as much information as possible so we can better help you. +- We realize there is a lot of information requested here. We ask only that you do your best to provide as much information as possible so we can better help you. - Support questions are better asked in one of the following locations: - [Solidity chat](https://gitter.im/ethereum/solidity) - [Stack Overflow](https://ethereum.stackexchange.com/) - Ensure the issue isn't already reported. -- The issue should be reproducible with the latest solidity version , however, this isn't a hard requirement and being reproducible with an older version is sufficient. +- The issue should be reproducible with the latest solidity version; however, this isn't a hard requirement and being reproducible with an older version is sufficient. *Delete the above section and the instructions in the sections below before submitting* @@ -1,19 +1,64 @@ # The Solidity Contract-Oriented Programming Language [![Join the chat at https://gitter.im/ethereum/solidity](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ethereum/solidity?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/ethereum/solidity.svg?branch=develop)](https://travis-ci.org/ethereum/solidity) +Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform. -## Useful links -To get started you can find an introduction to the language in the [Solidity documentation](https://solidity.readthedocs.org). In the documentation, you can find [code examples](https://solidity.readthedocs.io/en/latest/solidity-by-example.html) as well as [a reference](https://solidity.readthedocs.io/en/latest/solidity-in-depth.html) of the syntax and details on how to write smart contracts. +## Table of Contents -You can start using [Solidity in your browser](http://remix.ethereum.org) with no need to download or compile anything. +- [Background](#background) +- [Build and Install](#build-and-install) +- [Example](#example) +- [Documentation](#documentation) +- [Development](#development) +- [Maintainers](#maintainers) +- [License](#license) -The changelog for this project can be found [here](https://github.com/ethereum/solidity/blob/develop/Changelog.md). +## Background -Solidity is still under development. So please do not hesitate and open an [issue in GitHub](https://github.com/ethereum/solidity/issues) if you encounter anything strange. +Solidity is a statically-typed curly-braces programming language designed for developing smart contracts +that run on the Ethereum Virtual Machine. Smart contracts are programs that are executed inside a peer-to-peer +network where nobody has special authority over the execution and thus they allow to implement tokens of value, +ownership, voting and other kinds of logics. -## Building -See the [Solidity documentation](https://solidity.readthedocs.io/en/latest/installing-solidity.html#building-from-source) for build instructions. +## Build and Install -## How to Contribute -Please see our [contribution guidelines](https://solidity.readthedocs.io/en/latest/contributing.html) in the Solidity documentation. +Instructions about how to build and install the Solidity compiler can be found in the [Solidity documentation](https://solidity.readthedocs.io/en/latest/installing-solidity.html#building-from-source) + + +## Example + +A "Hello World" program in Solidity is of even less use than in other languages, but still: + +``` +contract HelloWorld { + function f() pure returns (string memory) { + return "Hello, World!"; + } +} +``` + +To get started with Solidity, you can use [Remix](https://remix.ethereum.org/), which is an +browser-based IDE. Here are some example contracts: + +1. [Voting](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#voting) +2. [Blind Auction](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#blind-auction) +3. [Safe remote purchase](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#safe-remote-purchase) +4. [Micropayment Channel](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#micropayment-channel) + +## Documentation + +The Solidity documentation is hosted at [Read the docs](https://solidity.readthedocs.io). + +## Development + +Solidity is still under development. Contributions are always welcome! +Please follow the +[Developers Guide](https://solidity.readthedocs.io/en/latest/contributing.html) +if you want to help. + +## Maintainers +[@axic](https://github.com/axic) +[@chriseth](https://github.com/chriseth) + +## License +Solidity is licensed under [GNU General Public License v3.0](https://github.com/ethereum/solidity/blob/develop/LICENSE.txt) -Any contributions are welcome! diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index b1cd15b4..e1e8403c 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -1501,8 +1501,6 @@ TypePointer ReferenceType::unaryOperatorResult(Token::Value _operator) const return make_shared<TupleType>(); case DataLocation::Storage: return m_isPointer ? TypePointer() : make_shared<TupleType>(); - default: - solAssert(false, ""); } return TypePointer(); } @@ -1548,8 +1546,6 @@ string ReferenceType::identifierLocationSuffix() const case DataLocation::CallData: id += "_calldata"; break; - default: - solAssert(false, "Unknown location returned by location()"); } if (isPointer()) id += "_ptr"; @@ -2496,7 +2492,7 @@ TypePointers FunctionType::returnParameterTypesWithoutDynamicTypes() const { TypePointers returnParameterTypes = m_returnParameterTypes; - if (m_kind == Kind::External || m_kind == Kind::CallCode || m_kind == Kind::DelegateCall) + if (m_kind == Kind::External || m_kind == Kind::DelegateCall) for (auto& param: returnParameterTypes) if (param->isDynamicallySized() && !param->dataStoredIn(DataLocation::Storage)) param = make_shared<InaccessibleDynamicType>(); @@ -2518,7 +2514,6 @@ string FunctionType::richIdentifier() const { case Kind::Internal: id += "internal"; break; case Kind::External: id += "external"; break; - case Kind::CallCode: id += "callcode"; break; case Kind::DelegateCall: id += "delegatecall"; break; case Kind::BareCall: id += "barecall"; break; case Kind::BareCallCode: id += "barecallcode"; break; @@ -2556,7 +2551,6 @@ string FunctionType::richIdentifier() const case Kind::ABIEncodeWithSelector: id += "abiencodewithselector"; break; case Kind::ABIEncodeWithSignature: id += "abiencodewithsignature"; break; case Kind::ABIDecode: id += "abidecode"; break; - default: solAssert(false, "Unknown function location."); break; } id += "_" + stateMutabilityToString(m_stateMutability); id += identifierList(m_parameterTypes) + "returns" + identifierList(m_returnParameterTypes); @@ -2700,7 +2694,6 @@ unsigned FunctionType::sizeOnStack() const switch(kind) { case Kind::External: - case Kind::CallCode: case Kind::DelegateCall: size = 2; break; @@ -2933,7 +2926,6 @@ string FunctionType::externalSignature() const { case Kind::Internal: case Kind::External: - case Kind::CallCode: case Kind::DelegateCall: case Kind::Event: break; @@ -3257,8 +3249,6 @@ string MagicType::richIdentifier() const return "t_magic_transaction"; case Kind::ABI: return "t_magic_abi"; - default: - solAssert(false, "Unknown kind of magic"); } return ""; } diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index 0b1b5d6d..b860bf6a 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -899,7 +899,6 @@ public: { Internal, ///< stack-call using plain JUMP External, ///< external call using CALL - CallCode, ///< external call using CALLCODE, i.e. not exchanging the storage DelegateCall, ///< external call using DELEGATECALL, i.e. not exchanging the storage BareCall, ///< CALL without function hash BareCallCode, ///< CALLCODE without function hash diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 53a06090..fbb1879a 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -566,7 +566,6 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) break; } case FunctionType::Kind::External: - case FunctionType::Kind::CallCode: case FunctionType::Kind::DelegateCall: case FunctionType::Kind::BareCall: case FunctionType::Kind::BareCallCode: @@ -1169,7 +1168,6 @@ bool ExpressionCompiler::visit(MemberAccess const& _memberAccess) _memberAccess.expression().accept(*this); m_context << funType->externalIdentifier(); break; - case FunctionType::Kind::CallCode: case FunctionType::Kind::External: case FunctionType::Kind::Creation: case FunctionType::Kind::Send: @@ -1831,7 +1829,7 @@ void ExpressionCompiler::appendExternalFunctionCall( solAssert(funKind != FunctionType::Kind::BareStaticCall || m_context.evmVersion().hasStaticCall(), ""); bool returnSuccessCondition = funKind == FunctionType::Kind::BareCall || funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::BareStaticCall; - bool isCallCode = funKind == FunctionType::Kind::BareCallCode || funKind == FunctionType::Kind::CallCode; + bool isCallCode = funKind == FunctionType::Kind::BareCallCode; bool isDelegateCall = funKind == FunctionType::Kind::BareDelegateCall || funKind == FunctionType::Kind::DelegateCall; bool useStaticCall = funKind == FunctionType::Kind::BareStaticCall || (_functionType.stateMutability() <= StateMutability::View && m_context.evmVersion().hasStaticCall()); @@ -1959,7 +1957,7 @@ void ExpressionCompiler::appendExternalFunctionCall( bool existenceChecked = false; // Check the the target contract exists (has code) for non-low-level calls. - if (funKind == FunctionType::Kind::External || funKind == FunctionType::Kind::CallCode || funKind == FunctionType::Kind::DelegateCall) + if (funKind == FunctionType::Kind::External || funKind == FunctionType::Kind::DelegateCall) { m_context << Instruction::DUP1 << Instruction::EXTCODESIZE << Instruction::ISZERO; // TODO: error message? |