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

[BUG] Improper import alias replacements on execution (or generation) #85

Open
sisyphusSmiling opened this issue Nov 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@sisyphusSmiling
Copy link

Current Behavior

Executing this generated template (generated with flow flix generate ...) results in error

error: unexpected token in import declaration: got decimal integer, expected string, address, or identifier
 --> :3:16
  |
3 | import EVM from 8c5303eaa26202d6

Updating the template at line 683 from

"address": "8c5303eaa26202d6",

to

"address": "0x8c5303eaa26202d6",

results in successful execution. This makes me think that the error lies in how the aliased imports are replaced.

Expected Behavior

I would expect the generated template to execute successfully

Steps To Reproduce

From a project root with a Testnet address properly configured and funded from Faucet, run

flow flix execute https://raw.githubusercontent.com/onflow/batched-evm-exec-example/refs/heads/gio/add-flix/cadence/flix/wrap_and_mint.flix.json \
  0xd3bF53DAC106A0290B0483EcBC89d40FcC961f3e \
  0xdbC43Ba45381e02825b14322cDdd15eC4B3164E6 \
  --signer testnet-signer \
  -n testnet

And you'll see the reported error

Environment

- OS: MacOS Sonoma 14.7
- Flow CLI: v2.0.10

What are you currently working on that this is blocking?

Generating a FLIX template for this example repo

@sisyphusSmiling sisyphusSmiling added the bug Something isn't working label Nov 8, 2024
@sisyphusSmiling sisyphusSmiling moved this to 🆕 New in 🌊 Flow 4D Nov 8, 2024
@bthaile
Copy link
Contributor

bthaile commented Nov 13, 2024

Thanks for reporting. The issue is contract dependencies are passed in based on flow.json. These addresses are missing "0x" prefix. flixkit needs to verify dependency addresses are formatted correctly to be used to replace "string" imports.

@bthaile bthaile moved this from 🆕 New to 🏗 In Progress in 🌊 Flow 4D Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

2 participants