Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

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

deprecated-near-examples/token-printer

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…..

Topics

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