Hypothetical scenario:
Account A
opts into USDC and then opts into a smart contract.
Account A
is then rekeyed to the smart contract.
I want Account A
to act as a pool of USDC inside of the smart contract.
I want to restrict the USDC sent to this account dynamically. Specifically, every time the pool gets to a balance of 1,000 USDC (or any arbitrary amount), the pool is emptied (all of the USDC is sent to some other account) and the smart contract restricts the “sending of USDC” to the pool until the smart contract logic decides to open it back up again.
Constraint: I want to restrict the USDC received by the pool without the need for grouped transactions with the smart contract.
Initial idea:
- Every time I want to close the USDC pool, I do the following:
-
- opt-out of USDC through an inner transaction
-
- when I want to open the pool again, opt into USDC through an inner transaction
Any ideas as to how to solve this problem more elegantly?