@@ -204,8 +204,8 @@ contract SwanDebate is Ownable, Pausable {
204
204
CORE FUNCTIONS
205
205
//////////////////////////////////////////////////////////////*/
206
206
/// @notice Register a new agent with their system prompt
207
- /// @return The ID of the newly registered agent
208
- function registerAgent () external onlyOwner returns (uint256 ) {
207
+ /// @return newAgentId The ID of the newly registered agent
208
+ function registerAgent () external onlyOwner returns (uint256 newAgentId ) {
209
209
uint256 agentId = nextAgentId++ ;
210
210
agents[agentId] = Agent ({isRegistered: true , wins: 0 });
211
211
@@ -217,13 +217,13 @@ contract SwanDebate is Ownable, Pausable {
217
217
/// @param _agent1Id ID of the first agent
218
218
/// @param _agent2Id ID of the second agent
219
219
/// @param _contest Address of the JokeRace contest
220
- /// @return The address of the initialized contest
220
+ /// @return contestAddress The address of the initialized contest
221
221
/// @dev Verifies agent registration and contest state before initialization
222
222
function initializeDebate (uint256 _agent1Id , uint256 _agent2Id , address _contest )
223
223
external
224
224
onlyOwner
225
225
whenNotPaused
226
- returns (address )
226
+ returns (address contestAddress )
227
227
{
228
228
if (! agents[_agent1Id].isRegistered || ! agents[_agent2Id].isRegistered) {
229
229
revert AgentNotRegistered ();
@@ -291,9 +291,8 @@ contract SwanDebate is Ownable, Pausable {
291
291
/// @param _contest Address of the JokeRace contest
292
292
/// @param _agentId ID of the agent providing output
293
293
/// @param _taskId ID of the oracle task
294
- /// @param _output Output data from the oracle
295
294
/// @dev Only owner can record outputs and both agents must provide output to complete a round
296
- function recordOracleOutput (address _contest , uint256 _agentId , uint256 _taskId , bytes calldata _output )
295
+ function recordOracleOutput (address _contest , uint256 _agentId , uint256 _taskId )
297
296
external
298
297
onlyOwner
299
298
whenNotPaused
@@ -309,10 +308,10 @@ contract SwanDebate is Ownable, Pausable {
309
308
RoundData storage round = debate.rounds[debate.currentRound];
310
309
if (_agentId == debate.agent1Id) {
311
310
round.agent1TaskId = _taskId;
312
- round.agent1Output = _output ;
311
+ round.agent1Output = coordinator. getBestResponse (_taskId).output ;
313
312
} else if (_agentId == debate.agent2Id) {
314
313
round.agent2TaskId = _taskId;
315
- round.agent2Output = _output ;
314
+ round.agent2Output = coordinator. getBestResponse (_taskId).output ;
316
315
} else {
317
316
revert InvalidAgent (_agentId);
318
317
}
@@ -370,23 +369,23 @@ contract SwanDebate is Ownable, Pausable {
370
369
//////////////////////////////////////////////////////////////*/
371
370
/// @notice Get an agent's information by their ID
372
371
/// @param _agentId The ID of the agent to query
373
- /// @return The Agent struct containing the agent's information
374
- function getAgent (uint256 _agentId ) external view returns (Agent memory ) {
372
+ /// @return agentInfo The Agent struct containing the agent's information
373
+ function getAgent (uint256 _agentId ) external view returns (Agent memory agentInfo ) {
375
374
return agents[_agentId];
376
375
}
377
376
378
377
/// @notice Retrieves round data for a specific debate round
379
378
/// @param _contest Address of the JokeRace contest
380
379
/// @param _round Round number to query
381
- /// @return RoundData structure containing the round's information
382
- function getRoundForDebate (address _contest , uint256 _round ) external view returns (RoundData memory ) {
380
+ /// @return roundData RoundData structure containing the round's information
381
+ function getRoundForDebate (address _contest , uint256 _round ) external view returns (RoundData memory roundData ) {
383
382
return debates[_contest].rounds[_round];
384
383
}
385
384
386
385
/// @notice Gets the latest round data for a debate
387
386
/// @param _contest Address of the JokeRace contest
388
- /// @return RoundData structure containing the current round's information
389
- function getLatestRoundForDebate (address _contest ) external view returns (RoundData memory ) {
387
+ /// @return latestRound RoundData structure containing the current round's information
388
+ function getLatestRoundForDebate (address _contest ) external view returns (RoundData memory latestRound ) {
390
389
return debates[_contest].rounds[debates[_contest].currentRound];
391
390
}
392
391
@@ -407,8 +406,8 @@ contract SwanDebate is Ownable, Pausable {
407
406
408
407
/// @notice Gets all debates an agent has participated in
409
408
/// @param _agentId ID of the agent
410
- /// @return Array of contest addresses the agent participated in
411
- function getAgentDebates (uint256 _agentId ) external view returns (address [] memory ) {
409
+ /// @return agentContests Array of contest addresses the agent participated in
410
+ function getAgentDebates (uint256 _agentId ) external view returns (address [] memory agentContests ) {
412
411
return agentDebates[_agentId];
413
412
}
414
413
0 commit comments