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

Add support for onboard + bridge where possible #43

Closed
sisyphusSmiling opened this issue Apr 19, 2024 · 2 comments · Fixed by #44
Closed

Add support for onboard + bridge where possible #43

sisyphusSmiling opened this issue Apr 19, 2024 · 2 comments · Fixed by #44

Comments

@sisyphusSmiling
Copy link
Contributor

Issue To Be Solved

The need to onboard in a distinct transaction creates UX friction and we would like to alleviate this friction where possible. The limitation when bridging from EVM to Cadence is one related to the availability of deployed contract. A Cadence contract is not available in the runtime until after the deployment transaction has been executed. In order to bridge an asset from EVM to Cadence, a defining bridge-owned contract must exist in the runtime from which a corresponding asset can be minted. However, since the defining contract isn't available until after the deploying transaction, the deployment and bridge transaction must then be separate, thus breaking the atomicity of the desired transaction.

Suggest A Solution

Explore if this limitation also exists for the EVM -> Cadence bridging path. If it does not, add support for onboard + bridge transactions along with test cases.

Context

Aligns with ongoing wallet product work
cc @JeffreyDoyle @lmcmz

@bluesign
Copy link

bluesign commented Apr 20, 2024

A Cadence contract is not available in the runtime until after the deployment transaction has been executed.

Little unorthodox but there can be few workarounds for that, such as you can mint and send on init, or callback etc. I will check bridge template contract, but should not be so hard.

@sisyphusSmiling
Copy link
Contributor Author

sisyphusSmiling commented Apr 22, 2024

Ah interesting idea @bluesign!

Update: After some discussion and brainstorming, it seems the limitation here is that a contract's init() block isn't executed until the end of a deployment transaction. This discord thread raised the question of changing that fact, but that will require more investigation. For now, my vote is to address this in the Cadence -> EVM path in #44 and put the issue of EVM -> Cadence in the backlog

@sisyphusSmiling sisyphusSmiling moved this from Todo to In Progress in FlowEVM Bridge Apr 22, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in 🌊 Flow 4D Apr 29, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in FlowEVM Bridge Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants