Skip to content

Commit

Permalink
permisionless validator registration
Browse files Browse the repository at this point in the history
  • Loading branch information
mtabasco committed Nov 8, 2023
1 parent 470fc45 commit 8878241
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
2 changes: 0 additions & 2 deletions contracts/SSVNetwork.sol
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ contract SSVNetwork is
uint256 amount,
ISSVNetworkCore.Cluster memory cluster
) external override {
if (!RegisterAuth.load().authorization[msg.sender].registerValidator) revert NotAuthorized();

_delegate(SSVStorage.load().ssvContracts[SSVModules.SSV_CLUSTERS]);
}

Expand Down
36 changes: 0 additions & 36 deletions test/operators/register-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,40 +48,4 @@ describe('Register Auth Operator Tests', () => {
helpers.CONFIG.minimalOperatorFee
)).to.be.revertedWithCustomError(ssvNetworkContract, 'NotAuthorized');
});

it('Register validator with unauthorized address reverts "NotAuthorized"', async () => {
await expect(ssvNetworkContract.connect(helpers.DB.owners[3]).registerValidator(
helpers.DataGenerator.publicKey(12),
[1, 2, 3, 4],
helpers.DataGenerator.shares(4),
10000000,
{
validatorCount: 0,
networkFeeIndex: 0,
index: 0,
balance: 0,
active: true
}
)).to.be.revertedWithCustomError(ssvNetworkContract, 'NotAuthorized');

});

it('Register validator with unauthorized address reverts "NotAuthorized" (2)', async () => {
await ssvNetworkContract.setRegisterAuth(helpers.DB.owners[3].address, true, false);

await expect(ssvNetworkContract.connect(helpers.DB.owners[3]).registerValidator(
helpers.DataGenerator.publicKey(12),
[1, 2, 3, 4],
helpers.DataGenerator.shares(4),
10000000,
{
validatorCount: 0,
networkFeeIndex: 0,
index: 0,
balance: 0,
active: true
}
)).to.be.revertedWithCustomError(ssvNetworkContract, 'NotAuthorized');
});

});

0 comments on commit 8878241

Please sign in to comment.