🧰Contracts API

Smart Contracts

Documentation for the sip-010-trait-ft-standard contract is not provided, as it's a standard implementation of the well-documented SIP-010 Fungible Token Standard

Units

All unit values passed or returned by methods use 6 decimal places. For example, 1 UWU is expressed as u1000000.

Error Codes

Code

Error

Description

1001

ERR_NOT_AUTHORIZED

The specified principal is not authorized

1002

ERR_INVALID_AMOUNT

The amount parameter is invalid

2001

ERR_VAULT_NOT_FOUND

The specified Vault was not found

2002

ERR_VAULT_LIMIT

The specified principal has reached the maximum limit of 20 Vaults per principal at any given time

2003

ERR_VAULT_NOT_LIQUIDATED

The specified Vault is not liquidated

2004

ERR_VAULT_LIQUIDATED

The specified Vault is liquidated

3001

ERR_MINIMUM_DEBT

The specified Vault is below the minimum amount of debt

3002

ERR_MAXIMUM_DEBT

The specified Vault has the maximum amount of debt

3003

ERR_NONZERO_DEBT

The specified Vault has non-zero debt

3004

ERR_ZERO_DEBT

The specified Vault has zero debt

4001

ERR_PROXY_FROZEN

The oracle proxy is frozen

Upgradability

UWU Protocol is designed with a strong emphasis on immutability and non-upgradability for the majority of its components. The CONTRACT_OWNER is a constant, representing the principal authorized to make specific parameter changes within the contracts it is defined in.

The CONTRACT_OWNER is specified in two contracts:

Its purpose is to allow for modifications to the oracle used and token metadata, with the latter not affecting the protocol itself as it pertains to off-chain information related to the protocol's tokens.

Due to the current lack of decentralized oracle providers on Stacks, UWU Protocol is temporarily relying on a trust-minimized oracle. This is the reason behind the upgradability of the oracle proxy. Once upgraded to a decentralized oracle provider, the oracle proxy will be permanently frozen.

The CONTRACT_OWNER cannot modify the core functionalities of other contracts, such as uwu-factory-v1-1-0. All other contracts are immutable and non-upgradable.

Versioning

The versioning for UWU Protocol follows a three-digit structure (X.Y.Z), where:

  • First digit (X): Represents a major change that requires redeployment of non-proxy contracts. Upgrading to a new major version implies a completely new system, operating separately from the previous one. Users can still interact with the previous release, even when a new major version is deployed

  • Second digit (Y): Represents a minor change that also requires redeployment of non-proxy contracts. Similar to a major change, this update results in a new version of the system operating separately from the previous one

  • Third digit (Z): Represents a minor change that does not require redeployment of core contracts. These updates may include changes such as a new oracle contract or the addition of new contracts that are optional and do not necessitate redeployment of core contracts

License

The contracts used in UWU Protocol are licensed under the GNU General Public License v3.0 (GPLv3). For more information on the license terms and conditions, please refer to the GNU General Public License v3.0.

Last updated