Skip to content

Instantly share code, notes, and snippets.

@kyriediculous
Created March 7, 2018 22:00
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 kyriediculous/13efccc780a9c180b37f4c27fe696bb8 to your computer and use it in GitHub Desktop.
Save kyriediculous/13efccc780a9c180b37f4c27fe696bb8 to your computer and use it in GitHub Desktop.
methods: {
clickNumber (event) {
console.log(event.target.innerHTML, this.amount)
this.winEvent = null
this.pending = true
this.$store.state.contractInstance().bet(event.target.innerHTML, {
gas: 300000,
value: this.$store.state.web3.web3Instance().toWei(this.amount, 'ether'),
from: this.$store.state.web3.coinbase
}, (err, result) => {
if (err) {
console.log(err)
this.pending = false
} else {
let Won = this.$store.state.contractInstance().Won()
Won.watch((err, result) => {
if (err) {
console.log('could not get event Won()')
} else {
this.winEvent = result.args
this.pending = false
}
})
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment