Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: configure contracts page #33

Merged
merged 6 commits into from
Oct 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/quick-start/configure-contracts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,32 @@ The contracts pulled from the network are determined by the chain configured in
**Note:**
While some contracts may have the same address on both `Sepolia and Mainnet`, this is not always guaranteed. Always double-check you are on the correct network based on the contract's intended usage.

```bash
// Example scaffold.config.ts
export const config = {
network: "sepolia", // Use "mainnet" for Mainnet
```ts
export type ScaffoldConfig = {
targetNetworks: readonly chains.Chain[];
pollingInterval: number;
onlyLocalBurnerWallet: boolean;
rpcProviderUrl: string;
walletAutoConnect: boolean;
};

const scaffoldConfig = {
targetNetworks: [chains.devnet],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just include this part ser, no need to include the entire file, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay ser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ser, kindly review @metalboyrick

// Only show the Burner Wallet when running on devnet
onlyLocalBurnerWallet: false,
rpcProviderUrl: process.env.NEXT_PUBLIC_PROVIDER_URL || "",
// The interval at which your front-end polls the RPC servers for new data
// it has no effect if you only target the local network (default is 30_000)
pollingInterval: 30_000,
/**
* Auto connect:
* 1. If the user was connected into a wallet before, on page reload reconnect automatically
* 2. If user is not connected to any wallet: On reload, connect to burner wallet if burnerWallet.enabled is true && burnerWallet.onlyLocal is false
*/
walletAutoConnect: true,
} as const satisfies ScaffoldConfig;

export default scaffoldConfig;
```

#### 2. Enter the Contract Address and Name
Expand All @@ -59,7 +80,7 @@ The tool will generate a configuration file that includes:
- Contract Address
- Class Hash

```bash
```ts
export const externalContracts = [
{
address: "0x1234...",
Expand Down
Loading