-
Notifications
You must be signed in to change notification settings - Fork 214
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
Add static contract analysis to CI #93
Conversation
58d5575
to
5027712
Compare
ce4fa35
to
2443d17
Compare
bdb0ee7
to
1f9ee17
Compare
0e24b47
to
ce8ef4d
Compare
@@ -125,7 +125,7 @@ contract ArgentENSManager is IENSManager, Owned, Managed { | |||
* @param _subnode The target subnode. | |||
* @return true if the subnode is available. | |||
*/ | |||
function isAvailable(bytes32 _subnode) public view returns (bool) { | |||
function isAvailable(bytes32 _subnode) external view returns (bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change necessary? I thought the idea was to not touch the infrastructure contracts for the next release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were raised by slither
on the ENS contracts for this rule. They are not dangerous so have ignored them for now but good to fix in future.
@@ -46,7 +46,7 @@ contract ArgentENSResolver is Owned, Managed, ENSResolver { | |||
* @param _node The node to update. | |||
* @param _addr The address to set. | |||
*/ | |||
function setAddr(bytes32 _node, address _addr) public onlyManager { | |||
function setAddr(bytes32 _node, address _addr) external onlyManager { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above. Are these changes necessary for Slither or is just cleaning?
_wallet.setOwner(recoveryOwner); | ||
guardianStorage.setLock(_wallet, 0); | ||
|
||
emit RecoveryFinalized(address(_wallet), config.recovery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be recoveryOwner
and not config.recovery
.
delete recoveryConfigs[address(_wallet)]; | ||
guardianStorage.setLock(_wallet, 0); | ||
|
||
emit RecoveryCanceled(address(_wallet), config.recovery); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we deleted the storage slot at position recoveryConfigs[address(_wallet)]
, shouldn't config.recovery
always return 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you're right.
Configure slither run
2046893
to
e3c35ce
Compare
as per conversation with olivdb
Add exteptions to comply with the newly released slither 0.6.11
Also add test:coverage details
…ning in infrastructure contracts as those will not be updated in this release
81b43ee
to
d7ce2fc
Compare
as those won't be upgraded in next release 2.0
@@ -145,9 +145,11 @@ contract RecoveryManager is BaseModule, RelayerModule { | |||
*/ | |||
function cancelRecovery(BaseWallet _wallet) external onlyExecute onlyWhenRecovery(_wallet) { | |||
RecoveryConfig storage config = recoveryConfigs[address(_wallet)]; | |||
emit RecoveryCanceled(address(_wallet), config.recovery); | |||
guardianStorage.setLock(_wallet, 0); | |||
address recoveryOwner = config.recovery; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since config
is only used to define recoveryOwner
it is probably more efficient to do
address recoveryOwner = recoveryConfigs[address(_wallet)].recovery;
ffe349c
to
1a58c5a
Compare
Enables static analysis on the contracts using
slither
https://github.com/crytic/slitherThis is run by CI in a parallel python-based container on all builds now. Some valid suggested fixes were applied the rest were ignored in the
slither.db.json
. Two new npm commands addedsecurity:slither
andsecurity:slither:triage
, the former runs slither analyzer on the contracts and the latter runs the same but in triage mode allowing us to ignore errors that are either false positives or we don't consider a threat.Includes extracting all test contracts out in a
/contracts-test
folder due to overlap in contract names between dappsys and openzeppelin contracts we use in unit testing, namelyIERC20
which trips upslither
atm.Removes duplication of
IUniswapExchange
andIUniswapFactory
contract definitions which otherwise causesslither
to error .Found and logged a couple of problems with the latest
slither release 0.6.11
crytic/slither#456 and crytic/slither#457. Those were resolved inslither release 0.6.12