Skip to content

Commit 01dc631

Browse files
committed
rm redundant code & config infura id
1 parent 4579397 commit 01dc631

File tree

3 files changed

+5
-23
lines changed

3 files changed

+5
-23
lines changed

basic/03-web3js-erc20/index.js

+1-13
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,6 @@ const Trans = async () => {
6363
);
6464
console.log(`Contract deployed at address: ${deployReceipt.contractAddress}`);
6565

66-
// method 2 infura not support
67-
// const deployTx2 = await deployContract.deploy({
68-
// data: bytecode,
69-
// arguments: ["hello","Dapp",1,100000000],
70-
// }).send({
71-
// from: '0x54A65DB20D7653CE509d3ee42656a8F138037d51',
72-
// gas: 1500000,
73-
// gasPrice: '30000000000000'}).
74-
// then(function(newContractInstance){
75-
// console.log(newContractInstance.options.address) // instance with the new contract address
76-
// });
77-
7866
const erc20Contract = new web3.eth.Contract(
7967
abi,
8068
deployReceipt.contractAddress
@@ -96,7 +84,7 @@ const Trans = async () => {
9684
);
9785

9886
// Send Tx and Wait for Receipt
99-
const transferReceipt = await web3.eth.sendSignedTransaction(
87+
await web3.eth.sendSignedTransaction(
10088
transferTransaction.rawTransaction
10189
);
10290

basic/04-web3js-truffle/truffle-config.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
},
1717
},
1818
networks: {
19-
// development: {
19+
// development: {
2020
// host: "127.0.0.1",
2121
// port: 7545,
2222
// network_id: "*"
@@ -31,7 +31,7 @@ module.exports = {
3131
provider: () =>
3232
new HDWalletProvider(
3333
process.env.PRIVATE_KEY,
34-
'https://ropsten.infura.io/v3/0aae8358bfe04803b8e75bb4755eaf07'
34+
'https://ropsten.infura.io/v3/' + process.env.INFURA_ID
3535
),
3636
network_id: '*',
3737
gas: 3000000,
@@ -41,15 +41,15 @@ module.exports = {
4141
provider: () =>
4242
new HDWalletProvider(
4343
process.env.PRIVATE_KEY,
44-
'https://kovan.infura.io/v3/0aae8358bfe04803b8e75bb4755eaf07'
44+
'https://kovan.infura.io/v3/' + process.env.INFURA_ID
4545
),
4646
network_id: '*',
4747
},
4848
rinkeby: {
4949
provider: () =>
5050
new HDWalletProvider(
5151
process.env.PRIVATE_KEY,
52-
'https://rinkeby.infura.io/v3/0aae8358bfe04803b8e75bb4755eaf07'
52+
'https://rinkeby.infura.io/v3/' + process.env.INFURA_ID
5353
),
5454
network_id: '*',
5555
gas: 3000000,

basic/06-ethersjs-waffle/test/simpleTokenTest.js

-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,6 @@ describe('SimpleToken', () => {
1616
token = await deployContract(wallet, SimpleToken, ["HEHE", "HH", 0, 100000000]);
1717
});
1818

19-
// beforeEach(async () => {
20-
// //token = await deployContract(wallet, SimpleToken, ["HEHE", "HH", 1, 100000000]);
21-
// const simpletoken = new ethers.ContractFactory(SimpleToken.abi, SimpleToken.bytecode, wallet);
22-
// token = await simpletoken.deploy( "HEHE", "HH", 1, 100000000);
23-
// });
24-
2519
it('Assigns initial balance', async () => {
2620
console.log("*****2");
2721
expect(await token.balanceOf(wallet.address)).to.equal(100000000);

0 commit comments

Comments
 (0)