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
For more details, see the [Solana to Base Relay Script](https://github.com/base/bridge/blob/main/scripts/src/commands/sol/onchain/bridge/solana-to-base/bridge-sol.handler.ts).
126
+
127
+
### Wrap Custom SPL Tokens
128
+
129
+
The example above shows how to bridge native SOL to Base.
130
+
To bridge custom SPL tokens,
131
+
you need to create wrapped ERC20 representations on Base using the CrossChainERC20Factory.
1.**Parse command:** The terminal parser resolves the asset, destination, and optional Base call (selector + args + value).
122
246
2.**Stage bridge:**`queueBridge` validates SPL overrides, ABI-encodes the Base call via `encodeFunctionData`, and stages relay overrides.
123
247
3.**Execute:**`solanaBridge.bridge()` resolves the destination (ENS/Basename), ensures balances, and calls `realBridgeImplementation` to sign and send the Solana transaction.
124
-
4.**Relay + Call:** If relay gas is prepaid, the Base Relayer executes the attached call from the user’s Twin contract immediately after WSOL is minted.
248
+
4.**Relay + Call:** If relay gas is prepaid, the Base Relayer executes the attached call from the user’s Twin contract immediately after ERC20 SOL is minted.
125
249
126
250
Key implementation references:
127
251
@@ -159,7 +283,7 @@ Set `CDP_API_KEY` in your `.env` file to get access to the faucet.
@@ -192,38 +316,6 @@ Set `CDP_API_KEY` in your `.env` file to get access to the faucet.
192
316
}
193
317
```
194
318
195
-
## Troubleshooting
196
-
197
-
<AccordionGroup>
198
-
<Accordiontitle="Incorrect gas fee receiver">
199
-
A mismatch triggers `Error Code: 12300`. Instead of hardcoding the receiver address, query it directly from the [bridge config](https://github.com/base/bridge/blob/main/solana/programs/bridge/src/common/state/bridge.rs#L170). See the [bridge script](https://github.com/base/bridge/blob/main/scripts/src/commands/sol/bridge/solana-to-base/bridge-sol.handler.ts#L92) for an example.
200
-
</Accordion>
201
-
<Accordiontitle="RPC 403 on mainnet">
202
-
Public Solana RPC endpoints throttle cross-origin requests. Set
203
-
`NEXT_PUBLIC_SOLANA_MAINNET_RPC` (or the equivalent in your client) to a dedicated provider such
204
-
as Helius, Triton, or QuickNode.
205
-
</Accordion>
206
-
<Accordiontitle="Message not appearing on Solana">
207
-
* Wait ~15 minutes for Base finality and relay.
208
-
* Confirm the Base tx emitted `MessageRegistered`.
209
-
* Verify you are using consistent network pairs (Mainnet/Mainnet or Sepolia/Devnet).
210
-
</Accordion>
211
-
<Accordiontitle="Proof verification failed">
212
-
* Use the latest provable block number.
213
-
* Confirm the message hash and Merkle proof correspond to the same transaction.
214
-
* Ensure all PDAs / account seeds are derived with the correct program IDs per environment.
215
-
</Accordion>
216
-
</AccordionGroup>
217
-
218
-
## Security
219
-
220
-
<Warning>
221
-
* Never mix testnet and mainnet addresses or RPC endpoints.
222
-
* Validate all destination addresses before bridging.
223
-
* Monitor both Base and Solana explorers for your transactions.
224
-
* Keep private keys and API keys secure; never expose them in client bundles.
0 commit comments