code-423n4 / 2021-04-marginswap-findings

1 stars 0 forks source link

isStakePenalizer differtent than other functions in RoleAware.sol #12

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Email address

mail@gpersoon.com

Handle

gpersoon

Eth address

gpersoon.eth

Vulnerability details

This is a minor suggestion.

The function isStakePenalizer in RoleAware.sol uses roles.getRole... However all other function use roleCache...

It's not clear why this difference exists.

Impact

If roleCache could also be used a tiny amount of gas could be safed.

Proof of concept

Recommended mitigation steps

Check if isStakePenalizer can use roleCache, in that case update the source. Otherwise provide a comment why roles.getRole is neccesary

zscole commented 3 years ago

This submission has been judged as non-critical as it has no impact on the security or function of the contract.