@@ -12,6 +12,7 @@ import {SignatureValidator} from "./libraries/SignatureValidator.sol";
1212
1313/// @title PegIn
1414/// @notice This contract is used to handle the peg in of the Bitcoin network to the Rootstock network
15+ /// @dev All non pure/view functions in this contract should be marked as nonReentrant
1516/// @author Rootstock Labs
1617contract PegInContract is
1718 OwnableDaoContributorUpgradeable ,
@@ -101,7 +102,7 @@ contract PegInContract is
101102 /// @param collateralManagement the address of the Collateral Management contract
102103 /// @dev This function is only callable by the owner of the contract
103104 // solhint-disable-next-line comprehensive-interface
104- function setCollateralManagement (address collateralManagement ) external onlyOwner {
105+ function setCollateralManagement (address collateralManagement ) external onlyOwner nonReentrant {
105106 if (collateralManagement.code.length == 0 ) revert Flyover.NoContract (collateralManagement);
106107 emit CollateralManagementSet (address (_collateralManagement), collateralManagement);
107108 _collateralManagement = ICollateralManagement (collateralManagement);
@@ -111,7 +112,7 @@ contract PegInContract is
111112 /// @param threshold the new dust threshold
112113 /// @dev This function is only callable by the owner of the contract
113114 // solhint-disable-next-line comprehensive-interface
114- function setDustThreshold (uint256 threshold ) external onlyOwner {
115+ function setDustThreshold (uint256 threshold ) external onlyOwner nonReentrant {
115116 emit DustThresholdSet (dustThreshold, threshold);
116117 dustThreshold = threshold;
117118 }
@@ -120,13 +121,13 @@ contract PegInContract is
120121 /// @param minPegIn the new minimum peg in amount
121122 /// @dev This function is only callable by the owner of the contract
122123 // solhint-disable-next-line comprehensive-interface
123- function setMinPegIn (uint256 minPegIn ) external onlyOwner {
124+ function setMinPegIn (uint256 minPegIn ) external onlyOwner nonReentrant {
124125 emit MinPegInSet (_minPegIn, minPegIn);
125126 _minPegIn = minPegIn;
126127 }
127128
128129 /// @inheritdoc IPegIn
129- function deposit () external payable override {
130+ function deposit () external payable nonReentrant override {
130131 if (! _collateralManagement.isRegistered (_PEG_TYPE, msg .sender )) {
131132 revert Flyover.ProviderNotRegistered (msg .sender );
132133 }
0 commit comments