stellar / basic-payment-app

An example payments application demonstrating integrations of various features and SEPs in a user-facing product.
https://github.com/stellar/basic-payment-app
Apache License 2.0
7 stars 11 forks source link

Enable interactions with Stellar Asset Contracts #15

Open ElliotFriend opened 1 day ago

ElliotFriend commented 1 day ago

It's possible that a user's contact list might include a contract's C... address (or many of them). When sending a payment of some asset to those contacts, we should utilize the SAC and create a transfer transaction with the invokeHostFunction operation, instead of a typical payment operation.

CollinsC1O commented 1 day ago

@ElliotFriend can i pick on this please

onlydustapp[bot] commented 1 day ago

Hi @CollinsC1O! Maintainers during the ODHack # 8.0 will be tracking applications via OnlyDust. Therefore, in order for you to have a chance at being assigned to this issue, please apply directly here, or else your application may not be considered.

Josh-121 commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

sotware engineering background and smart contract dev with esperience in working in similar issues in last hackthons(https://app.onlydust.com/u/Josh-121). looking to make first contribution here!!

How I plan on tackling this issue

Identify Contract Addresses in User's Contact List:

Modify the logic to check the user’s contact list for any contract addresses that start with "C" (or other relevant identifiers). Create a function that filters and identifies these contract addresses from the user’s contacts. Utilize the SAC (Smart Asset Controller):

Integrate the Smart Asset Controller (SAC) into the payment workflow. Ensure the SAC is capable of handling both traditional payments and transfer transactions for contracts. Implement invokeHostFunction:

When a payment is initiated, check if any of the recipients are contract addresses. If a recipient is a contract address: Use the invokeHostFunction operation to create a transfer transaction. Pass necessary parameters such as the contract address, asset type, amount, and any additional data required by the contract. Transaction Creation Logic:

Develop a function to encapsulate the logic for creating transactions. This should differentiate between standard payment operations and transfer transactions using the SAC. Handle any specific parameters or formats needed for invokeHostFunction. Error Handling:

Implement robust error handling for transaction failures, especially when interacting with contracts. Ensure that the user is notified of any issues and can retry the transaction if necessary.

work on feedback/recommendations

CollinsC1O commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I'm a front-end and also a blockchain developer. I will love to work on this

ScottyDavies commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have a solid background in blockchain development and smart contract integration, with experience in implementing transaction operations in decentralized applications

How I plan on tackling this issue

To address this problem, I would:

Update the logic to check if any contact addresses in the user's list are contract addresses.

Implement the necessary functionality to utilize the Smart Asset Contract (SAC) for transfers.

Change the payment operation to create a transfer transaction using the invokeHostFunction operation for those contacts identified as contracts.

Thoroughly test the new functionality to ensure that transfers to contract addresses are executed correctly and securely.

Update any relevant documentation to reflect the changes in the payment process.

ShantelPeters commented 1 day ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

i am a blockchain developer / technical writer i will like to take up this issue, kindly assign

How I plan on tackling this issue

To approach this problem i will modify the payment functionality to check for C... addresses in the user's contact list. If a C... address is detected, utilize the SAC to create a transfer transaction that employs the invokeHostFunction operation instead of the standard payment operation, ensuring proper handling of contract interactions.

josephchimebuka commented 55 minutes ago

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

Hello @ElliotFriend I am Joseph I am a Software developer and blockchain developer and I am also an active contributor here on only dust here is my profile https://app.onlydust.com/u/josephchimebuka. This is my first time to contribute to this repo ill appreciate the opportunity to contribute.

How I plan on tackling this issue

To solve this, I will first detect when a user's contact list contains a contract's C... address. If such an address is selected for sending a payment, I will modify the payment process to use the Stellar Asset Contract (SAC). Instead of performing a standard payment operation, I will create a transfer transaction by utilizing the invokeHostFunction operation. This will enable the correct transfer of assets to the contract address. I will ensure that this logic is incorporated into the transaction creation flow and thoroughly test it to verify that payments to contract addresses work as expected.