Git Product home page Git Product logo

token-printer's Introduction

Proof of Work Transfer Faucet

Try it out: https://near-examples.github.io/token-printer/

It consists of 2 parts:

Transfer Faucet contract

A Faucet contract allows to transfer tokens to a desired account for doing required Proof of Work. This contract is based on PoW faucet example: https://github.com/near-examples/pow-faucet

The transfer amount is set to 100N tokens. It's enough to deploy a 1Mb contract.

Proof of Work works the following way:

You need to compute a u64 salt (nonce) for a given account in such a way that the sha256(account_id + ':' + salt) has at the amount of leading zero bits as the required min_difficulty. The hash has to be unique in order to receive transfer. One account can request multiple transfers.

Faucet frontend

Allows to enter the account ID to receive transfer. And it computes the Proof of Work required by the contract using front-end JS.

https://near-examples.github.io/token-printer/

Testing

To test run:

cargo test

token-printer's People

Contributors

amgando avatar chadoh avatar dependabot-preview[bot] avatar doriancrutcher avatar evgenykuzyakov avatar janedegtiareva avatar mikedotexe avatar thisisjoshford avatar

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.