diff --git a/contracts/modules/CoreActions.sol b/contracts/modules/CoreActions.sol index e1f9c110..b57147a5 100644 --- a/contracts/modules/CoreActions.sol +++ b/contracts/modules/CoreActions.sol @@ -215,6 +215,7 @@ contract CoreActions is ICoreActions, EIP712 { address target, address actor ) public view returns (uint32) { + target = IAddressAliasRegistry(addressAliasRegistry).addressOf(target); ActorsAndTimestamps storage m = _coreActions[platform][coreActionType][target]; uint256 actorAlias = uint160(IAddressAliasRegistry(addressAliasRegistry).aliasOf(actor)); return m.timestamps.get(actorAlias); @@ -228,6 +229,7 @@ contract CoreActions is ICoreActions, EIP712 { uint256 coreActionType, address target ) public view returns (uint256) { + target = IAddressAliasRegistry(addressAliasRegistry).addressOf(target); return _coreActions[platform][coreActionType][target].length; } @@ -239,8 +241,7 @@ contract CoreActions is ICoreActions, EIP712 { uint256 coreActionType, address target ) public view returns (address[] memory actors, uint32[] memory timestamps) { - ActorsAndTimestamps storage m = _coreActions[platform][coreActionType][target]; - return getCoreActionsIn(platform, coreActionType, target, 0, m.length); + return getCoreActionsIn(platform, coreActionType, target, 0, type(uint256).max); } /** @@ -253,11 +254,13 @@ contract CoreActions is ICoreActions, EIP712 { uint256 start, uint256 stop ) public view returns (address[] memory actors, uint32[] memory timestamps) { + target = IAddressAliasRegistry(addressAliasRegistry).addressOf(target); ActorsAndTimestamps storage m = _coreActions[platform][coreActionType][target]; unchecked { - uint256 l = stop - start; uint256 n = m.length; - if (start > stop || stop > n) revert InvalidQueryRange(); + if (stop > n) stop = n; + uint256 l = stop - start; + if (start > stop) revert InvalidQueryRange(); actors = new address[](l); timestamps = new uint32[](l); IAddressAliasRegistry registry = IAddressAliasRegistry(addressAliasRegistry); diff --git a/contracts/modules/interfaces/ICoreActions.sol b/contracts/modules/interfaces/ICoreActions.sol index 72469650..7f97e135 100644 --- a/contracts/modules/interfaces/ICoreActions.sol +++ b/contracts/modules/interfaces/ICoreActions.sol @@ -19,10 +19,14 @@ interface ICoreActions { // The core action type. uint256 coreActionType; // The list of targets. + // Can be full addresses or aliases. address[] targets; - // The list of lists of timestamps. Must have the same dimensions as `actors`. + // The list of lists of timestamps. + // Can be full addresses or aliases. + // Must have the same dimensions as `actors`. address[][] actors; - // The list of lists of timestamps. Must have the same dimensions as `actors`. + // The list of lists of timestamps. + // Must have the same dimensions as `actors`. uint32[][] timestamps; // The nonce of the signature (per platform's signer). uint256 nonce; @@ -154,7 +158,7 @@ interface ICoreActions { * @param coreActionType The core action type. * @param target The core action target. * @param actor The actor - * @return The amped timestamp value. + * @return The timestamp value. */ function getCoreActionTimestamp( address platform, @@ -183,8 +187,8 @@ interface ICoreActions { * @param platform The platform. * @param coreActionType The core action type. * @param target The core action target. - * @return actors The actors for the coreActions. - * @return timestamps The timestamps of the coreActions. + * @return actors The actors for the core actions. + * @return timestamps The timestamps of the core actions. */ function getCoreActions( address platform, @@ -200,8 +204,8 @@ interface ICoreActions { * @param target The core action target. * @param start The start index of the range. * @param stop The end index of the range (exclusive). - * @return actors The actors for the coreActions. - * @return timestamps The timestamps of the coreActions. + * @return actors The actors for the core actions. + * @return timestamps The timestamps of the core actions. */ function getCoreActionsIn( address platform,