Skip to main content

Contracts

Not live yet

Stratus is not live yet. This page describes features that will be available when the app launches.

This page covers the contracts behind what Stratus offers today: token launches, trading pools with a liquidity lock, and staking pools (created through the PoolFactory's createStakingPool, on Ethereum for now). All of them are written in Solidity and run on Ethereum and Robinhood Chain.

Addresses

The token factory sits at the same address on every chain, and each chain has its own PoolFactory. Their addresses are listed under Official factory addresses. Lock pools are created per pool, at their own addresses.


SKY20 token​

Every token launched on Stratus is a SKY20: a standard ERC-20 with a fixed global supply that can live on several chains at one address.

  • The whole GLOBAL_SUPPLY is minted once, on LAUNCH_CHAIN, to the mint recipient.
  • On every other chain the token starts at zero supply. Supply arrives only by bridging.
  • Only BRIDGE (the SkyBridge Diamond) can mint or burn, and only as tokens move between chains. No chain's supply can exceed GLOBAL_SUPPLY.
  • There is no owner, no admin and no upgrade path.
  • On a native chain the token shows its own name and symbol. On a non-native chain it shows SkyBridge NAME and sSYMBOL.
ReadReturns
BRIDGE()The SkyBridge Diamond on this chain
LAUNCH_CHAIN()The chain ID where the supply was minted
GLOBAL_SUPPLY()Total supply across all chains
decimals(), name(), symbol(), totalSupply()Standard ERC-20 values for this chain

Configuration​

A token is defined by its SKY20Config. Every field is part of the token's identity, so changing any of them changes the address:

struct SKY20Config {
string name;
string symbol;
uint8 decimals_; // 1 to 18
uint256 globalSupply; // > 0
uint256 launchChain; // chain ID
address mintRecipient; // receives the whole supply on the launch chain
uint8 profile; // 0 = Clean, 1 = Taxed
uint256[] nativeChains; // chain IDs, strictly ascending, must include launchChain
}

Tax rates and the tax treasury are not part of the config. They are passed to launch and stored in the SkyBridge registry.


Token factory​

The SKY20 token factory (SKY20Factory) launches tokens and deploys them on more chains. It is permissionless: anyone can call it, with or without the Stratus app.

The factory is deployed at the same address on every chain. It places each token with CREATE3 at a salt of keccak256(creator, userSalt, configHash), so a token's address depends only on the factory, the creator, the creator's salt and the configuration. The same inputs give the same address on every chain, and a different configuration can never land at an existing token's address.

Functions​

function predict(address creator, bytes32 userSalt, SKY20Config calldata cfg)
external view returns (address);

function launch(
bytes32 userSalt,
SKY20Config calldata cfg,
uint16 buyTaxBps,
uint16 sellTaxBps,
address treasury
) external returns (address token);

function expandToChain(
address creator,
bytes32 userSalt,
SKY20Config calldata cfg,
uint16 buyTaxBps,
uint16 sellTaxBps,
address treasury
) external returns (address token);

launch must be called on cfg.launchChain. The caller (msg.sender) is the creator. It deploys the token, mints the full supply to cfg.mintRecipient, and registers the token in the SkyBridge registry with the native chains as its allowed chains. It is not payable: launching charges no fee.

expandToChain deploys the same token on another chain, at the same address, with zero supply. It cannot be called on the launch chain. For a Clean token anyone may call it; for a Taxed token only the creator may. On a non-native chain the token gets the SkyBridge name prefix.

Rules the factory enforces​

RuleError
Called on the wrong chain for launchWrongLaunchChain
expandToChain on the launch chainExpandOnLaunchChain
Taxed token expanded by someone other than the creatorNotCreator
Decimals 0 or above 18, zero supply, zero mint recipient, no native chains or more than 12, unknown profileBadConfig
Native chains not strictly ascendingNativeChainsNotSorted
Launch chain not in the native chainsLaunchChainNotNative
A chain that is not a SkyBridge chainUnknownChain(chainId)
Clean token with a tax rate or treasuryCleanTokenTax
Taxed token without a treasuryTaxedNeedsTreasury
Buy or sell tax above 2000 bpsTaxTooHigh(bps)
Sell tax more than 500 bps above buy taxTaxSpreadTooWide(buyBps, sellBps)

Events​

event Launched(address indexed token, address indexed creator, bytes32 salt);
event Expanded(address indexed token, uint256 indexed chainId, bytes32 salt);

Launched is emitted on the launch chain and Expanded on each chain the token is deployed to later. salt is the full CREATE3 salt. The Stratus app finds a creator's launches by filtering Launched on creator.


PoolFactory​

The PoolFactory creates a token's trading pool and locks the liquidity in one transaction. There is one per chain. It holds no funds between calls and has no authority over a pool once it is deployed.

Lock pool configuration​

struct LockPoolConfig {
address currency0; // lower-sorted currency (native ETH = address(0))
address currency1; // higher-sorted currency
uint24 fee; // V4 LP fee
int24 tickSpacing;
address hooks; // address(0) for none
address token; // the project token, one of the two currencies
uint256 hostChain; // the chain the pool lives on
address creator; // receives pair-side fees and, at expiry, the position
uint8 destination; // where token-side fees go (see below)
address treasury; // set only for the treasury destination
uint64 initialLockDuration; // seconds
}

destination is 1 for a treasury or 2 for burn. (0 is the staking destination, which the Stratus app does not offer yet.)

The pool's address is a CREATE3 address salted with the caller, the caller's userSalt and this configuration.

Functions​

function launchLockPool(
bytes32 userSalt,
LockPoolConfig calldata cfg,
LaunchParams calldata lp,
StakingConfig calldata sCfg // pass zeroed unless destination is staking
) external payable returns (address pool, address distributor);

function predictLockPool(
address creator, // the address that will call launchLockPool
bytes32 userSalt,
LockPoolConfig calldata cfg,
StakingConfig calldata sCfg
) external view returns (address);

LaunchParams carries the V4 starting price (sqrtPriceX96), the price tolerance in bps, the tick range, the liquidity, the maximum amount of each currency to take, and a deadline. The factory takes up to amount0Max / amount1Max from the caller and refunds what the mint did not use. When one side is native ETH, send exactly that side's maximum as msg.value.

Rules the factory enforces​

  • Exactly one side of the pair is a base asset (native ETH, or a stablecoin the factory lists; check with isBaseAsset(address)), and the project token is the other side.
  • A non-zero hook must be active in the chain's HookRegistry (HookNotCurated).
  • A static LP fee may not exceed 3% (LpFeeTooHigh).
  • initialLockDuration must be at least MIN_LOCK_DURATION(), which can never be set below 30 days (LockTooShort).
  • The treasury is set if and only if the destination is the treasury (TreasuryMismatch).
  • ERC-20s must arrive in full: a token that takes a fee on transfer is refused.

Reads​

ReadReturns
MIN_LOCK_DURATION()Shortest initial lock accepted, in seconds
CURVE()The LockFeeSchedule new pools are priced with
PLATFORM_FEE_RECIPIENT()Where new pools send the platform's share
hookRegistry()The chain's HookRegistry
isBaseAsset(address)Whether an asset can be the pair side

CURVE and PLATFORM_FEE_RECIPIENT are copied into each pool when it is created. Changing them on the factory only affects pools created afterwards.

Events​

event LaunchedLockPool(
address indexed pool,
address indexed distributor, // address(0) unless destination is staking
address indexed creator, // the caller of launchLockPool
uint8 destination
);

LiquidityLockPool​

One LiquidityLockPool is deployed for each locked pool. It holds a single Uniswap V4 position and has no owner, no admin and no upgrade path. Its rules are fixed at deployment.

For creators

This section documents the contract for developers and integrators. Creators will manage their locks (collecting fees, extending, withdrawing and claiming held fees) from the lock page in the Stratus app, which is Coming soon. See Managing your lock.

Lifecycle​

  1. Created and bound. In the same transaction that creates it, the PoolFactory mints the position to the lock pool and calls bindPosition. The first lock segment starts at that moment.
  2. Earning. Swaps in the V4 pool earn fees for the position. Fees stay in the position until someone calls collectAndDistribute.
  3. Collecting. Each collection splits the fees: the token side goes to the destination (treasury or burn address), and the pair side goes to the creator after the platform's share. If a payment cannot be delivered, it is credited (creatorOwed, platformOwed) and can be claimed later.
  4. Extending (optional). The creator can add lock segments at any time. A lock can never be shortened.
  5. Withdrawing. After the last segment ends, the creator calls withdraw. It collects one last time, then transfers the V4 position NFT to the creator. Until then, the last segment's platform share keeps applying.

Functions​

FunctionWho can callWhat it does
collectAndDistribute()AnyoneCollects the position's fees and splits them. Nothing calls it on a schedule.
extendLock(uint64 addedDuration)CreatorCollects first, then adds a segment of addedDuration seconds, priced at the schedule's rate for that length. The segment starts when the current lock ends, or now if it has already ended. At most 64 segments.
withdraw()Creator, after unlockTime()Collects first, then transfers the position NFT to the creator.
claimCreatorFees()AnyonePays the creator any pair-side fees credited to creatorOwed.
claimPlatformFees()AnyonePays the platform any share credited to platformOwed.

Reads​

ReadReturns
TOKEN() / PAIR()The project token and the pair side (address(0) for native ETH)
CREATOR()Receives pair-side fees and the position at expiry
DESTINATION() / DESTINATION_TARGET()Where token-side fees go: 1 treasury or 2 burn, and the receiving address
CURRENCY0(), CURRENCY1(), FEE(), TICK_SPACING(), HOOKS()The V4 pool key
FACTORY()The PoolFactory that deployed it
CURVE()The LockFeeSchedule it was priced with
PLATFORM_FEE_RECIPIENT()Where the platform's share goes
tokenId(), bound()The bound V4 position
unlockTime()When the position can be withdrawn (unix seconds)
activePlatformBps()The platform's share a collection would apply now
segmentCount(), lockSchedule(i)The lock segments: each has endTime and platformBps
creatorOwed(), platformOwed()Credited fees waiting to be claimed

Events​

event PositionBound(uint256 indexed tokenId);
event Collected(address indexed caller, uint256 tokenAmount, uint256 ethAmount, uint16 platformBps);
event LockExtended(uint64 addedDuration, uint64 newUnlock, uint16 platformBps);
event Withdrawn(address indexed creator, uint256 indexed tokenId);
event CreatorFeesDeferred(uint256 amount);
event CreatorFeesClaimed(uint256 amount);
event PlatformFeesDeferred(uint256 amount);
event PlatformFeesClaimed(uint256 amount);

In Collected, ethAmount is the pair-side amount before the platform's share, whether the pair is ETH or a stablecoin.

Errors a creator may see​

ErrorMeaning
NotCreatorOnly the creator can extend or withdraw.
StillLockedwithdraw before unlockTime().
ZeroDurationextendLock(0).
TooManySegmentsThe lock already has 64 segments.
NotBoundNo position is bound yet.

LockFeeSchedule​

The schedule maps a lock segment's length to the platform's share of pair-side fees, in bps. Lengths between tiers use the shorter tier's rate; lengths below the first tier use the first tier's rate; lengths above the last use the last. The schedule cannot be changed after deployment, and each pool keeps the schedule it was created with.

ReadReturns
platformBps(uint64 duration)The share for a segment of duration seconds
tiers(i), tierCount()The tiers: duration and platformBps
maxShare()The highest share in the schedule

The current rates are on the Fees page.


Hooks​

HookRegistry​

Each chain has a HookRegistry listing the V4 hooks a pool may use. A pool can only be created with a hook that is active there. Removing a hook from the list never affects a pool that already uses it.

ReadReturns
isActive(address hook)Whether new pools may use the hook
status(address hook)The hook's status

StratusTaxHook​

The tax hook charges a Taxed token's buy and sell rates on swaps in its pool. When the pool is created, the hook reads the token's rates and treasury from the SkyBridge registry and fixes them for that pool. A swap that sends the token into the pool is a sell; one that takes it out is a buy. Tax builds up in the hook per pool, and anyone can call claim(PoolKey) to send it to the token's treasury. The hook has no owner and no admin.

event TaxPoolInitialized(PoolId indexed poolId, address token, uint16 buyBps, uint16 sellBps, address treasury);
event TaxClaimed(PoolId indexed poolId, address indexed treasury, uint256 amount0, uint256 amount1);
ReadReturns
taxOf(PoolId)The pool's token, buy and sell rates, treasury
accrued(PoolId, Currency)Tax waiting to be claimed

Upgradeability​

  • The token factory and the PoolFactory are upgradeable proxies controlled by their admin. An upgrade changes how future launches work. It does not change tokens or pools that already exist.
  • SKY20 tokens, LiquidityLockPools, the LockFeeSchedule and the tax hook are not upgradeable and have no owner.