Function: transferOwnership(address owner, address newOwner)
The function is used to transfer the ownership of a smart account.
Inputs
ownerControl: Fully controlled by caller.
Constraints: Should not be
address(0).Impact: This is the previous owner to be removed.
newOwnerControl: Fully controlled by caller.
Constraints: Should not be
address(0).Impact: This is the new owner to be transferred ownership to.
Branches and code coverage
Intended branches
Set
_smartAccountOwnersforowneras false.Set
_smartAccountOwnersfornewOwneras true.
Negative behavior
Revert if
newOwneris a smart contract.Revert if
newOwnerorownerisaddress(0).Revert if
ownerandnewOwnerare same addresses.Revert if
owneris not an owner of the smart account.Revert if
newOwneris already an owner of the smart account.
Function call analysis
this._transferOwnership(msg.sender, owner, newOwner)What is controllable?
msg.sender,owner, andnewOwner.If the return value is controllable, how is it used and how can it go wrong? N/A.
What happens if it reverts, reenters, or does other unusual control flow? N/A.