I have the following outputs -

> eth.getStorageAt(con.address,0)
> eth.getStorageAt(con.address,1)   
> eth.getStorageAt(con.address,2)
> con.buyer()
> eth.coinbase
> eth.defaultAccount

Here is the contract -

pragma solidity ^0.4.18;

contract CollegeAdmin {
uint8 public studentAge=18;
uint16 public studentIncome=15000;
uint8 public studentScore=4;
uint8 public studentAttendance=96;
address public buyer;
address public owner;
event changedAge(uint age);

function CollegeAdmin() public {
owner = msg.sender;
function setAge(uint8 age) public {
studentAge = age;


I expected the default account to be used and hence owner = defaultAccount which then is shown in slot 1 of the storage. But slot 1 has eth.coinbase. But when I run setAge, I find that the buyer it then set to eth.defaultAccount.

It seems to be truffle deploys under eth.coinbase and then the contract runs under eth.defaultAccount.

I tried changing truffle.js -

module.exports = {
   networks: {
   development: {
   host: "localhost",
   port: 8545,
   network_id: "*",
 gas: 4712388,
 from: "0xf07044ba718e8eb25850be0e534f9522018784be"

This then gives a network error.

Using network 'development'.

Running migration: 1_initial_migration.js
  Replacing Migrations...
  ... undefined
Error encountered, bailing. Network state unknown. Review successful 
transactions manually.

This is I imagine related to eth.coinbase but geth does not let me change that.

Has anyone any ideas?


If you want to specify the creator of the contract directly in the deployment scripts

var MyContract = artifacts.require("MyContract");

module.exports = function(deployer) {
  deployer.deploy(MyContract, { from: "0xACCOUNT" });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.