Factory uses bytes4 to track instanceTypes, this is unjustifiably restrictive #278
Labels
Breaking Changes
Breaking changes to the interface or architecture
Milestone
The
Factory
contract wants to track types of contracts. It does this using abytes4
type. It seems this is inspired from the ERC-165 standard.The baseline choice should be using a full 32 byte hash. The
bytes4
costs more gas to store, retrieve and compare (EVM stores a whole word, Solidity handles truncation) also it has less collision resistance.As an author of ERC-165 I think
bytes4
is a bad choice here.Recommendation: use a full word hash
References: Definition
erasure-protocol/contracts/modules/Factory.sol
Line 20 in 4a3d98c
The text was updated successfully, but these errors were encountered: