Skip to content

Commit

Permalink
docs(oft-solana): mention rent (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
nazreen authored Dec 4, 2024
1 parent 4df85d1 commit df08538
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion examples/oft-solana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,43 @@ Replace `9UovNrJD8pQyBLheeHNayuG1wJSEAoxkmM14vw5gcsTT` with the programId that y

Ensure you have Docker running before running the build command.

#### Build the Solana OFT program

```bash
anchor build -v # verification flag enabled
```

#### Preview Rent Costs for the Solana OFT

:information_source: The majority of the SOL required to deploy your program will be for [**rent**](https://solana.com/docs/core/fees#rent) (specifically, for the minimum balance of SOL required for [rent-exemption](https://solana.com/docs/core/fees#rent-exempt)), which is calculated based on the amount of bytes the program or account uses. Programs typically require more rent than PDAs as more bytes are required to store the program's executable code.

In our case, the OFT Program's rent accounts for roughly 99% of the SOL needed during deployment, while the other accounts' rent, OFT Store, Mint, Mint Authority Multisig and Escrow make up for only a fraction of the SOL needed.

You can preview how much SOL would be needed for the program account. Note that the total SOL required would to be slightly higher than just this, to account for the other accounts that need to be created.

```bash
solana rent $(wc -c < target/verifiable/oft.so)
```

You should see an output such as

```bash
Rent-exempt minimum: 3.87415872 SOL
```

:information_source: LayerZero's default deployment path for Solana OFTs require you to deploy your own OFT program as this means you own the Upgrade Authority and don't rely on LayerZero to manage that authority for you. Read [this](https://neodyme.io/en/blog/solana_upgrade_authority/) to understand more no why this is important.

#### Deploy the Solana OFT

```bash
solana program deploy --program-id target/deploy/oft-keypair.json target/verifiable/oft.so -u devnet
```

:information_source: the `-u` flag specifies the RPC URL that should be used. The options are `mainnet-beta, devnet, testnet, localhost`, which also have their respective shorthands: `-um, -ud, -ut, -ul`

:warning: If the deployment is slow, it could be that the network is congested. If so, you can either wait it out or opt to include a `priorityFee`.

### (optional) Deploying with a priority fee
#### (optional) Deploying with a priority fee

This section only applies if you are unable to land your deployment transaction due to network congestion.

Expand Down

0 comments on commit df08538

Please sign in to comment.