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

Refund L1 transactions #196

Closed
wants to merge 6 commits into from
Closed

Conversation

ptisserand
Copy link
Collaborator

Refunding L1 transactions

This PR add the following programs to handle refunding L1 transactions.

Please note that to use Moralis API you need to provide API key with MORALIS_API_KEY environment variable.

extract_refund

extract_refund will connect to bridge database and retrieve all deposit L1 transaction.
ETH price is retrieved through Moralis API.

Usage: extract_refund [OPTIONS] --mongodb <MONGODB> --amount-max <AMOUNT_MAX> --output <OUTPUT>

Options:
      --mongodb <MONGODB>        Mongo db connection string [env: INDEXER__MONGODB_URI=]
      --amount-max <AMOUNT_MAX>  Max amount to refund
      --output <OUTPUT>          CSV output file
      --ceil                     Ceil amount (false by default)
  -h, --help                     Print help

send_refund

send_refund will parse the provide CSV file and send STRKs to recipient.
STRK rpice is retrieved through Moralis API.

Usage: send_refund --mongodb <MONGODB> --input <INPUT> --rpc <RPC> --address <ADDRESS> --private-key <PRIVATE_KEY>

Options:
      --mongodb <MONGODB>          Mongo db connection string [env: REFUND_MONGODB_URI=]
      --input <INPUT>              CSV input file
      --rpc <RPC>                  Starknet RPC [env: STARKNET_RPC=https://sepolia.arkproject.dev]
      --address <ADDRESS>          Starknet account address [env: STARKNET_ACCOUNT_ADDRESS=0x04093cb5725f75a9b095321b11e4708034c23ce3a4cf01754287b71e9f28661a]
      --private-key <PRIVATE_KEY>  Starknet account private key [env: STARKNET_PRIVATE_KEY=0x044db9ceb7e7cdb912b9e0d59b9302c6f9fa84e55cceed4bc003c37a485ea353]
  -h, --help                       Print help

@ptisserand ptisserand requested a review from remiroyc April 22, 2024 12:03
Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
bridge-mainnet ✅ Ready (Inspect) Visit Preview Apr 22, 2024 0:03am
bridge-sepolia ✅ Ready (Inspect) Visit Preview Apr 22, 2024 0:03am

Copy link
Contributor

@remiroyc remiroyc left a comment

Choose a reason for hiding this comment

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

That sounds good to me, though I would have opened a PR on this repo solely for the indexing part (indexing the dollar price of the fees). I would have placed the refund script in another private repo, since it only concerns Everai.

@ptisserand ptisserand closed this May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants