Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Emily Williams
    @emaG3m
    🎉🎉🎉
    Emily Williams
    @emaG3m
    what mike is referring to, where you can read transactions that have happened on the ethereum blockchain, as well as code from contracts
    ---^
    An example de compiling the CryptoKitties smart contract
    Adrian Guerrera
    @apguerrera
    Adrian Guerrera
    @apguerrera
    To get some free test net ether
    Mahesh Murthy
    @maheshmurthy
    If you don't have metamask installed, you can install by going to this link: https://metamask.io/
    We will need it to deploy your contract to the public network
    Ghost
    @ghost~5cd45391d73408ce4fbfd83d
    Also, uint256 size processing is optimized in solidity, which would cost less gas than smaller size uints. https://ethereum.stackexchange.com/questions/3067/why-does-uint8-cost-more-gas-than-uint256
    Get Remix above here
    https://metamask.io/ - Install this into chrome
    ygalper
    @ygalper
    please send me ETH - 0x71EFBA033220B52635eBAa035F301359dFFE067a
    still getting "Too many requests, please try again later." when I try to request Ether
    step271828
    @step271828
    please send eth: 0x9b352D250E63b76c971e9589C5764540d1973885
    Emily Williams
    @emaG3m
    can you guys view these slides?
    Joan
    @caozheng0_0_twitter
    it might need to switch to public access.
    Emily Williams
    @emaG3m
    thanks!
    what about now @caozheng0_0_twitter ?
    Joan
    @caozheng0_0_twitter
    👍👍👍
    haraamishaakal
    @haraamishaakal
    Yes I can see it now
    Emily Williams
    @emaG3m
    great
    Yulia Zileeva
    @zileeva
    would it also be possible to post code examples and exercises after we're done with them?
    Emily Williams
    @emaG3m
    can you be more specific Yulia? Would you like to see examples of smart contracts?
    Mahesh Murthy
    @maheshmurthy
    pragma solidity >=0.4.0 < 0.6.0;
    
    //This is a comment
    
    contract ERC20Token {
        string public name;
        string public symbol; //BOS
        uint public decimals;
        uint256 public totalSupply;
        uint256 public price;
        address public owner;
        mapping(address => uint256) tokenBalances;
    
        constructor() public {
            name = "Boston Token";
            symbol = "BOS";
            decimals = 18;
            totalSupply = 100000;
            price = 0.0001 ether;
            owner = msg.sender;
            tokenBalances[msg.sender] = totalSupply;
        }
    
        function balanceOf(address tokenOwner) public view returns(uint256) {
            return tokenBalances[tokenOwner];
        }
    
        function transfer(address to, uint256 value) public returns (bool) {
            require(tokenBalances[msg.sender] >= value);
            tokenBalances[msg.sender] -= value;
            tokenBalances[to] += value;
            return true;
        }
    
        function () external payable {
            uint tokens = msg.value/price;
            require(tokenBalances[owner] >= tokens, "Token balance low");
            tokenBalances[owner] -= tokens;
            tokenBalances[msg.sender] += tokens;
        }
    }
    Adrian Guerrera
    @apguerrera
    Fun page to deploy a token contract using metamask
    Mahesh Murthy
    @maheshmurthy
    If anyone need ropsten ether, post your address here
    Steve Flanagan
    @steveflanagan_gitlab
    <html>
    <head>
    <title>Hello World</title>
    <script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
    <script src="./dapp.js"></script>
    </head>
    <body>
    <div id="account-info">
    <table>
    <tr>
    <th>Account</th>
    <th>Balance</th>
    </tr>
    <tr>
    <td id="account-addr"></td>
    <td id="account-balance"></td>
    </tr>
    </table>
    </div>
    <div id="transfer-form">
    <h1>Transfer your tokens</h1>
    <input type="text" placeholder="0x123..." id="transfer-to" />
    <input type="number" id="transfer-amt" />
    <button onclick = "transfer()">Transfer</button>
    </div>
    <button onclick = "buyTokens()">Buy Tokens</button>
    </body>
    </html>
        <head>
            <title>Hello World</title>
            <script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>
            <script src="./dapp.js"></script>
        </head>
        <body>
            <div id="account-info">
                <table>
                    <tr>
                        <th>Account</th>
                        <th>Balance</th>
                    </tr>
                    <tr>
                        <td id="account-addr"></td>
                        <td id="account-balance"></td>
                    </tr>
                </table>
            </div>
            <div id="transfer-form">
                <h1>Transfer your tokens</h1>
                <input type="text" placeholder="0x123..." id="transfer-to" />
                <input type="number" id="transfer-amt" />
                <button onclick = "transfer()">Transfer</button>
            </div>
            <button onclick = "buyTokens()">Buy Tokens</button>
        </body>
    </html>
    
    // Make the contract accessible across the dapp
    contract = null;
    
    contractABI = web3.eth.contract([{"constant": true,"inputs": [{"name": "","type": "address"}],"name": "balanceOf","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": false,"inputs": [],"name": "claimToken","outputs": [],"payable": true,"stateMutability": "payable","type": "function"},{"constant": true,"inputs": [],"name": "tokenPrice","outputs": [{"name": "","type": "uint256"}],"payable": false,"stateMutability": "view","type": "function"},{"constant": false,"inputs": [{"name": "recipient","type": "address"},{"name": "amt","type": "uint256"}],"name": "transferTokens","outputs": [],"payable": false,"stateMutability": "nonpayable","type": "function"}]);
    
    window.addEventListener('load', async () => {
      if(typeof web3 !== 'undefined') {
        await ethereum.enable();
        web3 = new Web3(web3.currentProvider);
      } else {
        web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
      }
      try {
        var contractAddr = "0xb9baebac58f02e92d165e3d6e80537daca6c4c15"; // the address from deployment
        contract = contractABI.at(contractAddr);
        // Lets set user address
        document.getElementById("account-addr").innerHTML = web3.eth.accounts[0];
        // Ask the token contract for the user's balance:
        contract.balanceOf(web3.eth.accounts[0],
          // Callback
          function(error, output) {
            // If there was an error, log it
            if (error) {
              console.error(error);
            }
            // Else, lets reflect the output in our app
            else {
              document.getElementById("account-balance").innerHTML = output;
            }
          }
        );
      } catch (e) {
        console.error(e);
      }
    });
    
    function transfer() {
      contract.transfer(
        document.getElementById("transfer-to").value,
        document.getElementById("transfer-amt").value,
        function(error, output) {
          if (error) {
            console.error(error);
          } else {
            // Could use an event listener here, and wait for the transfer to complete
            // - then we could update the account info. For now, there's nothing to
            // do.
          }
        }
      );
    }
    
    function buyTokens() {
      web3.eth.sendTransaction({
        from:web3.eth.accounts[0],
        to:"0xb9baebac58f02e92d165e3d6e80537daca6c4c15",
        value:1000000000000000000
      }, function(error, output) {
        if(error) {
          console.error(error);
        }
      });
    }
    Steve Flanagan
    @steveflanagan_gitlab
    python -m SimpleHTTPServer
    Steve Flanagan
    @steveflanagan_gitlab
    python -m SimpleHTTPServer
    Steve Flanagan
    @steveflanagan_gitlab
    Emily Williams
    @emaG3m
    helpful for setting up dev environment for ethereum
    buidlboston.org
    hackathon: www.buidlboston.org