34 lines
1.7 KiB
Diff
34 lines
1.7 KiB
Diff
--- contracts/RelayerRegistry.sol 2023-11-02 22:04:45.720010503 +0000
|
|
+++ diffs/RelayerRegistryOld.sol 2023-11-03 20:19:30.256007626 +0000
|
|
@@ -200,30 +200,6 @@
|
|
}
|
|
|
|
/**
|
|
- * @notice This function should allow Governance to register relayer without real token transfer and permits
|
|
- * @dev designed this way as to allow Governance register mistakenly unregistered relayers (or bugged in other way) again
|
|
- * - reverts if relayer is already registered only, otherwise contract would break
|
|
- * - reverts if relayer does not own provided ens domain, do not check wrapper
|
|
- * - do not check worker, if someone except provided relayer registered this address as a worker, just ignore it
|
|
- * - do not check stake, because Governance need to have possibility to register relayer with stake lower than current min_stake
|
|
- */
|
|
- function registerRelayerAdmin(address relayer, string calldata ensName, uint256 stake) external onlyGovernance {
|
|
- bytes32 ensHash = bytes(ensName).namehash();
|
|
- address domainOwner = ens.owner(ensHash);
|
|
- require(relayer == domainOwner, "only ens domain owner");
|
|
- require(workers[relayer] != relayer, "cant register again");
|
|
-
|
|
- RelayerState storage metadata = relayers[relayer];
|
|
- require(metadata.ensHash == bytes32(0), "registered already");
|
|
-
|
|
- metadata.balance = stake;
|
|
- metadata.ensHash = ensHash;
|
|
- workers[relayer] = relayer;
|
|
-
|
|
- emit RelayerRegistered(ensHash, ensName, relayer, stake);
|
|
- }
|
|
-
|
|
- /**
|
|
* @notice This function should allow anybody to stake to a relayer more TORN
|
|
* @param relayer Relayer main address to stake to
|
|
* @param stake Stake to be added to relayer
|