# About

## What is Sudo?

Sudo is a fair-launch token platform on Aptos. Instead of bonding curves, presales, or insider allocations, every token on Sudo is distributed through a verifiably random raffle powered by Aptos on-chain VRF.

No bots. No front-running. No privileged access. Every ticket has an equal chance.

## How It Works

1. **A creator launches a token raffle.** They set the token supply, ticket price, draw frequency, and rules.
2. **Users buy raffle tickets.** Each ticket is an entry into the draw.
3. **On-chain randomness picks winners.** Aptos native VRF selects winners at the configured draw frequency. Nobody — not even validators — can predict or manipulate the outcome.
4. **Liquidity is created automatically.** Once the raffle completes, tokens and collected APT are paired and migrated to a DEX. The liquidity pool is owned by the token's DAO.
5. **Token holders govern everything.** Every token launched on Sudo has a DAO. Holders can create proposals, vote, and execute decisions on-chain.

## Key Features

* **Fair distribution** — VRF raffle ensures every participant has equal odds per ticket
* **No MEV or bot advantage** — Random selection makes speed irrelevant
* **Built-in governance** — Every token gets a DAO with on-chain proposals and voting
* **Automatic liquidity** — Post-raffle LP creation and migration to DEX
* **On-chain trading** — Swap tokens directly after liquidity migration
* **Keyless onboarding** — Connect with Aptos Connect for social login, or use Petra, Nightly, Martian, Pontem, and any AIP-62 compatible wallet

## Links

* **App:** [sudo.fun](https://sudo.fun)
* **Website:** [sudoprotocol.com](https://sudoprotocol.com)
* **Twitter:** [x.com/sudoprotocol](https://x.com/sudoprotocol)


# Connecting Your Wallet

You need a wallet to buy raffle tickets, vote on governance proposals, and trade tokens on Sudo.

## Supported Wallets

Sudo supports any Aptos-compatible wallet, including:

* **Aptos Connect** — Social login (Google, Apple, etc.). No wallet extension needed. Best for new users.
* **Petra** — Aptos' official wallet. Browser extension and mobile.
* **Nightly** — Multi-chain wallet with Aptos support. Browser extension and mobile.
* **Martian** — Browser extension wallet for Aptos.
* **Pontem** — Browser extension wallet for Aptos.
* **OKX Wallet** — Multi-chain wallet with Aptos support.
* **Trust Wallet** — Mobile-first multi-chain wallet.

Any wallet that supports the AIP-62 standard will work with Sudo automatically.

## How to Connect

1. Click **Connect Wallet** in the top-right corner of the page.
2. Choose your wallet:
   * **Aptos Connect** wallets appear at the top of the dialog for social login.
   * **Installed wallets** (Petra, Nightly, Martian, Pontem, etc.) appear next — any compatible wallet you have installed will show up automatically.
   * **More wallets** are listed in a dropdown with install links.
3. Follow your wallet's prompts to approve the connection.

Once connected, the button changes to show your wallet address. Click it to:

* **Copy your address**
* **View your account** (Aptos Connect only)
* **Disconnect**

## Network

Sudo runs on Aptos Mainnet. Your wallet should be set to the Aptos mainnet network. The current network is displayed next to the wallet button in the header.

## What You Need

* **APT tokens** for gas fees and ticket purchases (paid raffles).
* Gas fees on Aptos are low — typically fractions of a cent per transaction.


# Platform Overview

Sudo has five main sections accessible from the navigation bar.

## Home

The landing page shows all raffles on the platform. From here you can:

* Browse live, upcoming, and completed raffles
* Search raffles by name or symbol
* Filter and sort raffles (by price, draw speed, status)
* Switch between card view and list view
* See platform-wide stats: total raffles, active raffles, participants, tickets bought, and winners drawn

A featured raffle is highlighted at the top with a minting progress bar.

## Create Raffle

Launch your own token raffle. You configure the token supply, ticket price, draw frequency, rules, and DAO settings. The platform deploys your token contract and raffle on-chain.

## Dashboard

Your personal activity hub. See your total tickets purchased, raffles won, APT spent, and raffles created. View your full ticket history.

## Swap

Trade tokens that have completed their raffle and migrated liquidity to the DEX. Buy or sell tokens directly against APT.

## Governance

Every token launched on Sudo has its own DAO. The governance hub shows all DAOs, your DAOs, active proposals, and lets you create proposals and vote.


# Creating a Raffle

Anyone can launch a token on Sudo. The platform handles smart contract deployment, raffle mechanics, and liquidity migration automatically.

## Quick Deploy

Click the **Quick Deploy** button at the top of the create page to launch with sensible defaults. This fills in all fields and starts deployment immediately.

## Step-by-Step Setup

Navigate to **Create Raffle** from the top menu.

### Token Details

| Field            | Description                                  | Example                                          |
| ---------------- | -------------------------------------------- | ------------------------------------------------ |
| **Raffle Title** | Name for your raffle (max 100 characters)    | "Community Token Launch"                         |
| **Description**  | What makes your token or raffle special      | "Fair launch for our community governance token" |
| **Symbol**       | Token ticker, 2-10 uppercase letters/numbers | "SUDO"                                           |
| **Token Logo**   | Optional 512x512 PNG or SVG                  | —                                                |

### Raffle Parameters

| Field              | Description                                              | Example        |
| ------------------ | -------------------------------------------------------- | -------------- |
| **Ticket Price**   | APT per ticket. Set to 0 for a free raffle.              | 0.01 APT       |
| **Winning Ticket** | Number of tokens each winner receives                    | 10             |
| **Total Supply**   | Total token supply (minimum 1,000)                       | 1,000,000      |
| **Draw Frequency** | How often a winner is drawn                              | Every 1 second |
| **Raffle Expiry**  | How long the raffle runs before unsold tokens are burned | 24 hours       |
| **DEX Platform**   | Where liquidity will be created after the raffle         | Tapp DEX       |

### Free Raffle: Initial Liquidity

If ticket price is 0, a free raffle doesn't collect APT from buyers. You'll need to seed the initial DEX liquidity yourself.

An **Initial Liquidity (APT)** field appears when the ticket price is set to 0. Enter the amount of APT you want to pair with tokens in the liquidity pool. The estimated starting token price is calculated and displayed.

### DAO Settings

Every raffle creates a DAO for its token. You can configure:

| Field                 | Default | Description                                             |
| --------------------- | ------- | ------------------------------------------------------- |
| **Proposal Quorum**   | 10%     | Minimum % of voting power needed for a proposal to pass |
| **Proposal Duration** | 7 days  | How long proposals stay open for voting                 |

### Raffle Rules

Custom rules displayed to participants. Two defaults are pre-filled:

1. "There is always 1 winner every lottery"
2. "The Raffle lasts until all tokens are distributed"

You can add, edit, or remove rules.

## Deploying

1. Click **Deploy Raffle**.
2. The platform validates your form and uploads metadata to IPFS.
3. A deployment stepper modal appears with two steps:
   * **Deploy Complete System** — Creates your token and raffle contracts on-chain.
   * **Initialize Raffle** — Sets up the raffle state. You'll sign a transaction (gas only).
4. For free raffles: you'll sign one additional transaction to seed the initial APT liquidity.
5. Once complete, your raffle is live and visible on the home page.

## Token Distribution

Every token launch splits the supply:

* **50% Raffle Pool** — Distributed to raffle winners
* **50% Liquidity** — Paired with collected APT (or creator-seeded APT for free raffles) and migrated to the DEX

The DAO owns the resulting liquidity pool position.


# Free vs. Paid Raffles

Sudo supports both free and paid token raffles. The choice affects how liquidity is funded.

## Paid Raffles

* Users pay APT per ticket (e.g., 0.01 APT).
* The APT collected from ticket sales funds the DEX liquidity pool.
* After the raffle ends, 50% of the token supply + all collected APT migrate to the DEX as a liquidity pair.
* The DAO owns the LP position.

**Best for:** Projects that want price discovery driven by participant demand.

## Free Raffles

* Tickets cost 0 APT (users only pay gas).
* Since no APT is collected, the creator seeds the liquidity pool with their own APT.
* An **Initial Liquidity** field appears during raffle creation where the creator specifies how much APT to contribute.
* The creator signs an additional transaction during deployment to transfer the APT.

**Best for:** Community airdrops, promotional launches, or projects that want maximum participation.

## What Happens If a Raffle Expires

If a raffle reaches its expiry time before all tickets are sold:

* Distributed tokens stay with winners.
* Remaining unsold tokens are burned proportionally.
* Whatever APT was collected (or seeded) still migrates to the DEX with the distributed tokens.
* The raffle page shows how many tokens were distributed vs. burned.


# After Your Raffle Launches

Once deployed, your raffle runs automatically. Here's what happens next.

## During the Raffle

* Winners are drawn at your configured draw frequency (e.g., every 1 second).
* The minting progress bar shows how many raffle tokens have been distributed out of the total raffle pool.
* You can monitor participation from the raffle detail page: recent winners, leaderboard of top ticket buyers, and live stats.

## Raffle Completion

The raffle ends when either:

* **All raffle tokens are distributed** (sold out), or
* **The expiry time is reached** (remaining tokens are burned)

## Liquidity Migration and DAO Sovereignty

After the raffle ends, liquidity migrates automatically and the DAO takes full ownership:

1. The remaining 50% of token supply is paired with collected APT.
2. A liquidity pool is created on the configured DEX (Tapp DEX).
3. **Token admin rights** (mint, burn, transfer) are transferred to the DAO account.
4. **LP tokens** are transferred to the DAO account.
5. **External access to the DAO is killed** — no wallet, including the creator's, can control the DAO directly.

The raffle page shows migration status in real-time. Once complete, a green banner appears with an **Open Swap** link to trade the token.

After migration, the creator has no special privileges. All control flows through governance — proposals and votes, same as every other token holder.

## Your Token's DAO

Every launched token gets a fully sovereign DAO. As a token holder, you can:

* Create governance proposals (requires at least 1 winning ticket worth of tokens)
* Vote on proposals from other holders
* Execute passed proposals (any wallet can do this — just pays gas)
* Manage LP positions, treasury funds, token supply, and metadata through governance

The DAO account is the treasury. All assets (APT, tokens, LP positions) live at the DAO address and can only be moved through passed proposals.

See the [Governance](/governance/how-governance-works) section for details.


# Browsing Raffles

The home page at [sudo.fun](https://sudo.fun) shows all raffles on the platform.

## Search and Filter

Use the **search bar** to find raffles by name or symbol.

**Filter options:**

* All raffles
* Live and upcoming
* Migrated (completed with liquidity on DEX)

**Sort options:**

* Price: low to high
* Price: high to low
* Fast draws first
* Slow draws first

## Views

Toggle between **card view** and **list view** using the view switch button.

**Card view** shows each raffle as a card with the token logo, name, symbol, ticket price, draw frequency, and status badge.

**List view** shows the same information in a compact table format.

## Status Badges

Each raffle displays a status badge:

| Badge         | Meaning                                          |
| ------------- | ------------------------------------------------ |
| **Live**      | Raffle is active — you can buy tickets now       |
| **Upcoming**  | Raffle hasn't started yet                        |
| **Sold Out**  | All raffle tokens have been distributed          |
| **Expired**   | Raffle reached its time limit before selling out |
| **Migrating** | Liquidity is being created on the DEX            |
| **Migrated**  | Complete — token is tradeable on the DEX         |

## Platform Stats

Five stats are shown at the top of the page:

* Total raffles created
* Currently active raffles
* Total participants across all raffles
* Total tickets bought
* Total winners drawn

## Featured Raffle

The first or most prominent raffle is highlighted in a large featured card with a minting progress bar showing token distribution progress.

Click any raffle to view its detail page.


# Buying Tickets

Buying a raffle ticket enters you into the draw for that token. Each ticket gives you an equal chance of winning.

## How to Buy

1. Navigate to a **Live** raffle from the home page.
2. Connect your wallet if you haven't already.
3. Select how many tickets you want (1-10 per transaction) using the dropdown.
4. Click **Buy Ticket(s)**.
5. Sign the transaction in your wallet.

Each ticket is purchased and processed sequentially. You'll see a confirmation toast for each successful ticket.

## What It Costs

* **Paid raffles:** The ticket price in APT (displayed on the raffle page) plus a small gas fee.
* **Free raffles:** Gas only (fractions of a cent on Aptos).

## What Happens When You Win

Winners are selected by Aptos on-chain randomness (VRF) at the raffle's configured draw frequency. When you win:

* The winning tokens are sent directly to your wallet.
* Your win appears in the **Recent Blocks** feed on the raffle page.
* Your stats update on the **Dashboard**.

You can win multiple times in the same raffle if you buy multiple tickets across multiple draws.

## If the Raffle Ends

You can't buy tickets once a raffle is:

* **Sold Out** — All raffle tokens have been distributed
* **Expired** — The raffle reached its time limit
* **Migrated** — Liquidity has already moved to the DEX

The buy button text changes to reflect the current state.

## Tips

* Each ticket is independent — buying 10 tickets gives you 10 separate chances, not 10x odds on a single draw.
* Check the draw frequency before buying. A 1-second draw is fast; a 30-minute draw means fewer draws per day.
* Watch the minting progress bar. If it's close to full, the raffle may sell out soon.


# Raffle Lifecycle

Every raffle on Sudo moves through a series of states from creation to completion.

## States

### 1. Upcoming

The raffle has been created but hasn't started yet. A countdown shows time until it goes live. You can view the raffle details but can't buy tickets.

### 2. Live

The raffle is active. Users can buy tickets. Winners are drawn automatically at the configured draw frequency using Aptos on-chain VRF.

The raffle detail page shows:

* Minting progress bar (tokens distributed / total raffle pool)
* Recent winners in the block feed
* Leaderboard of top ticket buyers
* Countdown to expiry (if set)

### 3. Sold Out

All raffle pool tokens have been distributed. No more tickets can be purchased. The raffle transitions to liquidity migration.

### 4. Expired

The raffle reached its expiry time before all tokens were sold. When this happens:

* Tokens already distributed stay with winners.
* Remaining unsold raffle tokens are burned proportionally.
* The raffle page shows the split: "X distributed / Y burned."

### 5. Migrating

Liquidity is being created on the DEX. This happens automatically after a raffle sells out or expires:

* Token supply (50% liquidity allocation) and collected APT are paired.
* The liquidity pool is created on the configured DEX (Tapp DEX).
* A progress indicator shows migration status in real-time.

### 6. Migrated

Liquidity migration is complete. The token is now tradeable on the DEX. The raffle page shows a green banner with an **Open Swap** button linking to the swap page for that token.

### 7. Migration Failed

Rare — if liquidity migration encounters an error, a red banner is displayed. The team may need to investigate or retry.

## Visual Summary

```
Upcoming  -->  Live  -->  Sold Out  -->  Migrating  -->  Migrated
                 |
                 +--->  Expired  --->  Migrating  -->  Migrated
```


# How Governance Works

Every token launched on Sudo automatically gets a sovereign DAO. After the raffle completes and liquidity migrates, all token admin rights and LP tokens are transferred to the DAO. No admin retains any control. The DAO is the sole owner from that point forward.

## The Basics

* **Voting power** is based on your token balance. 1 token = 1 vote.
* **Anyone holding at least 1 winning ticket worth of tokens** can create a proposal. The threshold equals the raffle's "Winning Ticket" amount — the same number of tokens a single winner receives.
* **Anyone with voting power** can vote on active proposals.
* **Execution is fully permissionless** — once a proposal passes, any wallet can trigger execution. You just pay gas. No admin key, no operator, no single point of failure.

## DAO Sovereignty

When a raffle completes and liquidity is migrated, the following happens automatically:

1. **Token admin rights** (mint, burn, transfer) are transferred to the DAO account.
2. **LP tokens** are transferred to the DAO account.
3. **External access is killed** — the DAO account's authentication key is rotated to a dead key. No wallet can sign transactions as the DAO.
4. **All fund movement requires a passed proposal** — the DAO uses a stored SignerCapability that can only be invoked inside the governance contract's `execute_proposal` function.

The DAO account address IS the treasury. APT, tokens, and LP positions all live there. The creator retains nothing after migration.

## What Can Be Governed

DAOs on Sudo can make proposals across these categories:

| Action                    | What It Does                                                        |
| ------------------------- | ------------------------------------------------------------------- |
| **LP Rebalance**          | Remove liquidity, re-add with different ratios, or hold as treasury |
| **LP Migrate**            | Move liquidity from one DEX to another                              |
| **LP Lock**               | Lock the LP position for a specified duration                       |
| **Mint Tokens**           | Mint new tokens to a specified address                              |
| **Burn Tokens**           | Burn tokens from a specified address                                |
| **Update Token Metadata** | Change the token's name, symbol, URI, or description                |
| **Transfer Funds**        | Send APT or tokens from the DAO treasury to an address              |
| **Signal Proposal**       | Non-binding text proposal for community sentiment                   |

## Permissionless Execution

Once a proposal passes (meets quorum and pass threshold) and the voting period ends, **anyone** can call `execute_proposal`. The caller just pays gas — they have zero authority over the DAO. The governance contract uses the stored SignerCapability to execute the approved action on behalf of the DAO.

This means:

* No admin can block a passed proposal
* No single point of failure for execution
* Any community member (or bot) can trigger execution
* The caller cannot modify, redirect, or alter the proposal — they only trigger what was already approved

## DAO Parameters

Each DAO has configurable governance parameters set at launch:

* **Proposal Quorum** — Minimum percentage of voting power that must vote for a proposal to be valid (default: 10%).
* **Proposal Duration** — How long a proposal stays open for voting (default: 7 days).

## Accessing Governance

Navigate to **Governance** from the top menu to see:

* **All DAOs** — Every DAO on the platform
* **My DAOs** — DAOs where you hold tokens (requires wallet connection)
* **Stats** — Total DAOs, your DAOs, active proposals, total proposals

Click a DAO to view its proposals, voting power breakdown, and governance rules.


# Creating a Proposal

Any token holder with at least 1 winning ticket worth of tokens can create a governance proposal for their token's DAO. The threshold equals the raffle's "Winning Ticket" amount — the same number of tokens a single raffle winner receives.

## Steps

1. Go to **Governance** and select a DAO.
2. Click **Create Proposal**.
3. Follow the four-step form:

### Step 1: Choose Action Type

Select what your proposal does:

* **Manage LP Tokens** — Lock, migrate, or rebalance the DAO's liquidity position
* **Mint Tokens** — Create new tokens and send them to an address
* **Burn Tokens** — Burn tokens from an address
* **Update Token Metadata** — Change the token's name, symbol, URI, or description
* **Transfer Funds** — Send APT or tokens from the DAO treasury

### Step 2: Configure the Action

Depending on your action type:

**Manage LP Tokens:**

* Select the DEX venue
* Choose an LP action:
  * **Lock** — Lock LP tokens for a specified duration (in days)
  * **Migrate** — Move liquidity to a different DEX
  * **Rebalance** — Remove some or all liquidity, optionally re-add at different ratios. Removed funds go to the DAO treasury.

**Mint Tokens:**

* Enter the amount to mint
* Enter the destination wallet address

**Burn Tokens:**

* Enter the amount to burn
* Enter the source wallet address

**Update Token Metadata:**

* Check which fields to update (name, symbol, URI, description)
* Fill in the new values for checked fields

**Transfer Funds:**

* Select the asset (APT or token)
* Enter the amount
* Enter the destination wallet address

### Step 3: Set Voting Parameters

* **Proposal Title** — A clear, descriptive title
* **Description** — Explain what you're proposing and why
* **Voting Start** — Start now or schedule for a future date
* **Voting Duration** — How many days the vote stays open (default: 7)
* **Quorum %** — Minimum voting participation required (default: 20%)
* **Pass Threshold %** — Percentage of yes votes needed to pass (default: 50%)

### Step 4: Review and Submit

Review all parameters and click **Submit Proposal**. Sign the transaction in your wallet to create the proposal on-chain.

## Requirements

* Hold at least **1 winning ticket worth of tokens** to create a proposal.
* Wallet must be connected.

## After Submission

Your proposal appears in the DAO's proposal list with an **Active** status badge. Other token holders can now vote on it for the duration you configured.

Once the proposal passes and the voting period ends, anyone can execute it — see [Voting](/governance/voting) for details on execution.


# Voting

Any token holder can vote on active governance proposals in their DAO.

## How to Vote

1. Go to **Governance** and select a DAO where you hold tokens.
2. Click on an active proposal to open the detail view.
3. Review the proposal title, description, and action details.
4. Click **Yes** or **No** to cast your vote.
5. Sign the transaction in your wallet.

## Voting Power

Your voting power equals your token balance. 1 token = 1 vote. The more tokens you hold, the more weight your vote carries.

Your current voting power is displayed in the DAO detail page header and in the **Powers** tab.

## Proposal Lifecycle

| Status       | Meaning                                                      |
| ------------ | ------------------------------------------------------------ |
| **Active**   | Voting is open — you can cast your vote                      |
| **Passed**   | Voting ended, quorum and threshold met — ready for execution |
| **Executed** | Proposal was executed on-chain                               |
| **Failed**   | Proposal didn't reach quorum or pass threshold               |

## Executing a Passed Proposal

Once a proposal reaches **Passed** status (voting period ended, quorum met, pass threshold met), anyone can execute it:

1. Open the passed proposal.
2. Click **Execute Proposal**.
3. Sign the transaction — you just pay gas.

Execution is fully permissionless. You don't need to be the proposer, a token holder, or an admin. The governance contract validates that the proposal passed legitimately, then uses the DAO's stored SignerCapability to carry out the approved action. The caller has no influence over what gets executed — they only trigger what was already voted on.

## Quorum and Pass Threshold

Every proposal has two requirements to pass:

* **Quorum** — Minimum percentage of total voting power that must participate (default: 10-20%). If not enough people vote, the proposal fails regardless of the yes/no split.
* **Pass Threshold** — Minimum percentage of votes that must be "yes" (default: 50%). If quorum is met but not enough yes votes, the proposal fails.

Both values are displayed on the proposal detail view along with a progress bar showing current participation vs. required quorum.

## Real-Time Updates

Vote counts update in real-time via live connection. As other holders vote, you'll see the vote bar and quorum progress update instantly. Toast notifications appear when new votes are cast.

## One Vote Per Wallet

Each wallet address can vote once per proposal. You cannot change your vote after casting it.

## Security

* **No double execution** — A proposal can only be executed once. The contract marks it as executed atomically before dispatching the action.
* **No admin override** — The DAO account has a dead authentication key. No external wallet can sign transactions as the DAO.
* **Slippage protection** — LP operations include minimum output amounts. If the pool moves too much between proposal creation and execution, the transaction reverts.
* **All on-chain** — Every proposal, vote, and execution is recorded on-chain and publicly verifiable.


# Swapping Tokens

After a raffle completes and liquidity migrates to the DEX, you can trade that token directly on Sudo.

## How to Swap

1. Navigate to **Swap** from the top menu.
2. Select a token from the list on the left. Tokens with migrated liquidity are shown first.
3. Choose your direction: **Buy** (APT to token) or **Sell** (token to APT).
4. Enter the amount you want to swap.
5. Review the estimated output, price impact, and minimum received.
6. Click **Swap** and sign the transaction in your wallet.

## Token List

The swap page shows all tokens that have been launched on Sudo. Tokens are sorted with completed (migrated) tokens first. You can search by name or symbol.

Each token shows:

* Symbol and name
* Your balance (if you hold any)
* APT value equivalent
* Migration status (Migrated or Pending)

Only tokens with a **Migrated** status have an active liquidity pool and are tradeable.

## Swap Details

Before confirming, the swap widget shows:

* **Estimated output** — How many tokens (or APT) you'll receive
* **Price impact** — How much your trade moves the pool price
* **Current spot price** — The current exchange rate
* **Pool reserves** — How much APT and token are in the pool

## Slippage Settings

Click the settings icon to adjust slippage tolerance (default: 1%). This sets the minimum amount you'll accept. If the price moves more than your slippage tolerance between submission and execution, the transaction reverts.

## Requirements

* Wallet connected
* Sufficient balance of the input token (APT or the traded token)
* The token must have a live liquidity pool (status: Migrated)


# Your Dashboard

The Dashboard shows your personal activity across all raffles on Sudo. Connect your wallet to view it.

## Stats

Four cards at the top summarize your activity:

| Stat                        | What It Shows                                            |
| --------------------------- | -------------------------------------------------------- |
| **Total Tickets Purchased** | How many raffle tickets you've bought across all raffles |
| **Total Raffles Won**       | How many times you've won a raffle draw                  |
| **Total Spent on Tickets**  | Total APT spent on ticket purchases                      |
| **Raffles Created**         | How many raffles you've launched                         |

## Ticket History

Below the stats, the **Latest Tickets** table shows your recent ticket purchases with:

* Sequence number
* Timestamp
* Amount (APT)
* Status (won/pending)

Click **See All** to view your full ticket history.


# Smart Contracts

Sudo Protocol is built on core Move modules deployed on the Aptos blockchain.

## Modules

### sudo\_fa.move — Fungible Asset Token

Handles token creation and lifecycle management using the Aptos Fungible Asset (FA) standard.

**Capabilities:**

* Token initialization with name, symbol, decimals, icon URI, and project URI
* Mint, burn, and transfer operations
* Token admin rights stored in a transferable Object (MintRef, BurnRef, TransferRef)
* Admin Object transferred to DAO account after liquidity migration
* View functions for metadata lookup and balance queries

### sudo\_raffle.move — VRF Raffle Engine

Manages the fair-launch raffle mechanism for token distribution.

**Capabilities:**

* Raffle state management (active, completed, expired)
* Ticket purchase with configurable pricing (paid or free)
* Winner selection via `aptos_framework::randomness::u64_range()` with the `#[randomness]` attribute — native Aptos on-chain VRF
* Vault system for secure token and APT management
* Configurable draw frequency and raffle expiry
* User participation tracking and history
* Event emission for off-chain indexing

## On-Chain Randomness

Winner selection uses Aptos native VRF. The `#[randomness]` attribute on the raffle function ensures the random seed is derived from the validator set and is unpredictable before the block is finalized. No external oracle (Chainlink VRF, Switchboard) is needed.

```move
use aptos_framework::randomness;

#[randomness]
entry fun execute_raffle(...) {
    let winner_index = randomness::u64_range(0, vector::length(&state.buyers));
    // ...
}
```

## Token Distribution Model

Every token launch splits the supply 50/50:

* **50% Raffle Pool** — Distributed to raffle winners via VRF
* **50% Liquidity** — Paired with collected APT and migrated to DEX after raffle completion

The resulting LP position is owned by the token's DAO.

## Governance — Permissionless Execution

Each token's DAO supports fully permissionless on-chain governance.

**Architecture:**

* DAO account is created as a resource account with a stored `SignerCapability`
* External access is killed via dead authentication key (zero key + dead authenticator)
* Token admin Object and LP tokens are transferred to the DAO after migration
* `execute_proposal()` is callable by any wallet — the caller just pays gas
* The SignerCapability is only accessible inside the governance module's execution function — it cannot be used for arbitrary transactions

**Governance actions:** LP rebalance, LP migrate, LP lock, mint, burn, metadata updates, treasury transfers, signal proposals.

**Security properties:**

* No admin retains any control after migration
* Proposals can only be executed once (atomic `executed` flag set before dispatch)
* LP operations include slippage protection (reverts if pool moved too much)
* All proposals, votes, and executions are on-chain and publicly verifiable

## Source Code

GitHub: [Sudo-Protocol/sudo-latest](https://github.com/Sudo-Protocol/sudo-latest)


