You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,14 +79,18 @@ bun run dev
79
79
80
80
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. I use Firefox during development.
81
81
82
-
For unknown reasons, NextJs cannot launch the app properly in the very first time. So you need to press `F5` on your keyboard to reload your web browser again after launching the NextJs, so the NextJs can work properly.
82
+
If for unknown reasons, NextJs cannot launch the app properly in the very first time. You need to press `F5` on your keyboard to reload your web browser again after launching the NextJs, so the NextJs can work properly.
83
83
84
84
Initially, the app should use the default web3 provider via Infura API to load the page.
85
-
Then you should click on the `Connect to wallet` button on the top of the home page to connect your Web3 Wallet to this app.
85
+
86
+
Go to your browser wallet to choose the account you want to connect to. Then come back to this app and click on the `Connect to wallet` button on the top of the home page to connect your Web3 Wallet to this app.
87
+
88
+
Wagmi should prompt you to switch to the correct network with deployed contracts.
89
+
If you want to use another account, go to your browser wallet to choose the account you want to connect to. Then come back to this app and click on `Disconnect` then `Connect to Wallet`
86
90
87
91
Confirm your initial ETH balance and the token balance on the home page. This token is the token address set inside the ERC721 Sales smart contract during its deployment, or you can reset the token address after deployment.
88
92
89
-
#### If you do not have the token that is accepted by the NFT Sales contract:
93
+
#### If you do not have the tokens that is accepted by the NFT Sales contract:
90
94
91
95
In the dropdown: choose the USDT or TokenX on Ethereum/Other Chain
92
96
In the Radio buttons: choose `Mint Tokens To Guest`
toast({description: `Failed: connected chain is not expected! Click on the Network dropdown button, and click on ${capitalizeFirst(blockchain)}. Click on your account dropdown, then click on Disconnect. Then connect wallet again.`,variant: 'destructive'})
119
-
returntrue;
106
+
awaitdelayFunc(2000);//wait for statemanagement to update the data to be used below
// If MetaMask is not installed, we use the default provider, which is backed by a variety of third-party services (such as INFURA). They do not have private keys installed so are only have read-only access
119
-
warning="MetaMask not installed; using read-only defaults on sepolia test network";
141
+
warning=`MetaMask not installed; using read-only defaults on ${blockchain} test network`;
120
142
console.warn(warning)
121
-
provider=ethers.getDefaultProvider("sepolia");
143
+
try{
144
+
provider=ethers.getDefaultProvider(blockchain);
145
+
}catch(err){
146
+
console.error('Error getting default provider')
147
+
return{ ...web3InitDefault,err: 'failed to get default provider'};
148
+
}
122
149
return{
123
150
...web3InitDefault,
124
151
warn: warning,
125
-
chainId: '11155111',//sepolia
126
-
chainName: 'sepolia',
152
+
chainId: getChainObj(blockchain).chainId,
153
+
chainName: blockchain,
127
154
};
128
155
}else{
129
156
// Connect to the MetaMask EIP-1193 object. This is a standard protocol that allows Ethers access to make all read-only requests through MetaMask.
0 commit comments