Skip to content

Commit

Permalink
misc: constant made for param
Browse files Browse the repository at this point in the history
  • Loading branch information
vicnaum committed Dec 30, 2024
1 parent 7885cce commit fabd708
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contracts/rules/base/RestrictedSignersRule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ abstract contract RestrictedSignersRule is MetadataBased {
mapping(address => mapping(uint256 => bool)) wasSignerNonceUsed;
}

// keccak256("lens.rules.RestrictedSignersRule.param.key.restrictedSigners");
bytes32 internal immutable RESTRICTED_SIGNERS_PARAM_KEY =
0xb8a2337c40148374f2742539ca15863f85c2a622200150799113b1b02dfa658b;

// keccak256('lens.rule.restricted.storage')
bytes32 constant RESTRICTED_RULE_STORAGE_SLOT = 0xcf6ecf8730d498cbf6701bc1140f2b12e988e1c416a85799d241dcfbb3ed90df;

Expand Down Expand Up @@ -77,7 +81,7 @@ abstract contract RestrictedSignersRule is MetadataBased {

function _configure(bytes32 configSalt, KeyValue[] calldata ruleParams) internal virtual {
require(ruleParams.length > 0);
require(ruleParams[0].key == "restrictedSigners"); // TODO: Use proper constant
require(ruleParams[0].key == RESTRICTED_SIGNERS_PARAM_KEY);
(address[] memory signers, string[] memory labels, bool[] memory isWhitelisted) =
abi.decode(ruleParams[0].value, (address[], string[], bool[]));
require(signers.length == isWhitelisted.length);
Expand Down

0 comments on commit fabd708

Please sign in to comment.