All Projects → rumkin → piggy-bank

rumkin / piggy-bank

Licence: other
Nodejs with Ethereum smart contract tutorial app

Programming Languages

HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to piggy-bank

perihelion-m68k-tutorials
68000 assembly tutorials for Atari ST by perihelion of poSTmortem
Stars: ✭ 31 (+63.16%)
Mutual labels:  tutorials
School-Programming
Хранилище за свободно учебно съдържание по програмиране, информатика и ИТ за българските училища
Stars: ✭ 82 (+331.58%)
Mutual labels:  tutorials
YouTube tutorial
I store all the code I used in my YouTube tutorial here. Feel free to download and play around them😉
Stars: ✭ 56 (+194.74%)
Mutual labels:  tutorials
tutorials
Ably Tutorials in multiple languages
Stars: ✭ 35 (+84.21%)
Mutual labels:  tutorials
fixes
Random development problems and solutions
Stars: ✭ 38 (+100%)
Mutual labels:  tutorials
PY-NOOB
A repository of very simple Python programs to edit, change and learn basics of Python programming language.
Stars: ✭ 37 (+94.74%)
Mutual labels:  tutorials
klue-transformers-tutorial
KLUE 데이터를 활용한 HuggingFace Transformers 튜토리얼
Stars: ✭ 107 (+463.16%)
Mutual labels:  tutorials
PlutoStaticHTML.jl
Convert Pluto notebooks to HTML in automated workflows
Stars: ✭ 69 (+263.16%)
Mutual labels:  tutorials
TeachMePythonLikeIm5
Teach the Python programming language using a collection of super beginner friendly tutorials and challenges.
Stars: ✭ 23 (+21.05%)
Mutual labels:  tutorials
UnityTutorials-RTS
The code for my series of tutorials on how to make a real-time stategy (RTS) game in the well-know Unity game engine (with C# scripting)!
Stars: ✭ 256 (+1247.37%)
Mutual labels:  tutorials
Myapplications
My Tutorials
Stars: ✭ 50 (+163.16%)
Mutual labels:  tutorials
cloud-mdk-tutorial-samples
Sample from the SAP mobile development kit tutorials demonstrating various components and features of the MDK in the context of an enterprise mobile solution.
Stars: ✭ 16 (-15.79%)
Mutual labels:  tutorials
travis-ci-tutorial-java
Just to learn how to use travis-ci in a java project!
Stars: ✭ 38 (+100%)
Mutual labels:  tutorials
DataScienceTutorials.jl
A set of tutorials to show how to use Julia for data science (DataFrames, MLJ, ...)
Stars: ✭ 94 (+394.74%)
Mutual labels:  tutorials
tutorials
Collection of tutorials for various libraries and technologies
Stars: ✭ 98 (+415.79%)
Mutual labels:  tutorials
GeoStatsTutorials
GeoStats.jl tutorials
Stars: ✭ 49 (+157.89%)
Mutual labels:  tutorials
analyzing-reddit-sentiment-with-aws
Learn how to use Kinesis Firehose, AWS Glue, S3, and Amazon Athena by streaming and analyzing reddit comments in realtime. 100-200 level tutorial.
Stars: ✭ 40 (+110.53%)
Mutual labels:  tutorials
ogl to vlk
Vulkan Tutorials For OpenGL Developers
Stars: ✭ 16 (-15.79%)
Mutual labels:  tutorials
react-native-curated
💁‍♂️ Hand picked collection of packages, tutorials and more for React Native.
Stars: ✭ 43 (+126.32%)
Mutual labels:  tutorials
Tutorials
Start solving PDEs in Julia with Gridap.jl
Stars: ✭ 79 (+315.79%)
Mutual labels:  tutorials

Piggy Bank

Piggy bank is tutorial web application which utilize Ethereum smart contract. It demonstrates how to use web3.js with Node.js to deploy and interact with smart contracts, create web3 application powered with smart contracts and how to test contracts with mocha.

UI screenshot

⚠️ WARNING! This is only tutorial. And not a real application. It should not be used in production.

Installation

git clone [email protected]:rumkin/piggy-bank.git
cd piggy-bank
npm i # or npm ci

It will install all required dependencies like web3, solc (solidity compiler), ethereum testnet, mocha and webserver.

Testnet

To run steps 3, 4 and 5 you need to run testnet:

node bin/testnet.js

Steps

There is several named files:

  • 1-account.js Creates secret key and balance for test net. Outputs account.json.
  • 2-compile.js Compiles contract and write result to code.json.
  • 3-deploy.js Deploy contract into testnet and write it's address to contract.json.
  • 4-run.js Run HTTP Server with simple UI to interact with contract.
  • 5-destroy.js Destroy contract and remove it from blockchain.

Repository already contains compiled template and test account. To run step 5 you need to deploy contract into testnet (4-deploy.js).

Utils

  • bin/testnet.js Run testnet.
  • bin/connect.js Connect to running testnet with web3 and get active account.

Contract

Contract allow to deposit money. Contract doesn't let owner to withdraw money until some unchangable limit is riched:

function canWithdraw() public constant returns (bool){
    return this.balance >= limit;
}

function withdraw() public isOwner {
    require(canWithdraw());

    owner.transfer(this.balance);
}

UI

UI was created with Bundler.online. It's made for demonstration it's code is autogenerated. It's source is you can find at http://bundler.online/rumkin/piggy-bank.

License

MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].