diff --git a/contracts/registry/ENSSubdomainRegistry.sol b/contracts/registry/ENSSubdomainRegistry.sol index ef6e594..2d9ef55 100644 --- a/contracts/registry/ENSSubdomainRegistry.sol +++ b/contracts/registry/ENSSubdomainRegistry.sol @@ -170,23 +170,21 @@ contract ENSSubdomainRegistry is Controlled { /** * @notice Migrate account to new registry - * @param _newRegistry new registry address * @param _userHash `msg.sender` owned subdomain hash * @param _domainHash choosen contract owned domain hash **/ function moveAccount( - ENSSubdomainRegistry _newRegistry, bytes32 _userHash, bytes32 _domainHash ) external { - require(ens.owner(_domainHash) == address(_newRegistry)); - require(address(this) == _newRegistry.parentRegistry()); bytes32 subdomainHash = keccak256(_domainHash, _userHash); require(msg.sender == accounts[subdomainHash].fundsOwner); + ENSSubdomainRegistry _newRegistry = ENSSubdomainRegistry(ens.owner(_domainHash)); Account memory account = accounts[subdomainHash]; delete accounts[subdomainHash]; + require(address(this) == _newRegistry.parentRegistry()); token.approve(_newRegistry, account.tokenBalance); _newRegistry.migrateAccount(_userHash, _domainHash, account.tokenBalance, account.creationTime, account.fundsOwner); } @@ -324,5 +322,13 @@ contract ENSSubdomainRegistry is Controlled { { fundsOwner = accounts[_subdomainHash].fundsOwner; } + + function getCreationTime(bytes32 _subdomainHash) + external + view + returns(uint256 creationTime) + { + creationTime = accounts[_subdomainHash].creationTime; + } } \ No newline at end of file