I changed my subdomain registrar to allow users to register subdomains in years instead of months. In particular, I changed this line: duration = duration * 31 days;
to this: duration = duration * 365 days;
uint64 is not able to store this value more than one year.
How do you recommend making changes? I tried changing all the expiry variables to uint256 in my registrar and the base registrar, but errors were thrown in the base registrar.
If you want your duration input to be in terms of years, then you could just reduce that from a uint64 to like a uint16 or something.
And then you would not set duration = duration * 365 days, you would declare a local uint64 for the durationSeconds, and then durationSeconds = duration * 365 days.
You would pass that into the _register function, like uint64(block.timestamp) + durationInSeconds. Also make sure to update your other duration check there.
What’s not working? I see you successfully registered 286.bigb0ss.eth with that contract, you passed in 1 for the duration, and the expiry was set to 1 year from now.