|
@ -4,17 +4,17 @@ import { ethers } from 'ethers'; |
|
|
import store from '~/store'; |
|
|
import store from '~/store'; |
|
|
import { ContractType } from '~/types/store'; |
|
|
import { ContractType } from '~/types/store'; |
|
|
// 0x7a89c2D92Bf53160ab58d7889966741cA8Eb5855
|
|
|
// 0x7a89c2D92Bf53160ab58d7889966741cA8Eb5855
|
|
|
export const config = { |
|
|
|
|
|
// 56: {
|
|
|
|
|
|
// chainId: 56,
|
|
|
|
|
|
// rpc: "https://bsc-dataseed1.defibit.io",
|
|
|
|
|
|
// address: {
|
|
|
|
|
|
// FIL__factory: "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153",
|
|
|
|
|
|
// NFT__factory: "0x5fd156B6B47Bb0B363fa3D4e2E31a8394Ee7A630",
|
|
|
|
|
|
// Pool__factory: "0xC31cEb39961076d8fAD3936D88489972c02b4D83",
|
|
|
|
|
|
// Pledge__factory: "0x2F3d8761c8214627743F84F9890A8eEeD914ddf1",
|
|
|
|
|
|
// }
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
const config = { |
|
|
|
|
|
56: { |
|
|
|
|
|
chainId: 56, |
|
|
|
|
|
rpc: "https://bsc-dataseed1.defibit.io", |
|
|
|
|
|
address: { |
|
|
|
|
|
FIL__factory: "0x0d8ce2a99bb6e3b7db580ed848240e4a0f9ae153", |
|
|
|
|
|
NFT__factory: "0x5fd156B6B47Bb0B363fa3D4e2E31a8394Ee7A630", |
|
|
|
|
|
Pool__factory: "0xC31cEb39961076d8fAD3936D88489972c02b4D83", |
|
|
|
|
|
Pledge__factory: "0x2F3d8761c8214627743F84F9890A8eEeD914ddf1", |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
97: { |
|
|
97: { |
|
|
chainId: 97, |
|
|
chainId: 97, |
|
|
rpc: "https://bsc-testnet.blockpi.network/v1/rpc/public", |
|
|
rpc: "https://bsc-testnet.blockpi.network/v1/rpc/public", |
|
@ -36,6 +36,14 @@ export const config = { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
} as any |
|
|
} as any |
|
|
|
|
|
|
|
|
|
|
|
if(process.env.REACT_APP_CHAINID === '56'){ |
|
|
|
|
|
delete config[97] |
|
|
|
|
|
}else{ |
|
|
|
|
|
delete config[56] |
|
|
|
|
|
} |
|
|
|
|
|
console.log(config); |
|
|
|
|
|
|
|
|
// 57.333333333333333332
|
|
|
// 57.333333333333333332
|
|
|
const contractObj = { |
|
|
const contractObj = { |
|
|
FIL__factory, |
|
|
FIL__factory, |
|
@ -71,9 +79,7 @@ const switchNetWork = () => { |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export const initContract = async () => { |
|
|
|
|
|
|
|
|
const initContract = async () => { |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
let chainId = Number(process.env.REACT_APP_CHAINID); |
|
|
let chainId = Number(process.env.REACT_APP_CHAINID); |
|
@ -117,4 +123,8 @@ export const initContract = async () => { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
export{ |
|
|
|
|
|
config,initContract |
|
|
} |
|
|
} |