Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: checking mech and requester staking validity #37

Merged
merged 10 commits into from
Aug 26, 2024
13 changes: 0 additions & 13 deletions contracts/AgentFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@
function create(address agentOwner, bytes32 agentHash) external returns (uint256 agentId);
}

// Mech Marketplace interface
interface IMechMarketplace {
/// @dev Sets mech registration status.
/// @param mech Mech address.
/// @param status True, if registered, false otherwise.
function setMechRegistrationStatus(address mech, bool status) external;
}
Comment on lines -16 to -21
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to register mech in the marketplace anymore.


/// @title Agent Factory - Periphery smart contract for managing agent and mech creation
contract AgentFactory is GenericManager {
event CreateMech(address indexed mech, uint256 indexed agentId, uint256 indexed price);
Expand All @@ -28,7 +20,7 @@
string public constant VERSION = "1.1.0";

// Agent registry address
address public immutable agentRegistry;

Check warning on line 23 in contracts/AgentFactory.sol

View workflow job for this annotation

GitHub Actions / build

Immutable variables name are set to be in capitalized SNAKE_CASE

constructor(address _agentRegistry) {
agentRegistry = _agentRegistry;
Expand Down Expand Up @@ -59,11 +51,6 @@
// agentOwner is isOperator() for the mech
mech = address((new AgentMech){salt: salt}(agentRegistry, agentId, price, mechMarketplace));

// Register mech in a marketplace, if specified
if (mechMarketplace != address(0)) {
IMechMarketplace(mechMarketplace).setMechRegistrationStatus(mech, true);
}

emit CreateMech(mech, agentId, price);
}
}
Loading
Loading