I'm familiar with proxy contracts in solidity using the 'delegatecall' to separate out the proxy contract from the logic contract. Is there a simple way to choose the logic contract based on an argument that I pass into the call as opposed to "upgrading" a contract permanently?
I feel like I've seen people do this in various contracts, but I haven't really seen documentation on it so I'm not sure what it's called. I think of it as dynamic proxying, but it may be called something else.
Basically, I would like my proxy contract to point to 1 of many logic contracts depending on an argument that I pass into the function call. So say I'm making a call to a function "GetValue" and I want to pass it a number as a parameter. I'm thinking one way to do this would be to pass an additional parameter that tells the proxy contract which logic contract to use. It seems like I'd have to use some assembly code inside my proxy contract to pull that off. So the proxy contract would read the first few bytes of the data and use that to determine what logic contract to call. Then it would delegate the call off to the logic contract (possibly without that additional parameter...)
Note: I understand that I could just leave the proxy contract as is, and sub proxy within my logic contract. But that seems unnecessary when that's supposed to be the purpose of the proxy contract to begin with.
Additional thought: So in the code I linked above, it would be almost as if I called "upgradeTo" everytime I call the contract. But instead of the overhead of upgrading the logic contract, just choose which logic contract to forward the delegated call to.