diff options
Diffstat (limited to 'app/services')
-rw-r--r-- | app/services/Lottery/constants.js | 2 | ||||
-rw-r--r-- | app/services/Lottery/index.js | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/services/Lottery/constants.js b/app/services/Lottery/constants.js new file mode 100644 index 0000000..dd6062a --- /dev/null +++ b/app/services/Lottery/constants.js @@ -0,0 +1,2 @@ +export const DEXON_TESTNET = 'https://testnet-rpc.dexon.org'; +export const LOTTERY_ADDRESS = '0xAE64Df55807E2B9a58A124AB7d852EeBCAEb7CB9'; diff --git a/app/services/Lottery/index.js b/app/services/Lottery/index.js new file mode 100644 index 0000000..4244122 --- /dev/null +++ b/app/services/Lottery/index.js @@ -0,0 +1,8 @@ +import Web3 from '@cobinhood/web3'; +import { DEXON_TESTNET, LOTTERY_ADDRESS } from './constants'; +import { abi } from '../../../build/contracts/Lottery.json'; + +const web3 = new Web3(new Web3.providers.HttpProvider(DEXON_TESTNET)); +const lotteryContract = new web3.eth.Contract(abi, LOTTERY_ADDRESS); + +export default lotteryContract; |