Unclaimed or front-runnable proxy implementations
Various smart contracts in the system require initialization functions to be called. The point when these calls happen is up to the deploying address. Deployment and initialization in one transaction are typically safe, but it can potentially be front-run if the initialization is done in a separate transaction.\\nA frontrunner can call these functions to silently take over the contracts and provide malicious parameters or plant a backdoor during the deployment.\\nLeaving proxy implementations uninitialized further aides potential phishing attacks where users might claim that - just because a contract address is listed in the official documentation/code-repo - a contract is a legitimate component of the system. At the same time, it is ‘only' a proxy implementation that an attacker claimed. For the end-user, it might be hard to distinguish whether this contract is part of the system or was a maliciously appropriated implementation.\\n```\\nfunction initialize(\\n address \\_fujiadmin,\\n address \\_oracle,\\n address \\_collateralAsset,\\n address \\_borrowAsset\\n) external initializer {\\n```\\n\\n`FujiVault` was initialized many days after deployment, and `FujiVault` inherits `VaultBaseUpgradeable`, which exposes a `delegatecall` that can be used to `selfdestruct` the contract's implementation.\\nAnother `FujiVault` was deployed by `deployer` initialized in a 2-step approach that can theoretically silently be front-run.\\ncode/artifacts/250-core.deploy:L2079-L2079\\n```\\n"deployer": "0xb98d4D4e205afF4d4755E9Df19BD0B8BD4e0f148",\\n```\\n\\nTransactions of deployer:\\nhttps://ftmscan.com/txs?a=0xb98d4D4e205afF4d4755E9Df19BD0B8BD4e0f148&p=2\\nThe specific contract was initialized 19 blocks after deployment.\\nhttps://ftmscan.com/address/0x8513c2db99df213887f63300b23c6dd31f1d14b0\\n\\n`FujiAdminFTM` (and others) don't seem to be initialized. (low prior; no risk other than pot. reputational damage)\\ncode/artifacts/250-core.deploy:L1-L7\\n```\\n{\\n "FujiAdmin": {\\n "address": "0xaAb2AAfBFf7419Ff85181d3A846bA9045803dd67",\\n "deployer": "0xb98d4D4e205afF4d4755E9Df19BD0B8BD4e0f148",\\n "abi": [\\n {\\n "anonymous": false,\\n```\\n
It is recommended to use constructors wherever possible to immediately initialize proxy implementations during deploy-time. The code is only run when the implementation is deployed and affects the proxy initializations. If other initialization functions are used, we recommend enforcing deployer access restrictions or a standardized, top-level `initialized` boolean, set to `true` on the first deployment and used to prevent future initialization.\\nUsing constructors and locked-down initialization functions will significantly reduce potential developer errors and the possibility of attackers re-initializing vital system components.
```\\nfunction initialize(\\n address \\_fujiadmin,\\n address \\_oracle,\\n address \\_collateralAsset,\\n address \\_borrowAsset\\n) external initializer {\\n```\\n