owner is not special in any way although, by convention, it's an
address representing a privileged user. Importantly, it has meaning only by interpretation in the contract, usually something like:
require(msg.sender == owner);
It's customary to bootstrap a contract by setting
msg.sender in the
constructor so it has a non-null value and so we know the deployer (they who deployed the contract) can sign transactions.
The "deployer" may be a developer and the "owner" is often a sponsor, so it's routine to transfer the ownership to the proper custodian. This is typically done with a transaction to
function changeOwner(address newOwner) .... The original
owner is usually the only account that can sign such a transaction, owing to the rule that only the owner can transfer ownership. Something like:
function changeOwner(address newOwner) public onlyOwner ...
It's also a de facto standard to issue the initial supply of a fixed-supply token to the deployer. Often the developer isn't the sponsor (or treasurer) so it would be part of the migration process to transfer the tokens to the custodian.
A choreographed migration process can be scripted with truffle migrations, or it can be done manually. It might go something like:
- Developer deploys token contract (developer receives the total supply).
- Developer deploys crowdsale contract (developer assumes owner role).
- Developer transfers 100% of tokens from self to the crowdsale contract.
- Developer changes ownership of the crowsale contract from self to custodian.
- Developer account has no tokens and no privileges.
- Crowdsale contract has 100% of the token supply in "inventory" for sale.
- Custodian has the privilege of starting/stopping the crowdsale and withdrawing ETH collected by the contract.
There is, of course, plenty of latitude for customization.
Hope it helps.