|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | +pragma solidity ^0.8.19; |
| 3 | + |
| 4 | +import { Migration } from "script/Migration.s.sol"; |
| 5 | +import { Contract } from "script/utils/Contract.sol"; |
| 6 | +import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; |
| 7 | +import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; |
| 8 | +import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; |
| 9 | +import { LibRNSDomain } from "src/libraries/LibRNSDomain.sol"; |
| 10 | +import { DefaultNetwork } from "foundry-deployment-kit/utils/DefaultNetwork.sol"; |
| 11 | + |
| 12 | +contract Migration__01_Revoke_Roles is Migration { |
| 13 | + address duke = 0x0F68eDBE14C8f68481771016d7E2871d6a35DE11; |
| 14 | + address multisig = 0x1FF1edE0242317b8C4229fC59E64DD93952019ef; |
| 15 | + |
| 16 | + function run() external onlyOn(DefaultNetwork.RoninMainnet.key()) { |
| 17 | + address[] memory contracts = new address[](5); |
| 18 | + contracts[0] = loadContract(Contract.RNSDomainPrice.key()); |
| 19 | + contracts[1] = loadContract(Contract.RONRegistrarController.key()); |
| 20 | + contracts[2] = loadContract(Contract.NameChecker.key()); |
| 21 | + contracts[3] = loadContract(Contract.RNSUnified.key()); |
| 22 | + contracts[4] = loadContract(Contract.RNSAuction.key()); |
| 23 | + |
| 24 | + vm.startBroadcast(duke); |
| 25 | + |
| 26 | + Ownable(loadContract(Contract.OwnedMulticaller.key())).transferOwnership(multisig); |
| 27 | + Ownable(loadContract(Contract.RNSReverseRegistrar.key())).transferOwnership(multisig); |
| 28 | + // Transfer .ron domain ownership to multisig |
| 29 | + ERC721(loadContract(Contract.RNSUnified.key())).transferFrom(duke, multisig, LibRNSDomain.RON_ID); |
| 30 | + |
| 31 | + for (uint256 i; i < contracts.length; i++) { |
| 32 | + AccessControlEnumerable(contracts[i]).grantRole(0x0, multisig); |
| 33 | + AccessControlEnumerable(contracts[i]).renounceRole(0x0, duke); |
| 34 | + |
| 35 | + assertTrue( |
| 36 | + AccessControlEnumerable(contracts[i]).getRoleMemberCount(0x0) > 0, |
| 37 | + string.concat("Role is empty", "contract: ", vm.toString(contracts[i])) |
| 38 | + ); |
| 39 | + } |
| 40 | + |
| 41 | + vm.stopBroadcast(); |
| 42 | + } |
| 43 | +} |
0 commit comments