Skip to content

Commit

Permalink
fix: reco-4: Refactor for gas optimizations (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
ksatyarth2 authored Nov 26, 2024
1 parent e0047f1 commit b1734cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mainnet-contracts/src/ValidatorTicket.sol
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ contract ValidatorTicket is
restricted
returns (uint256 mintedAmount)
{
ValidatorTicket storage $ = _getValidatorTicketStorage();

uint256 mintPrice = PUFFER_ORACLE.getValidatorTicketPrice();
mintedAmount = (msg.value * 1 ether) / mintPrice; // * 1 ether is to upscale amount to 18 decimals

Expand All @@ -129,6 +127,8 @@ contract ValidatorTicket is
return mintedAmount;
}

ValidatorTicket storage $ = _getValidatorTicketStorage();

uint256 treasuryAmount = _sendETH(TREASURY, msg.value, $.protocolFeeRate);
uint256 guardiansAmount = _sendETH(GUARDIAN_MODULE, msg.value, $.guardiansFeeRate);
uint256 vaultAmount = msg.value - (treasuryAmount + guardiansAmount);
Expand Down

0 comments on commit b1734cf

Please sign in to comment.