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

fix(dec-2020-audit): [N10] Unnecessary type cast #2316

Merged
merged 3 commits into from
Dec 18, 2020

Conversation

chrismaree
Copy link
Member

Problem identified in audit:

In lines 102 and 104 of PerpetualCreator.sol the derivative variable is cast to the address type. Since it is defined as address type, the casts are unnecessary.

Solution in this PR
The redundant type casting was removed. This change was also made to the EMP creator, which was not audited but the change was made for consistency.

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
@chrismaree chrismaree added the dec-2020-audit Fixes for the perpetual, optimistic oracle, ancillary DVM data and financial product library audit. label Dec 17, 2020
@coveralls
Copy link

coveralls commented Dec 17, 2020

Coverage Status

Coverage remained the same at 93.157% when pulling 943c7f6 on chrismaree/audit-unnecessary-typecast into 0796d56 on master.

Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch LGTM

Copy link
Member

@mrice32 mrice32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! This one is interesting -- why was this here in the first place?

@@ -87,9 +87,9 @@ contract ExpiringMultiPartyCreator is ContractCreator, Testable, Lockable {

_registerContract(new address[](0), address(derivative));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove the cast on this line as well?

@@ -99,9 +99,9 @@ contract PerpetualCreator is ContractCreator, Testable, Lockable {

_registerContract(new address[](0), address(derivative));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Signed-off-by: Christopher Maree <christopher.maree@gmail.com>
@chrismaree chrismaree merged commit 9ce936b into master Dec 18, 2020
@chrismaree chrismaree deleted the chrismaree/audit-unnecessary-typecast branch December 18, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dec-2020-audit Fixes for the perpetual, optimistic oracle, ancillary DVM data and financial product library audit.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants