Skip to content

Commit

Permalink
Ignore a set of SWC-123 warnings,
Browse files Browse the repository at this point in the history
2 of those are false positives reported with following issue
Logged Consensys/truffle-security#224
The rest are valid ignores.
  • Loading branch information
elenadimitrova authored and area committed Jul 23, 2019
1 parent be8896a commit 57992f3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions contracts/ContractRecovery.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import "./IRecovery.sol";

/// @title Used for recovery in both ColonyNetwork and Colony instances
/// @notice Implements functions defined in IRecovery interface
contract ContractRecovery is CommonStorage {
contract ContractRecovery is CommonStorage { // ignore-swc-123
uint8 constant RECOVERY_ROLE = uint8(ColonyDataTypes.ColonyRole.Recovery);

event RecoveryRoleSet(address indexed user, bool setTo);
Expand All @@ -36,7 +36,7 @@ contract ContractRecovery is CommonStorage {
require(_slot != RESOLVER_SLOT, "colony-common-protected-variable");

// NB. This isn't necessarily a colony - could be ColonyNetwork. But they both have this function, so it's okay.
IRecovery(address(this)).checkNotAdditionalProtectedVariable(_slot);
IRecovery(address(this)).checkNotAdditionalProtectedVariable(_slot); // ignore-swc-123

// Protect key variables
uint64 _recoveryRolesCount = recoveryRolesCount;
Expand Down
6 changes: 3 additions & 3 deletions contracts/extensions/OldRolesFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import "./ExtensionFactory.sol";
import "./OldRoles.sol";


contract OldRolesFactory is ExtensionFactory, ColonyDataTypes { // ignore-swc-123. TODO Any takers to explain to me?
contract OldRolesFactory is ExtensionFactory, ColonyDataTypes { // ignore-swc-123
mapping (address => OldRoles) public deployedExtensions;

function deployExtension(address _colony) external {
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root");
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root"); // ignore-swc-123
require(deployedExtensions[_colony] == OldRoles(0x00), "colony-extension-already-deployed");
OldRoles newExtensionAddress = new OldRoles(_colony);
deployedExtensions[_colony] = newExtensionAddress;
emit ExtensionDeployed("OldRoles", _colony, address(newExtensionAddress));
}

function removeExtension(address _colony) external {
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root");
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root"); // ignore-swc-123
deployedExtensions[_colony] = OldRoles(0x00);
emit ExtensionRemoved("OldRoles", _colony);
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/extensions/OneTxPaymentFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract OneTxPaymentFactory is ExtensionFactory, ColonyDataTypes { // ignore-sw
mapping (address => OneTxPayment) public deployedExtensions;

function deployExtension(address _colony) external {
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root");
require(IColony(_colony).hasUserRole(msg.sender, 1, ColonyRole.Root), "colony-extension-user-not-root"); // ignore-swc-123
require(deployedExtensions[_colony] == OneTxPayment(0x00), "colony-extension-already-deployed");
OneTxPayment newExtensionAddress = new OneTxPayment(_colony);
deployedExtensions[_colony] = newExtensionAddress;
Expand Down

0 comments on commit 57992f3

Please sign in to comment.