Lock transfer addresses


I’m developing a smart contract and trying to be a bit clever, probably a bit too clever for my own good but wanted to see if anyone has tried to restrict the ability to transfer tokens, specifically I want to be able to only allow transfer of tokens to addresses that are approved.

Obviously, I’ll have a function to be able to add new addresses to the approved list, but I want to know if theres a way that I can restrict the transfer function to only allow transfers TO the approved address list.


Checkout a contract I created for our SEANCE token, found here: SeanceCircle | Address 0x97Ee3C9Cf4E5DE384f95e595a8F327e65265cC4E | SnowTrace

function transfer(address to, uint value) external override obey(sophia) returns (bool)

Note: “sophia” is a role via AccessControl.