-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: first part of service registry replacing agent registry #48
Conversation
contracts/AgentFactory.sol
Outdated
@@ -12,45 +12,71 @@ interface IAgentRegistry { | |||
function create(address agentOwner, bytes32 agentHash) external returns (uint256 agentId); | |||
} | |||
|
|||
|
|||
// Service Registry interface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lots of duplication now - needs cleaning
contracts/AgentFactory.sol
Outdated
/// @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); | ||
|
||
// Agent factory version number | ||
string public constant VERSION = "1.1.0"; | ||
|
||
// Agent registry address | ||
address public immutable agentRegistry; | ||
// Service registry address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Factory should point to service registry. IMO factory could even be deprecated and we add this function to marketplace itself...
contracts/AgentFactory.sol
Outdated
// revert WrongServiceState(uint256(state), serviceId); | ||
// } | ||
bytes32 salt = keccak256(abi.encode(multisig, serviceId)); | ||
// multisig is isOperator() for the mech |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires us to fly our own mech implementation. Otherwise we have an unnecessary layer of NFT in between
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for that as well
contracts/AgentMech.sol
Outdated
/** | ||
* @dev A Mech that is operated by the multisig of an Olas service | ||
*/ | ||
contract OlasMech is Mech, ImmutableStorage { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost identical to ERC721Mech except the constructor and isOperator implementations
contracts/AgentMech.sol
Outdated
IService.ServiceState state; | ||
(, multisig, , , , , state) = IService(_token).mapServices(_tokenId); | ||
if (state != IService.ServiceState.Deployed) { | ||
revert WrongServiceState(uint256(state), _tokenId); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We check the service exists and is live
contracts/AgentMech.sol
Outdated
address multisig; | ||
(, multisig, , , , , ) = IService(_token).mapServices(_tokenId); | ||
return multisig == signer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
operator simplified - we now check if the multisig is the signer
@@ -401,6 +478,7 @@ contract AgentMech is ERC721Mech { | |||
_locked = 1; | |||
} | |||
|
|||
/// TODO: We need the same system to work with Nevermined pricing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important that we consider this right from the start. Ideally the factory takes care of creating both types of mechs
refactor: creating mechs in marketplace
refactor: agent mechs and factory (soon to be deprecated)
No description provided.