OurBank – 我行区块链毕设代写

区块链毕设代写本文提供国外最新区块链项目源码下载,包括solidity,eth,fabric等blockchain区块链,OurBank – 我行区块链毕设代写 是一篇很好的国外资料

OurBank

Own your bank, DIY, powered by blockchain

OurBank is a simple bank smartcontract written in solidity. Own your finance, own your bank !

Features

  • Enroll user
  • Deposit Eth
  • Withdraw Eth
  • Check balance
  • Tests included

Tech

OurBank uses a number of open source projects to work properly:

  • truffle – The most popular development framework for Ethereum with a mission to make your life a whole lot easier !
  • web3.js – web3.js is a collection of libraries that allow you to interact with a local or remote ethereum node using HTTP, IPC or WebSocket.
  • ganache – Quickly fire up a personal Ethereum blockchain which you can use to run tests, execute commands, and inspect state while controlling how the chain operates.
  • solidity – Solidity is an object-oriented, high-level language for implementing smart contracts.
  • mochajs – Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun.
  • chai – Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
  • Openzeppelin Test Environment – Blazing fast smart contract testing. One-line setup for an awesome testing experience.
  • Openzeppelin Test Helpers – Assertion library for Ethereum smart contract testing. Make sure your contracts behave as expected!

Installation

OurBank requires Node.js v10+ to run.

Install the dependencies and devDependencies and start the server.

npm i

Compile the project

In order to compile the project, open your terminal and run the following command :

truffle compile

Run tests

In order to run the tests, open your terminal and run the following command :

npm test 

NB : make sure to compile before

Useful testing snippets

  • Test files headers
const { accounts, contract } = require('@openzeppelin/test-environment'); const Web3 = require('web3'); const { assert } = require('chai'); const { expectRevert, expectEvent, balance } = require('@openzeppelin/test-helpers'); const OurBank = contract.fromArtifact('OurBank'); // Loads a compiled contract  const ether = 10 ** 18; // 1 ether = 1000000000000000000 wei const [owner, alice, bob] = accounts; const OurBank = contract.fromArtifact('OurBank'); // Loads a compiled contract
  • Empty test body
describe("OurBank", () => {     it("should check something", async () => {     }); });
  • Deploy an instance of our contract
//const OurBank = contract.fromArtifact('OurBank'); describe("OurBank", () => {     it("should check something", async () => {         const bank = OurBank.new({from: owner});     }); });

Deploy on Ganache-CLI

  1. run a ganache-cli instance :
ganache-cli -p 8545
  1. Migrate :
truffle migrate --network development
  1. Open the truffle console :
truffle console

License

MIT

Free Software, Hell Yeah!

Join our community :

  • Discord
  • Twitter
  • LinkedIn
  • Medium
  • Youtube

add test cannot withdraw more than balance


我们的银行

拥有自己的银行,DIY,以区块链blockchain为动力

我们的银行是一个简单的银行合同,是用实体写的。拥有你的财务,拥有你的银行

功能

  • 注册用户
  • 存款Eth
  • 提取Eth
  • 测试包括
  • truffle-最流行的以太坊eth开发框架,其使命是让您的生活更轻松

技术

我们的银行使用许多开源项目来正常工作:

  • web3.js-web3.js是一组库,允许您使用HTTP、IPC或WebSocket与本地或远程以太坊eth节点进行交互
  • ganache-快速启动个人以太坊eth区块链blockchain,您可以使用它运行测试、执行命令和检查状态,同时控制链的运行方式
  • chai-chai是一个用于节点和浏览器的BDD/TDD断言库,可以与任何javascript测试框架完美结合以太坊eth智能合约测试的断言库。确保你的合同按预期执行
  • 测试文件头
  • 空测试体
  • 部署我们合同的实例
  • 运行ganache cli实例:
  • 迁移:

安装

我们的银行需要Node.jsv10+来运行

安装依赖项和devdependency并启动服务器

npm i

编译项目

要编译项目,请打开终端并运行以下命令:

truffle compile

运行测试

要运行测试,请打开终端并运行以下命令:

npm test 

NB:请确保在MIT自由软件之前编译,耶

有用的测试片段

  • 打开truffle控制台:
const { accounts, contract } = require('@openzeppelin/test-environment'); const Web3 = require('web3'); const { assert } = require('chai'); const { expectRevert, expectEvent, balance } = require('@openzeppelin/test-helpers'); const OurBank = contract.fromArtifact('OurBank'); // Loads a compiled contract  const ether = 10 ** 18; // 1 ether = 1000000000000000000 wei const [owner, alice, bob] = accounts; const OurBank = contract.fromArtifact('OurBank'); // Loads a compiled contract
  • Discord
describe("OurBank", () => {     it("should check something", async () => {     }); });
  • Twitter
//const OurBank = contract.fromArtifact('OurBank'); describe("OurBank", () => {     it("should check something", async () => {         const bank = OurBank.new({from: owner});     }); });

部署到Ganache CLI

  1. LinkedIn
ganache-cli -p 8545
  1. Medium
truffle migrate --network development
  1. Youtube
truffle console

许可证

加入我们的社区:

Free Software, Hell Yeah!

Join our community :

  • Discord
  • Twitter
  • LinkedIn
  • Medium
  • Youtube

add test cannot withdraw more than balance

部分转自网络,侵权联系删除区块链源码网

www.interchains.cc

https://www.interchains.cc/22112.html

区块链毕设网(www.interchains.cc)全网最靠谱的原创区块链毕设代做网站 部分资料来自网络,侵权联系删除! 最全最大的区块链源码站 ! QQ3039046426
区块链知识分享网, 以太坊dapp资源网, 区块链教程, fabric教程下载, 区块链书籍下载, 区块链资料下载, 区块链视频教程下载, 区块链基础教程, 区块链入门教程, 区块链资源 » OurBank – 我行区块链毕设代写

提供最优质的资源集合

立即查看 了解详情