YIP-0 - DAO Transition - Phase II - DAO contract to accept admin role on youves smart contracts

Author: Markus Laeng (@m.laeng) & Florin Avram on behalf of the Youves Team

Related discussion/information: youves DAO transition post on Medium

First publication date: 2023/06/01

Summary

As described in the blog post about the planned transition from the current multisig based governance model to the youves DAO, the DAO contract will be set as the administrator in all currently deployed youves smart contracts, which form the youves platform.

As laid out in section “Transition — Phase II — YIP-0”, for some of the contracts, a proposed administrator (in our case the DAO contract) needs to call the entry point acceptAdminProposal or the entry point set_administrator in order to accept its promotion to an admin. Only then will the DAO contract be permitted to change parameters on these contracts.

Rationale

Some of the youves contracts which have an administrator forsee that a new administrator can be proposed by the existing administrator. This proposed administrator then needs to accept his promotion, by calling a special entrypoint.

In our case this is the entrypoint acceptAdminProposal on the flat curve dex contracts and the entrypoint set_administrator on farms, savings pools, unified staking pool and on a proxy contract that is needed for the unified staking pool to receive XTZ rewards.

In order to set the DAO contract as the sole administrator on this contracts, the DAO contract needs to call these entrypoints on a number of youves contracts.

Motivation

In order to complete the transition to the youves DAO, this is a necessary change. Only then will the DAO be able to set different parameters to the contracts involved. Please refer to the blog post about the planned transition from the current multisig based governance model to the youves DAO.

Analysis

The following contracts forsee a proposed admin to accept his role as an administrator.

Address Contract Type
KT1UZcNDxTdkn33Xx5HRkqQoZedc3mEs11yV Unified Staking Pool
KT18bG4ctcB6rh7gPEPjNsWF8XkQXL2Y1pJe uUSD Savings Pool
KT1WT8hZsixALTmxcM3SDzCyh4UF8hYXVaUb uBTC Savings Pool
KT1KShHvxW69YukaGetdgYRTw31d9BX8ijfF uXTZ Savings Pool
KT1CpXvNd293VvHkY7M9krjBvwEFuvura65Q uUSD/USDC.e Farm
KT1HbzGokeEZ4hu1KRAAw2fyB61RCpBhQXKA uXTZ/XTZ Farm
KT1UJBvm4hv11Uvu6r4c8zE5K2EfmwiRVgsm uUSD/USDt Flat Curve Pool
KT1NgbaaYhtXh3MwJoYYxrrKUwG3RX5LYVL6 uUSD/USDC.E Flat Curve Pool
KT1JeWiS8j1kic4PHx7aTnEr9p4xVtJNzk5b uUSD/wUSDC Flat Curve Pool
KT1T974a8qau4xP3RAAWPYCZM9xtwU9FLjPS tzBTC/wWBTC Flat Curve Pool
KT1XvH5f2ja2jzdDbv6rxPmecZFU7s3obquN tzBTC/uBTC Flat Curve Pool
KT1CkpDuwCFrnoqTam6upYiPBiFNsSEVbBei WBTC.e/uBTC Flat Curve Pool
KT1AVbWyM8E7DptyBCu4B5J5B7Nswkq7Skc6 uUSD/kUSD Flat Curve Pool
KT1Xbx9pykNd38zag4yZvnmdSNBknmCETvQV uUSD/USDtz Flat Curve Pool
KT1WgguedKZWucrdRKQXaRECEPMZennaVPck uXTZ/XTZ Flat Curve Pool

Thse are also the contracts which are included in the lambda of this DAO proposal (see code below).

Methodology

We identified all active youves contracts which need a proposed administrator to accept administratorship.

Proposal

This proposal will, when executed, call the entrypoints necessary to accept administratorship by the DAO contract KT1C3T98TqCm38cHPauZ4SopkQ4torCsxgab.

Code

Source code in SmartPy

This is the SmartPy source code of the lambda which will be executed with this proposal, YIP-0:

import smartpy as sp

# REWARD_POOL 
UNIFIED_STAKING_POOL = sp.address("KT1UZcNDxTdkn33Xx5HRkqQoZedc3mEs11yV") 

# SAVINGS POOL
UUSD_SAVINGS_POOL = sp.address("KT18bG4ctcB6rh7gPEPjNsWF8XkQXL2Y1pJe") 
UBTC_SAVINGS_POOL = sp.address("KT1WT8hZsixALTmxcM3SDzCyh4UF8hYXVaUb") 
UXTZ_SAVINGS_POOL = sp.address("KT1KShHvxW69YukaGetdgYRTw31d9BX8ijfF") 

# FARMS
UUSD_USDCE_FARM = sp.address("KT1CpXvNd293VvHkY7M9krjBvwEFuvura65Q") 
UXTZ_XTZ_FARM = sp.address("KT1HbzGokeEZ4hu1KRAAw2fyB61RCpBhQXKA") 

# EXCHANGES
UUSD_USDT_EXCHANGE = sp.address("KT1UJBvm4hv11Uvu6r4c8zE5K2EfmwiRVgsm") 
UUSD_USDCE_EXCHANGE = sp.address("KT1NgbaaYhtXh3MwJoYYxrrKUwG3RX5LYVL6") 
UUSD_WUSDC_EXCHANGE = sp.address("KT1JeWiS8j1kic4PHx7aTnEr9p4xVtJNzk5b") 
TZBTC_WWBTC_EXCHANGE = sp.address("KT1T974a8qau4xP3RAAWPYCZM9xtwU9FLjPS") 
TZBTC_UBTC_EXCHANGE = sp.address("KT1XvH5f2ja2jzdDbv6rxPmecZFU7s3obquN") 
WBTCE_UBTC_EXCHANGE = sp.address("KT1CkpDuwCFrnoqTam6upYiPBiFNsSEVbBei") 
UUSD_KUSD_EXCHANGE = sp.address("KT1AVbWyM8E7DptyBCu4B5J5B7Nswkq7Skc6") 
UUSD_USDTZ_EXCHANGE = sp.address("KT1Xbx9pykNd38zag4yZvnmdSNBknmCETvQV") 
UXTZ_XTZ_EXCHANGE = sp.address("KT1WgguedKZWucrdRKQXaRECEPMZennaVPck") 

def execute_set_administrator_unit(administrable_address): 
    administrable_contract = sp.contract( 
    sp.TUnit, administrable_address, entry_point="set_administrator"
    ).open_some() 
    return sp.transfer_operation(sp.unit, sp.mutez(0), administrable_contract) 
    
def execute_accept_administrator_proposal(administrable_address): 
    administrable_contract = sp.contract( 
    sp.TUnit, administrable_address, entry_point="acceptAdminProposal" 
    ).open_some() 
    return sp.transfer_operation(sp.unit, sp.mutez(0), administrable_contract) 
    
def dao_contract_proposal_0(unit): 
    sp.set_type(unit, sp.TUnit) 
    
    sp.result(sp.list([ 
        # Pools & farms admin 
        execute_set_administrator_unit(UUSD_SAVINGS_POOL),
        execute_set_administrator_unit(UBTC_SAVINGS_POOL),
        execute_set_administrator_unit(UXTZ_SAVINGS_POOL),
        execute_set_administrator_unit(UNIFIED_STAKING_POOL),
        execute_set_administrator_unit(UUSD_USDCE_FARM),
        execute_set_administrator_unit(UXTZ_XTZ_FARM),
        
        # Flat swaps admin 
        execute_accept_administrator_proposal(UUSD_USDT_EXCHANGE),
        execute_accept_administrator_proposal(UUSD_USDCE_EXCHANGE),
        execute_accept_administrator_proposal(UUSD_WUSDC_EXCHANGE),
        execute_accept_administrator_proposal(TZBTC_WWBTC_EXCHANGE),
        execute_accept_administrator_proposal(TZBTC_UBTC_EXCHANGE),
        execute_accept_administrator_proposal(WBTCE_UBTC_EXCHANGE),
        execute_accept_administrator_proposal(UUSD_KUSD_EXCHANGE),
        execute_accept_administrator_proposal(UUSD_USDTZ_EXCHANGE),
        execute_accept_administrator_proposal(UXTZ_XTZ_EXCHANGE), 
    ]))

Compiled Michelson code

This is the compiled Michelson code of the above SmartPy code.

{ DROP; NIL operation; PUSH address "KT1WgguedKZWucrdRKQXaRECEPMZennaVPck"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1Xbx9pykNd38zag4yZvnmdSNBknmCETvQV"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1AVbWyM8E7DptyBCu4B5J5B7Nswkq7Skc6"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1CkpDuwCFrnoqTam6upYiPBiFNsSEVbBei"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1XvH5f2ja2jzdDbv6rxPmecZFU7s3obquN"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1T974a8qau4xP3RAAWPYCZM9xtwU9FLjPS"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1JeWiS8j1kic4PHx7aTnEr9p4xVtJNzk5b"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1NgbaaYhtXh3MwJoYYxrrKUwG3RX5LYVL6"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1UJBvm4hv11Uvu6r4c8zE5K2EfmwiRVgsm"; CONTRACT %acceptAdminProposal unit; IF_NONE { PUSH int 251; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1HbzGokeEZ4hu1KRAAw2fyB61RCpBhQXKA"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1CpXvNd293VvHkY7M9krjBvwEFuvura65Q"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1UZcNDxTdkn33Xx5HRkqQoZedc3mEs11yV"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1KShHvxW69YukaGetdgYRTw31d9BX8ijfF"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT1WT8hZsixALTmxcM3SDzCyh4UF8hYXVaUb"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS; PUSH address "KT18bG4ctcB6rh7gPEPjNsWF8XkQXL2Y1pJe"; CONTRACT %set_administrator unit; IF_NONE { PUSH int 245; FAILWITH } {}; PUSH mutez 0; UNIT; TRANSFER_TOKENS; CONS }

SHA256 Hash of the Michelson code

This is the SHA256 Hash of the above Michelson code.

8270f3cd413ceb39fe59878120f3a0959f032c6219884de9d890d0ec53d62ca4

Final comment

With this proposal being the first proposal to be submitted to the DAO, we are excited to kick off the new era of governance on youves. Be invited to comment, review and inspect this proposal.

Your youves team

Edited 06/02/2023 - 17:08 CEST - Removed Unified Staking proxy contract from list. Changes SmartPy and Michelson code.

1 Like

Hey community!

Even though this was a very short reviewing period, I will move forward and submit YIP-0 to the DAO now. There will be a 2 days waiting period before the actual voting begins.

The vote on YIP-0 passed sucessfully and YIP-0 " DAO Transition - Phase II - DAO contract to accept admin role on youves smart contract" was accepted by the community. The proposed lambdas have been executed at block level 3,724,513, see Operation oou72E..4aup on tzkt.io.

This marks the first vote on the youves DAO. We thank all YOU stakers for their participation!

With :heart:, your team from youves

1 Like