1
+ // SPDX-License-Identifier: UNLICENSED
2
+ pragma solidity ^ 0.8.13 ;
3
+
4
+ import "forge-std/Script.sol " ;
5
+ import "../../src/wallet/KintoWalletFactory.sol " ;
6
+ import "../../src/KintoID.sol " ;
7
+ import "../../src/wallet/KintoWallet.sol " ;
8
+ import {Create2Helper} from "../../test/helpers/Create2Helper.sol " ;
9
+ import {ArtifactsReader} from "../../test/helpers/ArtifactsReader.sol " ;
10
+ import {UUPSProxy} from "../../test/helpers/UUPSProxy.sol " ;
11
+ import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol " ;
12
+ import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol " ;
13
+ import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol " ;
14
+ import "forge-std/console.sol " ;
15
+
16
+ contract KintoMigration11DeployScript is Create2Helper , ArtifactsReader {
17
+ using ECDSAUpgradeable for bytes32 ;
18
+
19
+ KintoWalletFactory _walletFactory;
20
+ KintoWallet _kintoWalletv1;
21
+ KintoID _kintoIDv1;
22
+ UUPSProxy _proxy;
23
+
24
+ function setUp () public {}
25
+
26
+ // solhint-disable code-complexity
27
+ function run () public {
28
+ console.log ("RUNNING ON CHAIN WITH ID " , vm.toString (block .chainid ));
29
+ // If not using ledger, replace
30
+ uint256 deployerPrivateKey = vm.envUint ("PRIVATE_KEY " );
31
+ address deployer = vm.rememberKey (deployerPrivateKey);
32
+ vm.startBroadcast (deployerPrivateKey);
33
+ console.log ("Executing with address " , deployer);
34
+ address walletFactoryAddr = _getChainDeployment ("KintoWalletFactory " );
35
+ if (walletFactoryAddr == address (0 )) {
36
+ console.log ("Need to execute main deploy script first " , walletFactoryAddr);
37
+ return ;
38
+ }
39
+ address credits = _getChainDeployment ("EngenCredits " );
40
+ IKintoAppRegistry _kintoApp = IKintoAppRegistry (_getChainDeployment ("KintoAppRegistry " ));
41
+
42
+ // TODO: This needs to go through the entry point
43
+ _kintoApp.setWalletFactory (_walletFactory);
44
+ // // Create Engen App
45
+ _kintoApp.registerApp ("Engen " , credits, new address [](0 ), [uint256 (0 ), uint256 (0 ), uint256 (0 ), uint256 (0 )]);
46
+
47
+ vm.stopBroadcast ();
48
+
49
+ // Writes the addresses to a file
50
+ console.log ("Engen APP created and minted " );
51
+ }
52
+ }
0 commit comments