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
Priority
Medium — documentation bug, not a runtime failure, but directly impacts developer experience.
Estimated Effort
Small
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:
The actual contract implements a two-step admin transfer using:
There is no
transfer_adminfunction in the contract. Callers following the README will get aFunctionNotFounderror.2. Missing
treasuryParameter ininitializeThe README's
initializesignature:The actual contract also accepts a
treasury: Option<Address>parameter for the on-chain treasury disbursement feature, which is not documented.Acceptance Criteria
transfer_adminentry in the README withpropose_admin,accept_admin, andcancel_admin_transfer, including correct signatures and a brief description of the two-step transfer flowtreasury: Option<Address>parameter to theinitializesignature in the README, with a description of its purposelib.rsand correct any additional discrepanciesdocs/api/governance.mdis also updated to match (if it contains the same stale entries)make lint(or any doc linter) passesPriority
Medium — documentation bug, not a runtime failure, but directly impacts developer experience.
Estimated Effort
Small