Skip to content

Commit

Permalink
Update deployed version
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Dec 1, 2022
1 parent a00e083 commit 9337753
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 68 deletions.
2 changes: 1 addition & 1 deletion proxy/DEPLOYED
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.2-stable.1
1.3.4
69 changes: 2 additions & 67 deletions proxy/migrations/upgradeMainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,10 @@ import hre from "hardhat";

async function main() {
await upgrade(
"1.3.2",
"1.3.4",
contracts,
async (safeTransactions, abi) => undefined,
async (safeTransactions, abi) => {
const proxyAdmin = await getManifestAdmin(hre);
const owner = await proxyAdmin.owner();
const communityPoolName = "CommunityPool";
const communityPoolFactory = await ethers.getContractFactory(communityPoolName);
const communityPoolAddress = abi[getContractKeyInAbiFile(communityPoolName) + "_address"];
let communityPool;
if (communityPoolAddress) {
communityPool = communityPoolFactory.attach(communityPoolAddress) as CommunityPool;
const constantSetterRole = await communityPool.CONSTANT_SETTER_ROLE();
const isHasRole = await communityPool.hasRole(constantSetterRole, owner);
if (!isHasRole) {
console.log(chalk.yellow("Prepare transaction to grantRole CONSTANT_SETTER_ROLE to " + owner));
safeTransactions.push(encodeTransaction(
0,
communityPoolAddress,
0,
communityPool.interface.encodeFunctionData("grantRole", [constantSetterRole, owner])
));
}
console.log(chalk.yellow("Prepare transaction to set multiplier to 3/2"));
safeTransactions.push(encodeTransaction(
0,
communityPoolAddress,
0,
communityPool.interface.encodeFunctionData("setMultiplier", [3, 2])
));
console.log(chalk.yellow("Prepare transaction to set header message gas cost to 73800"));
} else {
console.log(chalk.red("CommunityPool was not found!"));
console.log(chalk.red("Check your abi!!!"));
process.exit(1);
}

const messageProxyForMainnet = (await ethers.getContractFactory("MessageProxyForMainnet"))
.attach(abi[getContractKeyInAbiFile("MessageProxyForMainnet") + "_address"]) as MessageProxyForMainnet;

if (! await messageProxyForMainnet.hasRole(await messageProxyForMainnet.CONSTANT_SETTER_ROLE(), owner)) {
console.log(chalk.yellow("Prepare transaction to grantRole CONSTANT_SETTER_ROLE to " + owner));
safeTransactions.push(encodeTransaction(
0,
messageProxyForMainnet.address,
0,
messageProxyForMainnet.interface.encodeFunctionData(
"grantRole",
[ await messageProxyForMainnet.CONSTANT_SETTER_ROLE(), owner ]
)
));
}

const newHeaderMessageGasCost = 92251;

console.log(chalk.yellow(
"Prepare transaction to set header message gas cost to",
newHeaderMessageGasCost.toString()
));
safeTransactions.push(encodeTransaction(
0,
messageProxyForMainnet.address,
0,
messageProxyForMainnet.interface.encodeFunctionData(
"setNewHeaderMessageGasCost",
[ newHeaderMessageGasCost ]
)
));
},
async (safeTransactions, abi) => undefined,
"proxyMainnet"
);
}
Expand Down

0 comments on commit 9337753

Please sign in to comment.