uwu-oracle-proxy-v1-1-0
The uwu-oracle-proxy-v1-1-0
contract is responsible for storing and managing STX price data fetched from the oracle address. As a proxy, it allows the defined contract owner to update the oracle address and to freeze the ability to make further changes to the oracle address.
Data Storage
These structures allow the contract to maintain its state, track information, and ensure data consistency throughout the contract's lifecycle.
CONTRACT_OWNER
A constant representing the principal authorized to make parameter changes to the contract. The CONTRACT_OWNER
can only issue changes to the oracle proxy (unless frozen) and update token metadata. The CONTRACT_OWNER
is not authorized to perform any other actions.
is-proxy-frozen
A data variable that holds the proxy's frozen status, indicating whether the oracle address can be changed.
oracle-address
A data variable storing the oracle address responsible for updating the STX price in the oracle proxy.
stx-price
A data variable containing the STX price provided by the oracle address.
Public Functions
These functions are accessible by external contracts or users, enabling interaction with the contract and state modification.
set-oracle-address
A public function that allows the contract owner to update the oracle address responsible for providing STX price updates.
Parameter | Type | Description |
address | principal | The new oracle address |
freeze-proxy
A public function, callable by the contract owner, which permanently freezes the proxy. When frozen, the oracle address cannot be changed.
update-stx-price
A public function that can be called by the oracle address to update the stored STX price in the oracle proxy.
Parameter | Type | Description |
price | uint | The updated STX price |
Private Functions
These functions are accessible only within the contract they are defined in, providing encapsulation and preventing external access to specific functionality.
This contract does not contain any private functions
Read-only Functions
These functions do not modify the contract's state and are used for querying or retrieving data. They can be called by external contracts or users but will not change the underlying state.
get-oracle-address
A read-only function that returns the current oracle address authorized to update the STX price in the oracle proxy.
get-is-proxy-frozen
A read-only function that returns whether the proxy is frozen or not. When the proxy is frozen, the oracle address cannot be changed.
get-stx-price
A read-only function that returns the most recent STX price stored in the proxy, which was sent by the oracle address.
Last updated