> ## Documentation Index
> Fetch the complete documentation index at: https://docs.defindex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Upgrade vault contract wasm

> **Manager Function**: Upgrades the vault contract to a new version by providing the new WASM hash. This operation is performed by the manager to ensure the vault contract is up-to-date with the latest features and fixes.



## OpenAPI

````yaml POST /vault/{address}/upgrade
openapi: 3.0.0
info:
  title: DeFindex API
  description: API documentation for DeFindex endpoints
  version: 1.0.0
  contact: {}
  x-logo:
    url: https://links.paltalabs.io/defindex-full.svg
    backgroundColor: '#0e0e0e'
    altText: DeFindex Logo
    href: https://defindex.io
servers: []
security: []
tags: []
paths:
  /vault/{address}/upgrade:
    post:
      tags:
        - Vault
      summary: Upgrade vault contract wasm
      description: >-
        **Manager Function**: Upgrades the vault contract to a new version by
        providing the new WASM hash. This operation is performed by the manager
        to ensure the vault contract is up-to-date with the latest features and
        fixes.
      operationId: VaultController_upgrade
      parameters:
        - name: address
          required: true
          in: path
          description: Stellar address of the vault contract
          schema:
            example: CBNKCU3HGFKHFOF7JTGXQCNKE3G3DXS5RDBQUKQMIIECYKXPIOUGB2S3
            type: string
        - name: network
          required: true
          in: query
          description: Stellar network to execute the transaction on (testnet or mainnet)
          schema:
            enum:
              - testnet
              - mainnet
            type: string
      requestBody:
        required: true
        description: Upgrade parameters. All parameters are required for this operation.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpgradeWasmDto'
            examples:
              Upgrade vault contract:
                value:
                  new_wasm_hash: new_wasm_hash_value
                  caller: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
      responses:
        '200':
          description: Transaction prepared successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  xdr:
                    type: string
                    description: Base64 encoded transaction XDR ready for signing
                  simulationResponse:
                    type: object
                    description: Simulation result of the transaction
                  functionName:
                    type: string
                    description: Function name for the operation
                  params:
                    type: object
                    description: Parameters used for the operation
        '400':
          description: Bad request - invalid parameters
        '403':
          description: Forbidden - caller is not authorized for this operation
components:
  schemas:
    UpgradeWasmDto:
      type: object
      properties:
        new_wasm_hash:
          type: string
          description: >-
            New WASM hash to upgrade the vault contract. Must be a valid hash
            string.
          example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
        caller:
          type: string
          description: >-
            Stellar address of the user initiating the upgrade. Must be a valid
            Stellar public key **with Manager role.**
          example: GB7NTQG4EXB7NZEA5GNFHIHEQVTGQTZ6OWKWUD535FBEHNSEVCKZULIY
      required:
        - new_wasm_hash
        - caller

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.