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

Route FlowToken requests to WFLOW #134

Open
sisyphusSmiling opened this issue Nov 14, 2024 · 1 comment · May be fixed by #137
Open

Route FlowToken requests to WFLOW #134

sisyphusSmiling opened this issue Nov 14, 2024 · 1 comment · May be fixed by #137
Assignees

Comments

@sisyphusSmiling
Copy link
Contributor

Issue To Be Solved

Currently, WFLOW is blocked from being bridged to Cadence since it only exists as an ecosystem primitive in EVM without analogous use case in Cadence. Additionally, moving FLOW between VMs via the bridge is only allowed en route to EVM and is blocked on the route back to Cadence. This is a fragmented pattern and can create unclear edge cases.

Proposed solution

Since there exists a native interface for depositing & withdrawing FLOW between VMs without reliance on the bridge, the proposed solution involves treating requests to move FLOW between VMs via the bridge as requests to wrap & unwrap FLOW.

Moving FLOW from Cadence -> EVM: Wraps FLOW and deposits in EVM to the named recipient
Moving FLOW from EVM -> Cadence: Unwraps FLOW from the calling COA returns a FlowToken Vault

The only caveat here is to check with Flow Wallet and Flow Port to ensure that they use the intended interface to bridge FLOW - via EVM.EVMAddress.deposit() and are not using the bridge to deposit FLOW to EVM recipients. This is likely to be true, but deserves a quick discovery.

@sisyphusSmiling sisyphusSmiling self-assigned this Nov 14, 2024
@sisyphusSmiling sisyphusSmiling moved this to 🔖 Ready for Pickup in 🌊 Flow 4D Nov 14, 2024
@Kay-Zee Kay-Zee moved this from 🔖 Ready for Pickup to 🏗 In Progress in 🌊 Flow 4D Dec 6, 2024
@sisyphusSmiling sisyphusSmiling linked a pull request Dec 6, 2024 that will close this issue
6 tasks
@sisyphusSmiling
Copy link
Contributor Author

sisyphusSmiling commented Dec 6, 2024

Following #137, the following steps will be required to enable FlowToken <> WFLOW handling:

  1. Update bridge contracts affected by Add wflow handler #137
    1. FlowEVMBridgeUtils
    2. FlowEVMBridgeConfig
    3. FlowEVMBridgeHandlerInterfaces
    4. FlowEVMBridgeHandlers
    5. FlowEVMBridge
  2. Remove current FLOW association with origination EVM address from FlowEVMBridgeConfig.registeredTypes & .evmAddressHexToType
  3. Add WFLOWTokenHandler to FlowEVMBridgeConfig.typeToTokenHandlers
  4. Enable WFLOWTokenHandler

@Kay-Zee Kay-Zee moved this from 🏗 In Progress to 👀 In Review in 🌊 Flow 4D Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Status: 👀 In Review
Development

Successfully merging a pull request may close this issue.

1 participant