Skip to content

Commit

Permalink
Merge pull request #115 from Lossless-Cash/LSS-3802-add-contract-chan…
Browse files Browse the repository at this point in the history
…ge-functions

feat: add functions to set lossless contracts after init
  • Loading branch information
Ignacio-Freire committed Feb 28, 2024
2 parents ae2877f + 772849b commit 91c3448
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions contracts/Interfaces/ILosslessGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,8 @@ interface ILssGovernance {
event CompensationRetrieval(address indexed _wallet, uint256 indexed _amount);
event LosslessClaim(ILERC20 indexed _token, uint256 indexed _reportID, uint256 indexed _amount);
event NewCompensationPercentage(uint256 indexed _compensationPercentage);
event NewLosslessReportingContract(address _newContract);
event NewLosslessControllerContract(address _newContract);
event NewLosslessStakingContract(address _newContract);
}

27 changes: 27 additions & 0 deletions contracts/LosslessGovernance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,33 @@ contract LosslessGovernance is ILssGovernance, Initializable, AccessControlUpgra
emit NewCompensationPercentage(compensationPercentage);
}

/// @notice This function sets the address for Lossless Reporting
/// @param _newAddress New Address
function setLosslessReportingContract(address _newAddress) override public onlyLosslessAdmin {
require(_newAddress != address(0), "LSS: Cannot be zero address");
require(_newAddress != address(losslessReporting), "LSS: Already set to that address");
losslessReporting = ILssReporting(_newAddress);
emit NewLosslessReportingContract(_newAddress);
}

/// @notice This function sets the address for Lossless Staking
/// @param _newAddress New Address
function setLosslessStakingContract(address _newAddress) override public onlyLosslessAdmin {
require(_newAddress != address(0), "LSS: Cannot be zero address");
require(_newAddress != address(losslessStaking), "LSS: Already set to that address");
losslessStaking = ILssStaking(_newAddress);
emit NewLosslessStakingContract(_newAddress);
}

/// @notice This function sets the address for Lossless Controller
/// @param _newAddress New Address
function setLosslessControllerContract(address _newAddress) override public onlyLosslessAdmin {
require(_newAddress != address(0), "LSS: Cannot be zero address");
require(_newAddress != address(losslessController), "LSS: Already set to that address");
losslessController = ILssController(_newAddress);
emit NewLosslessControllerContract(_newAddress);
}

/// @notice This function returns if the majority of the commitee voted and the resolution of the votes
/// @param _reportId Report number to be checked
/// @return isMajorityReached result Returns True if the majority has voted and the true if the result is positive
Expand Down

0 comments on commit 91c3448

Please sign in to comment.