solace-fi / solace-core

solace.fi smart contracts
GNU General Public License v3.0
6 stars 3 forks source link

Treasury as a script contract / smart wallet #138

Closed leonardishere closed 3 years ago

leonardishere commented 3 years ago

The Treasury contract has a set of functions that will be called by other contracts, eg routePremiums and refund. It also has functions that will be called by governance to manage tokens, eg swap (via uniswap), spend, wrapEth. These governance-only functions are limited by what is written before deployment and don't allow for other external calls that we may need to manage tokens in the future, eg swap via other exchanges and manage uni v3 tokens. We need a way for Treasury to call arbitrary external functions

I'm thinking a slim ERC725X https://eips.ethereum.org/EIPS/eip-725. We can probably remove operationType and use call. But we will need some sort of Javascript utility to assemble the call data

leonardishere commented 3 years ago

potential security risk, use multisig wallet instead