Skip to content

Update README: transfer_adminpropose_admin/accept_admin and add treasury parameter to initialize #507

Description

@PrincessnJoy

Description

The README contains two inaccuracies in the Governance Contract Reference section that will confuse developers integrating with the contract.

1. Admin Transfer Function Name

The README documents:

pub fn transfer_admin(env: Env, admin: Address, new_admin: Address) -> Result<(), ContractError>

The actual contract implements a two-step admin transfer using:

pub fn propose_admin(env: Env, admin: Address, new_admin: Address) -> Result<(), ContractError>
pub fn accept_admin(env: Env, pending_admin: Address) -> Result<(), ContractError>
pub fn cancel_admin_transfer(env: Env, admin: Address) -> Result<(), ContractError>

There is no transfer_admin function in the contract. Callers following the README will get a FunctionNotFound error.

2. Missing treasury Parameter in initialize

The README's initialize signature:

pub fn initialize(
    env: Env,
    admin: Address,
    voting_token: Address,
    min_proposal_balance: i128,
    proposal_cooldown: u64,
    min_quorum_bps: u32,
    restrict_admin_vote: bool,
) -> Result<(), ContractError>

The actual contract also accepts a treasury: Option<Address> parameter for the on-chain treasury disbursement feature, which is not documented.

Acceptance Criteria

  • Replace the transfer_admin entry in the README with propose_admin, accept_admin, and cancel_admin_transfer, including correct signatures and a brief description of the two-step transfer flow
  • Add the treasury: Option<Address> parameter to the initialize signature in the README, with a description of its purpose
  • Cross-check all other function signatures in the README against the actual lib.rs and correct any additional discrepancies
  • Ensure docs/api/governance.md is also updated to match (if it contains the same stale entries)
  • make lint (or any doc linter) passes

Priority

Medium — documentation bug, not a runtime failure, but directly impacts developer experience.

Estimated Effort

Small

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions