Skip to content

Instantly share code, notes, and snippets.

@stupeters187
stupeters187 / StandardToken.sol
Created August 29, 2018 02:59
StandardToken
pragma solidity ^0.4.24;
import "./ERC20.sol";
import "./SafeMath.sol";
import "./Ownable.sol";
/**
* @title Standard ERC20 token
*
@stupeters187
stupeters187 / EscrowSpecs.md
Last active August 28, 2018 19:06
Escrow contract specs
  1. Must be aware of buyer, seller and arbiter (addresses)
  2. Must be aware of current escrow amount (uint)
  3. Must be able to accept and hold ether in escrow
  4. Must be able to send the funds to seller upon successful transaction
  5. Must be able to refund the funds to the buyer upon unsuccessful transaction
  6. Must be able to display current value of contract
  7. Must store all of the transaction info in event(s) logs

.transfer function

Apparently testrpc development has been taken over by truffle, so they have a new tool:

https://github.com/trufflesuite/ganache-cli

Install, in one terminal tab run ganache-cli, and that will start the local blockchain. In the root directory run truffle migrate and your contracts will be deployed to localhost:8545.

You can access everything in node console like so:

const Web3 = require('web3');
0xDD5932580E3c87778Be013bcc739F7379BaFCfBD
0xC80674509EdaBD56581d8a1105f356bf108F5Fe4
0xDD5932580E3c87778Be013bcc739F7379BaFCfBD
0xCaEFfB0312cC6C6392d43D1BC6A5a4dE103074c1
0xDD5932580E3c87778Be013bcc739F7379BaFCfBD

Decypher.tv - video 15 - The Block Gas Limit

  • Over the next few lessons we will use a simple crowdfunding contract

  • CrowdFund will have 3 pieces of state:

    • address public beneficiary;
      • who recieves the money if the campaign is successful
  • uint256 public goal;

1. SELECT isbn
FROM editions
WHERE publisher_id = 59;
2. SELECT isbn, title
FROM books
JOIN editions on books.id = editions.book_id
WHERE publisher_id = 59;
3. SELECT stock, retail, title, editions.isbn