Skip to content

near-examples/token-printer

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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