Summary
Some leaves are not compatible with EIP-7201.
Vulnerability Details
Contest details mention Tree Proxy Pattern is EIP-7201 compatiable. However some leaves are not compatiable with EIP-7201.
CustomReferralConfiguration.sol =>
string internal constant CUSTOM_REFERRAL_CONFIGURATION_DOMAIN = "fi.zaros.CustomReferralConfiguration";
Referral.sol =>
string internal constant REFERRAL_DOMAIN = "fi.zaros.Referral";
Impact
Some leaves are not compatible with EIP-7201.
Tools Used
manual
Recommendations
// CustomReferralConfiguration.sol
- string internal constant CUSTOM_REFERRAL_CONFIGURATION_DOMAIN = "fi.zaros.CustomReferralConfiguration";
+ bytes32 internal constant CUSTOM_REFERRAL_CONFIGURATION_DOMAIN = keccak256(abi.encode(uint256(keccak256("fi.zaros.CustomReferralConfiguration")) - 1)) & ~bytes32(uint256(0xff));
// Referral.sol
- string internal constant REFERRAL_DOMAIN = "fi.zaros.Referral";
+ bytes32 internal constant REFERRAL_DOMAIN = keccak256(abi.encode(uint256(keccak256("fi.zaros.Referral")) - 1)) & ~bytes32(uint256(0xff));