Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions scripts/verify_admins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* eslint-disable no-console */
import { ethers } from "hardhat";

/**
* Verifies that proxy admin and token owner addresses match expected values.
*
* Usage: npx hardhat run scripts/verify_admins.ts --network sepolia
*/
async function main() {
const proxyAddress = process.env.FIAT_TOKEN_PROXY_ADDRESS!;
const expectedProxyAdmin = process.env.PROXY_ADMIN_EXPECTED!;
const expectedOwner = process.env.OWNER_EXPECTED!;

const proxy = await ethers.getContractAt("FiatTokenProxy", proxyAddress);
const proxyAdmin = await proxy.admin();
const implementation = await proxy.implementation();
const implementationContract = await ethers.getContractAt("FiatTokenV2_2", implementation);
const owner = await implementationContract.owner();

console.log(`Proxy admin: ${proxyAdmin}`);
console.log(`Owner: ${owner}`);

if (proxyAdmin.toLowerCase() !== expectedProxyAdmin.toLowerCase()) {
console.error("Proxy admin does not match expected!");
}
if (owner.toLowerCase() !== expectedOwner.toLowerCase()) {
console.error("Owner does not match expected!");
}
}

main().catch((err) => {
console.error(err);
process.exit(1);
});