![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Ape compiler plugin around VVM
pip
You can install the latest release via pip
:
pip install ape-vyper
setuptools
You can clone the repository and use setuptools
for the most up-to-date version:
git clone https://github.com/ApeWorX/ape-vyper.git
cd ape-vyper
python3 setup.py install
First, place Vyper contract source files (files with extension .vy
) in your Ape project's contracts folder.
An example Vyper contract can be found here.
Then, from your root Ape project folder, run the command:
ape compile
The .vy
files in your project will compile into ContractTypes
that you can deploy and interact with in Ape.
For ease of publishing, validation, and some other cases it's sometimes useful to "flatten" your contract into a single file. This combines your contract and any imported interfaces together in a way the compiler can understand. You can do so with a command like this:
ape vyper flatten contracts/MyContract.vy build/MyContractFlattened.vy
[!WARNING] This feature is experimental. Please report any bugs you find when trying it out.
By default, the ape-vyper
plugin uses version pragma for version specification.
However, you can also configure the version directly in your pyproject.toml
file:
[tool.vyper.version]
version = "0.3.7"
By default, ape-vyper
will use whatever version of EVM rules are set as default in the compiler version that gets used,
or based on what the #pragma evm-version ...
pragma comment specifies (available post-v0.3.10
).
Sometimes, you might want to use a different version, such as deploying on Arbitrum or Optimism where new opcodes are not supported yet.
If you want to require a different version of EVM rules to use in the configuration of the compiler, set it in your ape-config.yaml
like this:
[tool.ape.vyper]
evm_version = "paris"
NOTE: The config value chosen will not override if a pragma is set in a contract.
You can not compile interface source files directly.
Thus, you must place interface files in a directory named interfaces
in your contracts_folder
e.g. contracts/interfaces/IFace.vy
.
Then, these files can be imported in other .vy
sources files via:
import interfaces.IFace as IFace
Alternatively, use JSON interfaces from dependency contract types by listing them under the import_remapping
key:
[[tool.ape.dependencies]]
name = "VyperVoting"
github = "vyperlang/vyper"
contracts_folder = "examples/voting/"
version = "v0.3.8"
[tool.ape.vyper]
import_remapping = ["voting=VyperVoting@v0.3.8"]
Import the voting contract types like this:
# @version 0.3.10
import voting.ballot as ballot
To use decimals on Vyper 0.4, use the following config:
[tool.ape.vyper]
enable_decimals = true
Ape-Vyper supports Vyper 0.3.10's new pragma formats
#pragma version 0.3.10
#pragma evm-version paris
#pragma optimize codesize
You can install versions of Vyper using the ape vyper vvm
CLI tools.
List installed versions using:
ape vyper vvm list
To list the available Vyper versions, do:
ape vyper vvm list --available
Install more versions using the command:
ape vyper vvm install 0.3.7 0.3.10
To customize Vyper's output format (like the native -f
flag), you can configure the output format:
For example, to only get the ABI, do:
[tool.ape.vyper]
output_format = ["abi"]
To do this using the CLI only (adhoc), use the following command:
ape compile --config-override '{"vyper": {"output_format": ["abi"]}}'
ape-vyper
supports the socl_json
format.
To use this format, configure ape-vyper
like:
[tool.ape.vyper]
output_format = ["solc_json"]
Note: Normally, in Vyper, you cannot use solc_json
with other formats.
However, ape-vyper
handles this by running separately for the solc_json
request.
Be sure to use the --force
flag when compiling to ensure you get the solc JSON output.
ape compile file_needing_solc_json_format.vy -f
To get a dependency source file in this format, configure and compile the dependency.
[[tool.ape.dependencies]]
name = "my_dep"
config_override = { "vyper" = { "output_format" = ["solc_json"] } }
And then run:
ape pm compile --force
FAQs
Plugin for Ape Ethereum Framework for compiling Vyper contracts
We found that ape-vyper demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.