From d9fd8977140727c71af24fddb05af121d5ca8b5c Mon Sep 17 00:00:00 2001 From: DhairyaSethi <55102840+DhairyaSethi@users.noreply.github.com> Date: Mon, 2 Oct 2023 19:53:18 +0530 Subject: [PATCH] chore: cache `token` during mints --- src/DefaultEmissionManager.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DefaultEmissionManager.sol b/src/DefaultEmissionManager.sol index 961f206..001d8a1 100644 --- a/src/DefaultEmissionManager.sol +++ b/src/DefaultEmissionManager.sol @@ -80,8 +80,9 @@ contract DefaultEmissionManager is Ownable2StepUpgradeable, IDefaultEmissionMana emit TokenMint(amountToMint, msg.sender); - token.mint(address(this), amountToMint); - token.safeTransfer(treasury, treasuryAmt); + IPolygonEcosystemToken _token = token; + _token.mint(address(this), amountToMint); + _token.safeTransfer(treasury, treasuryAmt); // backconvert POL to MATIC before sending to StakeManager migration.unmigrateTo(stakeManager, stakeManagerAmt); }