ourovoros-io / charcoal

A Solidity to Sway translator written in Rust.
13 stars 7 forks source link

translate under hardhat framework #6

Open zxzyy10 opened 1 week ago

zxzyy10 commented 1 week ago

I am trying to use the tool to translate UniswapV3 code, and I have encountered the following two issues:

1 In Hardhat, when importing files from node_modules, the paths are not recognized. I need to change them to relative paths for them to be recognized. For example:

import '@openzeppelin/contracts/math/SafeMath.sol';

needs to be changed to:

import '../node_modules/@openzeppelin/contracts/math/SafeMath.sol';

2 Some structures cannot be recognized, causing the program to panic and terminate execution.

1732075543389

My suggestion is to consider using UniswapV3 as a test case, since many applications rely on the concentrated liquidity AMM mechanism proposed by UniswapV3 for price discovery and liquidity management. If the tool can effectively translate the main contracts of UniswapV3 (with any unimplemented parts marked with TODO), it would make Charcoal an excellent tool for developers to improve efficiency.

camden-smallwood commented 1 week ago

Thanks for pointing these out, we will add UniswapV3 to our test coverage and will attempt to get these resolved as soon as possible.

zxzyy10 commented 1 day ago

Thanks for pointing these out, we will add UniswapV3 to our test coverage and will attempt to get these resolved as soon as possible.

I tried new version today,and still face some issue

I'm not sure if this latest version supports the Uniswap V3 series of contracts, or if it's still in the testing phase.

image

GeorgiosDelkos commented 1 day ago

Hi there @zxzyy10 as @camden-smallwood pointed out we are actively working on fixing those issues and have the uniswap v2-3-4 translating. We are going to update the issue as soon as we fix everything for uniswap. Thank you