Closed Index0011 closed 1 year ago
To add context here on potential solution, we can create a custom handler:
trait CheckAllowTransferFn {
fn check(...) -> bool;
}
impl CheckAllowTransferFn for () {
return true;
}
trait Config {
// ...
type CheckAllowTransfer: CheckAllowTransferFn;
}
This allows for downstream to implement the handler default impl
of CheckAllowTransferFn
in their runtimes to satisfy their use case. Example:
fn transfer() {
if !T::CheckAllowTransfer::check() {
return Err;
}
// ...
// ...
}
Now the function transfer has no limitation that anyone could transfer items in any condition, now we have such a scene that we need to checkout if the transfer action satisfy some limitation, then to allow the transfer continue. If we can add a handler in RMRK- trait so that we can implement our custom pre-check handler?