Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow overriding onSwap in Stable Pool #1028

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion pkg/pool-stable/contracts/StablePool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ contract StablePool is IStablePool, BalancerPoolToken, BasePoolAuthentication, P
}

/// @inheritdoc IBasePool
function onSwap(PoolSwapParams memory request) public view onlyVault returns (uint256) {
function onSwap(PoolSwapParams memory request) public view virtual onlyVault returns (uint256) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this (and WeightedPool) non-view here to enable local state-changing operations in derived pools?

uint256 invariant = computeInvariant(request.balancesScaled18, Rounding.ROUND_DOWN);
(uint256 currentAmp, ) = _getAmplificationParameter();

Expand Down
2 changes: 0 additions & 2 deletions pkg/pool-stable/contracts/StablePoolFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import { StablePool } from "./StablePool.sol";
* Since this limit is less than Vault's maximum of 8 tokens, we need to enforce this at the factory level.
*/
contract StablePoolFactory is IPoolVersion, BasePoolFactory, Version {
// solhint-disable not-rely-on-time

string private _poolVersion;

constructor(
Expand Down
Loading