Skip to content

Commit

Permalink
fix: make it possible for the initial member addr to change the deleg…
Browse files Browse the repository at this point in the history
…ate key (#492)

* make it possible for the initial member addr to change the delegate key

* add test and fix update delegate key

* make sure you can update from the delegate key too
  • Loading branch information
adridadou authored Feb 2, 2022
1 parent b1f0c09 commit c2c5068
Show file tree
Hide file tree
Showing 4 changed files with 583 additions and 521 deletions.
15 changes: 10 additions & 5 deletions contracts/adapters/DaoRegistryAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ contract DaoRegistryAdapterContract is MemberGuard, AdapterGuard {
function updateDelegateKey(DaoRegistry dao, address delegateKey)
external
reentrancyGuard(dao)
onlyMember(dao)
{
dao.updateDelegateKey(
DaoHelper.msgSender(dao, msg.sender),
delegateKey
);
address dk = dao.getCurrentDelegateKey(msg.sender);
if (dk != msg.sender && dao.isMember(dk)) {
dao.updateDelegateKey(msg.sender, delegateKey);
} else {
require(dao.isMember(msg.sender), "only member");
dao.updateDelegateKey(
DaoHelper.msgSender(dao, msg.sender),
delegateKey
);
}
}
}
Loading

0 comments on commit c2c5068

Please sign in to comment.