Kodiak Finance
  • OVERVIEW
    • 🐻‍❄️Introducing Kodiak
    • 🐻Kodiak x Berachain
    • ✉️Contact Us
    • 🍯Kodiak Contracts
  • 🅱️Kodiak-Boyco
  • PROTOCOL
    • 🔃DEX
      • Swaps
      • Liquidity Provision
      • Trading Fees
    • 🏝️Islands
      • Island Liquidity Provision
      • Sweetened Islands
      • Auto-BGT
    • 🐼Panda Factory
  • 🪙Tokenomics
    • Kodiak Pre-TGE Rewards
  • 🧠User Guide
    • Launch a Token Launch on Panda Factory
    • Trading on Panda Factory
    • Swap
    • Create a V2 Position
    • Create a V3 Position
    • Add/Stake Islands Liquidity
    • Migrating to a Reward Vault
    • Deploying new Permissonless Islands
    • Deploying and Configuring a Kodiak Farm
    • Add your token
  • Add Your Project to the Ecosystem
  • 👨‍💻Developers
    • 🐼Panda
      • Technical Integration Guide
      • Subgraph
        • Entity Reference
        • Query Guide
        • Advanced Usage Guide
      • Smart Contract Reference
        • Panda Factory
        • Panda Pool
        • Panda Token
      • Api
    • Farms
      • Technical Integration Guide
      • Smart Contract Reference
    • 🌴Kodiak Islands
      • Technical Integration Guide
        • Understanding Token Deposit Ratio
      • Subgraph
        • Entity Reference
        • Query Guide
        • Advanced Usage Guide
      • Smart Contract Reference
        • Kodiak Island Factory
        • Kodiak Island
        • Kodiak Island Router
      • Api
    • 💰Pricing with Subgraph
    • 💱Quotes
    • Backend
  • 🛡️SECURITY
    • 🔍Audits
  • ℹ️Informational
    • 📜Terms of Use
    • 🔏Privacy Policy
    • TradingView Advanced License
Powered by GitBook
On this page
  • Deploying New Islands
  • Requirements for deploying a permissionless Island
  • Querying Deployed Islands and related data
  • Factory Management
  • ABI
  1. Developers
  2. Kodiak Islands
  3. Smart Contract Reference

Kodiak Island Factory

The core factory contract that manages deploying new islands and central shared setting between these islands for permission-less islands

Deploying New Islands

function deployVault(
    address tokenA,
    address tokenB,
    uint24 uniFee,
    address manager,
    address managerTreasury,
    uint16 managerFee,
    int24 lowerTick,
    int24 upperTick
) external returns (address island)

Creates a new Kodiak Island using these parameters. Get the tokens and fee tier for the pool you want to deploy the island for.

Deployment process - The tokens are sorted and the kodiak pool is fetched, if the kodiak pool does not exist it throws an error.

Parameters:

  • tokenA: First token in the pool pair

  • tokenB: Second token in the pool pair

  • uniFee: Underlying pool fee tier (eg: 100, 500, 3000, 10000)

  • manager: Manager address (0x0 for unmanaged/permisionless islands)

  • managerTreasury: The address that will receive the manager's fee share

  • managerFee: Manager fee in basis points (0 - 10000)

  • lowerTick: lower tick of the island's position

  • upperTick: upper tick of the islnad's position

Returns:

  • island (address): The address of the newly deployed KodiakIsland vault.

Deployment Process:

  • The function sorts the tokens (tokenA, tokenB) to ensure consistent ordering.

  • It fetches the corresponding Kodiak V3 pool address using the provided tokens and fee tier.

  • It validates that the Kodiak V3 pool exists and that the provided ticks align with the pool's tick spacing.

  • It clones the islandImplementation contract to create a new KodiakIsland vault.

  • It initializes the new vault with the provided parameters.

  • It adds the deployer to the list of deployers and the island to the list of islands deployed by the manager.

Emits: IslandCreated on successful deployment

event IslandCreated(address indexed uniPool, address indexed manager, address indexed island, address implementation);

Requirements for deploying a permissionless Island

  1. The manager address must be set to zero address.

  2. The managerTreasury must be set to zero address.

  3. The managerFee must be set to 0.

  4. The deployed island refers the managerFee and managerTreasury from the factory for permissionless islands

Querying Deployed Islands and related data

Get All Deployers

function getDeployers() public view returns (address[] memory)

Returns array of all addresses that have deployed at least one island.

Returns:

  • address[]: Array of deployer addresses

Get Islands by Deployer

function getIslands(address deployer) public view returns (address[] memory islands)

Returns array of all islands deployed by a specific address.

Parameters:

  • deployer: Address to query islands for

Returns:

  • islands: Array of island addresses deployed by specified deployer

  • Returns empty array if no islands deployed

Count Functions

function numIslands() public view returns (uint256)

Returns total number of islands deployed through factory.

function numDeployers() public view returns (uint256)

Returns total number of unique deployer addresses.

function numIslands(address deployer) public view returns (uint256)

Returns number of islands deployed by specific address.

Parameters:

  • deployer: Address to query island count for

Factory Management

Only the factory owner can call these functions.

Set Island Implementation

function setIslandImplementation(address _implementation) external

Updates the implementation contract used for new island deployments.

Parameters:

  • _implementation: Address of new implementation contract

    • Must be non-zero address

    • Must be a valid KodiakIsland contract

Requirements:

  • Caller must be factory owner

  • Implementation address cannot be zero

Emits: UpdateIslandImplementation(address implementation)

Set Treasury

function setTreasury(address _treasury) external

Updates the treasury address that receives protocol fees.

Parameters:

  • _treasury: New treasury address

    • Must be non-zero address

    • Will receive protocol fees from permissionless islands

Requirements:

  • Caller must be factory owner

  • Treasury address cannot be zero

Emits: TreasurySet(address treasury)

Set Island Fee

function setIslandFee(uint16 _islandFee) external

Updates the protocol fee for permissionless islands.

Parameters:

  • _islandFee: New protocol fee in basis points

    • Must be between 0-2000 (0-20%)

    • Applied to all permissionless islands

Requirements:

  • Caller must be factory owner

  • Fee cannot exceed 2000 (20%)

Emits: IslandFeeSet(uint16 islandFee)

ABI

[
        {
            "type": "function",
            "name": "deployVault",
            "inputs": [
                {
                    "name": "tokenA",
                    "type": "address",
                    "internalType": "address"
                },
                {
                    "name": "tokenB",
                    "type": "address",
                    "internalType": "address"
                },
                {
                    "name": "uniFee",
                    "type": "uint24",
                    "internalType": "uint24"
                },
                {
                    "name": "manager",
                    "type": "address",
                    "internalType": "address"
                },
                {
                    "name": "managerTreasury",
                    "type": "address",
                    "internalType": "address"
                },
                {
                    "name": "managerFee",
                    "type": "uint16",
                    "internalType": "uint16"
                },
                {
                    "name": "lowerTick",
                    "type": "int24",
                    "internalType": "int24"
                },
                {
                    "name": "upperTick",
                    "type": "int24",
                    "internalType": "int24"
                }
            ],
            "outputs": [
                {
                    "name": "island",
                    "type": "address",
                    "internalType": "address"
                }
            ],
            "stateMutability": "nonpayable"
        },
        {
            "type": "function",
            "name": "islandFee",
            "inputs": [],
            "outputs": [
                {
                    "name": "",
                    "type": "uint16",
                    "internalType": "uint16"
                }
            ],
            "stateMutability": "view"
        },
        {
            "type": "function",
            "name": "islandImplementation",
            "inputs": [],
            "outputs": [
                {
                    "name": "",
                    "type": "address",
                    "internalType": "address"
                }
            ],
            "stateMutability": "view"
        },
        {
            "type": "function",
            "name": "setIslandImplementation",
            "inputs": [
                {
                    "name": "newImplementation",
                    "type": "address",
                    "internalType": "address"
                }
            ],
            "outputs": [],
            "stateMutability": "nonpayable"
        },
        {
            "type": "function",
            "name": "treasury",
            "inputs": [],
            "outputs": [
                {
                    "name": "",
                    "type": "address",
                    "internalType": "address"
                }
            ],
            "stateMutability": "view"
        },
        {
            "type": "event",
            "name": "IslandCreated",
            "inputs": [
                {
                    "name": "uniPool",
                    "type": "address",
                    "indexed": true,
                    "internalType": "address"
                },
                {
                    "name": "manager",
                    "type": "address",
                    "indexed": true,
                    "internalType": "address"
                },
                {
                    "name": "island",
                    "type": "address",
                    "indexed": true,
                    "internalType": "address"
                },
                {
                    "name": "implementation",
                    "type": "address",
                    "indexed": false,
                    "internalType": "address"
                }
            ],
            "anonymous": false
        },
        {
            "type": "event",
            "name": "IslandFeeSet",
            "inputs": [
                {
                    "name": "fee",
                    "type": "uint16",
                    "indexed": false,
                    "internalType": "uint16"
                }
            ],
            "anonymous": false
        },
        {
            "type": "event",
            "name": "TreasurySet",
            "inputs": [
                {
                    "name": "treasury",
                    "type": "address",
                    "indexed": true,
                    "internalType": "address"
                }
            ],
            "anonymous": false
        },
        {
            "type": "event",
            "name": "UpdateIslandImplementation",
            "inputs": [
                {
                    "name": "newImplementation",
                    "type": "address",
                    "indexed": false,
                    "internalType": "address"
                }
            ],
            "anonymous": false
        }
    ]
PreviousSmart Contract ReferenceNextKodiak Island

Last updated 3 months ago

👨‍💻
🌴