From 14dfba19e47ee575ffd9703a0ba43c24de6bfe05 Mon Sep 17 00:00:00 2001 From: "Serenae.eth" Date: Thu, 22 Jun 2023 17:33:16 -0400 Subject: [PATCH 1/2] Example contract to allow anyone to extend a subname --- contracts/wrapper/OpenRenewalManager.sol | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 contracts/wrapper/OpenRenewalManager.sol diff --git a/contracts/wrapper/OpenRenewalManager.sol b/contracts/wrapper/OpenRenewalManager.sol new file mode 100644 index 00000000..68ea282f --- /dev/null +++ b/contracts/wrapper/OpenRenewalManager.sol @@ -0,0 +1,25 @@ +//SPDX-License-Identifier: MIT +pragma solidity ~0.8.17; + +import "../registry/ENS.sol"; +import {ReverseClaimer} from "../reverseRegistrar/ReverseClaimer.sol"; +import {INameWrapper} from "./INameWrapper.sol"; + +contract OpenRenewalManager is ReverseClaimer { + INameWrapper immutable nameWrapper; + + constructor( + ENS _ens, + INameWrapper wrapperAddress + ) ReverseClaimer(_ens, msg.sender) { + nameWrapper = wrapperAddress; + } + + function extendExpiry( + bytes32 parentNode, + bytes32 labelhash, + uint64 expiry + ) public returns (uint64) { + nameWrapper.extendExpiry(parentNode, labelhash, expiry); + } +} From c05c58c1ccac7c5c1961ebf11f80ac40d6d9a5e8 Mon Sep 17 00:00:00 2001 From: "Serenae.eth" Date: Thu, 22 Jun 2023 17:45:06 -0400 Subject: [PATCH 2/2] Returning new expiry --- contracts/wrapper/OpenRenewalManager.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/wrapper/OpenRenewalManager.sol b/contracts/wrapper/OpenRenewalManager.sol index 68ea282f..ea438db7 100644 --- a/contracts/wrapper/OpenRenewalManager.sol +++ b/contracts/wrapper/OpenRenewalManager.sol @@ -20,6 +20,6 @@ contract OpenRenewalManager is ReverseClaimer { bytes32 labelhash, uint64 expiry ) public returns (uint64) { - nameWrapper.extendExpiry(parentNode, labelhash, expiry); + return nameWrapper.extendExpiry(parentNode, labelhash, expiry); } }