Giter Site home page Giter Site logo

omodaka9375 / time-based-switch-on-ethereum Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 3.39 MB

Draft proposal for a standardized way to delay or schedule transactions based on block.timestamp

License: MIT License

HTML 8.36% JavaScript 44.08% CSS 13.52% Solidity 14.40% TypeScript 19.65%
ethereum-dapp ethereum deadmanswitch

time-based-switch-on-ethereum's Introduction

Time-Based Switch on Ethereum Blockchain

This is a simple demo implementing Time-Based Switch on Ethereum Blockchain. TimeBasedSwitch.sol smart contract provides standard methods and processes for safe transactions based on block.timestamp. This enables users to secure their accounts from lockout by predefining fallback addresses to transfer the funds after the predefined time.

It includes a minimalistic front-end built using Truffle.

Inspiration: Google's Inactive Account Manager allows the account holder to nominate someone else to access their services if not used for an extended period.

Source: https://en.wikipedia.org/wiki/Dead_man%27s_switch

Team

Branislav Đalić
Mališa Pušonja
Ivor Jugo
Marko Kolašinac
Andrej Rakić

How will it work here?

Flowchart

Time Based Switch Flowchart

Entities

Time Based Switch Entities

Requirements

Node.js version +5 Truffle v12

Installation

Install ganache and truffle

npm install -g truffle

Run it

npm run dev

License

This project is licensed under the MIT License

time-based-switch-on-ethereum's People

Contributors

absolutespace avatar alex-precosky avatar andrejrakic avatar dependabot[bot] avatar gfnord avatar ivorrr avatar omodaka9375 avatar tsuianthonyvr avatar

Watchers

 avatar  avatar  avatar

time-based-switch-on-ethereum's Issues

Hook truffle box front-end

This project has ReactJS trufflebox on the frontend.
All JS and HTML files are already there.

Hook JS functions with contract and parse user input.

Refactor getUnlockTime function

  • Rename function from getUnlockTime to getSwitchInfo.
  • getSwitchInfo should now return the owners switch object instead of just unlock timestamp

Proper function and variable visibility

withdrawToken and withdrawCollectible functions should be marked as private as they only need to be accessible to the contract itself.
users mapping should be changed to internal as we will need to access it from other derived contracts.

Use this logic of private vs internal to mark functions/variables that need to be accessible by derived bussines layer contract in the future.

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.