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

Mark state variables immutable where possible #192

Closed
wants to merge 1 commit into from

Conversation

sporejack
Copy link
Contributor

@sporejack sporejack commented Jul 12, 2021

Motivation

During the Code Arena audit, it was flagged (specifically in #40) that some state variables are likely able to be marked as immutable.

Changes

  • Mark collateralAsset in Insurance.sol as immutable
  • Mark token in Insurance.sol as immutable
  • Mark insuranceContract in Liquidation.sol as immutable
  • Mark fastGasOracle in Liquidation.sol as immutable
  • Mark tracer in Pricing.sol as immutable

@sporejack sporejack added the enhancement New feature or request label Jul 12, 2021
@sporejack sporejack self-assigned this Jul 12, 2021
@sporejack sporejack marked this pull request as ready for review July 12, 2021 05:43
Copy link
Contributor

@kumar-ish kumar-ish left a comment

Choose a reason for hiding this comment

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

The issue that you were referring to was done with manual analysis and not comprehensive; refer to this, done by someone with a custom Solidity compiler (note that some of the variables such as insurance in Pricing.sol weren't picked up by the one you mentioned).

@OsmanBran
Copy link
Contributor

Closing as issue fixed by #206

@OsmanBran OsmanBran closed this Jul 19, 2021
@OsmanBran OsmanBran deleted the 827-immutable-state-variables branch July 19, 2021 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants