Skip to content

Commit

Permalink
Merge pull request sphinx-labs#431 from chugsplash/pate/var-not-found…
Browse files Browse the repository at this point in the history
…-error-log

fix(core): Add additional recommendation to clear contract artifact cache if var not found in storage layout
  • Loading branch information
sam-goldman authored Jan 31, 2023
2 parents 2858cea + fd70a56 commit 4df4568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-mangos-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chugsplash/core': patch
---

Add recommendation to clear contract artifacts if variable not found in storage layout
5 changes: 3 additions & 2 deletions packages/core/src/languages/solidity/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,8 @@ export const computeStorageSlots = (
throw new Error(
`Could not find variable "${storageObj.label}" from the contract "${contractConfig.contract}" in your ChugSplash config file.\n` +
`You must configure all variables that are defined in the contract.\n` +
`Did you forget to declare it in your ChugSplash config file?`
`Did you forget to declare it in your ChugSplash config file?` +
`You may also need to delete and regenerate your contract compilation artifacts.`
)
}
}
Expand All @@ -530,7 +531,7 @@ export const computeStorageSlots = (
if (!storageObj) {
throw new Error(
`variable "${variableName}" was defined in the ChugSplash config for ${contractConfig.contract}
but does not exist as a variable in the contract`
but does not exist as a variable in the contract. If you think this is a mistake, you may need to delete and regenerate your contract compilation artifacts.`
)
}

Expand Down

0 comments on commit 4df4568

Please sign in to comment.