GithubHelp home page GithubHelp logo

plegge / duperchat Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 312 KB

A SmartContract on Ethereum for donations where the donators can also leave a message

Solidity 9.37% JavaScript 71.74% HTML 12.07% CSS 6.83%
ethereum

duperchat's Introduction

Duperchat

A Smart Contract on Ethereum for donations where the donators can also leave a message to the receivers. Messages are stored in IPFS.

Donate Contract

For now, the person that deploys the contract is the owner of the contract.

Public Methods

Returns the balance the contract contains (in native currency):

getTotalBalance()

Returns the total messages the contract received:

getTotalMessages() uint

Get the message based on a position in the array. The current POC is saving messages on IPFS. The message in the array will be an address from IPFS pointing to the content of the message.

getMessage(uint index) string

Send a message via the Payable function, with the amount you want to donate.

sendMessage(string message)

Owner Methods

To withdraw the balance from the contract to the owners's address

withdrawBalance()

Next Steps:

  • Create a contract that creates Donate contracts and uses aliases to find them
  • Increase security or remove in Donate.setOwner
  • Contract pause
  • On withdraw, send a percentual to the main contract
  • Create a Proxy Contract
  • Cleanup frontend POC
  • Actions for build and deploy frontend

Development

For development, this project uses Hardhat. Try running some of the following tasks:

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
node scripts/sample-script.js
npx hardhat help

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.