I want to deploy a contract directly accessible in OpenZeppelin/[email protected]
Brownie package without changes, namely ERC1967Proxy
and other non-abstract contracts from Brownie console.
How can I import it in a Brownie script or console?
My brownie-config.yaml
:
compiler:
solc:
version: 0.8.2
remappings:
- "@openzeppelin/contracts-upgradeable=~/.brownie/packages/OpenZeppelin/[email protected]/contracts"
- "@openzeppelin-upgradeable=/home/etsvigun/.brownie/packages/OpenZeppelin/[email protected]"
- "@openzeppelin=OpenZeppelin/[email protected]"
dependencies:
- OpenZeppelin/[email protected]
- OpenZeppelin/[email protected]
Imports work fine in Solidity code, from both remappings, like
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
Trying to import contracts from packages just by names results in errors:
>>> from brownie import Proxy
File "<console>", line 1, in <module>
ImportError: cannot import name 'Proxy' from 'brownie' (~/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/__init__.py)