From 2c55149f0ac5cb790a4d9c4be6e787a53c113cea Mon Sep 17 00:00:00 2001 From: Michael Victor Date: Thu, 28 May 2026 03:13:34 +0100 Subject: [PATCH] docs: restore set_admin rustdoc in revenue pool The set_admin doc block was mis-merged: its Events section bled directly into get_usdc_token's docs, and set_admin itself had no dedicated rustdoc block. - Give set_admin its own /// block with args, panics, and both emitted events (admin_changed, admin_transfer_started) - Restore get_usdc_token's doc block in the correct position (after set_admin, before claim_admin) - No logic changes --- contracts/revenue_pool/src/lib.rs | 39 ++++++++++++++----------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/contracts/revenue_pool/src/lib.rs b/contracts/revenue_pool/src/lib.rs index 2af564d..b857d53 100644 --- a/contracts/revenue_pool/src/lib.rs +++ b/contracts/revenue_pool/src/lib.rs @@ -101,34 +101,15 @@ impl RevenuePool { /// The new admin must call `claim_admin` to complete the transfer. /// /// # Arguments - /// * `env` - The environment running the contract. - /// * `caller` - Must be the current admin. + /// * `caller` - Must be the current admin; must authorize. /// * `new_admin` - Address of the proposed new admin. /// /// # Panics /// * If the caller is not the current admin (`"unauthorized: caller is not admin"`). /// /// # Events - /// Emits an `admin_changed` event with the `current_admin` as a topic and - /// `(current_admin, new_admin)` as data, followed by `admin_transfer_started` - /// with the `current_admin` as a topic and `new_admin` as data. - /// Return the USDC token address configured for this pool. - /// - /// # Arguments - /// * `env` - The environment running the contract. - /// - /// # Returns - /// The `Address` of the USDC token contract. - /// - /// # Panics - /// * If the revenue pool has not been initialized. - pub fn get_usdc_token(env: Env) -> Address { - env.storage() - .instance() - .get(&Symbol::new(&env, USDC_KEY)) - .expect("revenue pool not initialized") - } - + /// Emits `admin_changed` with `current_admin` as topic and `(current_admin, new_admin)` as data. + /// Emits `admin_transfer_started` with `current_admin` as topic and `new_admin` as data. pub fn set_admin(env: Env, caller: Address, new_admin: Address) { caller.require_auth(); let current = Self::get_admin(env.clone()); @@ -151,6 +132,20 @@ impl RevenuePool { ); } + /// Return the USDC token address configured for this pool. + /// + /// # Returns + /// The `Address` of the USDC token contract. + /// + /// # Panics + /// * If the revenue pool has not been initialized. + pub fn get_usdc_token(env: Env) -> Address { + env.storage() + .instance() + .get(&Symbol::new(&env, USDC_KEY)) + .expect("revenue pool not initialized") + } + /// Complete the admin transfer. Only the pending admin may call this. /// /// # Arguments