Ownable.sol has the following method:
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
If you want to transfer ownership of the token contract (and assuming the token is Ownable) you can call transferOwnership(address_of_new_owner)
using the account that currently owns the token contract.
Have in mind that unless the crowdsale contract that now owns the token also implements a function that can call this function, you won't be able to transfer ownership back again if you wanted so.
Here's an example.
You have the token contract with the transferOwnership()
function above. The current owner is your own account.
You call that function passing the address of the crowdsale. Now the owner = (the crowdsale).
If you now wanted to transfer ownership from the crowdsale to another account, the only one that can do so is the actual crowdsale contract as it is the current owner.
For that to be possible, the crowdsale contract would have to have the following code:
function transferOwnership(address _newOwner) public onlyOwner {
require(msg.sender == owner); // Only the owner of the crowdsale contract should be able to call this function.
// I assume the crowdsale contract holds a reference to the token contract.
token.transferOwnership(_newOwner);
}