-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot compile OpenZeppelin 5.x as a dependency #1817
Comments
I am confused, it looks like it is work? The last line in your output is
What is the part that makes this not working? Edit: Ok I ran the code and I got vastly different output, with contracts available |
For some reason I am not able to reproduce, it compiled fine for me.
|
Do you have |
Encountered the same issue while trying to use solmate. This is my name: demo
plugins:
- name: solidity
version: 0.7.0
dependencies:
- name: smartcontractkit
github: smartcontractkit/chainlink-brownie-contracts
version: 0.8.0
- name: solmate
github: transmissions11/solmate
solidity:
version: 0.8.23
import_remapping:
- "@chainlink/contracts=smartcontractkit/0.8.0"
- "@solmate=solmate" Yeah, I didn't specify the version, but Ape created a folder for the latest v6. Even if I define the version using Made a repo with minimum code, that yields the same result https://github.com/rafael-abuawad/super-duper-journey |
I cannot downgrade solmate to |
I mean, why are specifying the solidity version (0.7) in your ape-config? That is what I am curious about. Arent the OZ contracts mostly on 0.8? Either way, I havent been able to reproduce yet! |
your config is missing some things actually, i will open a PR against your repo that i had to do in order to get it to compile |
@antazoey, I'm specifying the ape-solidity plugin version as 0.7.0 plugins:
- name: solidity
version: 0.7.0 But the Solidity version is the latest one. |
Oops, sorry I was confused there. Anyway, I opened a PR against your repro repo showing how the config needed to get that dependency to compile: rafael-abuawad/super-duper-journey#1 (review) However I don't think it is the same reason you are having issues with OZ 5.0 as that one works out-of-the-gate for me. |
I did find one other bug when working on the PR against the repro repo: #1819 |
I'm still not able to compile solmate, I have the exact same config as the one your mentioned on your PR but is not working for me. $ ape pm compile -f
ERROR: 1 validation error for Config
exclude
extra fields not permitted (type=value_error.extra) |
Empty |
Yes, it does work for me. |
Perhaps Here is a demo of using OpenZeppelin 5.0.1 in a project, like you are , and it just works for me, I am not sure why it doesn't for you but I am invested in finding out. |
After deleting the cached stuff, it compiled and worked correctly! rm -rf ~/.ape/packages/solmate
rm -rf ./.build
rm -rf contracts/.cache I thought of this before but I didn't try to run the first command: rm -rf ~/.ape/packages/solmate |
Maybe something is being wrongly cached in the |
After a bunch of testing, I deduce the problem is just that it did not fail in anyway when the dependency had no sources. It makes sense to just fail and not even cache a dependency if it is missing sources because that is useless and will always require a re-install after fixing the config or whatever needs to be done. |
Environment information
OS: macOS
Python Version: 3.10
ape
and plugin versions: 0.7.3Contents of your
ape-config.yaml
(NOTE: do not post anything private like RPC urls or secrets!):What went wrong?
Please include information like:
OpenZeppelin 5.x does not work with ape.
How can it be fixed?
Downgrade to OpenZeppelin 4.x.
The text was updated successfully, but these errors were encountered: