Transpile for status app (#70)
This commit is contained in:
parent
2947309074
commit
6f240edf0d
|
@ -7,8 +7,14 @@ import { MockContract } from '@status-community-dapp/contracts/abi'
|
|||
export function useContracts() {
|
||||
const { config } = useConfig()
|
||||
const { chainId } = useEthers()
|
||||
let votingContract = new Contract('0x0000000000000000000000000000000000000000', new Interface(MockContract.abi))
|
||||
|
||||
return {
|
||||
votingContract: new Contract(config.contracts[chainId ?? 3].votingContract, new Interface(MockContract.abi)),
|
||||
if (chainId) {
|
||||
const chainConfig = config.contracts[chainId]
|
||||
if (chainConfig) {
|
||||
votingContract = new Contract(chainConfig.votingContract, new Interface(MockContract.abi))
|
||||
}
|
||||
}
|
||||
|
||||
return { votingContract }
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ module.exports = (env) => {
|
|||
rules: [
|
||||
{
|
||||
test: /\.[jt]sx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
options: {
|
||||
|
@ -36,7 +35,7 @@ module.exports = (env) => {
|
|||
'@babel/preset-typescript',
|
||||
[
|
||||
'@babel/preset-env',
|
||||
{ targets: { browsers: '> 5%, not IE <= 11' } },
|
||||
{ targets: { browsers: 'chrome 77' } },
|
||||
],
|
||||
'@babel/preset-react',
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue