Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691669525.json

Large diffs are not rendered by default.

122 changes: 122 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691669532.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691670553.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691670562.json

Large diffs are not rendered by default.

87 changes: 87 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691744608.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691744717.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1691744725.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692099029.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692099043.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692101659.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692101666.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692101854.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692101861.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692103993.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692104001.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692104629.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692104637.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692104684.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692187729.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692187736.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692187762.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196100.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196107.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196135.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196837.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196851.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692196906.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692198345.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692198352.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692198384.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692286627.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692286642.json

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692692425.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692692602.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692692609.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692692636.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692693005.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692693012.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692693039.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692694507.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692694514.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692694542.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692695933.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692695940.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692695968.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696010.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696017.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696044.json

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696516.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696523.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-1692696563.json

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions broadcast/DeploySocialRecovery.s.sol/80001/run-latest.json

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions scripts/DeploySocialRecovery.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
pragma solidity ^0.8.0;

import "src/factory/KernelFactory.sol";
import "src/validator/SocialRecoveryValidator.sol";
import "src/factory/RecoveryKernelFactory.sol";
import "src/validator/ERC165SessionKeyValidator.sol";
import "forge-std/Script.sol";
import "forge-std/console.sol";

contract DeploySocialRecovery is Script {
address internal constant DETERMINISTIC_CREATE2_FACTORY = 0x7A0D94F55792C434d74a40883C6ed8545E406D12;
function run() public {
uint256 key = vm.envUint("DEPLOYER_PRIVATE_KEY");
vm.startBroadcast(key);
SocialRecoveryValidator action = new SocialRecoveryValidator();
bool success;
bytes memory returnData;

bytes memory bytecode1 = type(SocialRecoveryValidator).creationCode;
(success, returnData) = DETERMINISTIC_CREATE2_FACTORY.call(abi.encodePacked(bytecode1, abi.encode(action)));
require(success, "Failed to deploy SocialRecoveryValidator");
address validator = address(bytes20(returnData));
console.log("SocialRecoveryValidator deployed at: %s", validator);

bytes memory bytecode2 = type(RecoveryKernelFactory).creationCode;
(success, returnData) = DETERMINISTIC_CREATE2_FACTORY.call(abi.encodePacked(bytecode2, abi.encode(KernelFactory(0x7A0D94F55792C434d74a40883C6ed8545E406D12)), abi.encode(address(validator)), abi.encode(IEntryPoint(0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789))));
require(success, "Failed to deploy RecoveryKernelFactory");
address recoveryFactory = address(bytes20(returnData));
console.log("RecoveryKernelFactory deployed at: %s", recoveryFactory);
vm.stopBroadcast();
}
}
25 changes: 25 additions & 0 deletions src/factory/RecoveryKernelFactory.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import "./KernelFactory.sol";
import "src/validator/SocialRecoveryValidator.sol";

contract RecoveryKernelFactory {
KernelFactory public immutable singletonFactory;
SocialRecoveryValidator public immutable validator;
IEntryPoint public immutable entryPoint;

constructor(KernelFactory _singletonFactory, SocialRecoveryValidator _validator, IEntryPoint _entryPoint) {
singletonFactory = _singletonFactory;
validator = _validator;
entryPoint = _entryPoint;
}

function createAccount(bytes memory data, uint256 _index) external returns (EIP1967Proxy proxy) {
proxy = singletonFactory.createAccount(validator, data, _index);
}

function getAccountAddress(bytes memory data, uint256 _index) public view returns (address) {
return singletonFactory.getAccountAddress(validator, data, _index);
}
}
Loading