Skip to main content

🤖 ACCOUNT ABSTRACTION DEPLOYMENT FLOW

🎯 THE VISION: ONE-SIGNATURE DEPLOYMENT

Even without an on-chain factory, we can use Account Abstraction to make deployment feel like one click!


🏗️ HOW IT WORKS

Traditional Flow (Manual):

1. Deploy Vault → Sign & Wait
2. Deploy Wrapper → Sign & Wait
3. Deploy ShareOFT → Sign & Wait
4. Configure Wrapper → Sign & Wait
5. Configure ShareOFT → Sign & Wait
6. Configure Vault → Sign & Wait
7. Deploy CCA → Sign & Wait
8. Approve Batcher → Sign & Wait
9. Launch CCA → Sign & Wait

Total: 9 signatures, 5-10 minutes

With Account Abstraction:

1. User signs ONCE
2. Smart account executes all 9 transactions atomically
3. Done in 30 seconds!

Total: 1 signature, 30 seconds ✨

🚀 IMPLEMENTATION OPTIONS

Option 1: Frontend AA (Best UX)

Users connect with a smart wallet (Coinbase Smart Wallet, Biconomy, etc.):

// Frontend: components/DeployVault.tsx
import { useSmartAccount } from '@biconomy/react';

export function DeployVaultButton() {
const { smartAccount } = useSmartAccount();

async function deployWithAA() {
// User signs ONCE
const userOp = await smartAccount.sendTransaction([
deployVaultTx,
deployWrapperTx,
deployShareOFTTx,
configureWrapperTx,
configureShareOFTTx,
configureVaultTx,
deployCCATx,
approveBatcherTx
]);

await userOp.wait();
// ✅ All deployed in ONE signature!
}

return (
<button onClick={deployWithAA}>
✨ Deploy Vault (1-Click)
</button>
);
}

Pros:

  • ✅ True 1-click for users
  • ✅ Gasless (you can sponsor)
  • ✅ Best UX
  • ✅ Works with Coinbase Smart Wallet

Cons:

  • Requires frontend integration
  • Users need compatible wallet

Option 2: Hybrid - Script Deploys, AA Launches

Backend deploys infrastructure (no AA needed):

  • Deploy Vault, Wrapper, ShareOFT, CCA
  • Configure everything
  • Return addresses

Creator uses AA for the launch:

  • Approve tokens
  • Launch CCA
  • All in ONE signature
// Frontend after backend deployment
async function launchWithAA(addresses: DeployedAddresses) {
const userOp = await smartAccount.sendTransaction([
// 1. Approve tokens
{
to: creatorToken,
data: encodeFunctionData({
abi: erc20Abi,
functionName: 'approve',
args: [VAULT_ACTIVATION_BATCHER, amount]
})
},
// 2. Launch CCA
{
to: VAULT_ACTIVATION_BATCHER,
data: encodeFunctionData({
abi: VaultActivationBatcherABI,
functionName: 'batchActivate',
args: [token, vault, wrapper, cca, amount, percent, raise]
})
}
]);

await userOp.wait();
// ✅ CCA launched in ONE signature!
}

Pros:

  • ✅ Simpler to implement
  • ✅ Backend handles complex deployment
  • ✅ Still great UX for launch
  • ✅ Works today with your batcher

Cons:

  • Backend still does manual deployment
  • Not fully 1-click (but close!)

Option 3: Full AA with Deployment Batcher 🚀

Create a deployment batcher contract (like VaultActivationBatcher but for deployment):

contract VaultDeploymentBatcher {
function batchDeploy(
address token,
address creator,
string memory symbol
) external returns (
address vault,
address wrapper,
address shareOFT,
address cca
) {
// Deploy all contracts
vault = address(new CreatorOVault(token, creator, ...));
wrapper = address(new CreatorOVaultWrapper(token, vault, creator));
shareOFT = address(new CreatorShareOFT(..., creator));
cca = address(new CCALaunchStrategy(shareOFT, ..., creator));

// Configure everything
wrapper.setShareOFT(shareOFT);
shareOFT.setVault(vault);
shareOFT.setMinter(wrapper, true);
vault.setWhitelist(wrapper, true);
cca.setApprovedLauncher(VAULT_ACTIVATION_BATCHER, true);

// Transfer ownership to creator
vault.transferOwnership(creator);
wrapper.transferOwnership(creator);
shareOFT.transferOwnership(creator);
cca.transferOwnership(creator);
}
}

Then with AA:

// ONE signature for EVERYTHING
const userOp = await smartAccount.sendTransaction([
// 1. Deploy all contracts
{
to: VAULT_DEPLOYMENT_BATCHER,
data: encodeFunctionData({
abi: VaultDeploymentBatcherABI,
functionName: 'batchDeploy',
args: [token, creator, symbol]
})
},
// 2. Approve tokens
{
to: token,
data: encodeFunctionData({
abi: erc20Abi,
functionName: 'approve',
args: [VAULT_ACTIVATION_BATCHER, amount]
})
},
// 3. Launch CCA
{
to: VAULT_ACTIVATION_BATCHER,
data: encodeFunctionData({
abi: VaultActivationBatcherABI,
functionName: 'batchActivate',
args: [...]
})
}
]);

// ✅ ENTIRE VAULT DEPLOYED + LAUNCHED IN ONE SIGNATURE!

Pros:

  • ✅ TRUE 1-click deployment
  • ✅ From wallet connect to live CCA in one signature
  • ✅ Best possible UX

Cons:

  • Need to deploy batcher contract
  • Still has contract size considerations (but smaller!)

🎯 MY RECOMMENDATION

Phase 1: Option 2 (This Week)

  1. Keep backend deployment as-is (using scripts)
  2. Add AA for CCA launch
  3. Users sign once to launch

Why:

  • Works with what you have
  • Easy to implement
  • Great UX improvement
  • Can deploy today

Phase 2: Option 3 (Next Week) 🚀

  1. Build VaultDeploymentBatcher (simpler than factory)
  2. Add AA for full flow
  3. True 1-signature deployment

Why:

  • Complete automation
  • Best UX
  • Still manageable contract size

💻 IMPLEMENTATION: OPTION 2 (QUICK WIN)

Let me create the AA integration for your current setup:

1. Frontend Component

// components/LaunchVaultAA.tsx
import { useAccount } from 'wagmi';
import { useSmartAccount } from '@biconomy/react';
import { encodeFunctionData, erc20Abi } from 'viem';

export function LaunchVaultAA({
vaultAddresses,
depositAmount,
auctionPercent,
requiredRaise
}) {
const { address } = useAccount();
const { smartAccount } = useSmartAccount();

async function launchWithOneClick() {
// Build transactions
const txs = [
// Approve tokens
{
to: vaultAddresses.creatorToken,
data: encodeFunctionData({
abi: erc20Abi,
functionName: 'approve',
args: [
'0x6d796554698f5Ddd74Ff20d745304096aEf93CB6',
depositAmount
]
})
},
// Launch CCA
{
to: '0x6d796554698f5Ddd74Ff20d745304096aEf93CB6',
data: encodeFunctionData({
abi: VaultActivationBatcherABI,
functionName: 'batchActivate',
args: [
vaultAddresses.creatorToken,
vaultAddresses.vault,
vaultAddresses.wrapper,
vaultAddresses.cca,
depositAmount,
auctionPercent,
requiredRaise
]
})
}
];

// Execute with ONE signature
const userOp = await smartAccount.sendTransaction(txs);
const receipt = await userOp.wait();

console.log('CCA launched!', receipt);
}

return (
<button onClick={launchWithOneClick}>
✨ Launch CCA (1-Click)
</button>
);
}

🎯 WHAT WOULD YOU LIKE?

A. Option 2: AA for Launch Only (This week)

  • I'll create the AA integration
  • Works with current deployment
  • Quick to implement

B. Option 3: Full AA Deployment (Next week)

  • Build VaultDeploymentBatcher
  • Complete 1-signature flow
  • Best UX

C. Both (Recommended)

  • Option 2 now for quick launch
  • Option 3 as enhancement

Which approach do you prefer? 🤔