Skip to content

Instantly share code, notes, and snippets.

View anupam-io's full-sized avatar
🤠
bonjour

anupam anupam-io

🤠
bonjour
View GitHub Profile
@anupam-io
anupam-io / deploy_ganache.js
Last active January 5, 2021 10:00
Deploy scripts for solidity with web3 and wallet/ganache
const Web3 = require('web3');
const compiledContract = require('./../build/MyContract.json');
const rpcEndpoint = 'rpc-END-POINT';
// you will get from ganache-GUI
// Setting up the provider
const provider = new Web3.providers.HttpProvider(rpcEndpoint);
const web3 = new Web3(provider);
@anupam-io
anupam-io / compileAll.js
Last active January 5, 2021 09:59
Compile scripts for solidity
var path = require('path');
var solc = require('solc');
var fs = require('fs-extra');
const buildPath = path.resolve(__dirname, 'build');
fs.removeSync(buildPath);
fs.mkdirSync(buildPath);
fs.readdir(path.resolve(__dirname, 'contracts'), function (err, files) {
//listing all files using forEach