-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
235 additions
and
20 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
broadcast/07-deploy_kinto_app.sol/7887/run-1704844364.json
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.23; | ||
|
||
import "forge-std/Script.sol"; | ||
import "../../src/apps/KintoAppRegistry.sol"; | ||
import "../../src/paymasters/SponsorPaymaster.sol"; | ||
import "../../src/interfaces/IKintoWalletFactory.sol"; | ||
import {Create2Helper} from "../../test/helpers/Create2Helper.sol"; | ||
import {ArtifactsReader} from "../../test/helpers/ArtifactsReader.sol"; | ||
import {UUPSProxy} from "../../test/helpers/UUPSProxy.sol"; | ||
import "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol"; | ||
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol"; | ||
import "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
contract KintoMigration7DeployScript is Create2Helper, ArtifactsReader { | ||
using ECDSAUpgradeable for bytes32; | ||
|
||
KintoAppRegistry _kintoApp; | ||
KintoAppRegistry _kintoAppImpl; | ||
|
||
function setUp() public {} | ||
|
||
// solhint-disable code-complexity | ||
function run() public { | ||
console.log("RUNNING ON CHAIN WITH ID", vm.toString(block.chainid)); | ||
// Execute this script with the hot wallet | ||
uint256 deployerPrivateKey = vm.envUint('PRIVATE_KEY'); | ||
vm.startBroadcast(deployerPrivateKey); | ||
console.log("Executing with address", msg.sender); | ||
address ledgerAdmin = vm.envAddress('LEDGER_ADMIN'); | ||
console.log("Executing with ledger admin as", ledgerAdmin); | ||
|
||
address appAddr = _getChainDeployment("KintoAppRegistry"); | ||
if (appAddr != address(0)) { | ||
console.log("KintoAppRegistry already deployed", appAddr); | ||
return; | ||
} | ||
address walletFactoryAddr = _getChainDeployment("KintoWalletFactory"); | ||
IOldWalletFactory _walletFactory = IOldWalletFactory(walletFactoryAddr); | ||
address kintoAppRegistryImpl = _getChainDeployment("KintoAppRegistry-impl"); | ||
|
||
if (kintoAppRegistryImpl == address(0)) { | ||
console.log("kintoAppRegistryImpl not deployed", appAddr); | ||
return; | ||
} | ||
console.log("kintoAppRegistryImpl", kintoAppRegistryImpl); | ||
bytes memory bytecode = abi.encodePacked( | ||
abi.encodePacked(type(UUPSProxy).creationCode), | ||
abi.encode( | ||
address(kintoAppRegistryImpl), | ||
bytes("") | ||
) | ||
); | ||
// deploy _proxy contract and point it to _implementation | ||
|
||
_kintoApp = KintoAppRegistry( | ||
_walletFactory.deployContract{value: 0}( | ||
0, bytecode, bytes32("") | ||
) | ||
); | ||
_kintoApp.initialize(); | ||
vm.stopBroadcast(); | ||
|
||
// Writes the addresses to a file | ||
console.log("Add these new addresses to the artifacts file"); | ||
console.log(string.concat('"KintoAppRegistry": "', vm.toString(address(_kintoApp)), '"')); | ||
|
||
} | ||
} | ||
|
||
interface IOldWalletFactory { | ||
|
||
function deployContract(uint256 amount, bytes calldata bytecode, bytes32 salt) external payable returns (address); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
script/migrations/09-upgrade_paymasterv2.sol → script/migrations/10-upgrade_paymasterv2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...igrations/10-upgrade_wallet_factoryv2.sol → ...igrations/11-upgrade_wallet_factoryv2.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters