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

Flow VM Bridge FLIP #233

Merged
merged 40 commits into from
Apr 24, 2024
Merged

Flow VM Bridge FLIP #233

merged 40 commits into from
Apr 24, 2024

Conversation

franklywatson
Copy link
Contributor

No description provided.

@franklywatson franklywatson changed the title Add initial draft of Flow VM Bridge FLIP Flow VM Bridge FLIP Dec 22, 2023
@franklywatson franklywatson marked this pull request as draft December 22, 2023 20:46
@sisyphusSmiling sisyphusSmiling marked this pull request as ready for review January 6, 2024 00:36
@sisyphusSmiling sisyphusSmiling self-assigned this Jan 6, 2024
@sisyphusSmiling sisyphusSmiling added the flip: application Application FLIP label Jan 6, 2024
application/20231222-evm-vm-bridge.md Outdated Show resolved Hide resolved
application/20231222-evm-vm-bridge.md Outdated Show resolved Hide resolved
application/20231222-evm-vm-bridge.md Show resolved Hide resolved
application/20231222-evm-vm-bridge.md Outdated Show resolved Hide resolved
application/20231222-evm-vm-bridge.md Show resolved Hide resolved
application/20231222-evm-vm-bridge.md Outdated Show resolved Hide resolved
@franklywatson
Copy link
Contributor Author

Marked this FLIP as proposed

@cybercent
Copy link

cybercent commented Mar 13, 2024

In order to bridge an NFT or FT from Flow VM to Flow EVM does the developer need to write and deploy a solidity contract on Flow EVM to match his Cadence contract ?

Assuming an NFT was bridged from Flow VM to Flow EVM. If that token changes owners (through a solidity marketplace contract for example) what events would be triggered on Flow? The events/logs on the solidity contract, the NFT transfer events in the Flow NFT standard, both , or some others ?

@sisyphusSmiling
Copy link
Contributor

In order for a user to be able to bridge an NFT or FT from Flow VM to Flow EVM does the developer need to write and deploy a solidity contract on Flow EVM to match the Cadence contract of that NFT or FT?

A corresponding EVM contract must exist, but the bridge deploys it on "onboarding". This is done so that the bridge can mint in the target (non-native) VM. The bridge takes a Cadence type, assesses whether it's an NFT or FT, then calls into an EVM factory contract that deploys an ERC721/ERC20 with identifying information about the corresponding Cadence asset. The bridge then retains an association between the Cadence type and the corresponding bridge-deployed EVM contract.

Assuming an NFT was bridged from Flow VM to Flow EVM. If that token changes owners (through a solidity marketplace contract for example) what events would be triggered? Are any events triggered on the Flow VM side or only on the Flow EVM side ?

On bridging from Cadence -> EVM, the NFT is locked in bridge escrow. Fulfillment of the bridge request emits an event (in Cadence) identifying the type, id, evm ID, recipient, and ERC721 defining contract.
Once in EVM, the NFT can be transferred like any ERC721, emitting all the associated ERC721 standard events in EVM. Upon bridging back, the current owner of the ERC721 token must initiate the bridge request from EVM -> Cadence as the ERC721 contract remains the source of truth on the NFT's ownership. As part of that bridge request, the ERC721 is transferred to the bridge's COA, effectively escrowing the EVM NFT, transfer is validated, and the originally escrowed Cadence NFT is unlocked and returned to the caller. A corresponding event is also emitted (in Cadence) with identifying info about the bridging request, namely type, id, EVM ID, calling COA EVM address, and defining ERC721 address.

Copy link
Member

@ramtinms ramtinms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice design 👏

@sisyphusSmiling sisyphusSmiling merged commit 88eaec3 into main Apr 24, 2024
@sisyphusSmiling sisyphusSmiling deleted the flow-evm-vm-bridge branch April 24, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flip: application Application FLIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants