don't forget to protect calling this method for only authorized addresses (admin, manager, etc)
Pay attention that you will not be able to pass address which doesn't support IMicapassBaseVerifier interface, as the internal _setMicapass method is protected with this check
require(IMicapassBaseVerifier(micapassAddress).supportsInterface( type(IMicapassBaseVerifier).interfaceId ),"Creator interface is incorrect" );
Step 3. Prepare methods and requirements
Step 3.1
Define your functions that are going to be protected by Micapass
For example it can be
functiondeposit()
and
functionwithdraw()
Step 3.2
Define requirements
which address should be checked (sender, receiver, etc)
For example for deposit method the msg.sender should be protected by Micapass, but for withdraw - the receiver, or both, msg.sender + receiver
which proofs this address should be checked for (KYC, WALLET_SCREENING), for example:
deposit - KYC, WALLET_SCREENING
withdraw - only WALLET_SCREENING
Step 4. Protection implementation
Add micapassProtected modifier to each method which should be protected with micapass passing address and claim topic that need to be checked
Examples
example of protection deposit method for msg.sender by checking two claims - KYC and WALLET_SCREENING
functiondeposit()externalpayablemicapassProtected(msg.sender,CLAIM_TOPIC_KYC)micapassProtected(msg.sender,CLAIM_TOPIC_WALLET_SCREENING) {// logic of deposit ...
example of protection withdraw method for msg.sender by checking claim WALLET_SCREENING