Does anyone know the best practices to import older versions of solidity? For example, I want to use a Uniswap V3 interface (0.7.6) with my project that is 0.8.15. What is the best way to do this with foundry?

Jul 13, 2022, 12:34 PM
That should happen easily without workarounds, what's the issue you are facing?
Jul 13, 2022, 1:24 PM
If your question is about the framework, then in Hardhat config there's an option for specifying multiple compilers.
Jul 13, 2022, 1:29 PM
Found a solution on how to integrate uniswap V3 with your solidity 0.8.x projects. Uniswap has a 0.8 branch on the v3-core and v3-periphery repositories. Make a fork of the repositories and make the 0.8 branch the main branch. Works in foundry and on remix with an anvil fork of mainnet.
Jul 13, 2022, 7:20 PM
I usually just make a file containing the relevant parts of the interface
It's easy to upgrade the 2 function signatures you're actually doing to use to a newer solidity version
I just learned that V3's master branch is called 'main'. Would already stop using it just bc of that bullshit
If they do, consider the possibility that your hash might mismatch, e.g. bc metamask only signs hashes of prefixed messages (metamask performs the prefixing and the hashing; the caller has no control over this)
Jul 13, 2022, 9:41 PM
If it's only 3 wallets no need to even code something ad hoc for it
Or you could always make a script where you do that with web3/ethers
But if it's 3 wallets also doing that in the naive way through metamask takes at most 1 minute
English here
Jul 14, 2022, 12:02 AM

© 2024 Draquery.com All rights reserved.