diff --git a/contracts/strategies/G3MStrategy.sol b/contracts/strategies/G3MStrategy.sol index 8f15f8f3..1d4264e8 100644 --- a/contracts/strategies/G3MStrategy.sol +++ b/contracts/strategies/G3MStrategy.sol @@ -212,16 +212,14 @@ contract G3MStrategy is IG3MStrategy { ); } - function getStrategyData( - address controller, - uint256 reserveX, - uint256 weightX, - uint256 price - ) + function getStrategyData(bytes memory data) external pure returns (bytes memory strategyData, uint256 initialX, uint256 initialY) { + (address controller, uint256 reserveX, uint256 weightX, uint256 price) = + abi.decode(data, (address, uint256, uint256, uint256)); + strategyData = abi.encode(controller, weightX); initialX = reserveX; initialY = G3MStrategyLib.computeReserveInGivenPrice( diff --git a/test/TestG3MCreatePool.t.sol b/test/TestG3MCreatePool.t.sol index a7306d2b..f7811115 100644 --- a/test/TestG3MCreatePool.t.sol +++ b/test/TestG3MCreatePool.t.sol @@ -29,7 +29,7 @@ contract TestG3MCreatePool is Setup { (bytes memory strategyData, uint256 initialX, uint256 initialY) = G3MStrategy(g3mStrategy()).getStrategyData( - address(this), reserveX, weightX, initialPrice + abi.encode(address(this), reserveX, weightX, initialPrice) ); uint64 poolId = subject().createPool( @@ -56,7 +56,7 @@ contract TestG3MCreatePool is Setup { (bytes memory strategyData, uint256 initialX, uint256 initialY) = G3MStrategy(g3mStrategy()).getStrategyData( - address(this), reserveX, weightX, initialPrice + abi.encode(address(this), reserveX, weightX, initialPrice) ); uint64 poolId = subject().createPool( @@ -89,7 +89,7 @@ contract TestG3MCreatePool is Setup { (bytes memory strategyData, uint256 initialX, uint256 initialY) = G3MStrategy(g3mStrategy()).getStrategyData( - address(this), reserveX, weightX, initialPrice + abi.encode(address(this), reserveX, weightX, initialPrice) ); uint64 poolId = subject().createPool(