From 568f773500671b77b81ed5bcce56a82de5952de4 Mon Sep 17 00:00:00 2001 From: Shawn Rizo Date: Sat, 4 Oct 2025 14:38:39 -0400 Subject: [PATCH 1/3] feat: Add View Function Natspec Section Header --- src/onchain/TestAMMContract.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/onchain/TestAMMContract.sol b/src/onchain/TestAMMContract.sol index 9897cae..705cd0f 100644 --- a/src/onchain/TestAMMContract.sol +++ b/src/onchain/TestAMMContract.sol @@ -434,4 +434,8 @@ contract Test_AMMContract is Ownable { emit TokensSwapped(_marketId, inputToken, outputToken, _amountIn, amountOut); } + + ////////////////////////////////////////////////////////////// + // VIEW FUNCTIONS // + ////////////////////////////////////////////////////////////// } From 165bfa9f15b1c3b5d6e127d3b835cf8c39bceec1 Mon Sep 17 00:00:00 2001 From: Shawn Rizo Date: Sat, 4 Oct 2025 14:39:03 -0400 Subject: [PATCH 2/3] feat: Add getPoolUsingMarketId External View Function --- src/onchain/TestAMMContract.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/onchain/TestAMMContract.sol b/src/onchain/TestAMMContract.sol index 705cd0f..c39ad79 100644 --- a/src/onchain/TestAMMContract.sol +++ b/src/onchain/TestAMMContract.sol @@ -438,4 +438,8 @@ contract Test_AMMContract is Ownable { ////////////////////////////////////////////////////////////// // VIEW FUNCTIONS // ////////////////////////////////////////////////////////////// + + function getPoolUsingMarketId(bytes32 marketId) external view returns (PoolData memory) { + return marketIdToPool[marketId]; + } } From bf3749864dc621f4c65cea15ca8486617c191d4b Mon Sep 17 00:00:00 2001 From: Shawn Rizo Date: Sat, 4 Oct 2025 14:39:26 -0400 Subject: [PATCH 3/3] feat: Add getPoolUsingMarketId External View Function Natspec Comments --- src/onchain/TestAMMContract.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/onchain/TestAMMContract.sol b/src/onchain/TestAMMContract.sol index c39ad79..19b78e5 100644 --- a/src/onchain/TestAMMContract.sol +++ b/src/onchain/TestAMMContract.sol @@ -439,6 +439,16 @@ contract Test_AMMContract is Ownable { // VIEW FUNCTIONS // ////////////////////////////////////////////////////////////// + /** + * @notice Retrieves complete pool data for a given market ID + * @dev Returns the PoolData struct containing all pool information + * + * @param marketId Unique identifier for the prediction market + * + * @return pool Complete PoolData struct with all pool information + * + * @custom:lookup Primary method for getting pool information by market ID + */ function getPoolUsingMarketId(bytes32 marketId) external view returns (PoolData memory) { return marketIdToPool[marketId]; }