@@ -6,6 +6,7 @@ import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
6
6
import {SwanAgent} from "./SwanAgent.sol " ;
7
7
import {LLMOracleCoordinator} from "@firstbatch/dria-oracle-contracts/LLMOracleCoordinator.sol " ;
8
8
import {LLMOracleTaskParameters} from "@firstbatch/dria-oracle-contracts/LLMOracleTask.sol " ;
9
+ import {IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol " ;
9
10
10
11
/// @notice Interface for JokeRace contest interactions
11
12
/// @dev Provides functions to interact with JokeRace contests and query their state
@@ -337,6 +338,7 @@ contract SwanDebate is Ownable, Pausable {
337
338
}
338
339
339
340
debate.winnerId = winnerId;
341
+ agents[winnerId].wins += 1 ;
340
342
341
343
emit DebateTerminated (
342
344
_contest, winnerId, agent1ProposalVotes >= agent2ProposalVotes ? agent1ProposalVotes : agent2ProposalVotes
@@ -405,4 +407,13 @@ contract SwanDebate is Ownable, Pausable {
405
407
function getAgentDebates (uint256 _agentId ) external view returns (address [] memory agentContests ) {
406
408
return agentDebates[_agentId];
407
409
}
410
+
411
+ /// @notice Approves a spender to spend a certain amount of the specified fee token
412
+ /// @dev Only the contract owner can call this function
413
+ /// @param feeToken The address of the ERC20 token to approve
414
+ /// @param spender The address allowed to spend the tokens
415
+ /// @param amount The amount of tokens to approve for the spender
416
+ function approveFeeToken (address feeToken , address spender , uint256 amount ) external onlyOwner {
417
+ IERC20 (feeToken).approve (spender, amount);
418
+ }
408
419
}
0 commit comments