Skip to content

Instantly share code, notes, and snippets.

@mihairadulescu
Created April 23, 2021 15:57
Show Gist options
  • Save mihairadulescu/eca0df72c4c0674ca0ca03fa946384ca to your computer and use it in GitHub Desktop.
Save mihairadulescu/eca0df72c4c0674ca0ca03fa946384ca to your computer and use it in GitHub Desktop.
import React from 'react'
import Web3 from 'web3'
import {Button} from '@material-ui/core'
import {abi} from './abi'
const onClick = () => {
const web3 = new Web3(Web3.givenProvider)
const contract = new web3.eth.Contract(abi, '0x42F0A5c2007847a2c15D9ba75f1B028324b54dA2')
return contract.methods.start(['Some title1', 'Some description1'])
.send({from: '0xf297000bC433Ce2CB669bBa3bD551C2E9b972522'})
.catch((error: any) => console.log('error is ', error))
}
export const TransactionTest = () => <div>
<Button onClick={onClick}>
Create atsk
</Button>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment