IFrictionlessModularCompliance
Inherits: IModularCompliance
Author: DEFYCA Labs S.à.r.l
Copyright © 2023 DEFYCA Labs S.à.r.l Permission is hereby granted, free of charge, to any person obtaining a copy of the Frictionless protocol smart contracts (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DEFYCA LABS S.à.r.l BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The IFrictionlessModularCompliance is responsible for the compliant transfer of the various Tokens in the Frictionless protocol.
Functions
init
Initializes the modular compliance, sets the maximum allowable modules per token and adds the modules provided
Parameters
modules_
address[]
the array of module addresses to be added
maxModulesCount_
uint256
maximum number of allowable modules which can be bound. throws FrictionlessModularComplianceMaxModuleCountReached
if the maximum amount of modules has been reached as per the maxModulesCount throws FrictionlessModularComplianceModuleIsAlreadyBound
if the module is already bound throws FrictionlessIsZeroAddress
if the module address is a zero address throws FrictionlessModularComplianceZeroMaxModulesCount
if an attempt to set the maximum number of allowable modules to zero is made in updateMaxModulesCount
emits ModulesAdded upon sucessful addition emits MaxModulesCountUpdated
upon successful update of the maximum modules count.
updateMaxModulesCount
Set the maximum number of allowable modules which can be bound.
Parameters
newMaxModulesCount_
uint256
maximum number of allowable modules which can be bound. throws FrictionlessModularComplianceZeroMaxModulesCount
if an attempt to set the maximum number of allowable modules to zero is made in updateMaxModulesCount
emits MaxModulesCountUpdated
upon successful update of the maximum modules count.
addModules
Adds modules based on the array of module addresses provided
Parameters
modulesToAdd_
address[]
the array of module addresses to be added throws FrictionlessModularComplianceMaxModuleCountReached
if the maximum amount of modules has been reached as per the maxModulesCount throws FrictionlessModularComplianceModuleIsAlreadyBound
if the module is already bound throws FrictionlessIsZeroAddress
if the module address is a zero address emits ModulesAdded upon sucessful addition
removeModules
Removes modules based on the array of module addresses provided
Parameters
modulesToRemove_
address[]
the array of module addresses to be removed throws FrictionlessModularComplianceModuleDoesNotExist
if module for the given address is not already bound emits ModulesRemoved upon sucessful removal
maxModulesCount
Returns the maximum number of allowable modules which can be bound.
Returns
<none>
uint256
maximum number of allowable modules which can be bound.
Events
MaxModulesCountUpdated
Emitted during updateMaxModulesCount
to inform of new modules max count updates
ModulesAdded
Emitted during addModules
to inform of new modules added
ModulesRemoved
Emitted during removeModules
to inform of modules removed
Errors
FrictionlessIsZeroAddress
thrown if specific address is zero.
FrictionlessModularComplianceZeroMaxModulesCount
thrown if an attempt to set the maximum number of allowable modules to zero is made in updateMaxModulesCount
FrictionlessModularComplianceModuleIsAlreadyBound
thrown if an attempt to add an already existing module during addModules
FrictionlessModularComplianceModuleDoesNotExist
thrown if module for the given address is not already bound by the modifier onlyExistingModule
FrictionlessModularComplianceMaxModuleCountReached
thrown if an attempt to add more than the allowable modules during addModules
FrictionlessModularComplianceCallerNotATokenOrOwner
thrown during bindToken
or unBindToken
if the caller is not the owner or the bound token address
FrictionlessModularComplianceCallerNotAToken
thrown if the the msg.sender is not the bound token address during modifier onlyToken