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

QA Report #297

Open
code423n4 opened this issue Sep 1, 2022 · 0 comments
Open

QA Report #297

code423n4 opened this issue Sep 1, 2022 · 0 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

code423n4 commented Sep 1, 2022

SUMMARY

[L-01] REPLACE INLINE ASSEMBLY WITH ACCOUNT.CODE.LENGTH

<address>.code.length can be used in Solidity >= 0.8.0 to access an account's code size and check if it is a contract without inline assembly.

There is 1 instance of this issue:

KernalUtils.sol#ensureContract

File: src/utils/KernelUtils.sol

31   function ensureContract(address target_) view {
32      uint256 size;
33      assembly {
34          size := extcodesize(target_)
35      }
36      if (size == 0) revert TargetNotAContract(target_);
37:  }

[N-01] INCORRECT COMMENT

Returns a bool flag for whether the tokens have been claimed, not the amount of tokens reclaimed.

There is 1 instance of this issue:

Governance.sol

File: src/policies/Governance.sol

116:   /// @notice Return the amount of tokens reclaimed by a user after voting on a proposal id.

[N-02] SAFEAPPROVE() IS DEPRECATED

safeApprove() is deprecated in favor of safeIncreaseAllowance() and safeDecreaseAllowance().

There are 2 instance(s) of this issue:

Operator.sol#configureDependencies

File: src/policies/Operator.sol    #1

167:   ohm.safeApprove(address(MINTR), type(uint256).max);

BondCallback.sol#configureDependencies

File: src/policies/BondCallback.sol    #2

57:   ohm.safeApprove(address(MINTR), type(uint256).max);

[N-03] OPEN TODOS

Code architecture, incentives, and error handling/reporting questions/issues should be resolved before deployment

There are 3 instance(s) of this issue:

Operator.sol#_addObservation

File: src/policies/Operator.sol    #1

657:   /// TODO determine if this should use the last price from the MA or recalculate the current price, ideally last price is ok since it should have been just updated and should include check against secondary?

TreasuryCustodian.sol

File: src/policies/TreasuryCustodian.sol    #2

51    // TODO Currently allows anyone to revoke any approval EXCEPT activated policies.
52:   // TODO must reorg policy storage to be able to check for deactivated policies.

TreasuryCustodian.sol#revokePolicyApprovals

File: src/policies/TreasuryCustodian.sol    #3

56:   // TODO Make sure `policy_` is an actual policy and not a random address.
@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Sep 1, 2022
code423n4 added a commit that referenced this issue Sep 1, 2022
code423n4 added a commit that referenced this issue Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

1 participant