├── Practical Part 11 - FINAL Project
├── app
│ └── stylesheets
│ │ └── app.css
├── postcss.config.js
├── .babelrc
├── .eslintignore
├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
├── contracts
│ ├── owned.sol
│ └── Migrations.sol
├── .eslintrc
├── truffle.js
├── package.json
├── webpack.bootstrap.config.js
└── webpack.config.js
├── Practical Part 7
├── l01 - Init Files
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ ├── trading.html
│ │ ├── index.html
│ │ └── managetoken.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── .eslintrc
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── l07 - manageToken function
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ ├── trading.html
│ │ └── index.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── l04 - Assignment implement Allowance
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ ├── trading.html
│ │ └── index.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
└── l06 - Finished implement Allowance
│ ├── app
│ ├── stylesheets
│ │ └── app.css
│ ├── index.html
│ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ └── contracts
│ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── Practical Part 8 - Events
├── .babelrc
├── .gitignore
├── .eslintignore
├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
├── contracts
│ ├── ConvertLib.sol
│ ├── Migrations.sol
│ └── MetaCoin.sol
├── truffle.js
├── .eslintrc
├── test
│ └── TestMetacoin.sol
├── app
│ ├── stylesheets
│ │ └── app.css
│ └── index.html
├── webpack.config.js
├── README.md
└── package.json
├── Practical Part 10 - Trading Coins
├── l04 - The OrderBook
│ ├── app
│ │ └── stylesheets
│ │ │ └── app.css
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── l08 - the FINAL Dapp
│ ├── app
│ │ └── stylesheets
│ │ │ └── app.css
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── l02 - The final HTML site
│ ├── app
│ │ └── stylesheets
│ │ │ └── app.css
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── l03 - Listen to Events
│ ├── app
│ │ └── stylesheets
│ │ │ └── app.css
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
└── l06 - the sellToken Function
│ ├── app
│ └── stylesheets
│ │ └── app.css
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ └── contracts
│ │ └── owned.json
│ ├── package.json
│ ├── webpack.bootstrap.config.js
│ └── webpack.config.js
├── Practical Part 9 - Deposit and Withdrawal
├── l06 - The depositEther function
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
├── l01 - Add the html to the index file
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
├── l03 - Add the deposit Token logic
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
├── l04 - Assignment Withdraw Token Logic
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
├── l05 - The final withdrawal Token Logic
│ ├── app
│ │ ├── stylesheets
│ │ │ └── app.css
│ │ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ │ └── contracts
│ │ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
└── l02 - Lets add the logic for showing the token and Ether balance
│ ├── app
│ ├── stylesheets
│ │ └── app.css
│ └── trading.html
│ ├── postcss.config.js
│ ├── .babelrc
│ ├── .eslintignore
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ ├── .eslintrc
│ ├── build
│ └── contracts
│ │ └── owned.json
│ ├── package.json
│ └── webpack.bootstrap.config.js
├── splash_screen.png
├── exchange_animation.gif
├── sheets
├── S02L13 - Recap.pdf
├── S03L00 - Intro.pdf
├── S04L00 - Intro.pdf
├── S05L00 - Intro.pdf
├── S06L00 - Intro.pdf
├── S02L10 - MetaMask.pdf
├── S02L12 - Truffle.pdf
├── S03L06 - Wrap Up.pdf
├── S04L06 - Wrap Up.pdf
├── S05L07 - Wrap Up.pdf
├── S06L05 - Wrap Up.pdf
├── S04L03 - Interfaces.pdf
├── S05L01 - Libraries.pdf
├── S02L00 - Outlook-Recap.pdf
├── S02L11 - Look at Remix.pdf
├── S02L06 - Testrpc Mnemonic.pdf
├── S03L01 - What is an ICO.pdf
├── S05L02 - Importing Files.pdf
├── S05L04 - Exception Handling.pdf
├── S05L06 - Solidity Security.pdf
├── S02L01 - Blockchain-Concepts.pdf
├── S04L01 - What is an exchange.pdf
├── S05L05 - Truffle Remix Webpack.pdf
├── S05L03 - Call - send - transfer.pdf
├── S02L02 - How smart contracts work.pdf
├── S02L08 - Mist and Ethereum Wallet.pdf
├── S02L09 - Troubleshooting tipps MIST.pdf
├── S04L04 - Limit Orders Market Orders.pdf
├── S04L05 - Events from our contract.pdf
├── S02L03 - Geth-Testrpc-Blockchain nodes.pdf
├── S04L02 - What we are going to integrate.pdf
├── S02L07 - Web3 and blockchain communication.pdf
├── S04L04 - Datatypes we are going to implement.pdf
└── S02L04 - Difference between a call and and a transaction.pdf
├── _general files_
├── example.png
├── genesis.json
└── structure_contract_drawio.xml
├── Practical Part 2
├── l01
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── ConvertLib.sol
│ │ ├── Migrations.sol
│ │ └── MetaCoin.sol
│ └── test
│ │ └── TestMetacoin.sol
├── l06
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ └── contracts
│ │ └── Migrations.sol
└── l07
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ └── build
│ └── contracts
│ └── owned.json
├── Practical Part 3
└── l05
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ └── contracts
│ ├── owned.sol
│ └── Migrations.sol
├── Practical Part 4
└── l03
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ └── build
│ └── contracts
│ └── owned.json
├── Practical Part 6
├── l06 - Final Contract
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ └── build
│ │ └── contracts
│ │ └── owned.json
├── l05 - Assignment BuyToken
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ └── build
│ │ └── contracts
│ │ └── owned.json
└── l02 - The sellToken Market Order Logic
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ └── build
│ └── contracts
│ └── owned.json
├── Practical Part 5
├── l06 - Discussion Sell Order Book
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ └── build
│ │ └── contracts
│ │ └── owned.json
├── l04 - Implementation Buy Order Book
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ └── build
│ │ └── contracts
│ │ └── owned.json
├── l02 - Implementation of the Limit Buy Orders
│ ├── migrations
│ │ ├── 1_initial_migration.js
│ │ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ │ ├── owned.sol
│ │ └── Migrations.sol
│ └── build
│ │ └── contracts
│ │ └── owned.json
└── l03 - Impelementation of the Limit Sell Orders
│ ├── migrations
│ ├── 1_initial_migration.js
│ └── 2_deploy_contracts.js
│ ├── truffle.js
│ ├── contracts
│ ├── owned.sol
│ └── Migrations.sol
│ └── build
│ └── contracts
│ └── owned.json
├── Practical Part 1
└── owned.sol
└── Exception Handling and Send Transfer Call
└── throw_revert_assert.sol
/Practical Part 11 - FINAL Project/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 8 - Events/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 8 - Events/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | node_modules
3 | yarn-error.log
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/splash_screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/splash_screen.png
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/exchange_animation.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/exchange_animation.gif
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/sheets/S02L13 - Recap.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L13 - Recap.pdf
--------------------------------------------------------------------------------
/sheets/S03L00 - Intro.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S03L00 - Intro.pdf
--------------------------------------------------------------------------------
/sheets/S04L00 - Intro.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L00 - Intro.pdf
--------------------------------------------------------------------------------
/sheets/S05L00 - Intro.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L00 - Intro.pdf
--------------------------------------------------------------------------------
/sheets/S06L00 - Intro.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S06L00 - Intro.pdf
--------------------------------------------------------------------------------
/_general files_/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/_general files_/example.png
--------------------------------------------------------------------------------
/sheets/S02L10 - MetaMask.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L10 - MetaMask.pdf
--------------------------------------------------------------------------------
/sheets/S02L12 - Truffle.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L12 - Truffle.pdf
--------------------------------------------------------------------------------
/sheets/S03L06 - Wrap Up.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S03L06 - Wrap Up.pdf
--------------------------------------------------------------------------------
/sheets/S04L06 - Wrap Up.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L06 - Wrap Up.pdf
--------------------------------------------------------------------------------
/sheets/S05L07 - Wrap Up.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L07 - Wrap Up.pdf
--------------------------------------------------------------------------------
/sheets/S06L05 - Wrap Up.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S06L05 - Wrap Up.pdf
--------------------------------------------------------------------------------
/sheets/S04L03 - Interfaces.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L03 - Interfaces.pdf
--------------------------------------------------------------------------------
/sheets/S05L01 - Libraries.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L01 - Libraries.pdf
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/postcss.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {};
--------------------------------------------------------------------------------
/sheets/S02L00 - Outlook-Recap.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L00 - Outlook-Recap.pdf
--------------------------------------------------------------------------------
/sheets/S02L11 - Look at Remix.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L11 - Look at Remix.pdf
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"]
3 | }
4 |
--------------------------------------------------------------------------------
/sheets/S02L06 - Testrpc Mnemonic.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L06 - Testrpc Mnemonic.pdf
--------------------------------------------------------------------------------
/sheets/S03L01 - What is an ICO.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S03L01 - What is an ICO.pdf
--------------------------------------------------------------------------------
/sheets/S05L02 - Importing Files.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L02 - Importing Files.pdf
--------------------------------------------------------------------------------
/sheets/S05L04 - Exception Handling.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L04 - Exception Handling.pdf
--------------------------------------------------------------------------------
/sheets/S05L06 - Solidity Security.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L06 - Solidity Security.pdf
--------------------------------------------------------------------------------
/sheets/S02L01 - Blockchain-Concepts.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L01 - Blockchain-Concepts.pdf
--------------------------------------------------------------------------------
/sheets/S04L01 - What is an exchange.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L01 - What is an exchange.pdf
--------------------------------------------------------------------------------
/sheets/S05L05 - Truffle Remix Webpack.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L05 - Truffle Remix Webpack.pdf
--------------------------------------------------------------------------------
/sheets/S05L03 - Call - send - transfer.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S05L03 - Call - send - transfer.pdf
--------------------------------------------------------------------------------
/sheets/S02L02 - How smart contracts work.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L02 - How smart contracts work.pdf
--------------------------------------------------------------------------------
/sheets/S02L08 - Mist and Ethereum Wallet.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L08 - Mist and Ethereum Wallet.pdf
--------------------------------------------------------------------------------
/sheets/S02L09 - Troubleshooting tipps MIST.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L09 - Troubleshooting tipps MIST.pdf
--------------------------------------------------------------------------------
/sheets/S04L04 - Limit Orders Market Orders.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L04 - Limit Orders Market Orders.pdf
--------------------------------------------------------------------------------
/sheets/S04L05 - Events from our contract.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L05 - Events from our contract.pdf
--------------------------------------------------------------------------------
/sheets/S02L03 - Geth-Testrpc-Blockchain nodes.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L03 - Geth-Testrpc-Blockchain nodes.pdf
--------------------------------------------------------------------------------
/sheets/S04L02 - What we are going to integrate.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L02 - What we are going to integrate.pdf
--------------------------------------------------------------------------------
/sheets/S02L07 - Web3 and blockchain communication.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L07 - Web3 and blockchain communication.pdf
--------------------------------------------------------------------------------
/sheets/S04L04 - Datatypes we are going to implement.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S04L04 - Datatypes we are going to implement.pdf
--------------------------------------------------------------------------------
/Practical Part 8 - Events/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 2/l06/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 2/l07/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 3/l05/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 4/l03/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/sheets/S02L04 - Difference between a call and and a transaction.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tomw1808/distributed_exchange_truffle_class_3/HEAD/sheets/S02L04 - Difference between a call and and a transaction.pdf
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 2/l06/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 |
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | };
7 |
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 2/l06/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 2/l07/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 3/l05/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 4/l03/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/contracts/ConvertLib.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | library ConvertLib{
4 | function convert(uint amount,uint conversionRate) returns (uint convertedAmount)
5 | {
6 | return amount * conversionRate;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/contracts/ConvertLib.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.2;
2 |
3 | library ConvertLib{
4 | function convert(uint amount,uint conversionRate) returns (uint convertedAmount)
5 | {
6 | return amount * conversionRate;
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/.eslintignore:
--------------------------------------------------------------------------------
1 | tmp/**
2 | build/**
3 | node_modules/**
4 | contracts/**
5 | migrations/1_initial_migration.js
6 | migrations/2_deploy_contracts.js
7 | test/metacoin.js
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/migrations/1_initial_migration.js:
--------------------------------------------------------------------------------
1 | var Migrations = artifacts.require("./Migrations.sol");
2 |
3 | module.exports = function(deployer) {
4 | deployer.deploy(Migrations);
5 | };
6 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 1/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 2/l07/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 3/l05/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 4/l03/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | }
8 | }
9 | };
10 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 2/l07/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 3/l05/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 4/l03/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/truffle.js:
--------------------------------------------------------------------------------
1 | // Allows us to use ES6 in our migrations and tests.
2 | require('babel-register')
3 |
4 | module.exports = {
5 | networks: {
6 | development: {
7 | host: 'localhost',
8 | port: 8545,
9 | network_id: '*' // Match any network id
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var ConvertLib = artifacts.require("./ConvertLib.sol");
2 | var MetaCoin = artifacts.require("./MetaCoin.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(ConvertLib);
6 | deployer.link(ConvertLib, MetaCoin);
7 | deployer.deploy(MetaCoin);
8 | };
9 |
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | require(msg.sender == owner);
8 | _;
9 |
10 | }
11 |
12 | function owned() public {
13 | owner = msg.sender;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var ConvertLib = artifacts.require("./ConvertLib.sol");
2 | var MetaCoin = artifacts.require("./MetaCoin.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(ConvertLib);
6 | deployer.link(ConvertLib, MetaCoin);
7 | deployer.deploy(MetaCoin);
8 | };
9 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Index Page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/app/managetoken.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Manage Token Page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Index Page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Index Page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Index Page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/migrations/2_deploy_contracts.js:
--------------------------------------------------------------------------------
1 | var FixedSupplyToken = artifacts.require("./FixedSupplyToken.sol");
2 | var Exchange = artifacts.require("./Exchange.sol");
3 |
4 | module.exports = function(deployer) {
5 | deployer.deploy(FixedSupplyToken);
6 | deployer.deploy(Exchange);
7 | };
8 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/contracts/owned.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.0;
2 |
3 | contract owned {
4 | address owner;
5 |
6 | modifier onlyowner() {
7 | if (msg.sender == owner) {
8 | _;
9 | }
10 | }
11 |
12 | function owned() {
13 | owner = msg.sender;
14 | }
15 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/app/trading.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | DTE - Distributed Token Exchange
5 |
6 |
7 |
8 |
9 | Trading
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/truffle.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | networks: {
3 | development: {
4 | host: "localhost",
5 | port: 8545,
6 | network_id: "*" // Match any network id
7 | },
8 | rinkeby: {
9 | host: "localhost",
10 | port: 8545,
11 | network_id: "4", // Rinkeby ID 4
12 | from: "0x42a4b80feD9521D85aaECAdF2a378C55c1321342",
13 | gas: 4600000
14 | }
15 | }
16 | };
17 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "parser": "babel-eslint",
3 | "extends": [
4 | "standard"
5 | ],
6 | "plugins": [
7 | "babel"
8 | ],
9 | "rules": {
10 | "key-spacing" : 0,
11 | "jsx-quotes" : [2, "prefer-single"],
12 | "max-len" : [2, 120, 2],
13 | "object-curly-spacing" : [2, "always"]
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Practical Part 2/l07/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 4/l03/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820cc448f2cb1aba66690db44778a4fa566de3323b098d689c7274e1770c01ab6900029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500560719027
14 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/_general files_/genesis.json:
--------------------------------------------------------------------------------
1 | {
2 | "coinbase" : "0x0000000000000000000000000000000000000001",
3 | "difficulty" : "0x20000",
4 | "extraData" : "",
5 | "gasLimit" : "0x8000000",
6 | "nonce" : "0x0000000000000042",
7 | "mixhash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
8 | "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000",
9 | "timestamp" : "0x00",
10 | "alloc": {},
11 | "config": {
12 | "chainId": 15,
13 | "homesteadBlock": 0,
14 | "eip155Block": 0,
15 | "eip158Block": 0
16 | }
17 | }
--------------------------------------------------------------------------------
/Practical Part 2/l01/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 2/l06/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 2/l07/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 3/l05/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 4/l03/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/build/contracts/owned.json:
--------------------------------------------------------------------------------
1 | {
2 | "contract_name": "owned",
3 | "abi": [
4 | {
5 | "inputs": [],
6 | "payable": false,
7 | "type": "constructor"
8 | }
9 | ],
10 | "unlinked_binary": "0x60606040523415600e57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b60368060396000396000f30060606040525b600080fd00a165627a7a72305820fbe99ac2e2e990e272b1f7e9f319add3fc849a242879ab4e5ca889240f531f660029",
11 | "networks": {},
12 | "schema_version": "0.0.5",
13 | "updated_at": 1500988812523
14 | }
--------------------------------------------------------------------------------
/Practical Part 8 - Events/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.2;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 6/l06 - Final Contract/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 6/l05 - Assignment BuyToken/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 5/l06 - Discussion Sell Order Book/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 5/l04 - Implementation Buy Order Book/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 6/l02 - The sellToken Market Order Logic/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 5/l02 - Implementation of the Limit Buy Orders/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 5/l03 - Impelementation of the Limit Sell Orders/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/contracts/Migrations.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | contract Migrations {
4 | address public owner;
5 | uint public last_completed_migration;
6 |
7 | modifier restricted() {
8 | if (msg.sender == owner) _;
9 | }
10 |
11 | function Migrations() {
12 | owner = msg.sender;
13 | }
14 |
15 | function setCompleted(uint completed) restricted {
16 | last_completed_migration = completed;
17 | }
18 |
19 | function upgrade(address new_address) restricted {
20 | Migrations upgraded = Migrations(new_address);
21 | upgraded.setCompleted(last_completed_migration);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/test/TestMetacoin.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.2;
2 |
3 | import "truffle/Assert.sol";
4 | import "truffle/DeployedAddresses.sol";
5 | import "../contracts/MetaCoin.sol";
6 |
7 | contract TestMetacoin {
8 |
9 | function testInitialBalanceUsingDeployedContract() {
10 | MetaCoin meta = MetaCoin(DeployedAddresses.MetaCoin());
11 |
12 | uint expected = 10000;
13 |
14 | Assert.equal(meta.getBalance(tx.origin), expected, "Owner should have 10000 MetaCoin initially");
15 | }
16 |
17 | function testInitialBalanceWithNewMetaCoin() {
18 | MetaCoin meta = new MetaCoin();
19 |
20 | uint expected = 10000;
21 |
22 | Assert.equal(meta.getBalance(tx.origin), expected, "Owner should have 10000 MetaCoin initially");
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/test/TestMetacoin.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.2;
2 |
3 | import "truffle/Assert.sol";
4 | import "truffle/DeployedAddresses.sol";
5 | import "../contracts/MetaCoin.sol";
6 |
7 | contract TestMetacoin {
8 |
9 | function testInitialBalanceUsingDeployedContract() {
10 | MetaCoin meta = MetaCoin(DeployedAddresses.MetaCoin());
11 |
12 | uint expected = 10000;
13 |
14 | Assert.equal(meta.getBalance(tx.origin), expected, "Owner should have 10000 MetaCoin initially");
15 | }
16 |
17 | function testInitialBalanceWithNewMetaCoin() {
18 | MetaCoin meta = new MetaCoin();
19 |
20 | uint expected = 10000;
21 |
22 | Assert.equal(meta.getBalance(tx.origin), expected, "Owner should have 10000 MetaCoin initially");
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/app/stylesheets/app.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin-left: 25%;
3 | margin-right: 25%;
4 | margin-top: 10%;
5 | font-family: "Open Sans", sans-serif;
6 | }
7 |
8 | label {
9 | display: inline-block;
10 | width: 100px;
11 | }
12 |
13 | input {
14 | width: 500px;
15 | padding: 5px;
16 | font-size: 16px;
17 | }
18 |
19 | button {
20 | font-size: 16px;
21 | padding: 5px;
22 | }
23 |
24 | h1, h2 {
25 | display: inline-block;
26 | vertical-align: middle;
27 | margin-top: 0px;
28 | margin-bottom: 10px;
29 | }
30 |
31 | h2 {
32 | color: #AAA;
33 | font-size: 32px;
34 | }
35 |
36 | h3 {
37 | font-weight: normal;
38 | color: #AAA;
39 | font-size: 24px;
40 | }
41 |
42 | .black {
43 | color: black;
44 | }
45 |
46 | #balance {
47 | color: black;
48 | }
49 |
50 | .hint {
51 | color: #666;
52 | }
53 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 |
4 | module.exports = {
5 | entry: './app/javascripts/app.js',
6 | output: {
7 | path: path.resolve(__dirname, 'build'),
8 | filename: 'app.js'
9 | },
10 | plugins: [
11 | // Copy our app's index.html to the build folder.
12 | new CopyWebpackPlugin([
13 | { from: './app/index.html', to: "index.html" }
14 | ])
15 | ],
16 | module: {
17 | rules: [
18 | {
19 | test: /\.css$/,
20 | use: [ 'style-loader', 'css-loader' ]
21 | }
22 | ],
23 | loaders: [
24 | { test: /\.json$/, use: 'json-loader' },
25 | {
26 | test: /\.js$/,
27 | exclude: /(node_modules|bower_components)/,
28 | loader: 'babel-loader',
29 | query: {
30 | presets: ['es2015'],
31 | plugins: ['transform-runtime']
32 | }
33 | }
34 | ]
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/Practical Part 2/l01/contracts/MetaCoin.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.4;
2 |
3 | import "./ConvertLib.sol";
4 |
5 | // This is just a simple example of a coin-like contract.
6 | // It is not standards compatible and cannot be expected to talk to other
7 | // coin/token contracts. If you want to create a standards-compliant
8 | // token, see: https://github.com/ConsenSys/Tokens. Cheers!
9 |
10 | contract MetaCoin {
11 | mapping (address => uint) balances;
12 |
13 | event Transfer(address indexed _from, address indexed _to, uint256 _value);
14 |
15 | function MetaCoin() {
16 | balances[tx.origin] = 10000;
17 | }
18 |
19 | function sendCoin(address receiver, uint amount) returns(bool sufficient) {
20 | if (balances[msg.sender] < amount) return false;
21 | balances[msg.sender] -= amount;
22 | balances[receiver] += amount;
23 | Transfer(msg.sender, receiver, amount);
24 | return true;
25 | }
26 |
27 | function getBalanceInEth(address addr) returns(uint){
28 | return ConvertLib.convert(getBalance(addr),2);
29 | }
30 |
31 | function getBalance(address addr) returns(uint) {
32 | return balances[addr];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/contracts/MetaCoin.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.2;
2 |
3 | import "./ConvertLib.sol";
4 |
5 | // This is just a simple example of a coin-like contract.
6 | // It is not standards compatible and cannot be expected to talk to other
7 | // coin/token contracts. If you want to create a standards-compliant
8 | // token, see: https://github.com/ConsenSys/Tokens. Cheers!
9 |
10 | contract MetaCoin {
11 | mapping (address => uint) balances;
12 |
13 | event Transfer(address indexed _from, address indexed _to, uint256 _value);
14 |
15 | function MetaCoin() {
16 | balances[tx.origin] = 10000;
17 | }
18 |
19 | function sendCoin(address receiver, uint amount) returns(bool sufficient) {
20 | if (balances[msg.sender] < amount) return false;
21 | balances[msg.sender] -= amount;
22 | balances[receiver] += amount;
23 | Transfer(msg.sender, receiver, amount);
24 | return true;
25 | }
26 |
27 | function getBalanceInEth(address addr) returns(uint){
28 | return ConvertLib.convert(getBalance(addr),2);
29 | }
30 |
31 | function getBalance(address addr) returns(uint) {
32 | return balances[addr];
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/README.md:
--------------------------------------------------------------------------------
1 | # truffle-init-webpack
2 | Example webpack project with Truffle. Includes contracts, migrations, tests, user interface and webpack build pipeline.
3 |
4 | ## Usage
5 |
6 | To initialize a project with this example, run `truffle init webpack` inside an empty directory.
7 |
8 | ## Building and the frontend
9 |
10 | 1. First run `truffle compile`, then run `truffle migrate` to deploy the contracts onto your network of choice (default "development").
11 | 1. Then run `npm run dev` to build the app and serve it on http://localhost:8080
12 |
13 | ## Possible upgrades
14 |
15 | * Use the webpack hotloader to sense when contracts or javascript have been recompiled and rebuild the application. Contributions welcome!
16 |
17 | ## Common Errors
18 |
19 | * **Error: Can't resolve '../build/contracts/MetaCoin.json'**
20 |
21 | This means you haven't compiled or migrated your contracts yet. Run `truffle compile` and `truffle migrate` first.
22 |
23 | Full error:
24 |
25 | ```
26 | ERROR in ./app/main.js
27 | Module not found: Error: Can't resolve '../build/contracts/MetaCoin.json' in '/Users/tim/Documents/workspace/Consensys/test3/app'
28 | @ ./app/main.js 11:16-59
29 | ```
30 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.2",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.22.2",
14 | "babel-core": "^6.22.1",
15 | "babel-eslint": "^6.1.2",
16 | "babel-loader": "^6.2.10",
17 | "babel-plugin-transform-runtime": "^6.22.0",
18 | "babel-preset-env": "^1.1.8",
19 | "babel-preset-es2015": "^6.22.0",
20 | "babel-register": "^6.22.0",
21 | "copy-webpack-plugin": "^4.0.1",
22 | "css-loader": "^0.26.1",
23 | "eslint": "^3.14.0",
24 | "eslint-config-standard": "^6.0.0",
25 | "eslint-plugin-babel": "^4.0.0",
26 | "eslint-plugin-mocha": "^4.8.0",
27 | "eslint-plugin-promise": "^3.0.0",
28 | "eslint-plugin-standard": "^2.0.0",
29 | "html-webpack-plugin": "^2.28.0",
30 | "json-loader": "^0.5.4",
31 | "style-loader": "^0.13.1",
32 | "truffle-contract": "^1.1.11",
33 | "web3": "^0.18.2",
34 | "webpack": "^2.2.1",
35 | "webpack-dev-server": "^2.3.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Exception Handling and Send Transfer Call/throw_revert_assert.sol:
--------------------------------------------------------------------------------
1 | pragma solidity ^0.4.13;
2 |
3 | contract TestRevertAssert {
4 |
5 | ////////////////////////////////
6 | // ASSERT STYLE: ALL GAS USED //
7 | ////////////////////////////////
8 | function assertExceptionArrayTooLarge() {
9 | uint[] memory myArray = new uint[](10);
10 | myArray[11] = 10;
11 | }
12 |
13 |
14 | function divideByZero() {
15 | uint someVar = 0;
16 | uint someOtherVar = 50;
17 | uint third = someOtherVar / someVar;
18 | third = 1;
19 | }
20 |
21 | function shiftByNegativeAmount() {
22 | uint someVar = 1;
23 | int shiftVar = -1;
24 | someVar << shiftVar;
25 | }
26 |
27 |
28 | function thisAsserts() {
29 | assert(false); //consumes all gas
30 | }
31 |
32 | ////////////////////////////////
33 | // REQUIRE STYLE: RETURNS GAS //
34 | ////////////////////////////////
35 |
36 |
37 | function thisThrows() {
38 | throw; //require-style exception
39 | }
40 |
41 | function thisRequires() {
42 | require(false); //consumes no gas
43 | }
44 |
45 | function thisReverts() {
46 | revert();
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/Practical Part 8 - Events/app/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | MetaCoin - Truffle Webpack Demo w/ Frontend
5 |
6 |
7 |
8 |
9 | MetaCoin
10 | Example Truffle Dapp
11 | You have META
12 |
13 |
14 | Send MetaCoin
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | All Events (watch)
23 |
24 |
25 | Events from a specific address (watch)
26 |
27 |
28 | All Events (get)
29 |
30 |
31 | Hint: open the browser developer console to view any errors and warnings.
32 |
33 |
34 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l03 - Add the deposit Token logic/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l06 - The depositEther function/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l01 - Add the html to the index file/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l04 - Assignment Withdraw Token Logic/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l05 - The final withdrawal Token Logic/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "truffle-init-webpack",
3 | "version": "0.0.1",
4 | "description": "Frontend example using truffle v3",
5 | "scripts": {
6 | "lint": "eslint ./",
7 | "build": "webpack",
8 | "dev": "webpack-dev-server"
9 | },
10 | "author": "Douglas von Kohorn",
11 | "license": "MIT",
12 | "devDependencies": {
13 | "babel-cli": "^6.24.1",
14 | "babel-core": "^6.25.0",
15 | "babel-eslint": "^7.2.3",
16 | "babel-loader": "^7.1.1",
17 | "babel-plugin-transform-runtime": "^6.23.0",
18 | "babel-preset-env": "^1.6.0",
19 | "babel-preset-es2015": "^6.24.1",
20 | "babel-register": "^6.24.1",
21 | "bootstrap-loader": "^2.1.0",
22 | "bootstrap-sass": "^3.3.7",
23 | "copy-webpack-plugin": "^4.0.1",
24 | "css-loader": "^0.28.4",
25 | "eslint": "^4.3.0",
26 | "eslint-config-standard": "^10.2.1",
27 | "eslint-plugin-babel": "^4.1.1",
28 | "eslint-plugin-mocha": "^4.11.0",
29 | "eslint-plugin-promise": "^3.5.0",
30 | "eslint-plugin-standard": "^3.0.1",
31 | "file-loader": "^0.11.2",
32 | "html-webpack-plugin": "^2.29.0",
33 | "jquery": "^3.2.1",
34 | "json-loader": "^0.5.7",
35 | "node-sass": "^4.5.3",
36 | "postcss-loader": "^2.0.6",
37 | "resolve-url-loader": "^2.1.0",
38 | "sass-loader": "^6.0.6",
39 | "style-loader": "^0.18.2",
40 | "truffle-contract": "^2.0.3",
41 | "url-loader": "^0.5.9",
42 | "web3": "^0.20.0",
43 | "webpack": "^3.3.0",
44 | "webpack-dev-server": "^2.6.1"
45 | },
46 | "dependencies": {
47 | "bootstrap": "^3.3.7",
48 | "jquery": "^3.2.1"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/Practical Part 9 - Deposit and Withdrawal/l02 - Lets add the logic for showing the token and Ether balance/webpack.bootstrap.config.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 |
3 | function getBootstraprcCustomLocation() {
4 | return process.env.BOOTSTRAPRC_LOCATION;
5 | }
6 |
7 | const bootstraprcCustomLocation = getBootstraprcCustomLocation();
8 |
9 | let defaultBootstraprcFileExists;
10 |
11 | try {
12 | fs.statSync('./.bootstraprc');
13 | defaultBootstraprcFileExists = true;
14 | } catch (e) {
15 | defaultBootstraprcFileExists = false;
16 | }
17 |
18 | if (!bootstraprcCustomLocation && !defaultBootstraprcFileExists) {
19 | /* eslint no-console: 0 */
20 | console.log('You did not specify a \'bootstraprc-location\' ' +
21 | 'arg or a ./.boostraprc file in the root.');
22 | console.log('Using the bootstrap-loader default configuration.');
23 | }
24 |
25 | // DEV and PROD have slightly different configurations
26 | let bootstrapDevEntryPoint;
27 | if (bootstraprcCustomLocation) {
28 | bootstrapDevEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?' +
29 | `configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
30 | '!bootstrap-loader/no-op.js';
31 | } else {
32 | bootstrapDevEntryPoint = 'bootstrap-loader';
33 | }
34 |
35 | let bootstrapProdEntryPoint;
36 | if (bootstraprcCustomLocation) {
37 | bootstrapProdEntryPoint = 'bootstrap-loader/lib/bootstrap.loader?extractStyles' +
38 | `&configFilePath=${__dirname}/${bootstraprcCustomLocation}` +
39 | '!bootstrap-loader/no-op.js';
40 | } else {
41 | bootstrapProdEntryPoint = 'bootstrap-loader/extractStyles';
42 | }
43 |
44 | module.exports = {
45 | dev: bootstrapDevEntryPoint,
46 | prod: bootstrapProdEntryPoint,
47 | };
--------------------------------------------------------------------------------
/_general files_/structure_contract_drawio.xml:
--------------------------------------------------------------------------------
1 | 7ZpLb+M2EIB/jYD2sIEeVmIfY2/SHtI2qIs+TgtaoiU2lGhQdBztr+9QIvWwKFvNWg4WkGEg4mhEkTMfh5yJLW+VvP3E0S7+hYWYWq4dvlneZ8t1nZl7C3+kJC8l85ldCiJOQqVUC9bkK1ZCrbYnIc5aioIxKsiuLQxYmuJAtGSIc3Zoq20Zbb91hyLcEawDRLvSv0goYjUL367lP2MSxfrNjq3ubFDwEnG2T9X7LNfbFp/ydoJ0X0o/i1HIDg2R92B5K86YKK+StxWm0rbabOVzjz13q3FznIohD7jlA6+I7tXU/2AvOFWDE7k2SHYgCUUptJaxSCgIHbjcslSslZJsI0qiFK4DeDvmIHjFXBAw6726IdgOpEFMaPiEcraXY8wE2Ey3ljHj5Ct0i/Q74DYXihDAqqmxlk+C2AYpxxnoPOuJO5XoCWVC6QSMUrTLyKYacIJ4RNIlE4IlSknP9JFQumKU8cIA2ovQq3QuDrW29l/Zf0ICdU3RBtNlRYPuKWWFDTPBwcyN7u3iU93R0BVGbgxEPS7t/ogSQuXy+hPzEKVIu6O0lDNTbdM7lM/BN/itlxunohFWOWYJFjwHFfXAQvGb6wUwK9uHerV4t0onbqwU11aRAakVGlVd15TChQLVDK3XgdZyl5LXPNkw+itKMDQs775AmJM06uAMExdtlNse0Xbuml4jTvFW9AKe7VAAr30qdD7PasnvyhJSdIiJwGuQyzEdII6CjEF/W1oAFZMwhIUogRNIoJJZ6b0dI6korOcv4QtGXtk3vuXDvFbQduo2fKU6BwhSmB8ihW8xLIgDlouiA8wgMFwzGIoEHfnPgnABDmY9HAgZwu7DEAJAVpGAdHtC4Uoo+O71UPB7UEjQbgfG/mEvJyxRgFu3KJEGjkQxTfs3HmK+ZOzlR7l/73N5OVFyNUru5tej5PZClGTQ7YTJVTFx7KEnjAtwctfDSbDny33+zElQnzBKZiYOrsWBZ1+Pg3k/B2vQnED4SBD8K540FwYQjjyNwwjrXBjTDTs81IKm/88lhpDtytRT+aCZ/c6hjdPwXtY3oMl2hddA0tCHlrbz7fBEsRgvNDRkIApRFhdZrlO5S86w5ayM7XlwVLkZkEJyTJEgr+2+TN5Rjz6zcltWpNzdtXNP11m0uwCTRViop458XA1jkNv1pBp+r84BHQCmEslUImmWSHz/uEbSPem6c2ONxP32iOU4PXtXDC/CfNq6Rt26HNuMRn+RxEzCBbYup1viLUEAE04cfCwHhgrJeBz0VU2HJL/bLeYy8WXyYqqhXRERQ3lkPET6Cqql27+84HwKFR/Egan+MR4IfeVUBQLFaQSDmFj4IBYMNZDxWDAVTU/kvmCLmEUsRbSZALdTggYUMGee/y3lNzN/pgX/gOCTfWO7UvIvFiJXNkR7waQTq5c8MYlD3dUz5gTmKFOr4lVm+59OZVX5r8wjrboWMUJ2C8k8yhsKirze5Ndz2kmF5zV9eVZ9bp9Ud+35CXW4KIf77nS6W1c1Hj70saP4KYI8dhT/0Os9dlw/rnwXMcSMpy6iHNVQDAHFHSugmKqqlwsoQ6PFOwKDP1IQ6KxDf7Y4co/f7uKCJa5uabM47Xdc0ihvHde0vq1YZVipH1y/GmG9zY8WnOMvOivOMW3hjn2CnqFLzu3WMcvz3CFm1sAfSExR1uj1xcmTmqHQY/TyJeKq21fxQwnESjHotD45+R1ONlRxxnOyqZr3XWyeuv40/u55HGurEuiZ3fP/nsXn7vEhatHs7ry+Gtc7j9fQrH8nXKrXP8b2Hv4D
--------------------------------------------------------------------------------
/Practical Part 11 - FINAL Project/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 7/l01 - Init Files/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 7/l07 - manageToken function/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 7/l06 - Finished implement Allowance/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l03 - Listen to Events/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l04 - The OrderBook/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l08 - the FINAL Dapp/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 7/l04 - Assignment implement Allowance/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l02 - The final HTML site/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/Practical Part 10 - Trading Coins/l06 - the sellToken Function/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const CopyWebpackPlugin = require('copy-webpack-plugin');
3 | const webpack = require('webpack');
4 |
5 | const bootstrapEntryPoints = require('./webpack.bootstrap.config.js');
6 |
7 |
8 | // eslint-disable-next-line no-console
9 | console.log(`=> bootstrap-loader configuration: ${bootstrapEntryPoints.dev}`);
10 |
11 | module.exports = {
12 | entry: './app/javascripts/app.js',
13 | output: {
14 | path: path.resolve(__dirname, 'build'),
15 | filename: 'app.js'
16 | },
17 | plugins: [
18 | // Copy our app's index.html to the build folder.
19 | new CopyWebpackPlugin([
20 | {from: './app/index.html', to: "index.html"},
21 | {from: './app/trading.html', to: "trading.html"},
22 | {from: './app/managetoken.html', to: "managetoken.html"}
23 | ]),
24 | new webpack.ProvidePlugin({
25 | jQuery: 'jquery',
26 | $: 'jquery',
27 | jquery: 'jquery'
28 | })
29 | ],
30 | module: {
31 | rules: [
32 | {test: /\.css$/, use: ['style-loader', 'css-loader', 'postcss-loader']},
33 | {test: /\.scss$/, use: ['style-loader', 'css-loader', 'postcss-loader', 'sass-loader']},
34 | {
35 | test: /\.woff2?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
36 | use: 'url-loader?limit=10000',
37 | },
38 | {
39 | test: /\.(ttf|eot|svg)(\?[\s\S]+)?$/,
40 | use: 'file-loader',
41 | },
42 |
43 | // Bootstrap 3
44 | {test: /bootstrap-sass\/assets\/javascripts\//, use: 'imports-loader?jQuery=jquery'},
45 |
46 | ],
47 | loaders: [
48 | {test: /\.json$/, use: 'json-loader'},
49 | {
50 | test: /\.js$/,
51 | exclude: /(node_modules|bower_components)/,
52 | loader: 'babel-loader',
53 | query: {
54 | presets: ['es2015'],
55 | plugins: ['transform-runtime']
56 | }
57 | }
58 | ]
59 | }
60 | }
61 |
--------------------------------------------------------------------------------