diff --git a/contracts/registries/IPAssetRegistry.sol b/contracts/registries/IPAssetRegistry.sol index d66a2f3e..9877ecc9 100644 --- a/contracts/registries/IPAssetRegistry.sol +++ b/contracts/registries/IPAssetRegistry.sol @@ -101,6 +101,14 @@ contract IPAssetRegistry is uint256 tokenId, address registerFeePayer ) internal override returns (address id) { + id = _registerIpAccount(chainid, tokenContract, tokenId); + IIPAccount ipAccount = IIPAccount(payable(id)); + + // return if the IP was already registered + if (bytes(ipAccount.getString("NAME")).length != 0) { + return id; + } + IPAssetRegistryStorage storage $ = _getIPAssetRegistryStorage(); // Pay registration fee @@ -112,14 +120,6 @@ contract IPAssetRegistry is emit IPRegistrationFeePaid(registerFeePayer, treasury, feeToken, feeAmount); } - id = _registerIpAccount(chainid, tokenContract, tokenId); - IIPAccount ipAccount = IIPAccount(payable(id)); - - // return if the IP was already registered - if (bytes(ipAccount.getString("NAME")).length != 0) { - return id; - } - (string memory name, string memory uri) = _getNameAndUri(chainid, tokenContract, tokenId); uint256 registrationDate = block.timestamp; ipAccount.setString("NAME", name);