Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a GörliETH faucet for our dapp #18

Open
streamerd opened this issue Oct 2, 2022 · 1 comment
Open

Create a GörliETH faucet for our dapp #18

streamerd opened this issue Oct 2, 2022 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@streamerd
Copy link
Member

Hey fam,

we'd like to create a faucet contract, and then link that to our dapp @ https://expressionsofpeace.org
so that any individual that'd like to express peace, can receive enough test ethereum for write operations @ Görli network.

why?
we'd like only metamask setup being a hurdle in this, peacemaking activities and our dapp giving more seamless experience for ones that are new to web3/blockchain technologies.
also, they need to verify their email with an alchemy account @ official goerli faucet, so we'd rather make it even easier.

what else'd be there?
however, what we'd also like to include next, is creating an invite-by-send-testEth concept, so wait for it..
// let there be rock!

@streamerd streamerd added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 2, 2022
@streamerd streamerd changed the title Create a GörliETH faucet Create a GörliETH faucet for our dapp Oct 2, 2022
@streamerd
Copy link
Member Author

streamerd commented Oct 6, 2022

Gonna use something like this, but need to figure out a few things beforehand. Here's the original post.

// Author: Janusz Chudzynski
pragma solidity >=0.4.22 <0.9.0;
	
contract GoerliFaucet {
	 
 mapping(address=>uint) lastTransfers;
 uint amountToWithdraw = 10 ** 18 * 0.001;
	
 function requestTokens(address payable requestor) external {
  uint lastTransfer = lastTransfers[requestor];
	 
  require(lastTransfer  + 1 hours <= block.timestamp, "Patience is a virtue. You already requested funds hour ago");
	    
  require(address(this).balance >= amountToWithdraw, "Not enough funds in the faucet. Please donate");
	
  requestor.transfer(amountToWithdraw);
  lastTransfers[requestor] = block.timestamp;
  }
	
 function getBalance() public view returns (uint) {
   return address(this).balance;
  }
	
  receive() external payable {}
  fallback() external payable {}
	
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
Status: No status
Development

No branches or pull requests

1 participant