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.
Initializes the modular compliance, sets the maximum allowable modules per token and adds the modules provided
Parameters
Set the maximum number of allowable modules which can be bound.
Parameters
Adds modules based on the array of module addresses provided
Parameters
Removes modules based on the array of module addresses provided
Parameters
Returns the maximum number of allowable modules which can be bound.
Returns
Emitted during updateMaxModulesCount
to inform of new modules max count updates
Emitted during addModules
to inform of new modules added
Emitted during removeModules
to inform of modules removed
thrown if specific address is zero.
thrown if an attempt to set the maximum number of allowable modules to zero is made in updateMaxModulesCount
thrown if an attempt to add an already existing module during addModules
thrown if module for the given address is not already bound by the modifier onlyExistingModule
thrown if an attempt to add more than the allowable modules during addModules
thrown during bindToken
or unBindToken
if the caller is not the owner or the bound token address
thrown if the the msg.sender is not the bound token address during modifier onlyToken
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
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.
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.
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
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
<none>
uint256
maximum number of allowable modules which can be bound.