safe-global / safe-smart-account

Safe allows secure management of blockchain assets.
https://safe.global
GNU Lesser General Public License v3.0
1.88k stars 927 forks source link

Using removeOwner of a gnosis safe doesnt seem to work for the first owner of the linked list #556

Closed gittygoo closed 1 year ago

gittygoo commented 1 year ago

https://github.com/safe-global/safe-contracts/blob/e870f514ad34cd9654c72174d6d4a839e3c6639f/contracts/base/OwnerManager.sol#L78

Supposing we have an array of owners ["0x8...09","0x3...26","0x2...9d"] There doesnt seem to be a possibility of removing using removeOwner the owner "0x8...09" as setting the prevOwner to 0x0000000000000000000000000000000000000000 fails.

Seems to be a bug? or what needs to be supplied as prevOwner to remove the first element ?

mmv08 commented 1 year ago

You should supply the sentinel node:

https://github.com/safe-global/safe-contracts/blob/e870f514ad34cd9654c72174d6d4a839e3c6639f/contracts/base/OwnerManager.sol#L17

gittygoo commented 1 year ago

Thank you, for others in the future, that has indeed solved it by using "0x0000000000000000000000000000000000000001" as you mentioned