... | ... | @@ -127,24 +127,15 @@ contract DEXWeb { |
|
|
|
|
|
## **Frontend-Entwicklung**
|
|
|
|
|
|
Das Frontend von DEXWeb ist mit React und Web3.js gebaut und befindet sich im **`frontend`** Verzeichnis.
|
|
|
Das Frontend von DEXWeb ist mit React und thirdweb gebaut und befindet sich im **`frontend`** Verzeichnis.
|
|
|
|
|
|
### **Hauptkomponenten**
|
|
|
|
|
|
* **App.js**: Die Hauptkomponente, die die Anwendung rendert.
|
|
|
* **Pages**: Die Hauptkomponente, die die Anwendung rendert.
|
|
|
* **components/**: Enthält wiederverwendbare UI-Komponenten.
|
|
|
|
|
|
### Beispielcode für Web3-integration
|
|
|
### Beispielcode für thirdweb-integration
|
|
|
|
|
|
```plaintext
|
|
|
import Web3 from 'web3';
|
|
|
|
|
|
const web3 = new Web3(Web3.givenProvider || 'http://localhost:8545');
|
|
|
|
|
|
const loadBlockchainData = async () => {
|
|
|
const accounts = await web3.eth.getAccounts();
|
|
|
const networkId = await web3.eth.net.getId();
|
|
|
// Load contract
|
|
|
const dexWeb = new web3.eth.Contract(DEXWeb.abi, DEXWeb.networks[networkId].address);
|
|
|
};
|
|
|
``` |
|
|
\ No newline at end of file |