Skip to content

Wrapper for compiling Vyper smart contracts in javascript and automatically deploying them via web3.js

Notifications You must be signed in to change notification settings

gakonst/VyperWeb3Deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Viper Web3 Deploy

Requires Viper (https://github.com/ethereum/vyper/) installed (https://vyper.readthedocs.io/en/latest/installing-vyper.html) Using web3@0.20.0! Does not work with latest web3 as the syntax is a little different.

Javascript wrapper for the Viper Compiler: ./utils/Wrapper.js

Automatic web3 deployment of Viper Contract: ./utils/Deployer.js

Ideally this can be used to integrate Vyper contracts in truffle-compile (https://github.com/trufflesuite/truffle-compile/) and thus in truffle-framework

Installing

npm install

Test

(launch ganache)

node example.js -f contracts/greeter.v.py -h http://localhost:8545

Usage:

Vyper compiler wrapper for Javascript

Vyper = require("./utils/Wrapper.js")
Vyper.compileAll(FILENAME, function(compiled_contract) {
	abi = JSON.parse(compiled_contract['abi'])
	bytecode = '0x' + compiled_contract['bytecode']
	// do whatever you want
});

Automatic Deployment

Deployer = require("./utils/Deployer.js")
Deployer.deployContract(FILENAME, RPC_ADDRESS, function(contractInstance) {

	// do whatever you want
});

About

Wrapper for compiling Vyper smart contracts in javascript and automatically deploying them via web3.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published