mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4462 from cryptomental/feature/add-codespell
Feature/add codespell
This commit is contained in:
commit
07910c80cb
@ -158,6 +158,23 @@ jobs:
|
||||
- store_artifacts: *solc_artifact
|
||||
- persist_to_workspace: *all_artifacts
|
||||
|
||||
test_check_spelling:
|
||||
docker:
|
||||
- image: circleci/python:3.6
|
||||
environment:
|
||||
TERM: xterm
|
||||
steps:
|
||||
- checkout
|
||||
- attach_workspace:
|
||||
at: build
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
pip install --user codespell
|
||||
- run:
|
||||
name: Check spelling
|
||||
command: ~/.local/bin/codespell -S "*.enc,.git" -I ./scripts/codespell_whitelist.txt
|
||||
|
||||
test_x86_linux:
|
||||
docker:
|
||||
- image: buildpack-deps:artful
|
||||
@ -220,6 +237,7 @@ workflows:
|
||||
version: 2
|
||||
build_all:
|
||||
jobs:
|
||||
- test_check_spelling: *build_on_tags
|
||||
- build_emscripten: *build_on_tags
|
||||
- test_emscripten_solcjs:
|
||||
<<: *build_on_tags
|
||||
|
@ -708,7 +708,7 @@ Bugfixes:
|
||||
* Conditional: `x ? y : z`
|
||||
* Bugfix: Fixed several bugs where the optimizer generated invalid code.
|
||||
* Bugfix: Enums and structs were not accessible to other contracts.
|
||||
* Bugfix: Fixed segfault connected to function paramater types, appeared during gas estimation.
|
||||
* Bugfix: Fixed segfault connected to function parameter types, appeared during gas estimation.
|
||||
* Bugfix: Type checker crash for wrong number of base constructor parameters.
|
||||
* Bugfix: Allow function overloads with different array types.
|
||||
* Bugfix: Allow assignments of type `(x) = 7`.
|
||||
|
@ -8,7 +8,7 @@ Checklist for making a release:
|
||||
- [ ] Make a final check that there are no platform-dependency issues in the ``solc-test-bytecode`` repository.
|
||||
- [ ] Wait for the tests for the commit on ``release``, create a release in Github, creating the tag.
|
||||
- [ ] Thank voluntary contributors in the Github release page (use ``git shortlog -s -n -e origin/release..origin/develop``).
|
||||
- [ ] Wait for the CI runs on the tag itself (they should push artefacts onto the Github release page).
|
||||
- [ ] Wait for the CI runs on the tag itself (they should push artifacts onto the Github release page).
|
||||
- [ ] Run ``scripts/release_ppa.sh release`` to create the PPA release (you need the relevant openssl key).
|
||||
- [ ] Check that the Docker release was pushed to Docker Hub (this still seems to have problems, run ``./scripts/docker_deploy_manual.sh release``).
|
||||
- [ ] Update the homebrew realease in https://github.com/ethereum/homebrew-ethereum/blob/master/solidity.rb (version and hash)
|
||||
|
@ -90,7 +90,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
|
||||
if (EMSCRIPTEN)
|
||||
# Do not emit a separate memory initialiser file
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --memory-init-file 0")
|
||||
# Leave only exported symbols as public and agressively remove others
|
||||
# Leave only exported symbols as public and aggressively remove others
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections -fvisibility=hidden")
|
||||
# Optimisation level
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
|
||||
|
@ -279,13 +279,13 @@ All together, the encoding is (newline after function selector and each 32-bytes
|
||||
|
||||
Let us apply the same principle to encode the data for a function with a signature ``g(uint[][],string[])`` with values ``([[1, 2], [3]], ["one", "two", "three"])`` but start from the most atomic parts of the encoding:
|
||||
|
||||
First we encode the length and data of the first embeded dynamic array ``[1, 2]`` of the first root array ``[[1, 2], [3]]``:
|
||||
First we encode the length and data of the first embedded dynamic array ``[1, 2]`` of the first root array ``[[1, 2], [3]]``:
|
||||
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (number of elements in the first array, 2; the elements themselves are ``1`` and ``2``)
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000001`` (first element)
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000002`` (second element)
|
||||
|
||||
Then we encode the length and data of the second embeded dynamic array ``[3]`` of the first root array ``[[1, 2], [3]]``:
|
||||
Then we encode the length and data of the second embedded dynamic array ``[3]`` of the first root array ``[[1, 2], [3]]``:
|
||||
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000001`` (number of elements in the second array, 1; the element is ``3``)
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (first element)
|
||||
@ -307,7 +307,7 @@ Offset ``a`` points to the start of the content of the array ``[1, 2]`` which is
|
||||
Offset ``b`` points to the start of the content of the array ``[3]`` which is line 5 (160 bytes); thus ``b = 0x00000000000000000000000000000000000000000000000000000000000000a0``.
|
||||
|
||||
|
||||
Then we encode the embeded strings of the second root array:
|
||||
Then we encode the embedded strings of the second root array:
|
||||
|
||||
- ``0x0000000000000000000000000000000000000000000000000000000000000003`` (number of characters in word ``"one"``)
|
||||
- ``0x6f6e650000000000000000000000000000000000000000000000000000000000`` (utf8 representation of word ``"one"``)
|
||||
@ -337,7 +337,7 @@ Offset ``d`` points to the start of the content of the string ``"two"`` which is
|
||||
Offset ``e`` points to the start of the content of the string ``"three"`` which is line 7 (224 bytes); thus ``e = 0x00000000000000000000000000000000000000000000000000000000000000e0``.
|
||||
|
||||
|
||||
Note that the encodings of the embeded elements of the root arrays are not dependent on each other and have the same encodings for a fuction with a signature ``g(string[],uint[][])``.
|
||||
Note that the encodings of the embedded elements of the root arrays are not dependent on each other and have the same encodings for a function with a signature ``g(string[],uint[][])``.
|
||||
|
||||
Then we encode the length of the first root array:
|
||||
|
||||
|
@ -212,9 +212,9 @@ In the grammar, opcodes are represented as pre-defined identifiers.
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| sar(x, y) | | C | arithmetic shift right y by x bits |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| addmod(x, y, m) | | F | (x + y) % m with arbitrary precision arithmetics |
|
||||
| addmod(x, y, m) | | F | (x + y) % m with arbitrary precision arithmetic |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| mulmod(x, y, m) | | F | (x * y) % m with arbitrary precision arithmetics |
|
||||
| mulmod(x, y, m) | | F | (x * y) % m with arbitrary precision arithmetic |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| signextend(i, x) | | F | sign extend from (i*8+7)th bit counting from least significant |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
@ -228,9 +228,9 @@ In the grammar, opcodes are represented as pre-defined identifiers.
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| pop(x) | `-` | F | remove the element pushed by x |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| dup1 ... dup16 | | F | copy ith stack slot to the top (counting from top) |
|
||||
| dup1 ... dup16 | | F | copy nth stack slot to the top (counting from top) |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| swap1 ... swap16 | `*` | F | swap topmost and ith stack slot below it |
|
||||
| swap1 ... swap16 | `*` | F | swap topmost and nth stack slot below it |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
| mload(p) | | F | mem[p...(p+32)) |
|
||||
+-------------------------+-----+---+-----------------------------------------------------------------+
|
||||
|
@ -20,7 +20,7 @@ Contracts can be created "from outside" via Ethereum transactions or from within
|
||||
|
||||
IDEs, such as `Remix <https://remix.ethereum.org/>`_, make the creation process seamless using UI elements.
|
||||
|
||||
Creating contracts programatically on Ethereum is best done via using the JavaScript API `web3.js <https://github.com/ethereum/web3.js>`_.
|
||||
Creating contracts programmatically on Ethereum is best done via using the JavaScript API `web3.js <https://github.com/ethereum/web3.js>`_.
|
||||
As of today it has a method called `web3.eth.Contract <https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html#new-contract>`_
|
||||
to facilitate contract creation.
|
||||
|
||||
@ -1042,7 +1042,7 @@ constant and defines the behaviour of the contract or
|
||||
describes it. The second way has to be used if the
|
||||
constructor arguments of the base depend on those of the
|
||||
derived contract. Arguments have to be given either in the
|
||||
inheritance list or in modifier-style in the derived constuctor.
|
||||
inheritance list or in modifier-style in the derived constructor.
|
||||
Specifying arguments in both places is an error.
|
||||
|
||||
If a derived contract doesn't specify the arguments to all of its base
|
||||
|
@ -110,13 +110,13 @@ Example: ``./test/libsolidity/syntaxTests/double_stateVariable_declaration.sol``
|
||||
// ----
|
||||
// DeclarationError: Identifier already declared.
|
||||
|
||||
A syntax test must contain at least the contract under test itself, followed by the seperator ``----``. The additional comments above are used to describe the
|
||||
A syntax test must contain at least the contract under test itself, followed by the separator ``----``. The additional comments above are used to describe the
|
||||
expected compiler errors or warnings. This section can be empty in case that the contract should compile without any errors or warnings.
|
||||
|
||||
In the above example, the state variable ``variable`` was declared twice, which is not allowed. This will result in a ``DeclarationError`` stating that the identifier was already declared.
|
||||
|
||||
The tool that is being used for those tests is called ``isoltest`` and can be found under ``./test/tools/``. It is an interactive tool which allows
|
||||
editing of failing contracts using your prefered text editor. Let's try to break this test by removing the second declaration of ``variable``:
|
||||
editing of failing contracts using your preferred text editor. Let's try to break this test by removing the second declaration of ``variable``:
|
||||
|
||||
::
|
||||
|
||||
@ -237,7 +237,7 @@ Othwerise, upon execution the fuzzer will halt with an error saying binary is no
|
||||
Location : check_binary(), afl-fuzz.c:6920
|
||||
|
||||
|
||||
Next, you need some example source files. This will make it much easer for the fuzzer
|
||||
Next, you need some example source files. This will make it much easier for the fuzzer
|
||||
to find errors. You can either copy some files from the syntax tests or extract test files
|
||||
from the documentation or the other tests:
|
||||
|
||||
|
@ -39,7 +39,7 @@ write::
|
||||
pragma solidity ^0.4.16;
|
||||
|
||||
contract Simple {
|
||||
function arithmetics(uint _a, uint _b)
|
||||
function arithmetic(uint _a, uint _b)
|
||||
public
|
||||
pure
|
||||
returns (uint o_sum, uint o_product)
|
||||
|
@ -69,7 +69,7 @@ Can you return an array or a ``string`` from a solidity function call?
|
||||
Yes. See `array_receiver_and_returner.sol <https://github.com/fivedogit/solidity-baby-steps/blob/master/contracts/60_array_receiver_and_returner.sol>`_.
|
||||
|
||||
What is problematic, though, is returning any variably-sized data (e.g. a
|
||||
variably-sized array like ``uint[]``) from a fuction **called from within Solidity**.
|
||||
variably-sized array like ``uint[]``) from a function **called from within Solidity**.
|
||||
This is a limitation of the EVM and will be solved with the next protocol update.
|
||||
|
||||
Returning variably-sized data as part of an external transaction or call is fine.
|
||||
@ -260,7 +260,7 @@ The third one is the stack, which is used to hold small local variables.
|
||||
It is almost free to use, but can only hold a limited amount of values.
|
||||
|
||||
For almost all types, you cannot specify where they should be stored, because
|
||||
they are copied everytime they are used.
|
||||
they are copied every time they are used.
|
||||
|
||||
The types where the so-called storage location is important are structs
|
||||
and arrays. If you e.g. pass such variables in function calls, their
|
||||
|
@ -319,7 +319,7 @@ Global Variables
|
||||
================
|
||||
|
||||
- ``abi.encode(...) returns (bytes)``: :ref:`ABI <ABI>`-encodes the given arguments
|
||||
- ``abi.encodePacked(...) returns (bytes)``: Performes :ref:`packed encoding <abi_packed_mode>` of the given arguments
|
||||
- ``abi.encodePacked(...) returns (bytes)``: Performs :ref:`packed encoding <abi_packed_mode>` of the given arguments
|
||||
- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes)``: :ref:`ABI <ABI>`-encodes the given arguments
|
||||
starting from the second and prepends the given four-byte selector
|
||||
- ``abi.encodeWithSignature(string signature, ...) returns (bytes)``: Equivalent to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)```
|
||||
|
@ -679,7 +679,7 @@ Creating the signature
|
||||
----------------------
|
||||
|
||||
Alice does not need to interact with Ethereum network to
|
||||
sign the transaction, the proccess is completely offline.
|
||||
sign the transaction, the process is completely offline.
|
||||
In this tutorial, we will sign messages in the browser
|
||||
using ``web3.js`` and ``MetaMask``.
|
||||
In particular, we will use the standard way described in `EIP-762 <https://github.com/ethereum/EIPs/pull/712>`_,
|
||||
@ -1034,7 +1034,7 @@ The full contract
|
||||
}
|
||||
|
||||
/// if the timeout is reached without the recipient closing the channel,
|
||||
/// then the Ether is realeased back to the sender.
|
||||
/// then the Ether is released back to the sender.
|
||||
function clainTimeout() public {
|
||||
require(now >= expiration);
|
||||
selfdestruct(sender);
|
||||
|
@ -188,8 +188,8 @@ Event Definitions and Event Emitters
|
||||
Yes::
|
||||
|
||||
event LongAndLotsOfArgs(
|
||||
adress sender,
|
||||
adress recipient,
|
||||
address sender,
|
||||
address recipient,
|
||||
uint256 publicKey,
|
||||
uint256 amount,
|
||||
bytes32[] options
|
||||
@ -205,8 +205,8 @@ Yes::
|
||||
|
||||
No::
|
||||
|
||||
event LongAndLotsOfArgs(adress sender,
|
||||
adress recipient,
|
||||
event LongAndLotsOfArgs(address sender,
|
||||
address recipient,
|
||||
uint256 publicKey,
|
||||
uint256 amount,
|
||||
bytes32[] options);
|
||||
@ -830,7 +830,7 @@ The naming recommendations given here are intended to improve the readability,
|
||||
and thus they are not rules, but rather guidelines to try and help convey the
|
||||
most information through the names of things.
|
||||
|
||||
Lastly, consistency within a codebase should always supercede any conventions
|
||||
Lastly, consistency within a codebase should always supersede any conventions
|
||||
outlined in this document.
|
||||
|
||||
|
||||
|
@ -100,7 +100,7 @@ ABI Encoding Functions
|
||||
----------------------
|
||||
|
||||
- ``abi.encode(...) returns (bytes)``: ABI-encodes the given arguments
|
||||
- ``abi.encodePacked(...) returns (bytes)``: Performes :ref:`packed encoding <abi_packed_mode>` of the given arguments
|
||||
- ``abi.encodePacked(...) returns (bytes)``: Performs :ref:`packed encoding <abi_packed_mode>` of the given arguments
|
||||
- ``abi.encodeWithSelector(bytes4 selector, ...) returns (bytes)``: ABI-encodes the given arguments
|
||||
starting from the second and prepends the given four-byte selector
|
||||
- ``abi.encodeWithSignature(string signature, ...) returns (bytes)``: Equivalent to ``abi.encodeWithSelector(bytes4(keccak256(bytes(signature)), ...)```
|
||||
|
@ -338,7 +338,7 @@ The following functions must be available:
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| xor(x:bool, y:bool) -> z:bool | xor |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| *Arithmetics* |
|
||||
| *Arithmetic* |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| addu256(x:u256, y:u256) -> z:u256 | x + y |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
@ -358,9 +358,9 @@ The following functions must be available:
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| expu256(x:u256, y:u256) -> z:u256 | x to the power of y |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| addmodu256(x:u256, y:u256, m:u256) -> z:u256| (x + y) % m with arbitrary precision arithmetics |
|
||||
| addmodu256(x:u256, y:u256, m:u256) -> z:u256| (x + y) % m with arbitrary precision arithmetic |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| mulmodu256(x:u256, y:u256, m:u256) -> z:u256| (x * y) % m with arbitrary precision arithmetics |
|
||||
| mulmodu256(x:u256, y:u256, m:u256) -> z:u256| (x * y) % m with arbitrary precision arithmetic |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
| ltu256(x:u256, y:u256) -> z:bool | true if x < y, false otherwise |
|
||||
+---------------------------------------------+-----------------------------------------------------------------+
|
||||
|
@ -39,7 +39,7 @@ using KnownStatePointer = std::shared_ptr<KnownState>;
|
||||
|
||||
/**
|
||||
* Identifier for a block, coincides with the tag number of an AssemblyItem but adds a special
|
||||
* ID for the inital block.
|
||||
* ID for the initial block.
|
||||
*/
|
||||
class BlockId
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ LinkerObject::matchLibrary(
|
||||
if (it != _libraryAddresses.end())
|
||||
return &it->second;
|
||||
// If the user did not supply a fully qualified library name,
|
||||
// try to match only the simple libary name
|
||||
// try to match only the simple library name
|
||||
size_t colon = _linkRefName.find(':');
|
||||
if (colon == string::npos)
|
||||
return nullptr;
|
||||
|
@ -59,7 +59,7 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleList(
|
||||
{
|
||||
std::vector<SimplificationRule<Pattern>> rules;
|
||||
rules += std::vector<SimplificationRule<Pattern>>{
|
||||
// arithmetics on constants
|
||||
// arithmetic on constants
|
||||
{{Instruction::ADD, {A, B}}, [=]{ return A.d() + B.d(); }, false},
|
||||
{{Instruction::MUL, {A, B}}, [=]{ return A.d() * B.d(); }, false},
|
||||
{{Instruction::SUB, {A, B}}, [=]{ return A.d() - B.d(); }, false},
|
||||
|
@ -67,7 +67,7 @@ void Rules::addRule(SimplificationRule<Pattern> const& _rule)
|
||||
|
||||
Rules::Rules()
|
||||
{
|
||||
// Multiple occurences of one of these inside one rule must match the same equivalence class.
|
||||
// Multiple occurrences of one of these inside one rule must match the same equivalence class.
|
||||
// Constants.
|
||||
Pattern A(Push);
|
||||
Pattern B(Push);
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
virtual LabelID newLabelId() = 0;
|
||||
/// Returns a label identified by the given name. Creates it if it does not yet exist.
|
||||
virtual LabelID namedLabel(std::string const& _name) = 0;
|
||||
/// Append a reference to a to-be-linked symobl.
|
||||
/// Append a reference to a to-be-linked symbol.
|
||||
/// Currently, we assume that the value is always a 20 byte number.
|
||||
virtual void appendLinkerSymbol(std::string const& _name) = 0;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public:
|
||||
virtual LabelID newLabelId() override;
|
||||
/// Returns a label identified by the given name. Creates it if it does not yet exist.
|
||||
virtual LabelID namedLabel(std::string const& _name) override;
|
||||
/// Append a reference to a to-be-linked symobl.
|
||||
/// Append a reference to a to-be-linked symbol.
|
||||
/// Currently, we assume that the value is always a 20 byte number.
|
||||
virtual void appendLinkerSymbol(std::string const& _name) override;
|
||||
|
||||
|
@ -56,7 +56,7 @@ protected:
|
||||
/// Registers the assignment.
|
||||
void handleAssignment(std::set<std::string> const& _names, Expression* _value);
|
||||
|
||||
/// Clears information about the valuse assigned to the given variables,
|
||||
/// Clears information about the values assigned to the given variables,
|
||||
/// for example at points where control flow is merged.
|
||||
void clearValues(std::set<std::string> const& _names);
|
||||
|
||||
|
@ -64,7 +64,7 @@ void SimplificationRules::addRule(SimplificationRule<Pattern> const& _rule)
|
||||
|
||||
SimplificationRules::SimplificationRules()
|
||||
{
|
||||
// Multiple occurences of one of these inside one rule must match the same equivalence class.
|
||||
// Multiple occurrences of one of these inside one rule must match the same equivalence class.
|
||||
// Constants.
|
||||
Pattern A(PatternKind::Constant);
|
||||
Pattern B(PatternKind::Constant);
|
||||
|
@ -448,7 +448,7 @@ void TypeChecker::overrideError(FunctionDefinition const& function, FunctionDefi
|
||||
{
|
||||
m_errorReporter.typeError(
|
||||
function.location(),
|
||||
SecondarySourceLocation().append("Overriden function is here:", super.location()),
|
||||
SecondarySourceLocation().append("Overridden function is here:", super.location()),
|
||||
message
|
||||
);
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ private:
|
||||
void checkContractDuplicateFunctions(ContractDefinition const& _contract);
|
||||
void checkContractDuplicateEvents(ContractDefinition const& _contract);
|
||||
void checkContractIllegalOverrides(ContractDefinition const& _contract);
|
||||
/// Reports a type error with an appropiate message if overriden function signature differs.
|
||||
/// Reports a type error with an appropriate message if overridden function signature differs.
|
||||
/// Also stores the direct super function in the AST annotations.
|
||||
void checkFunctionOverride(FunctionDefinition const& function, FunctionDefinition const& super);
|
||||
void overrideError(FunctionDefinition const& function, FunctionDefinition const& super, std::string message);
|
||||
|
@ -1169,11 +1169,11 @@ public:
|
||||
Statement const& body() const { return *m_body; }
|
||||
|
||||
private:
|
||||
/// For statement's initialization expresion. for(XXX; ; ). Can be empty
|
||||
/// For statement's initialization expression. for(XXX; ; ). Can be empty
|
||||
ASTPointer<Statement> m_initExpression;
|
||||
/// For statement's condition expresion. for(; XXX ; ). Can be empty
|
||||
/// For statement's condition expression. for(; XXX ; ). Can be empty
|
||||
ASTPointer<Expression> m_condExpression;
|
||||
/// For statement's loop expresion. for(;;XXX). Can be empty
|
||||
/// For statement's loop expression. for(;;XXX). Can be empty
|
||||
ASTPointer<ExpressionStatement> m_loopExpression;
|
||||
/// The body of the loop
|
||||
ASTPointer<Statement> m_body;
|
||||
|
@ -949,7 +949,7 @@ TypePointer RationalNumberType::binaryOperatorResult(Token::Value _operator, Typ
|
||||
RationalNumberType const& other = dynamic_cast<RationalNumberType const&>(*_other);
|
||||
if (Token::isCompareOp(_operator))
|
||||
{
|
||||
// Since we do not have a "BoolConstantType", we have to do the acutal comparison
|
||||
// Since we do not have a "BoolConstantType", we have to do the actual comparison
|
||||
// at runtime and convert to mobile typse first. Such a comparison is not a very common
|
||||
// use-case and will be optimized away.
|
||||
TypePointer thisMobile = mobileType();
|
||||
|
@ -1031,7 +1031,7 @@ public:
|
||||
/// @param _selfType if the function is bound, this has to be supplied and is the type of the
|
||||
/// expression the function is called on.
|
||||
bool canTakeArguments(TypePointers const& _arguments, TypePointer const& _selfType = TypePointer()) const;
|
||||
/// @returns true if the types of parameters are equal (does't check return parameter types)
|
||||
/// @returns true if the types of parameters are equal (doesn't check return parameter types)
|
||||
bool hasEqualArgumentTypes(FunctionType const& _other) const;
|
||||
|
||||
/// @returns true if the ABI is used for this call (only meaningful for external calls)
|
||||
|
@ -203,7 +203,7 @@ private:
|
||||
std::string arrayLengthFunction(ArrayType const& _type);
|
||||
/// @returns the name of a function that computes the number of bytes required
|
||||
/// to store an array in memory given its length (internally encoded, not ABI encoded).
|
||||
/// The function reverts for too large lengthes.
|
||||
/// The function reverts for too large lengths.
|
||||
std::string arrayAllocationSizeFunction(ArrayType const& _type);
|
||||
/// @returns the name of a function that converts a storage slot number
|
||||
/// or a memory pointer to the slot number / memory pointer for the data position of an array
|
||||
|
@ -363,8 +363,8 @@ void CompilerUtils::encodeToMemory(
|
||||
|
||||
// Stack during operation:
|
||||
// <v1> <v2> ... <vn> <mem_start> <dyn_head_1> ... <dyn_head_r> <end_of_mem>
|
||||
// The values dyn_head_i are added during the first loop and they point to the head part
|
||||
// of the ith dynamic parameter, which is filled once the dynamic parts are processed.
|
||||
// The values dyn_head_n are added during the first loop and they point to the head part
|
||||
// of the nth dynamic parameter, which is filled once the dynamic parts are processed.
|
||||
|
||||
// store memory start pointer
|
||||
m_context << Instruction::DUP1;
|
||||
|
@ -1751,7 +1751,7 @@ void ExpressionCompiler::appendShiftOperatorCode(Token::Value _operator, Type co
|
||||
{
|
||||
if (c_valueSigned)
|
||||
// In the following assembly snippet, xor_mask will be zero, if value_to_shift is positive.
|
||||
// Therefor xor'ing with xor_mask is the identity and the computation reduces to
|
||||
// Therefore xor'ing with xor_mask is the identity and the computation reduces to
|
||||
// div(value_to_shift, exp(2, shift_amount)), which is correct, since for positive values
|
||||
// arithmetic right shift is dividing by a power of two (which, as a bitwise operation, results
|
||||
// in discarding bits on the right and filling with zeros from the left).
|
||||
@ -1879,7 +1879,7 @@ void ExpressionCompiler::appendExternalFunctionCall(
|
||||
{
|
||||
m_context << u256(0);
|
||||
utils().fetchFreeMemoryPointer();
|
||||
// This touches too much, but that way we save some rounding arithmetics
|
||||
// This touches too much, but that way we save some rounding arithmetic
|
||||
m_context << u256(retSize) << Instruction::ADD << Instruction::MSTORE;
|
||||
}
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ bool SMTChecker::visit(FunctionDefinition const& _function)
|
||||
|
||||
void SMTChecker::endVisit(FunctionDefinition const&)
|
||||
{
|
||||
// TOOD we could check for "reachability", i.e. satisfiability here.
|
||||
// TODO we could check for "reachability", i.e. satisfiability here.
|
||||
// We only handle local variables, so we clear at the beginning of the function.
|
||||
// If we add storage variables, those should be cleared differently.
|
||||
removeLocalVariables();
|
||||
|
@ -119,7 +119,7 @@ MachineAssemblyObject AssemblyStack::assemble(Machine _machine) const
|
||||
julia::EVMAssembly assembly(true);
|
||||
julia::CodeTransform(assembly, *m_analysisInfo, m_language == Language::Yul, true)(*m_parserResult);
|
||||
object.bytecode = make_shared<eth::LinkerObject>(assembly.finalize());
|
||||
/// TOOD: fill out text representation
|
||||
/// TODO: fill out text representation
|
||||
return object;
|
||||
}
|
||||
case Machine::eWasm:
|
||||
|
@ -93,7 +93,7 @@ public:
|
||||
m_errorList(),
|
||||
m_errorReporter(m_errorList) {}
|
||||
|
||||
/// @returns the list of errors that occured during parsing and type checking.
|
||||
/// @returns the list of errors that occurred during parsing and type checking.
|
||||
ErrorList const& errors() const { return m_errorReporter.errors(); }
|
||||
|
||||
/// @returns the current state.
|
||||
|
@ -45,7 +45,7 @@ public:
|
||||
/// @param _contractDef The contract definition
|
||||
/// @return A JSON representation of the contract's user documentation
|
||||
static Json::Value userDocumentation(ContractDefinition const& _contractDef);
|
||||
/// Genereates the Developer's documentation of the contract
|
||||
/// Generates the Developer's documentation of the contract
|
||||
/// @param _contractDef The contract definition
|
||||
/// @return A JSON representation
|
||||
/// of the contract's developer documentation
|
||||
|
@ -31,7 +31,7 @@ namespace solidity
|
||||
{
|
||||
|
||||
/**
|
||||
* Standard JSON compiler interface, which expects a JSON input and returns a JSON ouput.
|
||||
* Standard JSON compiler interface, which expects a JSON input and returns a JSON output.
|
||||
* See docs/using-the-compiler#compiler-input-and-output-json-description.
|
||||
*/
|
||||
class StandardCompiler: boost::noncopyable
|
||||
|
@ -223,7 +223,7 @@ private:
|
||||
bool isSourcePastEndOfInput() const { return m_source.isPastEndOfInput(); }
|
||||
|
||||
TokenDesc m_skippedComment; // desc for current skipped comment
|
||||
TokenDesc m_nextSkippedComment; // desc for next skiped comment
|
||||
TokenDesc m_nextSkippedComment; // desc for next skipped comment
|
||||
|
||||
TokenDesc m_currentToken; // desc for current token (as returned by Next())
|
||||
TokenDesc m_nextToken; // desc for next token (one token look-ahead)
|
||||
|
3
scripts/codespell_whitelist.txt
Normal file
3
scripts/codespell_whitelist.txt
Normal file
@ -0,0 +1,3 @@
|
||||
iff
|
||||
nd
|
||||
assignend
|
@ -447,7 +447,7 @@ bool CommandLineInterface::readInputFilesAndConfigureRemappings()
|
||||
m_sourceCodes[g_stdinFileName] = dev::readStandardInput();
|
||||
if (m_sourceCodes.size() == 0)
|
||||
{
|
||||
cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicity." << endl;
|
||||
cerr << "No input files given. If you wish to use the standard input please specify \"-\" explicitly." << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -277,7 +277,7 @@ contract ico is safeMath {
|
||||
|
||||
function () external payable {
|
||||
/*
|
||||
Callback function. Simply calls the buy function as a beneficiary and there is no affilate address.
|
||||
Callback function. Simply calls the buy function as a beneficiary and there is no affiliate address.
|
||||
If they call the contract without any function then this process will be taken place.
|
||||
*/
|
||||
require( isICO() );
|
||||
@ -290,9 +290,9 @@ contract ico is safeMath {
|
||||
|
||||
If there is not at least 0.2 ether balance on the beneficiaryAddress then the amount of the ether which was intended for the purchase will be reduced by 0.2 and that will be sent to the address of the beneficiary.
|
||||
From the remaining amount calculate the reward with the help of the getIcoReward function.
|
||||
Only that affilate address is valid which has some token on it’s account.
|
||||
If there is a valid affilate address then calculate and credit the reward as well in the following way:
|
||||
With more than 1e12 token contract credit 5% reward based on the calculation that how many tokens did they buy when he was added as an affilate.
|
||||
Only that affiliate address is valid which has some token on it’s account.
|
||||
If there is a valid affiliate address then calculate and credit the reward as well in the following way:
|
||||
With more than 1e12 token contract credit 5% reward based on the calculation that how many tokens did they buy when he was added as an affiliate.
|
||||
More than 1e11 token: 4%
|
||||
More than 1e10 token: 3%
|
||||
More than 1e9 token: 2% below 1%
|
||||
@ -345,7 +345,7 @@ contract ico is safeMath {
|
||||
/*
|
||||
Crediting the premium token
|
||||
|
||||
@owner The corion token balance of this address will be set based on the calculation which shows that how many times can be the amount of the purchased tokens devided by 5000. So after each 5000 token we give 1 premium token.
|
||||
@owner The corion token balance of this address will be set based on the calculation which shows that how many times can be the amount of the purchased tokens divided by 5000. So after each 5000 token we give 1 premium token.
|
||||
*/
|
||||
uint256 _reward = (brought[owner].cor / 5e9) - brought[owner].corp;
|
||||
if ( _reward > 0 ) {
|
||||
@ -372,5 +372,5 @@ contract ico is safeMath {
|
||||
return startBlock <= block.number && block.number <= icoDelay && ( ! aborted ) && ( ! closed );
|
||||
}
|
||||
|
||||
event EICO(address indexed Address, uint256 indexed value, address Affilate, uint256 AffilateValue);
|
||||
event EICO(address indexed Address, uint256 indexed value, address Affiliate, uint256 AffilateValue);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ contract module {
|
||||
/*
|
||||
Check self for ready for functions or not.
|
||||
|
||||
@success Function call was successfull or not
|
||||
@success Function call was successful or not
|
||||
@active Ready for functions or not
|
||||
*/
|
||||
return (true, moduleStatus == status.Connected && block.number >= disabledUntil);
|
||||
|
@ -63,7 +63,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
function addModule(modules_s input, bool call) internal {
|
||||
/*
|
||||
Inside function for registration of the modules in the database.
|
||||
If the call is false, wont happen any direct call.
|
||||
If the call is false, won't happen any direct call.
|
||||
|
||||
@input _Structure of module.
|
||||
@call Is connect to the module or not.
|
||||
@ -88,7 +88,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
@name Name of module.
|
||||
@addr Address of module.
|
||||
@found Is there any result.
|
||||
@success Was the transaction succesfull or not.
|
||||
@success Was the transaction successful or not.
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName(name);
|
||||
if ( _success && _found ) { return (true, true, modules[_id].addr); }
|
||||
@ -204,7 +204,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
Deleting module from the database. Can be called only by the Publisher contract.
|
||||
|
||||
@name Name of module to delete.
|
||||
@bool Was the function successfull?
|
||||
@bool Was the function successful?
|
||||
@callCallback Call the replaceable module to confirm replacement or not.
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
@ -245,7 +245,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
@from from who.
|
||||
@to to who.
|
||||
@value amount.
|
||||
@bool Was the function successfull?
|
||||
@bool Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found && modules[_id].name == keccak256('Token') );
|
||||
@ -264,7 +264,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
|
||||
@roundID Number of Schelling round.
|
||||
@reward Coin emission in this Schelling round.
|
||||
@bool Was the function successfull?
|
||||
@bool Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found && modules[_id].name == keccak256('Schelling') );
|
||||
@ -283,7 +283,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
Every module will be informed about the ModuleHandler replacement.
|
||||
|
||||
@newHandler Address of the new ModuleHandler.
|
||||
@bool Was the function successfull?
|
||||
@bool Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success );
|
||||
@ -304,7 +304,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
|
||||
@owner address
|
||||
@value balance.
|
||||
@success was the function successfull?
|
||||
@success was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName('Token');
|
||||
require( _success && _found );
|
||||
@ -315,7 +315,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
Query of the whole token amount.
|
||||
|
||||
@value amount.
|
||||
@success was the function successfull?
|
||||
@success was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName('Token');
|
||||
require( _success && _found );
|
||||
@ -326,7 +326,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
Query of ICO state
|
||||
|
||||
@ico Is ICO in progress?.
|
||||
@success was the function successfull?
|
||||
@success was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName('Token');
|
||||
require( _success && _found );
|
||||
@ -337,7 +337,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
Query of number of the actual Schelling round.
|
||||
|
||||
@round Schelling round.
|
||||
@success was the function successfull?
|
||||
@success was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByName('Schelling');
|
||||
require( _success && _found );
|
||||
@ -350,7 +350,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
@to Place of new token
|
||||
@value Token amount
|
||||
|
||||
@success Was the function successfull?
|
||||
@success Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found && modules[_id].name == keccak256('Provider') );
|
||||
@ -367,7 +367,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
@to To who.
|
||||
@value Token amount.
|
||||
@fee Transaction fee will be charged or not?
|
||||
@success Was the function successfull?
|
||||
@success Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found );
|
||||
@ -382,7 +382,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
|
||||
@from From who.
|
||||
@value Token amount.
|
||||
@success Was the function successfull?
|
||||
@success Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found && modules[_id].name == keccak256('Provider') );
|
||||
@ -397,7 +397,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
|
||||
@from From who.
|
||||
@value Token amount.
|
||||
@success Was the function successfull?
|
||||
@success Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success && _found && modules[_id].name == keccak256('Schelling') );
|
||||
@ -413,7 +413,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
@moduleName Module name which will be configured
|
||||
@aType Type of variable (announcementType).
|
||||
@value New value
|
||||
@success Was the function successfull?
|
||||
@success Was the function successful?
|
||||
*/
|
||||
(bool _success, bool _found, uint256 _id) = getModuleIDByAddress(msg.sender);
|
||||
require( _success );
|
||||
@ -431,7 +431,7 @@ contract moduleHandler is multiOwner, announcementTypes {
|
||||
function freezing(bool forever) external {
|
||||
/*
|
||||
Freezing CORION Platform. Can be called only by the owner.
|
||||
Freez can not be recalled!
|
||||
Freeze can not be recalled!
|
||||
|
||||
@forever Is it forever or not?
|
||||
*/
|
||||
|
@ -118,7 +118,7 @@ contract premium is module, safeMath {
|
||||
@extraData Extra data to be received by the receiver
|
||||
@nonce Transaction count
|
||||
|
||||
@sucess Was the Function successful?
|
||||
@success Was the Function successful?
|
||||
*/
|
||||
_approve(spender, amount, nonce);
|
||||
require( thirdPartyPContractAbstract(spender).approvedCorionPremiumToken(msg.sender, amount, extraData) );
|
||||
|
@ -18,7 +18,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
}
|
||||
function transferEvent(address from, address to, uint256 value) external returns (bool success) {
|
||||
/*
|
||||
Transaction completed. This function is ony available for the modulehandler.
|
||||
Transaction completed. This function is only available for the modulehandler.
|
||||
It should be checked if the sender or the acceptor does not connect to the provider or it is not a provider itself if so than the change should be recorded.
|
||||
|
||||
@from From whom?
|
||||
@ -35,7 +35,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
New schelling round. This function is only available for the moduleHandler.
|
||||
We are recording the new schelling round and we are storing the whole current quantity of the tokens.
|
||||
We generate a reward quantity of tokens directed to the providers address. The collected interest will be tranfered from this contract.
|
||||
We generate a reward quantity of tokens directed to the providers address. The collected interest will be transferred from this contract.
|
||||
|
||||
@roundID Number of the schelling round.
|
||||
@reward token emission
|
||||
@ -228,7 +228,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
@website Provider’s website
|
||||
@country Provider’s country
|
||||
@info Provider’s short introduction.
|
||||
@rate Rate of the emission what is going to be transfered to the client by the provider.
|
||||
@rate Rate of the emission what is going to be transferred to the client by the provider.
|
||||
@isForRent is for Rent or not?
|
||||
@admin The admin’s address
|
||||
*/
|
||||
@ -328,7 +328,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
|
||||
@addr Address of the provider
|
||||
@height Height
|
||||
@rate The rate of the emission which will be transfered to the client.
|
||||
@rate The rate of the emission which will be transferred to the client.
|
||||
@isForRent Rent or not.
|
||||
@clientsCount Number of the clients.
|
||||
@priv Private or not?
|
||||
@ -356,7 +356,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
}
|
||||
function closeProvider() isReady external {
|
||||
/*
|
||||
Closing and inactivate the provider.
|
||||
Closing and deactivating the provider.
|
||||
It is only possible to close that active provider which is owned by the sender itself after calling the whole share of the emission.
|
||||
Whom were connected to the provider those clients will have to disconnect after they’ve called their share of emission which was not called before.
|
||||
*/
|
||||
@ -373,7 +373,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
Permition of the user to be able to connect to the provider.
|
||||
This can only be invited by the provider’s admin.
|
||||
With this kind of call only 100 address can be permited.
|
||||
With this kind of call only 100 address can be permitted.
|
||||
|
||||
@addr Array of the addresses for whom the connection is allowed.
|
||||
*/
|
||||
@ -391,7 +391,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
Disable of the user not to be able to connect to the provider.
|
||||
It is can called only for the admin of the provider.
|
||||
With this kind of call only 100 address can be permited.
|
||||
With this kind of call only 100 address can be permitted.
|
||||
|
||||
@addr Array of the addresses for whom the connection is allowed.
|
||||
*/
|
||||
@ -411,7 +411,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
Providers can not connect to other providers.
|
||||
If is a client at any provider, then it is not possible to connect to other provider one.
|
||||
It is only possible to connect to valid and active providers.
|
||||
If is an active provider then the client can only connect, if address is permited at the provider (Whitelist).
|
||||
If is an active provider then the client can only connect, if address is permitted at the provider (Whitelist).
|
||||
At private providers, the number of the client is restricted. If it reaches the limit no further clients are allowed to connect.
|
||||
This process has a transaction fee based on the senders whole token quantity.
|
||||
|
||||
@ -487,12 +487,12 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
Polling the share from the token emission token emission for clients and for providers.
|
||||
|
||||
It is optionaly possible to give an address of a beneficiary for whom we can transfer the accumulated amount. In case we don’t enter any address then the amount will be transfered to the caller’s address.
|
||||
It is optionally possible to give an address of a beneficiary for whom we can transfer the accumulated amount. In case we don’t enter any address then the amount will be transferred to the caller’s address.
|
||||
As the interest should be checked at each schelling round in order to get the share from that so to avoid the overflow of the gas the number of the check-rounds should be limited.
|
||||
Opcionalisan megadhato az ellenorzes koreinek szama. It is possible to enter optionaly the number of the check-rounds. If it is 0 then it is automatic.
|
||||
Opcionalisan megadhato az ellenorzes koreinek szama. It is possible to enter optionally the number of the check-rounds. If it is 0 then it is automatic.
|
||||
Provider variable should only be entered if the real owner of the provider is not the caller’s address.
|
||||
In case the client/provider was far behind then it is possible that this function should be called several times to check the total generated schelling rounds and to collect the share.
|
||||
If is neighter a client nor a provider then the function is not available.
|
||||
If is neither a client nor a provider then the function is not available.
|
||||
The tokens will be sent to the beneficiary from the address of the provider without any transaction fees.
|
||||
|
||||
@beneficiary Address of the beneficiary
|
||||
@ -784,7 +784,7 @@ contract provider is module, safeMath, announcementTypes {
|
||||
/*
|
||||
Inner function to check the ICO status.
|
||||
|
||||
@isICO Is the ICO in proccess or not?
|
||||
@isICO Is the ICO in process or not?
|
||||
*/
|
||||
(bool _success, bool _isICO) = moduleHandler(moduleHandlerAddress).isICO();
|
||||
require( _success );
|
||||
|
@ -264,7 +264,7 @@ contract publisher is announcementTypes, module, safeMath {
|
||||
function checkICO() internal returns (bool isICO) {
|
||||
/*
|
||||
Inner function to check the ICO status.
|
||||
@bool Is the ICO in proccess or not?
|
||||
@bool Is the ICO in process or not?
|
||||
*/
|
||||
(bool _success, bool _isICO) = moduleHandler(moduleHandlerAddress).isICO();
|
||||
require( _success );
|
||||
|
@ -147,7 +147,7 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
@from From who
|
||||
@to To who
|
||||
@value Amount
|
||||
@bool Was the transaction succesfull?
|
||||
@bool Was the transaction successful?
|
||||
*/
|
||||
require( super.isModuleHandler(msg.sender) );
|
||||
if ( to == address(this) ) {
|
||||
@ -442,14 +442,14 @@ contract schelling is module, announcementTypes, schellingVars {
|
||||
if ( ! round.voted ) {
|
||||
newRound.reward = round.reward;
|
||||
}
|
||||
uint256 aboves;
|
||||
uint256 above;
|
||||
for ( uint256 a=currentRound ; a>=currentRound-interestCheckRounds ; a-- ) {
|
||||
if (a == 0) { break; }
|
||||
prevRound = getRound(a);
|
||||
if ( prevRound.totalAboveWeight > prevRound.totalBelowWeight ) { aboves++; }
|
||||
if ( prevRound.totalAboveWeight > prevRound.totalBelowWeight ) { above++; }
|
||||
}
|
||||
uint256 expansion;
|
||||
if ( aboves >= interestCheckAboves ) {
|
||||
if ( above >= interestCheckAboves ) {
|
||||
expansion = getTotalSupply() * interestRate / interestRateM / 100;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ pragma solidity ^0.4.6;
|
||||
/// @dev This contract tracks the
|
||||
|
||||
|
||||
/// is rules the relation betwen a donor and a recipient
|
||||
/// is rules the relation between a donor and a recipient
|
||||
/// in order to guaranty to the donor that the job will be done and to guaranty
|
||||
/// to the recipient that he will be paid
|
||||
|
||||
|
@ -16,7 +16,7 @@ contract Bounty is PullPayment, Destructible {
|
||||
event TargetCreated(address createdAddress);
|
||||
|
||||
/**
|
||||
* @dev Fallback function allowing the contract to recieve funds, if they haven't already been claimed.
|
||||
* @dev Fallback function allowing the contract to receive funds, if they haven't already been claimed.
|
||||
*/
|
||||
function() external payable {
|
||||
if (claimed) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
pragma solidity ^0.4.11;
|
||||
|
||||
/**
|
||||
* @title Helps contracts guard agains rentrancy attacks.
|
||||
* @title Helps contracts guard against rentrancy attacks.
|
||||
* @author Remco Bloemen <remco@2π.com>
|
||||
* @notice If you mark a function `nonReentrant`, you should also
|
||||
* mark it `external`.
|
||||
|
@ -29,7 +29,7 @@ contract LimitedTransferToken is ERC20 {
|
||||
|
||||
/**
|
||||
* @dev Checks modifier and allows transfer if tokens are not locked.
|
||||
* @param _to The address that will recieve the tokens.
|
||||
* @param _to The address that will receive the tokens.
|
||||
* @param _value The amount of tokens to be transferred.
|
||||
*/
|
||||
function transfer(address _to, uint256 _value) canTransfer(msg.sender, _value) public {
|
||||
@ -39,7 +39,7 @@ contract LimitedTransferToken is ERC20 {
|
||||
/**
|
||||
* @dev Checks modifier and allows transfer if tokens are not locked.
|
||||
* @param _from The address that will send the tokens.
|
||||
* @param _to The address that will recieve the tokens.
|
||||
* @param _to The address that will receive the tokens.
|
||||
* @param _value The amount of tokens to be transferred.
|
||||
*/
|
||||
function transferFrom(address _from, address _to, uint256 _value) public canTransfer(_from, _value) {
|
||||
|
@ -27,7 +27,7 @@ contract MintableToken is StandardToken, Ownable {
|
||||
|
||||
/**
|
||||
* @dev Function to mint tokens
|
||||
* @param _to The address that will recieve the minted tokens.
|
||||
* @param _to The address that will receive the minted tokens.
|
||||
* @param _amount The amount of tokens to mint.
|
||||
* @return A boolean that indicates if the operation was successful.
|
||||
*/
|
||||
|
@ -18,7 +18,7 @@ contract SimpleToken is StandardToken {
|
||||
uint256 public INITIAL_SUPPLY = 10000;
|
||||
|
||||
/**
|
||||
* @dev Contructor that gives msg.sender all of existing tokens.
|
||||
* @dev Constructor that gives msg.sender all of existing tokens.
|
||||
*/
|
||||
constructor() public {
|
||||
totalSupply = INITIAL_SUPPLY;
|
||||
|
@ -21,7 +21,7 @@ contract StandardToken is ERC20, BasicToken {
|
||||
* @dev Transfer tokens from one address to another
|
||||
* @param _from address The address which you want to send tokens from
|
||||
* @param _to address The address which you want to transfer to
|
||||
* @param _value uint256 the amout of tokens to be transfered
|
||||
* @param _value uint256 the amount of tokens to be transferred
|
||||
*/
|
||||
function transferFrom(address _from, address _to, uint256 _value) public {
|
||||
uint256 _allowance = allowed[_from][msg.sender];
|
||||
@ -56,7 +56,7 @@ contract StandardToken is ERC20, BasicToken {
|
||||
* @dev Function to check the amount of tokens that an owner allowed to a spender.
|
||||
* @param _owner address The address which owns the funds.
|
||||
* @param _spender address The address which will spend the funds.
|
||||
* @return A uint256 specifing the amount of tokens still avaible for the spender.
|
||||
* @return A uint256 specifying the amount of tokens still available for the spender.
|
||||
*/
|
||||
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
|
||||
return allowed[_owner][_spender];
|
||||
|
@ -69,7 +69,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Revoke the grant of tokens of a specifed address.
|
||||
* @dev Revoke the grant of tokens of a specified address.
|
||||
* @param _holder The address which will have its tokens revoked.
|
||||
* @param _grantId The id of the token grant.
|
||||
*/
|
||||
@ -135,13 +135,13 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Calculate amount of vested tokens at a specifc time.
|
||||
* @param tokens uint256 The amount of tokens grantted.
|
||||
* @dev Calculate amount of vested tokens at a specific time.
|
||||
* @param tokens uint256 The amount of tokens granted.
|
||||
* @param time uint64 The time to be checked
|
||||
* @param start uint64 A time representing the begining of the grant
|
||||
* @param start uint64 A time representing the beginning of the grant
|
||||
* @param cliff uint64 The cliff period.
|
||||
* @param vesting uint64 The vesting period.
|
||||
* @return An uint256 representing the amount of vested tokensof a specif grant.
|
||||
* @return An uint256 representing the amount of vested tokens of a specific grant.
|
||||
* transferableTokens
|
||||
* | _/-------- vestedTokens rect
|
||||
* | _/
|
||||
@ -186,7 +186,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Get all information about a specifc grant.
|
||||
* @dev Get all information about a specific grant.
|
||||
* @param _holder The address which will have its tokens revoked.
|
||||
* @param _grantId The id of the token grant.
|
||||
* @return Returns all the values that represent a TokenGrant(address, value, start, cliff,
|
||||
@ -226,7 +226,7 @@ contract VestedToken is StandardToken, LimitedTransferToken {
|
||||
* @dev Calculate the amount of non vested tokens at a specific time.
|
||||
* @param grant TokenGrant The grant to be checked.
|
||||
* @param time uint64 The time to be checked
|
||||
* @return An uint256 representing the amount of non vested tokens of a specifc grant on the
|
||||
* @return An uint256 representing the amount of non vested tokens of a specific grant on the
|
||||
* passed time frame.
|
||||
*/
|
||||
function nonVestedTokens(TokenGrant grant, uint64 time) private view returns (uint256) {
|
||||
|
@ -385,7 +385,7 @@ contract Wallet is multisig, multiowned, daylimit {
|
||||
emit Deposit(msg.sender, msg.value);
|
||||
}
|
||||
|
||||
// Outside-visible transact entry point. Executes transacion immediately if below daily spend limit.
|
||||
// Outside-visible transact entry point. Executes transaction immediately if below daily spend limit.
|
||||
// If not, goes into multisig process. We provide a hash on return to allow the sender to provide
|
||||
// shortcuts for the other confirmations (allowing them to avoid replicating the _to, _value
|
||||
// and _data arguments). They still get the option of using them if they want, anyways.
|
||||
|
@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(multiple_params)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(multiple_methods_order)
|
||||
{
|
||||
// methods are expected to be in alpabetical order
|
||||
// methods are expected to be in alphabetical order
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
function f(uint a) public returns (uint d) { return a * 7; }
|
||||
|
@ -6387,9 +6387,9 @@ BOOST_AUTO_TEST_CASE(return_multiple_strings_of_various_sizes)
|
||||
"ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ"
|
||||
);
|
||||
vector<size_t> lengthes{0, 30, 32, 63, 64, 65, 210, 300};
|
||||
for (auto l1: lengthes)
|
||||
for (auto l2: lengthes)
|
||||
vector<size_t> lengths{0, 30, 32, 63, 64, 65, 210, 300};
|
||||
for (auto l1: lengths)
|
||||
for (auto l2: lengths)
|
||||
{
|
||||
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
|
||||
bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2));
|
||||
@ -6456,9 +6456,9 @@ BOOST_AUTO_TEST_CASE(bytes_in_function_calls)
|
||||
compileAndRun(sourceCode, 0, "Main");
|
||||
string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
string s2("ABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZABCDEFGHIJKLMNOPQRSTUVXYZ");
|
||||
vector<size_t> lengthes{0, 31, 64, 65};
|
||||
for (auto l1: lengthes)
|
||||
for (auto l2: lengthes)
|
||||
vector<size_t> lengths{0, 31, 64, 65};
|
||||
for (auto l1: lengths)
|
||||
for (auto l2: lengths)
|
||||
{
|
||||
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
|
||||
bytes dyn2 = encodeArgs(u256(l2), s2.substr(0, l2));
|
||||
@ -6497,8 +6497,8 @@ BOOST_AUTO_TEST_CASE(return_bytes_internal)
|
||||
)";
|
||||
compileAndRun(sourceCode, 0, "Main");
|
||||
string s1("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
|
||||
vector<size_t> lengthes{0, 31, 64, 65};
|
||||
for (auto l1: lengthes)
|
||||
vector<size_t> lengths{0, 31, 64, 65};
|
||||
for (auto l1: lengths)
|
||||
{
|
||||
bytes dyn1 = encodeArgs(u256(l1), s1.substr(0, l1));
|
||||
bytes args1 = encodeArgs(u256(0x20)) + dyn1;
|
||||
|
@ -77,7 +77,7 @@ Declaration const& resolveDeclaration(
|
||||
)
|
||||
{
|
||||
ASTNode const* scope = &_sourceUnit;
|
||||
// bracers are required, cause msvc couldnt handle this macro in for statement
|
||||
// bracers are required, cause msvc couldn't handle this macro in for statement
|
||||
for (string const& namePart: _namespacedName)
|
||||
{
|
||||
auto declarations = _resolver.resolveName(namePart, scope);
|
||||
@ -319,7 +319,7 @@ BOOST_AUTO_TEST_CASE(short_circuiting)
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(code.begin(), code.end(), expectation.begin(), expectation.end());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(arithmetics)
|
||||
BOOST_AUTO_TEST_CASE(arithmetic)
|
||||
{
|
||||
char const* sourceCode = R"(
|
||||
contract test {
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
"\nOptimized: " + toHex(optimizedOutput));
|
||||
}
|
||||
|
||||
/// @returns the number of intructions in the given bytecode, not taking the metadata hash
|
||||
/// @returns the number of instructions in the given bytecode, not taking the metadata hash
|
||||
/// into account.
|
||||
size_t numInstructions(bytes const& _bytecode, boost::optional<Instruction> _which = boost::optional<Instruction>{})
|
||||
{
|
||||
|
@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(environment_access)
|
||||
"this",
|
||||
"address(1).balance"
|
||||
};
|
||||
// ``block.blockhash`` and ``blockhash`` are tested seperately below because their usage will
|
||||
// ``block.blockhash`` and ``blockhash`` are tested separately below because their usage will
|
||||
// produce warnings that can't be handled in a generic way.
|
||||
vector<string> pure{
|
||||
"msg.data",
|
||||
|
@ -1,4 +1,4 @@
|
||||
// This tests a crash that occured because we did not stop for fatal errors.
|
||||
// This tests a crash that occurred because we did not stop for fatal errors.
|
||||
contract C {
|
||||
struct S {
|
||||
ftring a;
|
||||
@ -8,4 +8,4 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError: (113-119): Identifier not found or not unique.
|
||||
// DeclarationError: (114-120): Identifier not found or not unique.
|
||||
|
Loading…
Reference in New Issue
Block a user