-
Hello, using the Stargate contracts for the first time and have been running into issues with it during tests. test // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;
import "../src/Contract.sol";
import "forge-std/Test.sol";
contract StargateFarmingTest is Test {
StargateFarming stargate;
IEthRouter ethRouter = IEthRouter(0xbf22f0f184bCcbeA268dF387a49fF5238dD23E40);
address public addrTest = 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266;
function setUp() public {
stargate = new StargateFarming(ethRouter);
}
function testCanAddLiquidity() public {
vm.startPrank(addrTest);
stargate.addLiquidity{value:1 ether}();
}
} contract // SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "./Interfaces/IEthRouter.sol";
contract StargateFarming{
// uint16 public immutable poolId;
// address public immutable ethVault;
// address public immutable stgRouter;
IEthRouter ethRouter;
constructor(IEthRouter _ethRouter){
ethRouter = _ethRouter;
}
function addLiquidity() public payable {
ethRouter.addLiquidityETH();
}
receive() external payable {}
} It's not much because Im just trying to test with it. Another dev I work with mentioned it worked with Hardhat. When i run forge test I get fail reason revert. When i do cast send with the contract address and use the same from address, the value is sending, so Im unsure of what I am doing wrong or if this is a forge issue. Appreciate the assistance! Here is the stargate contract I made an interface from: https://arbiscan.io/address/0xbf22f0f184bccbea268df387a49ff5238dd23e40#code |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
What command are you running? Edit: Solution is
|
Beta Was this translation helpful? Give feedback.
What command are you running?
Edit: Solution is