swapOwner
Replaces the owner oldOwner
in the Safe with newOwner
.
⚠️
This action can only be done via a Safe transaction.
Usage
_17interface ISafe {_17 function swapOwner(_17 address prevOwner,_17 address oldOwner,_17 address newOwner_17 ) external;_17}_17_17contract Example {_17 function example() … {_17 (ISafe safe).swapOwner(_17 0x...,_17 0x...,_17 0x..._17 );_17 }_17}
Parameters
prevOwner
- Type:
address
Owner address that is pointing to the owner to be removed in the contract linked list (opens in a new tab).
A linked list is a data structure that allows efficient insertion and removal of elements in a list. Each element in it will point to the next one. In Safe contracts, the owners are stored in a linked list.
_10(ISafe safe).swapOwner(_10 0x...,_10 0x...,_10 0x..._10);
oldOwner
- Type:
address
Owner address to be replaced.
_10(ISafe safe).swapOwner(_10 0x...,_10 0x...,_10 0x..._10);
newOwner
- Type:
address
New owner address.
_10(ISafe safe).swapOwner(_10 0x...,_10 0x...,_10 0x..._10);
Events
AddedOwner
_10event AddedOwner(address owner);
Emitted when an owner is added to the Safe.
RemovedOwner
_10event RemovedOwner(address owner);
Emitted when an owner is removed from the Safe.