Omniscia Gnosis Guild Audit
Periphery Code Style Findings
Periphery Code Style Findings
PYR-01C: Redundant Code Duplication
Type | Severity | Location |
---|---|---|
Code Style | ![]() | Periphery.sol:L26, L34 |
Description:
The referenced statements are replicated within the Core::_key
function.
Example:
packages/evm/contracts/Periphery.sol
12abstract contract Periphery is OwnableUpgradeable {13 event SetUnwrapAdapter(14 address to,15 bytes4 selector,16 ITransactionUnwrapper adapter17 );18
19 mapping(bytes32 => ITransactionUnwrapper) public unwrappers;20
21 function setTransactionUnwrapper(22 address to,23 bytes4 selector,24 ITransactionUnwrapper adapter25 ) external onlyOwner {26 unwrappers[bytes32(bytes20(to)) | (bytes32(selector) >> 160)] = adapter;27 emit SetUnwrapAdapter(to, selector, adapter);28 }29
30 function getTransactionUnwrapper(31 address to,32 bytes4 selector33 ) internal view returns (ITransactionUnwrapper) {34 return unwrappers[bytes32(bytes20(to)) | (bytes32(selector) >> 160)];35 }36}
Recommendation:
We advise the relevant function to either be imported and utilized within Periphery
or its logic to be relocated to a common dependency in use by both contracts, either of which we consider an adequate resolution to this exhibit.
Alleviation:
The Gnosis Guild team evaluated this exhibit and has opted to retain the code inline instead of refactoring it to a shared dependency. As such, we consider this exhibit acknowledged.