FulfillableRegistry
Overview
The FulfillableRegistry contract manages the registration and validation of fulfillment services. It stores service information, including fulfiller and beneficiary addresses, and handles service references and fee configurations.
Inheritance
Versions
V1
The initial version provides core functionality for service registration and validation.
V1_1
Adds enhanced management capabilities and optimizations.
V1_2
Adds the ability to create services lazily when adding service references.
Key Functions
Service Management
Adds a new service to the registry.
Removes a service from the registry.
Updates the beneficiary of a service.
Updates the fee amount percentage of a service.
Updates the fulfiller of a service.
Updates the beneficiary address for a service.
Effects:
Updates the beneficiary address in the service record
Emits
ServiceBeneficiaryUpdated
event
Requirements:
Caller MUST be the owner
Service MUST exist
updateServiceFulfiller
updateServiceFulfiller
Updates the fulfiller address for a service.
Effects:
Updates the fulfiller address in the service record
Emits
ServiceFulfillerUpdated
event
Requirements:
Caller MUST be the owner
Service MUST exist
New fulfiller address MUST NOT be zero
getService
getService
Retrieves the service details and its associated fulfillment fee basis points.
Fulfiller Management
The following methods are used to manage fulfillers:
addFulfiller
addFulfiller
Registers a new fulfiller for a service.
Effects:
Associates the fulfiller with the service
Increments the fulfiller's service count
Emits
FulfillerAdded
event
Requirements:
Caller MUST be the owner
Fulfiller address MUST NOT be zero
Service References
The following methods are used to manage service references:
addServiceRef
addServiceRef
Adds a reference to a service. References can be used for additional validation or metadata.
Effects:
Stores the reference for the service
Increments the reference count for the service
Emits
ServiceRefAdded
event
Requirements:
Caller MUST be the owner
Service MUST exist
isRefValid
isRefValid
Checks if a reference is valid for a given service.
Fee Management
The following methods are used to manage service fees:
updateServicefeeAmountBasisPoints
updateServicefeeAmountBasisPoints
Updates the fee amount basis points for a service.
Effects:
Updates the fee amount basis points for the service
Emits
ServiceFulfillmentFeeSet
event
Requirements:
Caller MUST be the owner
Service MUST exist
New fee amount basis points MUST be valid (0-10000)
Events
Emitted when a new service is added to the registry.
Emitted when a service is removed from the registry.
Emitted when a service's beneficiary is updated.
Emitted when a reference is added to a service.
Emitted when a fulfiller is added to a service.
Emitted when the manager address is updated.
Errors
Emitted when an invalid address is provided.
Emitted when attempting to add a service that already exists.
Emitted when attempting to interact with a service that does not exist.
Emitted when an invalid fee amount basis points is provided.
Parameterization
MAX_FULFILLMENT_FEE_BASIS_POINTS
: The maximum allowed value for fulfillment fee basis points (10000, representing 100%)_serviceRegistry
: Mapping to store services by their ID_serviceRefs
: Mapping to store service references by service ID_serviceFulfillmentFeeBasisPoints
: Mapping to store fulfillment fees basis points by service ID_serviceRefCount
: Mapping to store the count of references for each service_fulfillerServices
: Mapping to store fulfillers and their associated services_fulfillerServiceCount
: Mapping to store the count of services for each fulfiller_serviceCount
: The total number of services_manager
: The manager address
Constants
Last updated
Was this helpful?