Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expressions and Control Structures - to test and report #8

Open
ghost opened this issue Oct 10, 2018 · 0 comments
Open

Expressions and Control Structures - to test and report #8

ghost opened this issue Oct 10, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 10, 2018

Section:
https://github.com/arrayio/array-io-solidity/blob/master/control-structures.rst#error-handling-assert-require-revert-and-exceptions

An assert-style exception is generated in the following situations:

If you access an array at a too large or negative index (i.e. x[i] where i >= x.length or i < 0).
If you access a fixed-length bytesN at a too large or negative index.
If you divide or modulo by zero (e.g. 5 / 0 or 23 % 0).
If you shift by a negative amount.
If you convert a value too big or negative into an enum type.
If you call a zero-initialized variable of internal function type.
If you call assert with an argument that evaluates to false.
A require-style exception is generated in the following situations:

Calling throw.
Calling require with an argument that evaluates to false.
If you call a function via a message call but it does not finish properly (i.e. it runs out of gas, has no matching function, or throws an exception itself), except when a low level operation call, send, delegatecall or callcode is used. The low level operations never throw exceptions but indicate failures by returning false.
If you create a contract using the new keyword but the contract creation does not finish properly (see above for the definition of "not finish properly").
If you perform an external function call targeting a contract that contains no code.
If your contract receives Ether via a public function without payable modifier (including the constructor and the fallback function).
If your contract receives Ether via a public getter function.
If a .transfer() fails.

  1. Does it work for Array? Which parts do?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants