Skip to content

Commit

Permalink
Revert PR60 "send POL to StakeManager"
Browse files Browse the repository at this point in the history
This reverts commit 8b0a0b6.
  • Loading branch information
simonDos committed Jun 26, 2024
1 parent f555f12 commit e3dbdb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 2 additions & 4 deletions src/DefaultEmissionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,10 @@ contract DefaultEmissionManager is Ownable2StepUpgradeable, IDefaultEmissionMana
emit TokenMint(amountToMint, msg.sender);

IPolygonEcosystemToken _token = token;

_token.mint(address(this), amountToMint);

_token.safeTransfer(treasury, treasuryAmt);

_token.safeTransfer(stakeManager, stakeManagerAmt);
// backconvert POL to MATIC before sending to StakeManager
migration.unmigrateTo(stakeManager, stakeManagerAmt);
}

/// @inheritdoc IDefaultEmissionManager
Expand Down
12 changes: 8 additions & 4 deletions test/DefaultEmissionManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ contract DefaultEmissionManagerTest is Test {
emissionManager.mint();
// timeElapsed is zero, so no minting
assertEq(polygon.balanceOf(stakeManager), 0);
assertEq(matic.balanceOf(stakeManager), 0);
assertEq(polygon.balanceOf(treasury), 0);
}

Expand All @@ -146,7 +147,7 @@ contract DefaultEmissionManagerTest is Test {
assertApproxEqAbs(newSupply, polygon.totalSupply(), _MAX_PRECISION_DELTA);
uint256 totalAmtMinted = polygon.totalSupply() - initialTotalSupply;
uint256 totalAmtMintedTwoFifth = totalAmtMinted * 2 / 5;
assertEq(polygon.balanceOf(stakeManager), totalAmtMinted - totalAmtMintedTwoFifth);
assertEq(matic.balanceOf(stakeManager), totalAmtMinted - totalAmtMintedTwoFifth);
assertEq(polygon.balanceOf(treasury), totalAmtMintedTwoFifth);
}

Expand All @@ -166,7 +167,8 @@ contract DefaultEmissionManagerTest is Test {
assertApproxEqAbs(newSupply, polygon.totalSupply(), _MAX_PRECISION_DELTA);
uint256 balance = (polygon.totalSupply() - initialTotalSupply) * 2 / 5;
uint256 stakeManagerBalance = (polygon.totalSupply() - initialTotalSupply) - balance;
assertEq(polygon.balanceOf(stakeManager), stakeManagerBalance);
assertEq(matic.balanceOf(stakeManager), stakeManagerBalance);
assertEq(polygon.balanceOf(stakeManager), 0);
assertEq(polygon.balanceOf(treasury), balance);

skip(delay);
Expand All @@ -183,7 +185,8 @@ contract DefaultEmissionManagerTest is Test {
balance = totalAmtMintedTwoFifth;
stakeManagerBalance = totalAmtMinted - totalAmtMintedTwoFifth;

assertEq(polygon.balanceOf(stakeManager), stakeManagerBalance);
assertEq(matic.balanceOf(stakeManager), stakeManagerBalance);
assertEq(polygon.balanceOf(stakeManager), 0);
assertEq(polygon.balanceOf(treasury), balance);
}

Expand All @@ -210,7 +213,8 @@ contract DefaultEmissionManagerTest is Test {
balance = totalAmtMintedTwoFifth;
stakeManagerBalance = totalAmtMinted - totalAmtMintedTwoFifth;

assertEq(polygon.balanceOf(stakeManager), stakeManagerBalance);
assertEq(matic.balanceOf(stakeManager), stakeManagerBalance);
assertEq(polygon.balanceOf(stakeManager), 0);
assertEq(polygon.balanceOf(treasury), balance);
}
}
Expand Down

0 comments on commit e3dbdb3

Please sign in to comment.