I have upgraded to the latest version of the truffle upgrades package, version 1.2.3 as suggested. I still get this error when trying to run tests or deploy my contracts locally:
Error: Artifacts are from different compiler runs Run a full recompilation using truffle compile --all https://zpl.in/upgrades/truffle-recompile-all at reconstructSolcInputOutput (/Users/@openzeppelin/truffle-upgrades/src/validate.ts:70:15) at Object.validateArtifacts (/Users/@openzeppelin/truffle-upgrades/src/validate.ts:17:29)
I used the command truffle compile --all and it still gives this error.
@elliot Are you running on Windows? Please share more details about your project, and we will try to reproduce the error. If there is a repo you can share that is ideal.
I upgraded to version 1.2.4 and now I am getting this error deploying the oracle contract:
Error: The requested contract was not found. Make sure the source code is available for compilation at getContractNameAndRunValidation (/node_modules/@openzeppelin/upgrades-core/src/validate.ts:157:11) at Object.assertUpgradeSafe (/node_modules/@openzeppelin/upgrades-core/src/validate.ts:195:26) at deployProxy (/node_modules/@openzeppelin/truffle-upgrades/src/deploy-proxy.ts:33:3) at process._tickCallback (internal/process/next_tick.js:68:7)
Truffle v5.1.45 (core: 5.1.45) Node v10.20.1
This contract is in the build folder. In order to run the test, cd into the smart-contracts directory, cp .env.example. .env, run yarn develop in another window then run truffle test --network develop
In the migrations file, all of the deployments set unsafeAllowCustomTypes: true so it should not be an issue that the solidity code uses structs and enums.
I can push up the changes to package.json to bump from version 1.2.3 --> 1.2.4, but that is the only difference from my local machine vs what is on the branch. Just pushed this change up so it should be 100% the same across branches.
The contract is Oracle.sol
Did you try running truffle test --network develop? That’s the way we run it locally.
We have found an error in Upgrades Plugins for Truffle and Hardhat. Users of the flag unsafeAllowCustomTypes should update their dependencies to the latest version.