question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Importing Interfaces breaks deployProxy

See original GitHub issue

Updated the Box contract used on https://docs.openzeppelin.com/upgrades-plugins/1.x/truffle-upgrades Importing a simple interface. Makes the migrate command to throw the following contract Error: The requested contract was not found. Make sure the source code is available for compilation

When an interface is imported, checkForImportIdConsistency removes a contract from the input, output validated.

https://github.com/OpenZeppelin/openzeppelin-upgrades/blob/master/packages/plugin-truffle/src/validate.ts#L84-L105

.

@openzeppelin/truffle-upgrades/dist/validate.js

// contracts/Box.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;

import "contracts/Itest.sol";
 
contract Box {
    uint256 private value;
 
    // Emitted when the stored value changes
    event ValueChanged(uint256 newValue);
 
    // Stores a new value in the contract
    function store(uint256 newValue) public {
        value = newValue;
        emit ValueChanged(newValue);
    }
 
    // Reads the last stored value
    function retrieve() public view returns (uint256) {
        return value;
    }

    function testing() public pure returns(bool) {
      return false;

    }

    function test() public view returns (bool) {
      Itest temp = Itest(address(this));
      return temp.testing();
    }
}

Oddly enough putting an inline interface presents works fine.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
parkjihwanjaycommented, Jun 7, 2021

Hi I’m using @openzeppelin/truffle-upgrades ^1.7.0 and my Computer is macbook air(m1, 2020), macOs BigSur.

I’m using truffle version of v5.3.6 and before using @openzeppelin/truffle-upgrades, it compiled and migrated well. However, when I tried to deploy my contract with deployProxy which is provided by @openzeppelin/truffle-upgrades packages, I encountered with the error like below

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

The error occured for the contracts that import other contract like below

import "./SafeMath.sol";

Thank you for reading 👍

1reaction
ccoloradocommented, Jan 18, 2021

Thanks. I just tryied to reproduce on a new ubuntu vm and couldn’t reproduce the issue. Seems to be some kind of local issue I haven’t figured out yet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

deployProxy() using `truffle migrate --reset` errors with ...
But with deployProxy() when I run truffle migrate --reset` I get the following error: `Error: ... Importing Interfaces breaks deployProxy.
Read more >
OZ-Upgrades Plugins - Solidity Libraries - HackMD
If a contract contains external linked libraries, the deployment breaks due to the plugin not identifying a previously validated version of that contract ......
Read more >
Upgrading Smart Contracts - Should You Do it and How?
As you can see, deployProxy does three things: ... SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import ...
Read more >
Deploy API proxies using the API | Apigee Edge
The deploy tool provides support for packaging and importing API proxies ... This can break other plugins and wrappers that make use of...
Read more >
Renovate Bot Package Diff
import { ValidationOptions } from ' @openzeppelin/upgrades-core ';. 3. + import { DeployOptions } from ' ./utils ';. 4. 4. export interface ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found