Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function createExampleContract() {
// hide create button
document.getElementById('create').style.visibility = 'hidden';
document.getElementById('source').innerText = source;
// create contract
var address = web3.eth.sendTransaction({data: web3.eth.compile.solidity(source)}),
Contract = web3.eth.contract(desc);
myContract = new Contract(address);
document.getElementById('call').style.visibility = 'visible';
}
function test8() {
// "{"topic":["0x83c9849c","000000000000000000000000000000000000000000000000000000000000001e"],"max":100,"address":"0x01"}"
web3.eth.watch(contract.Event, {a: 30}, {max: 100}).changed(function (res) {
});
};
mint(e) {
const { addToBalance } = this.props;
e.preventDefault();
const value = parseInt(this.state.amountToMint, 10);
if (EmbarkJS.isNewWeb3()) {
TestToken.methods.mint(value).send({ from: web3.eth.defaultAccount })
.then(() => { addToBalance(value); });
} else {
TestToken.mint(value).send({ from: web3.eth.defaultAccount })
.then(() => { addToBalance(value); });
}
console.log(TestToken.options.address +".mint("+value+").send({from: " + web3.eth.defaultAccount + "})");
}
it('getTransactionReceipt', function(done) {
web3.eth.onBlock(8, function() {
web3.eth.getTransactionReceipt(txHash, function(err, receipt) {
validateTxReceipt(err, receipt, tx);
done();
});
});
});
SingleDeploy = function(compiledContracts, gasLimit, gasPrice, _web3) {
if (_web3 !== undefined) {
web3 = _web3;
}
this.compiledContracts = compiledContracts;
this.gasLimit = gasLimit;
this.gasPrice = gasPrice;
this.deployedContracts = {};
web3.eth.defaultAccount = web3.eth.coinbase;
};
componentWillMount() {
overrideSendTransaction(web3.eth, () => {
return this.state.wallet.privKey;
});
}
getLatestStates: function(url) {
web3.setProvider(new web3.providers.HttpProvider(url));
var last = web3.eth.blockNumber;
var first = last - AppConstants.BlockFetchLimit + 1;
return {
defaultAccount: web3.eth.defaultAccount,
accounts: this.getAccounts(),
network: this.getNetwork(),
mining: this.getMining(),
blocks: this.getBlocks(first, last)
};
},