Truper solved a temporary need so I could learn Vyper by translating existing solidity contracts and reuse the test suites for quick feedback. It's probably not compatible with recent versions of Truffle.
Try this: https://github.com/truffle-box/vyper-example-box
A simple tool to compile vyper contracts to truffle compatible artifacts.
This is a somewhat hacky approach to working with vyper in truffle. You need to have the vyper
compiler installed and available in your terminal's environment. If you can't run $ vyper -h
this tool will be useless to you.
This is a bit of a stop-gap, as truffle will likely include this functionality in the future.
npm i -g truper
Compile all .v.py
files found in ./contracts
or an immediate child directory:
$ truper
Compile all .v.py
files in a specified directory:
$ truper /path/to/contracts
The compiled output is always written to ./build/contracts
.
If the contract file name was myContract.v.py
, the compiler output will be written to myContract.json
.
const MyContract = artifacts.require('myContract');
The contract can then be used in truffle just as any other solidity contracts compiled by truffle, (though I have not tested with migrations at all).