diff --git a/contracts/ControllerV1.sol b/contracts/ControllerV1.sol index 104efed..a871108 100644 --- a/contracts/ControllerV1.sol +++ b/contracts/ControllerV1.sol @@ -99,6 +99,10 @@ contract ControllerV1 is uint256 expectedPodId, string memory _imageUrl ) external override { + require(_members.length > 0, "cannot have 0 members"); + require(threshold > 0, "threshold must be more than 0"); + require(_label != bytes32(0), "label cannot be blank"); + require(bytes(_ensString).length > 0, "ensString cannot be empty"); address safe = createSafe(_members, threshold, expectedPodId); _createPod( diff --git a/contracts/MemberTeller.sol b/contracts/MemberTeller.sol index ebba679..b91c933 100644 --- a/contracts/MemberTeller.sol +++ b/contracts/MemberTeller.sol @@ -33,6 +33,8 @@ contract MemberTeller { function memberTellerCheck(uint256 podId, bytes memory data) internal { if (bytes4(data) == ENCODED_SIG_ADD_OWNER) { + // Ensure data is at minimum, the length required for the below logic. + require(data.length >= 24, "incorrect data length"); address mintMember; assembly { // shift 0x4 for the sig + 0x20 padding @@ -41,6 +43,8 @@ contract MemberTeller { memberToken.mint(mintMember, podId, getSyncData()); } if (bytes4(data) == ENCODED_SIG_REMOVE_OWNER) { + // Ensure data is at minimum, the length required for the below logic. + require(data.length >= 44, "incorrect data length"); address burnMember; assembly { // note: consecutive addresses are packed into a single memory slot @@ -51,6 +55,8 @@ contract MemberTeller { memberToken.burn(burnMember, podId); } if (bytes4(data) == ENCODED_SIG_SWAP_OWNER) { + // Ensure data is at minimum, the length required for the below logic. + require(data.length >= 64, "incorrect data length"); address burnMember; address mintMember; assembly { diff --git a/contracts/MemberToken.sol b/contracts/MemberToken.sol index d2a2c47..798273a 100644 --- a/contracts/MemberToken.sol +++ b/contracts/MemberToken.sol @@ -38,6 +38,10 @@ contract MemberToken is ERC1155Supply, Ownable { // Note that OpenSea does not currently update contract metadata when this value is changed. - Nov 2021 function setContractURI(string memory newContractURI) public onlyOwner { + require( + bytes(newContractURI).length > 0, + "newContractURI cannot be empty" + ); _contractURI = newContractURI; } diff --git a/contracts/MultiCreateV1.sol b/contracts/MultiCreateV1.sol index 70dc315..2d6688f 100644 --- a/contracts/MultiCreateV1.sol +++ b/contracts/MultiCreateV1.sol @@ -8,6 +8,7 @@ contract MultiCreateV1 { IMemberToken immutable memberToken; constructor(address _memberToken) { + require(_memberToken != address(0), "member token can't be 0 address"); memberToken = IMemberToken(_memberToken); } @@ -26,7 +27,9 @@ contract MultiCreateV1 { string[] memory _imageUrls ) public returns (address[] memory) { uint256 numPods = _thresholds.length; + require(numPods > 0, "can't call with 0 pods"); require(_members.length == numPods, "incorrect members array"); + require(_admins.length == numPods, "incorrect admins array"); require(_labels.length == numPods, "incorrect labels array"); require(_ensStrings.length == numPods, "incorrect ensStrings array"); require(_imageUrls.length == numPods, "incorrect imageUrls array"); diff --git a/contracts/PermissionManager.sol b/contracts/PermissionManager.sol index 9abcc53..f5433b8 100644 --- a/contracts/PermissionManager.sol +++ b/contracts/PermissionManager.sol @@ -1,6 +1,7 @@ pragma solidity ^0.8.7; import "openzeppelin-contracts/access/AccessControl.sol"; +import "openzeppelin-contracts/utils/Address.sol"; // This contract will be the owner of all other contracts in the ecosystem. contract PermissionManager is AccessControl { @@ -13,6 +14,7 @@ contract PermissionManager is AccessControl { public onlyRole(DEFAULT_ADMIN_ROLE) { + Address.isContract(contractAddress); // Call uses the context of this contract, so msg.sender of other contracts // will be this contract. (bool success, ) = contractAddress.call(data); diff --git a/contracts/SafeTeller.sol b/contracts/SafeTeller.sol index ec80faf..cbfefd1 100644 --- a/contracts/SafeTeller.sol +++ b/contracts/SafeTeller.sol @@ -42,6 +42,9 @@ contract SafeTeller { address _gnosisMasterAddress, address _fallbackHanderAddress ) { + require(_proxyFactoryAddress != address(0), "Invalid address"); + require(_gnosisMasterAddress != address(0), "Invalid address"); + require(_fallbackHanderAddress != address(0), "Invalid address"); proxyFactoryAddress = _proxyFactoryAddress; gnosisMasterAddress = _gnosisMasterAddress; fallbackHandlerAddress = _fallbackHanderAddress; @@ -62,6 +65,8 @@ contract SafeTeller { _newSafeTeller ); + require(_newSafeTeller != address(0), "safe teller can't be 0 address"); + bool enableSuccess = IGnosisSafe(_safe).execTransactionFromModule( _safe, 0, diff --git a/contracts/ens/IPodEnsRegistrar.sol b/contracts/ens/IPodEnsRegistrar.sol index 3dfca96..a72282d 100644 --- a/contracts/ens/IPodEnsRegistrar.sol +++ b/contracts/ens/IPodEnsRegistrar.sol @@ -17,8 +17,6 @@ interface IPodEnsRegistrar { function register(bytes32 label, address owner) external; - function deregister(address safe, bytes32 label) external; - function setText( bytes32 node, string calldata key,