creation_sourcecode: # pragma version 0.3.10
  # pragma evm-version paris
  """
  @title CurveAdminPassThroughStableswapNGFactory
  @author Curve.Fi
  @license Copyright (c) Curve.Fi, 2024 - all rights reserved
  @notice Passthrough ownership contract that allows for permissionless base pools
          for CurveStableswapFactoryNG
  """
  
  interface CurveStableSwapNGFactory:
    def add_base_pool(
        _base_pool: address,
        _base_lp_token: address,
        _asset_types: DynArray[uint8, MAX_COINS],
        _n_coins: uint256,
    ): nonpayable
    def add_asset_type(_id: uint8, _name: String[10]): nonpayable
    def set_fee_receiver(_pool: address, _fee_receiver: address): nonpayable
    def set_views_implementation(_views_implementation: address): nonpayable
    def set_gauge_implementation(_gauge_implementaion: address): nonpayable
    def set_math_implementation(_math_implementation: address): nonpayable
    def set_metapool_implementations(_implementation_index: uint256, _implementation: address): nonpayable
    def set_pool_implementations(_implementation_index: uint256, _implementation: address): nonpayable
    def commit_transfer_ownership(_addr: address): nonpayable
    def accept_transfer_ownership(): nonpayable
    def admin() -> address: view
  
  MAX_COINS: constant(uint256) = 8
  admin: public(immutable(address))
  stableswap_ng_factory: public(immutable(CurveStableSwapNGFactory))
  
  @external
  def __init__(_stableswap_ng_factory: address):
  
    stableswap_ng_factory = CurveStableSwapNGFactory(_stableswap_ng_factory)
    admin = stableswap_ng_factory.admin()
  
  
  @external
  def add_base_pool(
      _base_pool: address,
      _base_lp_token: address,
      _asset_types: DynArray[uint8, MAX_COINS],
      _n_coins: uint256,
  ):
      """
      @notice Add a base pool to the registry, which may be used in factory metapools
      @dev 1. Rebasing tokens are not allowed in the base pool.
           2. Do not add base pool which contains native tokens (e.g. ETH).
           3. As much as possible: use standard ERC20 tokens.
           Should you choose to deviate from these recommendations, audits are advised.
      @param _base_pool Pool address to add
      @param _asset_types Asset type for pool, as an integer
      """
      stableswap_ng_factory.add_base_pool(
          _base_pool,
          _base_lp_token,
          _asset_types,
          _n_coins,
      )
  
  
  @external
  def set_pool_implementations(
      _implementation_index: uint256,
      _implementation: address,
  ):
      """
      @notice Set implementation contracts for pools
      @dev Only callable by admin
      @param _implementation_index Implementation index where implementation is stored
      @param _implementation Implementation address to use when deploying plain pools
      """
      assert msg.sender == admin  # dev: admin-only function
      stableswap_ng_factory.set_pool_implementations(_implementation_index, _implementation)
  
  
  @external
  def set_metapool_implementations(
      _implementation_index: uint256,
      _implementation: address,
  ):
      """
      @notice Set implementation contracts for metapools
      @dev Only callable by admin
      @param _implementation_index Implementation index where implementation is stored
      @param _implementation Implementation address to use when deploying meta pools
      """
      assert msg.sender == admin  # dev: admin-only function
      stableswap_ng_factory.set_metapool_implementations(_implementation_index, _implementation)
  
  
  @external
  def set_math_implementation(_math_implementation: address):
      """
      @notice Set implementation contracts for StableSwap Math
      @dev Only callable by admin
      @param _math_implementation Address of the math implementation contract
      """
      assert msg.sender == admin  # dev: admin-only function
      stableswap_ng_factory.set_math_implementation(_math_implementation)
  
  
  @external
  def set_gauge_implementation(_gauge_implementation: address):
      """
      @notice Set implementation contracts for liquidity gauge
      @dev Only callable by admin
      @param _gauge_implementation Address of the gauge blueprint implementation contract
      """
      assert msg.sender == admin  # dev: admin-only function
      stableswap_ng_factory.set_gauge_implementation(_gauge_implementation)
  
  
  @external
  def set_views_implementation(_views_implementation: address):
      """
      @notice Set implementation contracts for Views methods
      @dev Only callable by admin
      @param _views_implementation Implementation address of views contract
      """
      assert msg.sender == admin  # dev: admin-only function
      stableswap_ng_factory.set_views_implementation(_views_implementation)
  
  
  @external
  def set_fee_receiver(_fee_receiver: address):
      """
      @notice Set fee receiver for all pools
      @param _pool Address of  pool to set fee receiver for.
      @param _fee_receiver Address that fees are sent to
      """
      assert msg.sender == admin  # dev: admin only
      # the first arg can be empty (seems an extra arg that does nothing at all):
      stableswap_ng_factory.set_fee_receiver(empty(address), _fee_receiver)
  
  
  @external
  def add_asset_type(_id: uint8, _name: String[10]):
      """
      @notice Admin only method that adds a new asset type.
      @param _id asset type id.
      @param _name Name of the asset type.
      """
      assert msg.sender == admin  # dev: admin only
      stableswap_ng_factory.add_asset_type(_id, _name)
  
  
  # ----- Admin Transfer Functions ----- #
  
  
  @external
  def accept_transfer_ownership():
      """
      @notice Accepts ownership of stableswap ng factory
      """
      stableswap_ng_factory.accept_transfer_ownership()
  
  
  @external
  def commit_transfer_ownership(_addr: address):
      """
      @notice Transfer ownership of stableswap_ng_factory contract to `addr`
      @dev only callable by admin
      @param _addr Address of the new owner of stableswap_ng_factory
      """
      assert msg.sender == admin  # dev: admin only
      stableswap_ng_factory.commit_transfer_ownership(_addr)