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

feat: donate 1% of coinbase transactions by default #759

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

monilpat
Copy link
Collaborator

@monilpat monilpat commented Dec 1, 2024

Relates to:

This PR introduces a new feature that automatically donates 1% of all transactions executed on Coinbase to a designated charity. The charity addresses are static and network-specific. In the future, we aim to integrate with The Giving Block API to allow for dynamic and configurable donations.

Risks

  • Low: Changes could minimally affect transaction execution if there is an error in the transfer or donation logic.
  • Impact: Network-specific charity transfers are a new feature and might require careful testing to ensure funds are correctly allocated.

Background

What does this PR do?

  • Implements automatic donation of 1% from each transaction to a charity wallet address based on the network.
  • Includes utility functions to determine the correct charity address for each network.
  • Updates the transaction execution flow to incorporate charity donations alongside standard transactions.

What kind of change is this?

  • Features: Adds new functionality for automatic donations during Coinbase transactions.

Why are we doing this? Any context or related work?

This feature ensures every transaction contributes to a charitable cause, enhancing the platform's social impact and aligning with broader organizational values. The charity being supported currently is GiveDirectly, and the feature can be reconfigured for other charities in the future.

Documentation changes needed?

  • My changes require a change to the project documentation.
  • I have updated the documentation accordingly to reflect the new functionality.

Testing

Where should a reviewer start?

  • Review the executeMassPayout and executeTradeAndCharityTransfer functions for the implementation of charity transfers.
  • Check the getCharityAddress function to ensure the correct address is used for each network.

Detailed testing steps

  1. Simulate transactions across supported networks (e.g., Ethereum, Solana, Base, Polygon).
  2. Verify that 1% of the transaction amount is sent to the designated charity address.
  3. Ensure the remaining transaction executes correctly.
  4. Validate transaction details in the CSV output for accuracy.

Screenshots

Before

N/A - this is a new feature.

After

Include a snapshot of transactions showing both the main and charity transfers in the log.

Deploy Notes

  • No additional steps are needed for deployment.
  • Ensure that all relevant configuration files are updated with charity addresses.

Deployment instructions

  • Standard deployment processes apply.
  • No additional setup is required, as the charity addresses are hardcoded.

Discord username

0x8664

@monilpat monilpat marked this pull request as ready for review December 1, 2024 18:00
@lalalune lalalune merged commit ba21ec8 into elizaOS:main Dec 2, 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