[Ethereum] How to see deployed “StandardToken” contract owner with truffle console

consoleopenzeppelinsoliditytestrpctruffle

I have deployed on testrpc contract with ERC20 token which has following constructor:

pragma solidity ^0.4.4;
import 'zeppelin-solidity/contracts/token/StandardToken.sol';

contract TutorialToken is StandardToken {
    string public name = 'TutorialToken';
    string public symbol = 'TT';
    uint public decimals = 2;
    uint public INITIAL_SUPPLY = 12000;

    function TotorialToken() {
        totalSupply = INITIAL_SUPPLY;
        balances[msg.sender] = INITIAL_SUPPLY;
    }
}

My understanding is that contract will be deployed by 0th testrpc account. However when I do

TutorialToken.deployed().then(c => c.balanceOf('<0th account addr>').then(b => console.log(b)))

It displays

{ [String: '0'] s: 1, e: 0, c: [ 0 ] }

So it seems that the account has no balance. I aslo can't see the balance in "Token" tab of metamask. Looks like some other address was used to create account. However I'm not able to find any function to see who is contract creator (who was msg.sender).

Is it possible in truffle console to see who is a contract creator?

Update

The problem with balance was because of the typo: constructor name was TotorialToken instead of TutorialToken.

The original question still holds though: how to print contract owner?

Update #2

To actually see contract owner I can do something like this (thanks pabloruiz55 for suggestion):

address owner;

function TutorialToken() {
    owner = msg.sender;
    ...
}

That works. So I guess my question is different then: does OpenZeppelin's StandardToken contains owner field which can be accessed?

Best Answer

The easiest way would be to store the owner/creator of the contract in a state variable on deployment.

pragma solidity ^0.4.8;
contract myContract  {

    address public owner;

    function myContract() {
        owner = msg.sender;
    }
}
Related Topic