generated from transmissions11/dapptools-template
-
Notifications
You must be signed in to change notification settings - Fork 44
/
ENSReverseRecord.sol
29 lines (24 loc) · 991 Bytes
/
ENSReverseRecord.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;
interface IReverseRegistrar {
/**
@notice sets reverse ENS Record
@param name the ENS record to set
After calling this, a user has a fully configured reverse record claiming the provided name as that account's canonical name.
*/
function setName(string memory name) external returns (bytes32);
}
/**
@title helper contract to set reverse ens record
@notice sets reverse ENS record against canonical ReverseRegistrar https://docs.ens.domains/contract-api-reference/reverseregistrar.
*/
abstract contract ENSReverseRecord {
/// @notice the ENS Reverse Registrar
IReverseRegistrar public constant REVERSE_REGISTRAR = IReverseRegistrar(0x084b1c3C81545d370f3634392De611CaaBFf8148);
constructor(string memory name) {
if (bytes(name).length != 0) setENSName(name);
}
function setENSName(string memory name) private {
REVERSE_REGISTRAR.setName(name);
}
}