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

v1.5.1 add token faucet function [BAC-2018] #138

Merged
merged 2 commits into from
Nov 9, 2021
Merged

v1.5.1 add token faucet function [BAC-2018] #138

merged 2 commits into from
Nov 9, 2021

Conversation

jiajames
Copy link
Contributor

@jiajames jiajames commented Nov 9, 2021

No description provided.

@linear
Copy link

linear bot commented Nov 9, 2021

BAC-2018 Add a testnet (ropsten) token faucet

This can be done by adding a new endpoint on librarian that creates a layer-2 transfer from an existing account (controlled by dYdX) to the users account. This allows users to receive testnet tokens without us having to send a layer 1 transaction that could quickly drain our Ropsten wallets of ETH. This also makes it so that users don't have to have testnet ETH to start playing around in the testnet.

Endpoint details:

  • add a "testnet" controller to librarian
  • add a single private POST endpoint tokens (full path is v3/testnet/tokens )
  • only active when config.isStaging() === true
  • takes in no arguments
  • transfer 10,000 (configurable in config) tokens to the user's account from the deposit-matcher account on staging

Extensions:

  • Can start with using the lowTrafficRateLimiter, but should ultimately have its own rate-limiter (start with 5 times per day per IP address)

Other notes (mostly product notes):

  • We still should still try and get users to on-chain register their starkKey with their ethereumAddress since otherwise they won't be able to complete slow withdrawals. This does request them to have ropsten ETH and we would have to point them to faucets such as here or here

@jiajames jiajames requested review from BrendanChou and removed request for samweinberg23 November 9, 2021 18:39
* @description requests tokens on dYdX's staging server.
* NOTE: this will not work on Mainnet/Production.
*/
async requestTestnetTokens(): Promise<{ transfer: TransferResponseObject }> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throw error if networkId is not 3?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants