prevent moveAccount to self contract.

This commit is contained in:
Ricardo Guilherme Schmidt 2018-09-06 16:38:24 -03:00
parent 47d9e13e8b
commit 043156cc56
No known key found for this signature in database
GPG Key ID: 3F95A3AD0B607030
1 changed files with 2 additions and 1 deletions

View File

@ -241,7 +241,7 @@ contract UsernameRegistrar is Controlled, ApproveAndCallFallBack {
}
/**
* @notice Migrate account to new registry.
* @notice Migrate account to new registry, opt-in to new contract.
* @param _label Username hash.
**/
function moveAccount(
@ -249,6 +249,7 @@ contract UsernameRegistrar is Controlled, ApproveAndCallFallBack {
)
external
{
require(state == RegistrarState.Moved, "Wrong contract state");
require(msg.sender == accounts[_label].owner, "Callable only by account owner.");
UsernameRegistrar _newRegistry = UsernameRegistrar(ensRegistry.owner(ensNode));
Account memory account = accounts[_label];