When I attempted to compile, it threw up an error stating that when passing stakingparam in, it needed to be a struct, enum or contract, even though I thought I defined it above?

struct AddLiquidityParams {
        address token0;
        address token1;
        uint24 fee;
        address recipient;
        int24 tickLower;
        int24 tickUpper;
        uint256 amount0Desired;
        uint256 amount1Desired;
        uint256 amount0Min;
        uint256 amount1Min;

AddLiquidityParams stakingParam = AddLiquidityParams(0xdAC17F958D2ee523a2206206994597C13D831ec7,0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2, 0.3, 0x7858e59e0c01ea06df3af3d20ac7b0003275d4bf,34,34,address(this).balance,uSDT.balanceOf(address(this)));

function stakeCombinedLiquidity(stakingParam) public {
      liquidityM.addLiquidity(stakingParam);//liquidityM is an imported solidity file, didn't put the whole file in so I cropped only the parts I assumed were involved.

  • Please try this function stakeCombinedLiquidity(AddLiquidityParams stakingParam) public
    – trizin
    Commented Jun 30, 2021 at 12:19
  • Hi, Sorry for the late reply, but then this error shows up. This declaration shadows an existing declaration. Thanks
    – AFDS
    Commented Jul 2, 2021 at 3:00


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.