Solana Integration Guide
CreatorVault supports Solana users from Day 1 via the Base-Solana Bridge.
Overviewβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SOLANA β BASE FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β SOLANA BRIDGE BASE β
β βββββββββββ βββββββββββββββ βββββββββββββββββββ β
β β Phantom βββLockβββββΊβ Validators βββApproveββΊβ Mint SOL on β β
β β Wallet β SOL β (~300 blocksβ β Twin Contract β β
β βββββββββββ βββββββββββββββ ββββββββββ¬βββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββ β
β β Execute Call on Base β β
β β - CCA Bid β β
β β - Buy wsToken (π°) β β
β β - Deposit to Vault β β
β ββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
What Solana Users Can Doβ
1. π·οΈ Participate in CCA (Fair Launch)β
Solana users can bid in Continuous Clearing Auctions to get wsTokens at fair prices:
// From Solana wallet
bridge SOL + call submitCCABidFromSolana(
ccaAuction,
maxPrice,
amount,
prevTickPrice
)
Flow:
- User locks SOL on Solana
- Validators approve the bridge message
- SOL minted on Base to user's Twin Contract
- Twin Contract submits bid to CCA
- User owns the bid (can claim tokens after graduation)
2. π° Enter Buy-To-Win Lotteryβ
Every BUY of wsToken is a lottery entry! Solana users can participate:
// From Solana wallet
bridge SOL + call buyAndEnterLottery(
router,
tokenIn, // SOL
wsToken, // e.g., wsAKITA
amountIn,
amountOutMin,
recipient // Twin contract or any address
)
Flow:
- User locks SOL on Solana
- SOL minted on Base
- Adapter swaps SOL β wsToken on Uniswap V4
- Tax hook captures 6.9% fee
- Lottery entry registered for the buyer
- User could win the jackpot!
3. π¦ Deposit into Vaultsβ
Solana users can deposit into CreatorVaults:
// From Solana wallet
bridge SOL + call depositFromSolana(
vault,
token,
amount,
recipient
)
Contract Addressesβ
Base Mainnetβ
| Contract | Address |
|---|---|
| Bridge | 0x3eff766C76a1be2Ce1aCF2B69c78bCae257D5188 |
| BridgeValidator | 0xAF24c1c24Ff3BF1e6D882518120fC25442d6794B |
| CrossChainERC20Factory | 0xDD56781d0509650f8C2981231B6C917f2d5d7dF2 |
| SOL Token | 0x311935Cd80B76769bF2ecC9D8Ab7635b2139cf82 |
| SolanaBridgeAdapter | To be deployed |
Solana Mainnetβ
| Program | Address |
|---|---|
| BridgeProgram | HNCne2FkVaNghhjKXapxJzPaBvAKDG1Ge3gqhZyfVWLM |
| BaseRelayerProgram | g1et5VenhfJHJwsdJsDbxWZuotD5H4iELNG61kS4fb9 |
Twin Contractsβ
Each Solana wallet has a deterministic Twin Contract on Base:
- What is it? A smart contract on Base that represents your Solana wallet
- Why? Enables Solana wallets to execute Base transactions
- How? Bridge messages with attached calls execute FROM the Twin contract
Solana Wallet: 9aYkCA...
β
ββββΊ Twin Contract: 0x1234... (on Base)
β
ββββΊ msg.sender when executing calls
Auto-Relay (Gasless for Solana Users)β
With the BaseRelayerProgram, Solana users can:
- Pay gas fees in SOL on Solana
- Have their Base transaction executed automatically
- No need for ETH on Base!
// Add PayForRelay instruction to your Solana tx
const ixs = [
getBridgeSolInstruction({ ... }),
await buildPayForRelayIx(RELAYER_PROGRAM_ID, outgoingMessage, payer)
];
Example: Solana User Enters Lotteryβ
// 1. User connects Phantom wallet
const phantom = window.phantom?.solana;
const { publicKey } = await phantom.connect();
// 2. Build bridge + lottery call
const ixs = [
getBridgeSolInstruction({
payer: publicKey,
from: publicKey,
solVault: SOLANA_BRIDGE.solana.bridgeProgram,
bridge: bridgeAccountAddress,
outgoingMessage,
to: toBytes(SOLANA_BRIDGE_ADAPTER), // CreatorVault adapter
remoteToken: toBytes(SOLANA_BRIDGE.base.solToken),
amount: BigInt(0.1 * 10**9), // 0.1 SOL
}),
// Auto-relay for gasless
await buildPayForRelayIx(
RELAYER_PROGRAM_ID,
outgoingMessage,
publicKey
)
];
// 3. Attach call to buy wsToken + enter lottery
const call = {
target: SOLANA_BRIDGE_ADAPTER,
data: encodeLotteryEntryCall({
router: UNISWAP_V4_ROUTER,
tokenIn: SOL_ON_BASE,
wsToken: WSAKITA,
amountIn: BigInt(0.1 * 10**9),
amountOutMin: 0n,
recipient: getTwinAddress(publicKey)
}),
value: 0n
};
// 4. Send transaction
const signature = await buildAndSendTransaction(
SOLANA_RPC_URL,
ixs,
publicKey
);
// 5. Wait for bridge + execution (~5 minutes)
// User's Twin contract receives SOL, swaps for wsToken
// Lottery entry automatically registered!
Security Considerationsβ
- Twin Contract Ownership: Only the corresponding Solana wallet can execute calls from its Twin
- Bridge Validation: All bridge messages require validator signatures
- Slippage Protection: Always set
amountOutMinwhen swapping - Time Sensitivity: CCA bids may expire; account for ~5 minute bridge time
Frontend Integrationβ
import { SolanaConnect, SolanaBridgeCard } from '@/components'
function SolanaBridge() {
const [publicKey, setPublicKey] = useState<string | null>(null)
return (
<div>
<SolanaConnect onConnect={setPublicKey} />
<SolanaBridgeCard
publicKey={publicKey}
onBridge={(amount, action) => {
// Handle bridge transaction
}}
/>
</div>
)
}
Resourcesβ
CreatorVault supports Solana users from Day 1 via the Base-Solana Bridge.
Overviewβ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SOLANA β BASE FLOW β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β SOLANA BRIDGE BASE β
β βββββββββββ βββββββββββββββ βββββββββββββββββββ β
β β Phantom βββLockβββββΊβ Validators βββApproveββΊβ Mint SOL on β β
β β Wallet β SOL β (~300 blocksβ β Twin Contract β β
β βββββββββββ βββββββββββββββ ββββββββββ¬βββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββ β
β β Execute Call on Base β β
β β - CCA Bid β β
β β - Buy wsToken (π°) β β
β β - Deposit to Vault β β
β ββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
What Solana Users Can Doβ
1. π·οΈ Participate in CCA (Fair Launch)β
Solana users can bid in Continuous Clearing Auctions to get wsTokens at fair prices:
// From Solana wallet
bridge SOL + call submitCCABidFromSolana(
ccaAuction,
maxPrice,
amount,
prevTickPrice
)
Flow:
- User locks SOL on Solana
- Validators approve the bridge message
- SOL minted on Base to user's Twin Contract
- Twin Contract submits bid to CCA
- User owns the bid (can claim tokens after graduation)
2. π° Enter Buy-To-Win Lotteryβ
Every BUY of wsToken is a lottery entry! Solana users can participate:
// From Solana wallet
bridge SOL + call buyAndEnterLottery(
router,
tokenIn, // SOL
wsToken, // e.g., wsAKITA
amountIn,
amountOutMin,
recipient // Twin contract or any address
)
Flow:
- User locks SOL on Solana
- SOL minted on Base
- Adapter swaps SOL β wsToken on Uniswap V4
- Tax hook captures 6.9% fee
- Lottery entry registered for the buyer
- User could win the jackpot!
3. π¦ Deposit into Vaultsβ
Solana users can deposit into CreatorVaults:
// From Solana wallet
bridge SOL + call depositFromSolana(
vault,
token,
amount,
recipient
)
Contract Addressesβ
Base Mainnetβ
| Contract | Address |
|---|---|
| Bridge | 0x3eff766C76a1be2Ce1aCF2B69c78bCae257D5188 |
| BridgeValidator | 0xAF24c1c24Ff3BF1e6D882518120fC25442d6794B |
| CrossChainERC20Factory | 0xDD56781d0509650f8C2981231B6C917f2d5d7dF2 |
| SOL Token | 0x311935Cd80B76769bF2ecC9D8Ab7635b2139cf82 |
| SolanaBridgeAdapter | To be deployed |
Solana Mainnetβ
| Program | Address |
|---|---|
| BridgeProgram | HNCne2FkVaNghhjKXapxJzPaBvAKDG1Ge3gqhZyfVWLM |
| BaseRelayerProgram | g1et5VenhfJHJwsdJsDbxWZuotD5H4iELNG61kS4fb9 |
Twin Contractsβ
Each Solana wallet has a deterministic Twin Contract on Base:
- What is it? A smart contract on Base that represents your Solana wallet
- Why? Enables Solana wallets to execute Base transactions
- How? Bridge messages with attached calls execute FROM the Twin contract
Solana Wallet: 9aYkCA...
β
ββββΊ Twin Contract: 0x1234... (on Base)
β
ββββΊ msg.sender when executing calls
Auto-Relay (Gasless for Solana Users)β
With the BaseRelayerProgram, Solana users can:
- Pay gas fees in SOL on Solana
- Have their Base transaction executed automatically
- No need for ETH on Base!
// Add PayForRelay instruction to your Solana tx
const ixs = [
getBridgeSolInstruction({ ... }),
await buildPayForRelayIx(RELAYER_PROGRAM_ID, outgoingMessage, payer)
];
Example: Solana User Enters Lotteryβ
// 1. User connects Phantom wallet
const phantom = window.phantom?.solana;
const { publicKey } = await phantom.connect();
// 2. Build bridge + lottery call
const ixs = [
getBridgeSolInstruction({
payer: publicKey,
from: publicKey,
solVault: SOLANA_BRIDGE.solana.bridgeProgram,
bridge: bridgeAccountAddress,
outgoingMessage,
to: toBytes(SOLANA_BRIDGE_ADAPTER), // CreatorVault adapter
remoteToken: toBytes(SOLANA_BRIDGE.base.solToken),
amount: BigInt(0.1 * 10**9), // 0.1 SOL
}),
// Auto-relay for gasless
await buildPayForRelayIx(
RELAYER_PROGRAM_ID,
outgoingMessage,
publicKey
)
];
// 3. Attach call to buy wsToken + enter lottery
const call = {
target: SOLANA_BRIDGE_ADAPTER,
data: encodeLotteryEntryCall({
router: UNISWAP_V4_ROUTER,
tokenIn: SOL_ON_BASE,
wsToken: WSAKITA,
amountIn: BigInt(0.1 * 10**9),
amountOutMin: 0n,
recipient: getTwinAddress(publicKey)
}),
value: 0n
};
// 4. Send transaction
const signature = await buildAndSendTransaction(
SOLANA_RPC_URL,
ixs,
publicKey
);
// 5. Wait for bridge + execution (~5 minutes)
// User's Twin contract receives SOL, swaps for wsToken
// Lottery entry automatically registered!
Security Considerationsβ
- Twin Contract Ownership: Only the corresponding Solana wallet can execute calls from its Twin
- Bridge Validation: All bridge messages require validator signatures
- Slippage Protection: Always set
amountOutMinwhen swapping - Time Sensitivity: CCA bids may expire; account for ~5 minute bridge time
Frontend Integrationβ
import { SolanaConnect, SolanaBridgeCard } from '@/components'
function SolanaBridge() {
const [publicKey, setPublicKey] = useState<string | null>(null)
return (
<div>
<SolanaConnect onConnect={setPublicKey} />
<SolanaBridgeCard
publicKey={publicKey}
onBridge={(amount, action) => {
// Handle bridge transaction
}}
/>
</div>
)
}