A package for running, deploying, and working with vyper contracts in a foundry setup.
The following will need to be installed in order to use this template. Please follow the links and instructions.
- Git
- You'll know you've done it right if you can run
git --version
- You'll know you've done it right if you can run
- Foundry / Foundryup
- This will install
forge
,cast
, andanvil
- 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
- This will install
- Vyper Compiler
- You'll know you've done it right if you can run
vyper --version
and get an output like:0.3.4+commit.f31f0ec
- You'll know you've done it right if you can run
- Install the package.
forge install PatrickAlphaC/foundry-vyper --no-commit
- Update
remappings.txt
Either make a remappings.txt
file or just add the following to it:
foundry-vyper/=lib/foundry-vyper/src/
- Use the Vyper Deployer Contract!
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);
}
To deploy with arguments, just abi encode your arguments:
vyperDeployer.deployContract("SimpleStore", abi.encode(1234))