-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinteract.js
More file actions
25 lines (19 loc) · 984 Bytes
/
Copy pathinteract.js
File metadata and controls
25 lines (19 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const HDWalletProvider = require('truffle-hdwallet-provider');
const Web3 = require('web3');
const { interface, bytecode } = require('./compile');
const provider = new HDWalletProvider(
'couch buddy mixed betray there erosion zebra jungle battle man payment unaware loan evoke crush velvet random wealth stone shrimp banner jungle maple fade',
'https://ropsten.infura.io/v3/640fe7e8258f438abe306c1421b8412e',
1
);
const web3 = new Web3(provider);
const deploy = async() => {
const accounts = await web3.eth.getAccounts();
console.log(accounts)
const contract = await new web3.eth.Contract(JSON.parse(interface),
"0xBD43Af44158a9CE58D8B8beb082d8bb2B6261dE0");
const manager = await contract.methods.manager().call();
console.log('Contract manager', manager);
await contract.methods.enter().send({value: 200000001, gas: "1000000", gasPrice: '5000000000', from: accounts[0]});
};
deploy();