Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYC Sanction Expiration #320

Merged
merged 9 commits into from
Dec 6, 2024
318 changes: 318 additions & 0 deletions broadcast/135-upgrade_faucet_id.s.sol/7887/run-1733521441.json

Large diffs are not rendered by default.

262 changes: 211 additions & 51 deletions broadcast/135-upgrade_faucet_id.s.sol/7887/run-latest.json

Large diffs are not rendered by default.

49 changes: 28 additions & 21 deletions script/migrations/135-upgrade_faucet_id.s.sol
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;

import {Faucet} from "../../src/Faucet.sol";
import {KintoID} from "../../src/KintoID.sol";
import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol";
import "@openzeppelin/contracts/access/IAccessControl.sol";

contract UpgradeKintoIDFaucetDeployScript is MigrationHelper {
contract UpgradeKintoIDScript is MigrationHelper {
function run() public override {
super.run();

// bytes memory bytecode = abi.encodePacked(
// type(KintoID).creationCode,
// abi.encode(
// _getChainDeployment("KintoWalletFactory"),
// _getChainDeployment("Faucet")
// )
// );
bytes memory bytecode = abi.encodePacked(
type(KintoID).creationCode,
abi.encode(
_getChainDeployment("KintoWalletFactory"),
_getChainDeployment("Faucet")
)
);

// address impl = _deployImplementationAndUpgrade("KintoID", "V8", bytecode);
// saveContractAddress("KintoIDV8-impl", impl);
address impl = _deployImplementationAndUpgrade("KintoID", "V9", bytecode);
saveContractAddress("KintoIDV9-impl", impl);

// bytecode = abi.encodePacked(
// type(Faucet).creationCode,
// abi.encode(_getChainDeployment("KintoWalletFactory"))
// );
KintoID kintoID = KintoID(_getChainDeployment("KintoID"));
address nioGovernor = _getChainDeployment("NioGovernor");
bytes32 governanceRole = kintoID.GOVERNANCE_ROLE();

// impl = _deployImplementationAndUpgrade("Faucet", "V9", bytecode);
// saveContractAddress("FaucetV9-impl", impl);
assertFalse(kintoID.hasRole(governanceRole, kintoAdminWallet));
assertFalse(kintoID.hasRole(governanceRole, nioGovernor));

// vm.broadcast(deployerPrivateKey);
KintoID kintoID = KintoID(_getChainDeployment("KintoID"));
_whitelistApp(address(kintoID));
_upgradeTo(address(kintoID), _getChainDeployment("KintoIDV8-impl"), deployerPrivateKey);
_handleOps(
abi.encodeWithSelector(IAccessControl.grantRole.selector, governanceRole, kintoAdminWallet), address(kintoID)
);

_handleOps(
abi.encodeWithSelector(IAccessControl.grantRole.selector, governanceRole, nioGovernor), address(kintoID)
);

assertTrue(kintoID.hasRole(kintoID.GOVERNANCE_ROLE(), kintoAdminWallet));
assertTrue(kintoID.hasRole(kintoID.GOVERNANCE_ROLE(), nioGovernor));

assertTrue(kintoID.isKYC(deployer));
}
}
Loading
Loading