dApp Security Guidelines: LSD
Threat
Impact
Threat 1: Manipulation of iBERA/BERA Exchange Rate through Mass Deposits and Withdrawals
Impact
Guideline
Best Practice
function mint(address receiver) public payable returns (uint256 shares) {
compound(); // Settle and reflect unrealized profits
uint256 d = deposits;
uint256 ts = totalSupply();
uint256 amount = msg.value;
// Synchronize external fund inflow by calling the BeaconDeposit contract via the queue function in the InfraredBERADepositor contract
_deposit(amount);
// Process at 1:1 during initialization, then proportionally to the deposit ratio
shares = (d != 0 && ts != 0) ? (ts * amount) / d : amount;
// Handle exceptions during initialization attempts
if (shares == 0) revert Errors.InvalidShares();
_mint(receiver, shares);
emit Mint(receiver, amount, shares);
}Threat 2: Malicious Actor Profit Maximization through Mass Harvesting Before/After Fee Changes
Impact
Guideline
Best Practice
Threat 3: Contamination of the Bribe System through Tokens Susceptible to Malicious Behavior
Impact
Guideline
Best Practice
Threat 4: Reward Imbalance and Centralization Due to Fund Concentration in Specific Validators
Impact
Guideline
Best Practice
Last updated