DApps and web3 Flashcards

1
Q

Is the front end of a DApp restricted to any technology/framework?

A

No. You can use anything you want, like HTML, CSS, JS, Java, Python, the list goes on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the front end use in order to connect to the backend (Smart Contracts)?

A

Web3 API libraries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What do you need in order to interact with a contract from a DApp?

A

The contract’s ABI and bytecode.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the ABI used for?

A

ABI is a description of the public interface of a contract, which is used by DApps for invoking the contract.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the bytecode used for?

A

The EVM on each node requires bytecode in order to execute the contract code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why would you use BigNumber library?

A

Because Javascript does not handle big numbers correctly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why is it necessary to always check if the web3 provider is set in the beginning of your web DApp code?

A

Because Metamask injects it and overwrites the any other web3 with its own.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why would you use version web3 js 1.x instead of 0.2x.x?

A

Mainly because its async calls use promises instead of callbacks, which is preferred in the javascript world.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to list accounts in web3 1.x?

A

web3.eth.getAccounts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between .call and .send?

A

.send sends a transaction and costs moeny while .call queries the state of the contract.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Is sending one ether like this “.send({ value: 1 })” okay?

A

No, you send 1 wei. Transactions always work with wei.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

So in order to send 1 ether I have to mutiply the value by 10^18?

A

You can use the util method web3.utils.toWei(1, ‘ether’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What do I have to specify when calling “.send()”?

A

You must specify “from” which is the sender address. Everything else is optional.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

The only function of web3.eth.sendTransaction() is to send ethers to a specific address, is that correct?

A

No, you can also invoke contract methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly