A note in the docs referring to the contract example SubCurrency states:

This is not a nice example for browser-solidity. If you use browser-solidity to try this example, you cannot change the address where you call functions from. So you will always be the “minter”, you can mint coins and send them somewhere, but you cannot impersonate someone else. This might change in the future Solidity Docs pg 8

contract Coin {
  // The keyword "public" makes those variables
  // readable from outside.
  address public minter;
  mapping (address => uint) public balances;
  // Events allow light clients to react on
  // changes efficiently.
  event Sent(address from, address to, uint amount);
  // This is the constructor whose code is
  // run only when the contract is created.
  function Coin() {
    minter = msg.sender;
  function mint(address receiver, uint amount) {
    if (msg.sender != minter) return;
    balances[receiver] += amount;
  function send(address receiver, uint amount) {
    if (balances[msg.sender] < amount) return;
    balances[msg.sender] -= amount;
    balances[receiver] += amount;
    Sent(msg.sender, receiver, amount);

Apart from the issue of whether this persists in the current version, why can you not change the address from where you can call functions in the browser Solidity compiler?

Context: I'm asking to firm up my grasp of contract origins, deployment and ownership.


Use the transaction tab in the right-hand pane of the browser (paper plane icon) to change the transaction origin before you submit a function call.

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.