File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,12 +16,21 @@ contract SessionKeyOwnedKernelFactory {
1616 }
1717
1818 function createAccount (address _owner , uint256 _index ) external returns (EIP1967Proxy proxy ) {
19- bytes memory data = abi.encodePacked (_owner);
19+ bytes memory data = _getOwnerData (_owner);
20+
2021 proxy = singletonFactory.createAccount (validator, data, _index);
2122 }
2223
2324 function getAccountAddress (address _owner , uint256 _index ) public view returns (address ) {
24- bytes memory data = abi.encodePacked (_owner);
25+ bytes memory data = _getOwnerData (_owner);
2526 return singletonFactory.getAccountAddress (validator, data, _index);
2627 }
28+
29+ function _getOwnerData (address _owner ) internal pure returns (bytes memory data ) {
30+ // the owner is treated as a session key that lasts forever
31+ uint48 validUntil = type (uint48 ).max;
32+ uint48 validAfter = 0 ;
33+
34+ data = abi.encodePacked (_owner, validUntil, validAfter);
35+ }
2736}
You can’t perform that action at this time.
0 commit comments