You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently owned tokens are retrieved by querying positive balances on the protocol-whitelisted tokens. There is reason to remove the whitelist requirement in the future, in line with the ultimate vision of facilitating earning without using other people’s capital. This would allow a pool to own any token. In that case, it would be helpful to keep track of owned tokens in the pool state.
Specification
allocate deterministic storage slot to indexed mapping of owned token addresses
allocate deterministic storage slot to number of owned tokens
add a token to the mapping when it is first added to the pool
remove the token from the mapping when it is removed from the pool (should check whether to leave an empty slot in the mapping or to reorganize the mapping (which could be cost intensive). We can always retrieve the array of tokens by try/catch so that we return the actual length and can have a mapping with empty values).
upgrade pool implementation (requires governance onchain voting).
Rationale
Removing the token whitelist would allow a pool to potentially own any token, but it is desirable to have a method that returns all owned tokens.
Notes
NFTs and contract positions (like staking to other applications) could be added to the mapping, but they won't have an address.
Allowing trading any token would allow a pool operator to create a rogue token and empty the pool. This is already possible by routing to a whitelisted token by a route involving a rogue token in the middle, however, doing this would be explicit pool operator rogue behavior.
The text was updated successfully, but these errors were encountered:
Summary
Add a storage slot for pool-owned tokens.
Motivation
Currently owned tokens are retrieved by querying positive balances on the protocol-whitelisted tokens. There is reason to remove the whitelist requirement in the future, in line with the ultimate vision of facilitating earning without using other people’s capital. This would allow a pool to own any token. In that case, it would be helpful to keep track of owned tokens in the pool state.
Specification
Rationale
Removing the token whitelist would allow a pool to potentially own any token, but it is desirable to have a method that returns all owned tokens.
Notes
NFTs and contract positions (like staking to other applications) could be added to the mapping, but they won't have an address.
Allowing trading any token would allow a pool operator to create a rogue token and empty the pool. This is already possible by routing to a whitelisted token by a route involving a rogue token in the middle, however, doing this would be explicit pool operator rogue behavior.
The text was updated successfully, but these errors were encountered: