Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
deploy an upgradable contract using artifacts on hardhat

To deploy a contract from an artifact on hardhat (for testing purposes) I can get the contract artifact json file and put it in the repo and then do it like this:

import XTokenWrapperArtifact from './helpers/artifactsForTesting/XTokenWrapper.json';
const XTokenWrapperFactory = new ethers.ContractFactory(
        XTokenWrapperArtifact.abi,
        XTokenWrapperArtifact.bytecode,
        deployer,
      );
      xTokenWrapperContract = await XTokenWrapperFactory.deploy();
      await xTokenWrapperContract.deployed(); 

So I can call the contract using await xTokenWrapperContract.method()

When I have an upgradable contract I try to do the same thing but it is not working:

import PermissionManagerArtifact from './helpers/artifactsForTesting/PermissionManager.json';
const PermissionManagerFactory = new ethers.ContractFactory(
        PermissionManagerArtifact.abi,
        PermissionManagerArtifact.bytecode,
        deployer,
      );
permissionManagerContract = await upgrades.deployProxy(PermissionManagerFactory, []);
await permissionManagerContract.deployed();

I get on the tests this error:

Error: The requested contract was not found. Make sure the source code is available for compilation

Does anybody know how to deploy an upgradable contract from an artifact ?

Thanks a lot!

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!