Skip to content

Faucet using Proof of Work to distribute Ⓝ. The token printer goes BRRR…

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE
Notifications You must be signed in to change notification settings

crackerli/open-shards-faucet

 
 

Repository files navigation

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

About

Faucet using Proof of Work to distribute Ⓝ. The token printer goes BRRR…

Resources

License

MIT, Apache-2.0 licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 47.6%
  • Rust 42.0%
  • HTML 8.7%
  • Other 1.7%