Skip to content

Commit

Permalink
πŸ› Fix commitment selector
Browse files Browse the repository at this point in the history
  • Loading branch information
cairoeth authored Feb 2, 2024
2 parents 50dd4c7 + 8638c6e commit 9c9771b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/CommitmentManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,11 @@ contract CommitmentManager {
function makeCommitment(bytes32 target, address indicatorFunctionAddress, bytes4 indicatorFunctionSelector)
external
{
uint32 selector = uint32(indicatorFunctionSelector);
function (bytes memory) view external returns (uint256) indicatorFunction;
assembly {
indicatorFunction.address := indicatorFunctionAddress
indicatorFunction.selector := indicatorFunctionSelector
indicatorFunction.selector := selector
}
Commitment memory commitment = Commitment({timestamp: block.timestamp, indicatorFunction: indicatorFunction});
commitments[msg.sender][target].push(commitment);
Expand Down
1 change: 0 additions & 1 deletion src/erc4337/Aggregator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ contract Aggregator is IAggregator, Screener {
* @return sigForUserOp the value to put into the signature field of the userOp when calling handleOps.
* (usually empty, unless account and aggregator support some kind of "multisig"
*/

function validateUserOpSignature(UserOperation calldata userOp)
external
view
Expand Down
3 changes: 2 additions & 1 deletion test/CommitmentManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ contract CommitmentManagerTest is Test {
assertEq(actorCommitments.length, 1);

function (bytes memory) external view returns (uint256) indicatorFunction;
uint32 selector = uint32(indicatorFunctionSelector);
assembly {
indicatorFunction.address := indicatorFunctionAddress
indicatorFunction.selector := indicatorFunctionSelector
indicatorFunction.selector := selector
}

assertEq(actorCommitments[actorCommitments.length - 1].indicatorFunction.address, indicatorFunction.address);
Expand Down

0 comments on commit 9c9771b

Please sign in to comment.