Azoyalabs / avalanche_hackathon

https://avalanche-hackathon-web.vercel.app
0 stars 1 forks source link

Handle Token Transfers - Transfer from Receiver to Summit or merge contracts #5

Closed Wally869 closed 8 months ago

Wally869 commented 8 months ago

In current workflow, the Receiver contract is the one receiving tokens.

Need to either transfer these tokens to the Summit contract or merge Receiver and Summit contracts. Added benefit of merging is a simplified instantiation process

Wally869 commented 8 months ago

Could also set the Receiver as a proxy for balances and call methods from Summit for transfers

Wally869 commented 8 months ago

related https://github.com/Azoyalabs/avalanche_hackathon/issues/8

Wally869 commented 8 months ago

From discussion with @MBeliou intent is to minimize the number of contracts interacted with, so:

Wally869 commented 8 months ago

I think the proxy approach, with the Receiver being the one storing funds and the Summit contract handling the tracking of funds and withdrawals (and so calling receiver to do the actual sends) is the best approach

Wally869 commented 8 months ago

Set up the CCIPReceiver as a proxy to distribute funds in 1cd84a581770e9171d0812ec135dea14c28de6f9 A first test has been set in that commit (withdrawal after someone bought access to a paying article).

Will add more tests to validate this new feature is working properly:

Wally869 commented 8 months ago

Added final tests in 293a96f13d974d35acfea5f93fe44e696236b0f9 (multiple steps tests)