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

Implement Multisend Transaction Capability #13

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

PriyanshuVijay-S
Copy link

Overview

This pull request introduces enhancements to the ConditionalNativeTransferBehaviour within our ABCI learning agent to support multisend transactions. This feature allows the agent to bundle native token transfers and ERC20 deposits into a single transaction, leveraging Gnosis Safe's multisend capabilities for improved efficiency and reduced transaction costs.

Changes

  • ConditionalNativeTransferBehaviour: Expanded to include a method for creating multisend transactions that combine native token transfers and ERC20 contract deposits. This method coordinates the collection of necessary transaction data and submits it as a single multisend transaction.

  • get_multisend_safe_tx_hash: Updated to handle multiple types of transaction data, specifically for native transfers and ERC20 deposits. This method now packages these transactions into one multisend call.

  • _build_safe_tx_hash: Modified to process and execute the multisend transaction data prepared by get_multisend_safe_tx_hash.

cpp-priyanshu added 9 commits December 1, 2024 04:05
…nents

This commit introduces the ERC20_NEW contract package into the contracts folder, featuring the new class ERC20_NEW designed to enhance our ABCI learning agents with updated token handling capabilities. Changes span across several components to ensure comprehensive integration:

1. **Contracts:**
   - Added ERC20_NEW class in the erc20_new package to manage interactions with ERC20 tokens more effectively.

2. **Agent Configuration:**
   - Updated �ea-config.yaml to reference the new ERC20_NEW contract, ensuring that the agent recognizes and utilizes this new contract class.

3. **Service Configuration:**
   - Modified service.yaml to include configurations that align with the changes in the ERC20_NEW contract operations.

4. **Skill Updates:**
   - Updated skill.yaml in both skill/learning_abci and skill/learning_chained_abci to ensure skills are compatible with the new contract functionalities.
   - Revised behaviors in �ehaviours.py to incorporate methods from ERC20_NEW for enhanced token transactions.

These updates ensure that our learning agents are well-equipped to handle ERC20 token transactions with the latest contract logic, reflecting improved efficiency and compliance with current blockchain standards.
- Extend ConditionalNativeTransferBehaviour to handle conditional deposits into an ERC20 contract.
- Add logic to deposit native coins based on the parity of the calculated transaction value.
- Update contract.py in erc20_new and behaviours.py in skill/learning_abci with new deposit functionality.
…actions

This commit updates the ConditionalNativeTransferBehaviour to bundle native token transfers and ERC20 deposits into a single multisend transaction. It modifies the get_multisend_safe_tx_hash function to accept both native transfer and ERC20 deposit data. This integration allows for more efficient transaction processing and cost optimization by executing both actions in a single blockchain transaction.

Changes:
- Modified ConditionalNativeTransferBehaviour to support gathering data for native and ERC20 transactions.
- Updated get_multisend_safe_tx_hash to handle the packaging of multiple transaction data.
- Integrated _build_safe_tx_hash to create the actual multisend transaction from the prepared data.
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.

1 participant