https://github.com/patrickalphac/foundry-vyper
A package for deploying and compiling vyper code in foundry
https://github.com/patrickalphac/foundry-vyper
Last synced: 12 months ago
JSON representation
A package for deploying and compiling vyper code in foundry
- Host: GitHub
- URL: https://github.com/patrickalphac/foundry-vyper
- Owner: PatrickAlphaC
- Created: 2022-08-06T02:53:51.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-09-24T18:13:54.000Z (almost 4 years ago)
- Last Synced: 2023-03-04T01:09:11.601Z (over 3 years ago)
- Language: Solidity
- Homepage:
- Size: 28.3 KB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Foundry/Vyper
A package for running, deploying, and working with vyper contracts in a foundry setup.
# Table of Contents
- [Foundry/Vyper](#foundryvyper)
- [Table of Contents](#table-of-contents)
- [Getting Started](#getting-started)
- [Requirements](#requirements)
- [Quickstart](#quickstart)
- [Deploying with arguments](#deploying-with-arguments)
- [Acknowledgments](#acknowledgments)
# Getting Started
## Requirements
The following will need to be installed in order to use this template. Please follow the links and instructions.
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- You'll know you've done it right if you can run `git --version`
- [Foundry / Foundryup](https://github.com/gakonst/foundry)
- This will install `forge`, `cast`, and `anvil`
- You can test you've installed them right by running `forge --version` and get an output like: `forge 0.2.0 (f016135 2022-07-04T00:15:02.930499Z)`
- To get the latest of each, just run `foundryup`
- [Vyper Compiler](https://vyper.readthedocs.io/en/stable/installing-vyper.html)
- You'll know you've done it right if you can run `vyper --version` and get an output like: `0.3.4+commit.f31f0ec`
## Quickstart
1. Install the package.
```
forge install PatrickAlphaC/foundry-vyper --no-commit
```
2. Update `remappings.txt`
Either make a `remappings.txt` file or just add the following to it:
```
foundry-vyper/=lib/foundry-vyper/src/
```
3. Use the Vyper Deployer Contract!
```javascript
import "foundry-vyper/VyperDeployer.sol";
import "src/interfaces/ISimpleStorage.sol";
.
.
.
function deploy() public {
string vyperSimpleStorageLocation = "src/VSimpleStorage.vy";
vyperDeployer = new VyperDeployer();
address vyContractAddress = vyperDeployer.deployContract(vyperSimpleStorageLocation);
ISimpleStorage simpleStorage = ISimpleStorage(vyContractAddress);
}
```
### Deploying with arguments
To deploy with arguments, just abi encode your arguments:
```
vyperDeployer.deployContract("SimpleStore", abi.encode(1234))
```
# Acknowledgments
- [0xKitsune/Foundry-Vyper](https://github.com/0xKitsune/Foundry-Vyper)
- [Foundry/Huff](https://github.com/huff-language/foundry-huff)