Skip to main content
An administrative function can transfer control of your protocol. This example keeps the configured owner and admin addresses unchanged across a transaction.

Behavior

OwnerChangeAssertion registers separate transaction-end functions for owner slot 0 and admin slot 1. Each compares its address at _preTx() and _postTx().

Configuration

Map both slots to the deployed contract’s storage layout. Packed or namespaced access-control storage needs different decoding. Attach the assertion to the contract that holds the authority, which may be a proxy. The local walkthrough tests the owner function, including rejection and rollback. Test the admin function separately: cl.assertion arms only the selected assertion function in each local test.

Scenarios

Coverage limits

This is an address lock, not an approval system. It does not distinguish authorized and unauthorized changes, inspect role memberships, or detect temporary authority used and then restored. Your signers must approve policy changes needed for a planned transfer.

Source

The reviewed source is a teaching template. The example setup guide provides the pinned checkout and test procedure.