Skip to content

Commit db286ec

Browse files
committed
Modifies migration
1 parent 52e7be4 commit db286ec

File tree

2 files changed

+57
-13
lines changed

2 files changed

+57
-13
lines changed

script/migrations/07-deploy_kinto_app.sol

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@ contract KintoMigration7DeployScript is Create2Helper, ArtifactsReader {
2323
// solhint-disable code-complexity
2424
function run() public {
2525
console.log("RUNNING ON CHAIN WITH ID", vm.toString(block.chainid));
26-
// Execute this script with the hot wallet, not with ledger
27-
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
28-
address admin = vm.envAddress("LEDGER_ADMIN");
29-
if (admin == address(0)) {
30-
console.log("Admin key not set", admin);
31-
return;
32-
}
33-
vm.startBroadcast(deployerPrivateKey);
26+
// If not using ledger, replace
27+
// Execute this script with the admin
28+
// uint256 deployerPrivateKey = vm.envUint('PRIVATE_KEY');
29+
// vm.startBroadcast(deployerPrivateKey);
30+
vm.startBroadcast();
3431
console.log("Executing with address", msg.sender);
3532
address appAddr = _getChainDeployment("KintoAppRegistry");
3633
if (appAddr != address(0)) {
@@ -44,12 +41,7 @@ contract KintoMigration7DeployScript is Create2Helper, ArtifactsReader {
4441
msg.sender, 0, abi.encodePacked(type(KintoAppRegistry).creationCode), bytes32(0)
4542
)
4643
);
47-
_kintoApp.setWalletFactory(_walletFactory);
48-
// Give ownership to admin
49-
_kintoApp.transferOwnership(admin);
5044
address credits = _getChainDeployment("EngenCredits");
51-
// Create Engen App
52-
_kintoApp.registerApp("Engen", credits, new address[](0), [uint256(0), uint256(0), uint256(0), uint256(0)]);
5345
// Fund in the paymaster
5446
SponsorPaymaster _paymaster = SponsorPaymaster(payable(_getChainDeployment("SponsorPaymaster")));
5547
_paymaster.addDepositFor{value: 1e17}(credits);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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

Comments
 (0)