Upgradeable smart contract patterns that minimize attack surface in composable DeFi stacks