Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
grammar fixes
Source Link
eth
  • 86.5k
  • 53
  • 287
  • 411

I'm a beginner.

and I have a smart contract:

I'm a beginner.

I have a smart contract:

I'm a beginner and I have a smart contract:

How use contract with web3jsweb3.js

I'm beginera beginner.

pragma solidity ^0.4.0;

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);
    }
}

I runran on local console  : testrpc -u 0 -u 1testrpc -u 0 -u 1

I runran on Chrome console (result of compilation with https://ethereum.github.io/browser-solidity/)

And i try I tried:

But nothing appendappends :'( And iI have no idea of why  !?

Work This works!! (Return @account[0])

Could someone write me the lines to copy paste into the console to execute an ether transfer with this smart-contract contract?

How use contract with web3js

I'm beginer.

pragma solidity ^0.4.0;

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);
    }
}

I run on local console  : testrpc -u 0 -u 1

I run on Chrome console (result of compilation with https://ethereum.github.io/browser-solidity/)

And i try :

But nothing append :'( And i have no idea of why  !?

Work !! (Return @account[0])

Could someone write me the lines to copy paste into the console to execute an ether transfer with this smart-contract?

How use contract with web3.js

I'm a beginner.

pragma solidity ^0.4.0;

contract Coin {
    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);
    }
}

I ran on local console: testrpc -u 0 -u 1

I ran on Chrome console (result of compilation with https://ethereum.github.io/browser-solidity/)

And I tried:

But nothing appends :'( And I have no idea of why!

This works!! (Return @account[0])

Could someone write me the lines to copy paste into the console to execute an ether transfer with this smart contract?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user