Skip to content

Commit

Permalink
Extend error handling on MaticX contract
Browse files Browse the repository at this point in the history
  • Loading branch information
evercoinx committed Sep 25, 2024
1 parent 790940d commit 8ca1048
Show file tree
Hide file tree
Showing 2 changed files with 328 additions and 6 deletions.
5 changes: 4 additions & 1 deletion contracts/MaticX.sol
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ contract MaticX is
uint256 _toValidatorId,
uint256 _amount
) external override whenNotPaused onlyRole(DEFAULT_ADMIN_ROLE) {
require(_amount > 0, "Amount is zero");
require(
IValidatorRegistry(validatorRegistry).validatorIdExists(
_fromValidatorId
Expand Down Expand Up @@ -590,9 +591,11 @@ contract MaticX is
override
returns (uint256)
{
uint256 totalStake;
uint256[] memory validators = IValidatorRegistry(validatorRegistry)
.getValidators();

uint256 totalStake;

for (uint256 i = 0; i < validators.length; ++i) {
address validatorShare = IStakeManager(stakeManager)
.getValidatorContract(validators[i]);
Expand Down
Loading

0 comments on commit 8ca1048

Please sign in to comment.