Commit 2f33ea9e authored by Maurelian's avatar Maurelian Committed by Kelvin Fichter

chore(contracts): Rename AddressSetter to AddressDictator

Reasoning:
1. It manages the address manager
2. AddressSetter is overly generic
parent f3764e57
......@@ -4,9 +4,9 @@ pragma solidity ^0.8.9;
import { Lib_AddressManager } from "../resolver/Lib_AddressManager.sol";
/**
* @title AddressSetter
* @title AddressDictator
*/
contract AddressSetter {
contract AddressDictator {
/*************
* Variables *
*************/
......@@ -39,7 +39,7 @@ contract AddressSetter {
finalOwner = _finalOwner;
require(
_names.length == _addresses.length,
"AddressSetter: Must provide an equal number of names and addresses."
"AddressDictator: Must provide an equal number of names and addresses."
);
names = _names;
addresses = _addresses;
......
......@@ -37,7 +37,7 @@ const deployFn: DeployFunction = async (hre) => {
})
)
// Add non-deployed addresses to the Address Setter arguments.
// Add non-deployed addresses to the Address Dictator arguments.
namesAndAddresses = [
...namesAndAddresses,
// L2CrossDomainMessenger is the address of the predeploy on L2. We can refactor off-chain
......@@ -70,8 +70,8 @@ const deployFn: DeployFunction = async (hre) => {
await deployAndPostDeploy({
hre,
name: 'AddressSetter',
contract: 'AddressSetter',
name: 'AddressDictator',
contract: 'AddressDictator',
args: [
Lib_AddressManager.address,
(hre as any).deployConfig.ovmAddressManagerOwner,
......@@ -85,6 +85,6 @@ const deployFn: DeployFunction = async (hre) => {
})
}
deployFn.tags = ['fresh', 'upgrade', 'AddressSetter']
deployFn.tags = ['fresh', 'upgrade', 'AddressDictator']
export default deployFn
......@@ -8,18 +8,18 @@ import { getLiveContract, waitUntilTrue } from '../src/hardhat-deploy-ethers'
const deployFn: DeployFunction = async (hre) => {
const { deployer } = await hre.getNamedAccounts()
const addressSetter = await getLiveContract(hre, 'AddressSetter', {
const addressDictator = await getLiveContract(hre, 'AddressDictator', {
signerOrProvider: deployer,
})
const libAddressManager = await getLiveContract(hre, 'Lib_AddressManager')
const names = await addressSetter.getNames()
const addresses = await addressSetter.getAddresses()
const finalOwner = await addressSetter.finalOwner()
const names = await addressDictator.getNames()
const addresses = await addressDictator.getAddresses()
const finalOwner = await addressDictator.finalOwner()
let currentOwner = await libAddressManager.owner()
console.log(
'\n',
'An Address Setter contract has been deployed, with the following address <=> name pairs:'
'An Address Dictator contract has been deployed, with the following name/address pairs:'
)
for (let i = 0; i < names.length; i++) {
console.log(`${addresses[i]} <=> ${names[i]}`)
......@@ -31,7 +31,9 @@ const deployFn: DeployFunction = async (hre) => {
console.log(
` then transfer ownership of the Address Manager at (${libAddressManager.address})`
)
console.log(` to the Address Setter contract at ${addressSetter.address}.`)
console.log(
` to the Address Dictator contract at ${addressDictator.address}.`
)
const hreSigners = await hre.ethers.getSigners()
const hreSignerAddresses = hreSigners.map((signer) => {
......@@ -48,15 +50,15 @@ const deployFn: DeployFunction = async (hre) => {
const owner = await hre.ethers.getSigner(currentOwner)
await libAddressManager
.connect(owner)
.transferOwnership(addressSetter.address)
.transferOwnership(addressDictator.address)
}
await waitUntilTrue(
async () => {
console.log('Checking ownership of Lib_AddressManager... ')
currentOwner = await libAddressManager.owner()
console.log('Lib_AddressManager owner is now set to AddressSetter.')
return hexStringEquals(currentOwner, addressSetter.address)
console.log('Lib_AddressManager owner is now set to AddressDictator.')
return hexStringEquals(currentOwner, addressDictator.address)
},
{
// Try every 30 seconds for 500 minutes.
......@@ -67,7 +69,7 @@ const deployFn: DeployFunction = async (hre) => {
// Set the addresses!
console.log('Ownership successfully transferred. Invoking setAddresses...')
await addressSetter.setAddresses()
await addressDictator.setAddresses()
currentOwner = await libAddressManager.owner()
console.log('Verifying final ownership of Lib_AddressManager')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment