Skip to content

Commit

Permalink
feat: cache ptoken
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvaleri committed Jul 22, 2024
1 parent 90a84e4 commit 660b967
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contracts/PointTokenVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,11 @@ contract PointTokenVault is UUPSUpgradeable, AccessControlUpgradeable, Multicall
}

(string memory name, string memory symbol) = LibString.unpackTwo(_pointsId); // Assume the points id was created using LibString.packTwo.
pTokens[_pointsId] = new PToken{salt: _pointsId}(name, symbol, 18);
emit PTokenDeployed(_pointsId, address(pTokens[_pointsId]));
PToken pToken = new PToken{salt: _pointsId}(name, symbol, 18);
pTokens[_pointsId] = pToken;

return pTokens[_pointsId];
emit PTokenDeployed(_pointsId, address(pToken));
return pToken;
}

// Internal ---
Expand Down
5 changes: 5 additions & 0 deletions contracts/test/PointTokenVault.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ contract PointTokenVaultTest is Test {

pointTokenVault.grantRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), admin);
pointTokenVault.grantRole(pointTokenVault.MERKLE_UPDATER_ROLE(), merkleUpdater);





pointTokenVault.grantRole(pointTokenVault.OPERATOR_ROLE(), operator);
pointTokenVault.grantRole(pointTokenVault.FEE_COLLECTOR_ROLE(), feeCollector);
pointTokenVault.revokeRole(pointTokenVault.DEFAULT_ADMIN_ROLE(), address(this));
Expand Down

0 comments on commit 660b967

Please sign in to comment.