Automatically send an ERC20 when detecting a deposit

I was trying to figure out how I could set up Defender to act almost as a crowdsale contract would have. I'd like for it to monitor the gnosis safe for deposits and then when a deposit is received by an account, preferably checking against a list to see if that account is 'whitelisted' and then minting from the ERC20 contract and sending out to that address.

Is that something it could do? Any examples of it? Cheers!

Hey @ZrowGz! I've moved your post to a new topic, hope you don't mind.

What you describe is pretty similar to this workshop from a few months back: it involves setting up a Sentinel for monitoring for events, triggering an Autotask in response, and using the Autotask to send a minting transaction to a token contract via a Relayer, having authorized the Relayer as a minter in the contract using Admin.

In the workshop, the event monitored was a purchase in a Uniswap pool, and the minted token was an ERC721 instead of ERC20, but the spirit should be the same.

That said, if you control the address for deposits, you may want to consider implementing the whole thing in Solidity. You can write a Crowdsale contract that receives ETH, sends it to a Gnosis Safe for safekeeping, and mints an ERC20 back to the sender in response. If it helps, we used to have Crowdsale contracts in the OpenZeppelin contracts library, maybe you can take a look at them for inspiration!