diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 4196a96..5d9c48d 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -33,7 +33,7 @@ contract DeployLLMOracleCoordinator is Script { } } -contract DeployAIAgentFactory is Script { +contract DeploySwanAgentFactory is Script { HelperConfig public config; function run() external returns (address addr) { @@ -42,7 +42,7 @@ contract DeployAIAgentFactory is Script { } } -contract DeployArtifactFactory is Script { +contract DeploySwanArtifactFactory is Script { HelperConfig public config; function run() external returns (address addr) { diff --git a/src/Swan.sol b/src/Swan.sol index f062a8e..cb3f8a2 100644 --- a/src/Swan.sol +++ b/src/Swan.sol @@ -181,7 +181,7 @@ contract Swan is SwanManager, UUPSUpgradeable { //////////////////////////////////////////////////////////////*/ /// @notice Creates a new agent. - /// @dev Emits a `AIAgentCreated` event. + /// @dev Emits a `AgentCreated` event. /// @return address of the new agent. function createAgent( string calldata _name, @@ -358,10 +358,10 @@ contract Swan is SwanManager, UUPSUpgradeable { emit ArtifactSold(listing.seller, msg.sender, _artifact, listing.price); } - /// @notice Set the factories for AI Agents and Artifacts. + /// @notice Set the factories for Agents and Artifacts. /// @dev Only callable by owner. - /// @param _agentFactory new AIAgentFactory address - /// @param _artifactFactory new ArtifactFactory address + /// @param _agentFactory new SwanAgentFactory address + /// @param _artifactFactory new SwanArtifactFactory address function setFactories(address _agentFactory, address _artifactFactory) external onlyOwner { agentFactory = SwanAgentFactory(_agentFactory); artifactFactory = SwanArtifactFactory(_artifactFactory); diff --git a/src/SwanAgent.sol b/src/SwanAgent.sol index 964ffac..f08222d 100644 --- a/src/SwanAgent.sol +++ b/src/SwanAgent.sol @@ -20,7 +20,7 @@ contract SwanAgentFactory { } } -/// @notice AIAgent is responsible for buying the artifacts from Swan. +/// @notice Agent is responsible for buying the artifacts from Swan. contract SwanAgent is Ownable { /*////////////////////////////////////////////////////////////// ERRORS @@ -131,7 +131,7 @@ contract SwanAgent is Ownable { //////////////////////////////////////////////////////////////*/ /// @notice Creates an agent. - /// @dev `_feeRoyalty` should be between 1 and maxAIAgentFee in the swan market parameters. + /// @dev `_feeRoyalty` should be between 1 and max agent fee in the swan market parameters. /// @dev All tokens are approved to the oracle coordinator of operator. constructor( string memory _name, diff --git a/test/Helper.t.sol b/test/Helper.t.sol index 71d5698..9513f8c 100644 --- a/test/Helper.t.sol +++ b/test/Helper.t.sol @@ -101,7 +101,7 @@ abstract contract Helper is Test { for (uint96 i = 0; i < agentOwners.length; i++) { agentParameters.push( AgentParameters({ - name: string.concat("AIAgent", vm.toString(uint256(i))), + name: string.concat("SwanAgent", vm.toString(uint256(i))), description: "description of the AI agent", feeRoyalty: feeRoyalty, amountPerRound: amountPerRound @@ -250,12 +250,12 @@ abstract contract Helper is Test { Vm.Log[] memory entries = vm.getRecordedLogs(); // 1. OwnershipTransferred (from Ownable) - // 2. Approval (from AIAgent constructor to approve coordinator) - // 3. Approval (from AIAgent constructor to approve swan) - // 4. AIAgentCreated (from Swan) + // 2. Approval (from SwanAgent constructor to approve coordinator) + // 3. Approval (from SwanAgent constructor to approve swan) + // 4. Agent (from Swan) assertEq(entries.length, 4); - // get the AIAgentCreated event + // get the agent event Vm.Log memory agentCreatedEvent = entries[entries.length - 1]; // Log is a struct that holds the event info: @@ -274,7 +274,7 @@ abstract contract Helper is Test { // get event sig bytes32 eventSig = agentCreatedEvent.topics[0]; - assertEq(keccak256("AIAgentCreated(address,address)"), eventSig); + assertEq(keccak256("AgentCreated(address,address)"), eventSig); // decode owner & agent address from topics address _owner = abi.decode(abi.encode(agentCreatedEvent.topics[1]), (address)); @@ -287,7 +287,7 @@ abstract contract Helper is Test { // all guuud agents.push(SwanAgent(_agent)); - vm.label(address(agents[i]), string.concat("AIAgent#", vm.toString(i + 1))); + vm.label(address(agents[i]), string.concat("SwanAgent#", vm.toString(i + 1))); // transfer token to agent token.transfer(address(AIagent), amountPerRound); @@ -323,13 +323,13 @@ abstract contract Helper is Test { vm.expectRevert(abi.encodeWithSelector(Swan.InvalidPrice.selector, invalidPrice)); vm.prank(seller); - swan.list("Artifact", "SA", "description or the swan artifact", invalidPrice, _agent); + swan.list("SwanArtifact", "SA", "description or the swan artifact", invalidPrice, _agent); vm.recordLogs(); for (uint256 i = 0; i < artifactCount; i++) { vm.prank(seller); swan.list( - string.concat("Artifact#", vm.toString(i)), + string.concat("SwanArtifact#", vm.toString(i)), string.concat("SA#", vm.toString(i)), "description or the swan artifact", artifactPrice, diff --git a/test/SwanFuzzTest.t.sol b/test/SwanFuzzTest.t.sol index 528cd0e..3087c60 100644 --- a/test/SwanFuzzTest.t.sol +++ b/test/SwanFuzzTest.t.sol @@ -125,7 +125,7 @@ contract SwanFuzzTest is Helper { uint256 _currTimestamp = block.timestamp; // increase time to buy phase of the second round but round comes +1 because of the setMarketParameters call - // AIAgents[0] should be in buy phase of second round + // agents[0] should be in buy phase of second round increaseTime( _currTimestamp + (2 * swan.getCurrentMarketParameters().listingInterval) + swan.getCurrentMarketParameters().buyInterval + swan.getCurrentMarketParameters().withdrawInterval, @@ -164,7 +164,7 @@ contract SwanFuzzTest is Helper { _allParams = swan.getMarketParameters(); assertEq(_allParams.length, 3); - // AIAgents[0] should be in listing phase of the fourth round (2 more increase time + 2 for setting new params) + // agents[0] should be in listing phase of the fourth round (2 more increase time + 2 for setting new params) checkRoundAndPhase(agents[0], SwanAgent.Phase.Listing, 3); // agentAfterFirstSet should be in listing phase of the second round diff --git a/test/SwanTest.t.sol b/test/SwanTest.t.sol index 4d0995a..257b62d 100644 --- a/test/SwanTest.t.sol +++ b/test/SwanTest.t.sol @@ -56,7 +56,7 @@ contract SwanTest is Helper { assertEq(swan.owner(), _newOwner); } - function test_CreateAIAgents() external createAgents fund { + function test_CreateSwanAgents() external createAgents fund { assertEq(agents.length, agentOwners.length); for (uint256 i = 0; i < agents.length; i++) { diff --git a/test/script/Deploy.t.sol b/test/script/Deploy.t.sol index 1ac14c5..44a339d 100644 --- a/test/script/Deploy.t.sol +++ b/test/script/Deploy.t.sol @@ -2,8 +2,8 @@ pragma solidity ^0.8.20; import { - DeployAIAgentFactory, - DeployArtifactFactory, + DeploySwanAgentFactory, + DeploySwanArtifactFactory, DeployLLMOracleCoordinator, DeployLLMOracleRegistry, DeploySwan @@ -17,8 +17,8 @@ import {Swan} from "../../src/Swan.sol"; import {Upgrades} from "@openzeppelin/foundry-upgrades/Upgrades.sol"; contract DeployTest is Test { - DeployAIAgentFactory deployAgentFactory; - DeployArtifactFactory deployArtifactFactory; + DeploySwanAgentFactory deployAgentFactory; + DeploySwanArtifactFactory deployArtifactFactory; DeployLLMOracleCoordinator deployLLMOracleCoordinator; DeployLLMOracleRegistry deployLLMOracleRegistry; DeploySwan deploySwan; @@ -36,10 +36,10 @@ contract DeployTest is Test { address llmOracleRegistryImpl; function setUp() external { - deployAgentFactory = new DeployAIAgentFactory(); + deployAgentFactory = new DeploySwanAgentFactory(); agentFactory = deployAgentFactory.run(); - deployArtifactFactory = new DeployArtifactFactory(); + deployArtifactFactory = new DeploySwanArtifactFactory(); artifactFactory = deployArtifactFactory.run(); deployLLMOracleRegistry = new DeployLLMOracleRegistry();