Skip to content

Instantly share code, notes, and snippets.

@mcdee
Created September 26, 2017 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcdee/247af7de6344c5ffc5fd67732b58abfa to your computer and use it in GitHub Desktop.
Save mcdee/247af7de6344c5ffc5fd67732b58abfa to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "var input=`solc node_modules=node_modules --optimize --combined-json abi,bin,interface contracts/DomainSale.sol`" > contract.js
# First address is the ENS registry
geth attach ipc:/home/jgm/.ethereum/testnet/geth.ipc <<EOGETH
loadScript('contract.js');
var contract = web3.eth.contract(JSON.parse(input.contracts["contracts/DomainSale.sol:DomainSale"].abi));
personal.unlockAccount(eth.accounts[1], "throwaway");
var partial = contract.new('0x112234455c3a32fd11230c42e7bccd4a84e02010', { from: eth.accounts[1], data: "0x" + input.contracts["contracts/DomainSale.sol:DomainSale"].bin, gas: 4700000, gasPrice: web3.toWei(105, 'gwei')});
console.log(partial.transactionHash);
EOGETH
rm -f contract.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment