Refactored error handling and minor code cleanup #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
throw
has been deprecated in newer versions of Solidity in favor of theassert
,revert
, andrequire
functions. The 4 instances ofthrow
in this code have been refactored to utilize the new preferred functions instead. The logic in these checkpoints was also adjusted to reflect the usage of the newer functions.My editor seems to have automatically deleted extraneous whitespaces within the document, as visible in the comparison. I manually included a space between all instances of
if
and the following(
for consistency's sake, since a couple instances did not have a whitespace betweenif
and(
though most of them did.Please look over the changes to the error handling checkpoints and consequent changes to the logic applied in those checkpoints. I have made all changes based off of what little I understand of the holistic function of those checks.
Even if I implemented the incorrect logic or used the wrong refactored functions (e.g. I used
assert
whereas I should have usedrequire
, or vice-versa), I have hopefully pointed out the areas that need to be properly refactored in order to comply with current and planned Solidity changes.e: minor text fix