Skip to content

Commit

Permalink
Fix DMDcoin#51: Add reentrancy protection to critical functions
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalman6 committed Jan 22, 2025
1 parent 7b6280f commit ef95916
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contracts/DiamondDao.sol
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ contract DiamondDao is IDiamondDao, Initializable, ReentrancyGuardUpgradeable, V
emit SetIsCoreContract(_add, isCore);
}

function switchPhase() external {
function switchPhase() external nonReentrant {
if (block.timestamp < daoPhase.end) {
return;
}
Expand Down Expand Up @@ -249,7 +249,7 @@ contract DiamondDao is IDiamondDao, Initializable, ReentrancyGuardUpgradeable, V
string memory title,
string memory description,
string memory discussionUrl
) external payable onlyPhase(Phase.Proposal) noUnfinalizedProposals {
) external payable nonReentrant onlyPhase(Phase.Proposal) noUnfinalizedProposals {
if (
targets.length != values.length ||
targets.length != calldatas.length ||
Expand Down Expand Up @@ -336,7 +336,7 @@ contract DiamondDao is IDiamondDao, Initializable, ReentrancyGuardUpgradeable, V
emit SubmitVoteWithReason(voter, proposalId, _vote, reason);
}

function finalize(uint256 proposalId) external exists(proposalId) {
function finalize(uint256 proposalId) external nonReentrant exists(proposalId) {
_requireState(proposalId, ProposalState.VotingFinished);

Proposal storage proposal = proposals[proposalId];
Expand Down

0 comments on commit ef95916

Please sign in to comment.