ZTP-173
ZTP-173 is the Zetrix Contract Ownership Standard, inspired by Ethereum's ERC-173. It provides a standard interface for querying and transferring ownership of a smart contract on the Zetrix blockchain.
Overview
Standard
ZTP-173
Category
Contract Ownership
Network
Zetrix Blockchain
Abstract
ZTP-173 defines a standard interface for contract ownership on the Zetrix blockchain. It specifies how a smart contract declares, queries, transfers, and renounces a single owner address enabling block explorers, tooling, and other contracts to interact with ownership in a predictable and interoperable way.
The ownership model follows a two-step transfer pattern: the current owner initiates a transfer, and the new owner must explicitly accept it. This prevents accidental or malicious transfers to inaccessible addresses.
Motivation
Many smart contracts deployed on Zetrix require an administrative owner — an account that can adjust parameters, mint tokens, pause functionality, or manage funds. Without a common interface:
Block explorers cannot uniformly display or verify contract ownership.
Tooling cannot generically transfer or renounce ownership across contracts.
Other contracts cannot safely query the owner of an on-chain resource.
Security audits cannot follow a predictable, auditable ownership lifecycle.
ZTP-173 solves this by standardising five entry points so every conforming contract exposes the same ownership API, consistent with existing Zetrix contract conventions (Chain.load, Chain.store, Chain.tlog, contractInfo.issuer).
Specification
Interface
A ZTP-173-compliant contract MUST implement the following functions:
owner()
Public
Returns the current owner address
transferOwnership(newOwner)
Owner only
Initiates a two-step ownership transfer
Functions
owner
Returns the address of the current contract owner. Reads from contractInfo.issuer stored under the CONTRACT_PRE key.
Access
Public (query)
Returns
String — current owner Zetrix address, or '' if renounced
Throws
Never
transferOwnership
Initiates a two-step ownership transfer. The proposed new owner must call acceptOwnership() to finalise the transfer. This function does not immediately change contractInfo.issuer.
Access
Owner only
Parameters
newOwner — target Zetrix address
Emits
OwnershipTransferStarted(newOwner)
Throws if
Caller is not owner; address is invalid or empty; address is same as current owner; address is blacklisted
Invoking the Contract
Query — owner
Response
transferOwnership
json
Sample Code
Last updated