Skip to content

Commit 353c93e

Browse files
committed
Upgrade KintoID contract to version 9, update deployment scripts and tests, and add governance role management for KintoID and NioGovernor.
1 parent 7a226c7 commit 353c93e

File tree

5 files changed

+561
-75
lines changed

5 files changed

+561
-75
lines changed

broadcast/135-upgrade_faucet_id.s.sol/7887/run-1733521441.json

Lines changed: 318 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/135-upgrade_faucet_id.s.sol/7887/run-latest.json

Lines changed: 211 additions & 51 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,43 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity ^0.8.18;
33

4-
import {Faucet} from "../../src/Faucet.sol";
54
import {KintoID} from "../../src/KintoID.sol";
65
import {MigrationHelper} from "@kinto-core-script/utils/MigrationHelper.sol";
6+
import "@openzeppelin/contracts/access/IAccessControl.sol";
77

8-
contract UpgradeKintoIDFaucetDeployScript is MigrationHelper {
8+
contract UpgradeKintoIDScript is MigrationHelper {
99
function run() public override {
1010
super.run();
1111

12-
// bytes memory bytecode = abi.encodePacked(
13-
// type(KintoID).creationCode,
14-
// abi.encode(
15-
// _getChainDeployment("KintoWalletFactory"),
16-
// _getChainDeployment("Faucet")
17-
// )
18-
// );
12+
bytes memory bytecode = abi.encodePacked(
13+
type(KintoID).creationCode,
14+
abi.encode(
15+
_getChainDeployment("KintoWalletFactory"),
16+
_getChainDeployment("Faucet")
17+
)
18+
);
1919

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

23-
// bytecode = abi.encodePacked(
24-
// type(Faucet).creationCode,
25-
// abi.encode(_getChainDeployment("KintoWalletFactory"))
26-
// );
23+
KintoID kintoID = KintoID(_getChainDeployment("KintoID"));
24+
address nioGovernor = _getChainDeployment("NioGovernor");
25+
bytes32 governanceRole = kintoID.GOVERNANCE_ROLE();
2726

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

31-
// vm.broadcast(deployerPrivateKey);
32-
KintoID kintoID = KintoID(_getChainDeployment("KintoID"));
33-
_whitelistApp(address(kintoID));
34-
_upgradeTo(address(kintoID), _getChainDeployment("KintoIDV8-impl"), deployerPrivateKey);
30+
_handleOps(
31+
abi.encodeWithSelector(IAccessControl.grantRole.selector, governanceRole, kintoAdminWallet), address(kintoID)
32+
);
33+
34+
_handleOps(
35+
abi.encodeWithSelector(IAccessControl.grantRole.selector, governanceRole, nioGovernor), address(kintoID)
36+
);
37+
38+
assertTrue(kintoID.hasRole(kintoID.GOVERNANCE_ROLE(), kintoAdminWallet));
39+
assertTrue(kintoID.hasRole(kintoID.GOVERNANCE_ROLE(), nioGovernor));
40+
41+
assertTrue(kintoID.isKYC(deployer));
3542
}
3643
}

src/KintoID.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,6 @@ contract KintoID is
629629
}
630630
}
631631

632-
contract KintoIDV8 is KintoID {
632+
contract KintoIDV9 is KintoID {
633633
constructor(address _walletFactory, address _faucet) KintoID(_walletFactory, _faucet) {}
634634
}

test/artifacts/7887/addresses.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,6 @@
242242
"cbBTC": "0xCBb7c0F98bb7312b821e78AB76312Cd3950fBFca",
243243
"AAVE-impl": "0x87a0D1c12f83ce5aB21C88f7459891586C32B875",
244244
"AAVE": "0xaa0e00F095Eb986CB65FD3FA328782c7Fe4ceFD9",
245-
"KintoAppRegistryV22": "0xb9cE6BC89b79c713f34fd15D82a70900fEFD0de1"
246-
}
245+
"KintoAppRegistryV22": "0xb9cE6BC89b79c713f34fd15D82a70900fEFD0de1",
246+
"KintoIDV9-impl": "0x7CFe474936fA50181ae7c2C43EeB8806e25bc983"
247+
}

0 commit comments

Comments
 (0)