I try to deploy a upgradeable contract to eth-sepolia network,
my deploy scripts code is:
import { DeployFunction } from 'hardhat-deploy/dist/types'
import { ethers, upgrades } from 'hardhat';
const deployFn: DeployFunction = async (hre) => {
const { deployer, owner } = await hre.getNamedAccounts()
const maxRedeemDeadline = 30 * 24 * 60 * 60;
const X404Hub = await ethers.getContractFactory("X404Hub");
const proxy = await upgrades.deployProxy(X404Hub, [deployer, maxRedeemDeadline, []]);
const proxyAddress = await proxy.getAddress()
console.log("proxy address: ", proxyAddress)
console.log("admin address: ", await upgrades.erc1967.getAdminAddress(proxyAddress))
console.log("implement address: ", await upgrades.erc1967.getImplementationAddress(proxyAddress))
}
and it works well when i deploy to base-sepolia network;
npx hardhat deploy --network baseSepolia
Nothing to compile
No need to generate any newer typings.
proxy address: 0xCA422a2a3714517cd0944BEfFF2485582962f103
admin address: 0x83ACddd1Cc9aC0063B8442Fcde258e99a71e8D18
implement address: 0x6DE5881F292b5131825c44F2a2DDA09D4Fb8d496
than i try to deploy to eth-sepolia network, it returns error:
npx hardhat deploy --network sepolia
Nothing to compile
No need to generate any newer typings.
proxy address: 0x5648CFdFF4b6519D6aE8Bb08A0179b3e588fCAa0
admin address: 0x0000000000000000000000000000000000000000
An unexpected error occurred:
Error: ERROR processing /Users/leven/workspace/xrgb/X404/deploy/00-deploy-X404Hub_spec.ts:
Error: Contract at 0x5648CFdFF4b6519D6aE8Bb08A0179b3e588fCAa0 doesn't look like an ERC 1967 proxy with a logic contract address
at getImplementationAddress (/Users/leven/workspace/xrgb/X404/node_modules/@openzeppelin/upgrades-core/src/eip-1967.ts:29:11)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.deployFn [as func] (/Users/leven/workspace/xrgb/X404/deploy/00-deploy-X404Hub_spec.ts:16:38)
I check the ethscan, the implement contract and proxy contract already deployed. but i don't know where is admin contract,
can someone give some suggestions? thanks so much.
this is my package.json.
{
"name": "hardhat-project",
"devDependencies": {
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"@openzeppelin/contracts": "^5.0.1",
"@openzeppelin/contracts-upgradeable": "^5.0.1",
"@openzeppelin/hardhat-upgrades": "^3.0.4",
"dotenv": "^16.4.5",
"hardhat": "^2.20.1",
"hardhat-deploy": "^0.11.45"
}
}