Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/PSMFed.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ contract PSMFed {
event PendingGovUpdated(address indexed pendingGov);
event ChairChanged(address indexed oldChair, address indexed newChair);
event SupplyCapUpdated(uint256 oldSupplyCap, uint256 newSupplyCap);
event Expansion(uint256 amount);
event Contraction(uint256 amount);

constructor(address _psm, address _gov, address _chair, address _dola) {
psm = _psm;
Expand Down Expand Up @@ -52,6 +54,7 @@ contract PSMFed {
require(amount + supply <= supplyCap, "Supply cap exceeded");
supply += amount;
DOLA.mint(psm, amount);
emit Expansion(amount);
}

/**
Expand All @@ -66,6 +69,7 @@ contract PSMFed {
supply -= amount;
DOLA.transferFrom(psm, address(this), amount);
DOLA.burn(amount);
emit Contraction(amount);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/PSM.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ contract PSMTest is Test {
uint256 sellFee1 = dolaToSell1 * psm.sellFeeBps() / 10000; // 1% sell fee
uint256 sellFee2 = dolaToSell2 * psm.sellFeeBps() / 10000; // 1% sell fee
assertEq(collateral.balanceOf(user), user1CollateralBal - (buyFee1 + sellFee1)); // User 1 gets back collateral minus fees
// Profit should include fees from both users
// Profit should include fees from both users
assertEq(psm.getProfit(), psmProfit + buyFee1 + buyFee2 + sellFee1 + sellFee2);
psm.takeProfit(); // Take profit

Expand Down