Skip to content

Codebase Change Analysis

V3 Codebase: https://github.com/sky-ecosystem/chief/blob/newchief/src/Chief.sol

V2 Codebase: https://github.com/sky-ecosystem/chief/blob/d42f10fdf922bbc7636817961a85f540b285d0e6/src/chief.sol

There have been NO changes to external user-facing function interfaces in the Chief contract upgrade. These functions can continue to be used as before.

  • lock(uint256): Deposits governance tokens into the Chief contract to gain voting power
  • free(uint256): Withdraws governance tokens from the Chief contract, removing associated voting power
  • etch(address[]): Creates a new slate of candidates (a unique address set to vote for)
  • vote(address[]): Votes for a slate of addresses with your full voting weight
  • lift(address): Elevates an address to authority status if it has sufficient votes

Flash Loan Protection Changed Flash loan protections remain in the upgraded Chief contract, but now use a new mechanism to prevent manipulation of the voting process with flash-loaned MKR or SKY tokens.

Previous Implementation:

  • lock and free could not be executed within the same block.
  • lift could be performed at any time, including in the same block as lock.
  • This allowed a flash loan transaction to perform lock and lift in a single block, but not free.

New Implementation:

  • lift and free cannot occur in the same block.
  • Flash loan transactions can still perform lock and lift together, but cannot execute free in that block due to new restrictions between free and lift.
  • lock and free can now occur together in the same block.

Lift Cooldown Period

lift operations now have a cooldown: after a successful lift, further lift actions are blocked until the cooldown period expires, even if attempted within the same block.

  • The lock function does not update the last timestamp when tokens are deposited. This behavior differs from previous versions, where the timestamp was updated on each lock operation.
  • The lift function now updates the last timestamp. This change ensures that the timestamp accurately reflects the most recent lift operation, which is important for enforcing the cooldown period.

IOU Token Removed IOU tokens are no longer issued for deposited SKY. As a result, actions involving IOU tokens—such as approving IOU transfers before calling free on Chief—are no longer required.

  • The lock function no longer mints IOU token balances when governance tokens are deposited.
  • The free function no longer burns IOU token balances when governance tokens are withdrawn. Since IOU tokens are no longer issued, there is no need to handle their burning during withdrawals.

V3 Codebase: https://github.com/sky-ecosystem/vote-delegate/tree/v3/src

V2 Codebase: https://github.com/sky-ecosystem/vote-delegate/tree/v2/src

There have been NO changes to external user-facing function interfaces in the Vote Delegate contract upgrade.

Hatch Trigger and Cooldown Removed The hatch trigger and cooldown mechanisms have been removed from the Vote Delegate contract. As a result, you no longer need to check for previous Vote Delegate V2 restrictions related to hatch triggers or cooldown periods when determining if the lock() function is available for other users within the same Vote Delegate contract. Participants are no longer restricted by others’ actions, as removing the hatch reserve and cooldown eliminates previous user interaction limitations.

IOU Tokens No Longer Held Vote Delegate no longer manages IOU token balances.

In version 3, the Chief contract has removed IOU tokens entirely, so neither governance participants nor Vote Delegate need to manage IOU tokens.

In version 2, IOU tokens were held within the Vote Delegate contract, removing the need for user approval, but they were still present.

In version 1, IOU tokens were returned to the user’s wallet, requiring MKR holders to approve the contract for their IOU balance before withdrawing.

Getter Function Change The Chief contract’s GOV() function has been renamed to gov(). The function signature and its usage within Vote Delegate have changed accordingly. For backward compatibility, the GOV() getter remains available in the new Chief contract.

V2 Codebase: https://github.com/sky-ecosystem/sky/blob/one-direction/src/MkrSky.sol

V1 Codebase: https://github.com/sky-ecosystem/sky/blob/3ddfa5ee55d10b8192f239235bf83e46744314b8/src/MkrSky.sol

Only the mkrToSky(uint256 mkrAmount) function from version 1 remains available in version 2. The skyToMkr(uint256 skyAmount) function and all related logic have been completely removed. The interface for mkrToSky is unchanged; however, the conversion rate is now affected by a governance-set fee parameter. Users can no longer convert SKY to MKR using this contract.

Pre-minted SKY Token Balance

The Converter V2 contract no longer has permission to mint new SKY tokens. Instead, the full SKY token balance needed to convert all outstanding MKR is pre-minted and deposited into Converter V2. When an upgrade is executed, the SKY tokens held by Converter V2 are distributed to MKR holders.

Governance Control

Converter V2 introduces governance-controlled functionality. Previously, governance could not modify any settings in the contract. Now, governance can update the fee parameter, which determines the fee charged during MKR-to-SKY conversions. All fees collected are tracked in the take variable.

Governance can call the collect function to transfer the accumulated SKY fees from the Converter V2 contract to a designated address.

V2 Codebase: https://github.com/sky-ecosystem/lockstake/blob/v2/src

V1 Codebase: https://github.com/sky-ecosystem/lockstake/tree/7c71318623f5d6732457fd0c247a1f1760960011/src

The following changes impact the external functional interface which integrations have to account for:

  • lock(uint256 amount) and free(uint256 amount) now operate solely on SKY; the lockSky/freeSky methods are removed.
  • Collateral renamed from MKR → SKY and the liquid‑staked wrapper from lsMKR → lsSKY (identical ABI, downstream compatibility).
  • Added migrate(address from, address to, uint256[] positionIds) in the new LockstakeMigrator contract to move positions from V1 → V2 in one transaction.

Conversion Logic Removed All MkrSkyLike interfaces and MKR↔SKY conversion calls are deleted. The engine now accepts raw SKY and mints/burns lsSKY directly, removing an external call and oracle dependency.

Fixed Exit Fee Exit fee is locked at deployment — governance cannot adjust it post‑deployment. Exit Fee will be set to 0 at deployment.

Migration Path Users should invoke the LockstakeMigrator (flash‑loan–assisted) to migrate V1 positions containing debt to V2.

Proxy / Storage Compatibility No storage‑layout changes in LockstakeUrn; existing proxy clones remain valid.

Accounting Model Simplified Single mapping tracks SKY locks; separate MKR/SKY balances are removed.

LockstakeMigrator Module

Stateless contract enabling vault migration with or without USDS debt:

  1. Unlock old MKR, convert via external mkrSky, relock as SKY.
  2. If debt exists, take a USDS flash‑loan, wipe debt, migrate collateral, then draw USDS to repay.

Manages approvals and relies on Sky Protocol’s flash‑loan callback checks (initiator == self) for safety.

IOU Logic Removed No more IOU token minting/burning; deposits and withdrawals adjust only raw locked balances.

Released into the public domain (CC0 1.0 Universal) – trademarks remain with their owners; no warranty. See full license.