Skip to content

Commit

Permalink
feat: add caller param to updatePool
Browse files Browse the repository at this point in the history
  • Loading branch information
clemlak committed Dec 4, 2023
1 parent c41b120 commit 9334c05
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion contracts/Portfolio.sol
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ contract Portfolio is ERC1155, IPortfolio {
}

function updatePool(uint64 poolId, bytes memory data) external {
IStrategy(getStrategy(poolId)).updatePool(poolId, data);
IStrategy(getStrategy(poolId)).updatePool(poolId, msg.sender, data);
}

/// @inheritdoc IPortfolioActions
Expand Down
6 changes: 5 additions & 1 deletion contracts/interfaces/IStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,9 @@ interface IStrategy is IPortfolioStrategy {
uint256 reserveY
) external view returns (bool, int256);

function updatePool(uint64 poolId, bytes memory data) external;
function updatePool(
uint64 poolId,
address caller,
bytes memory data
) external;
}
2 changes: 2 additions & 0 deletions contracts/strategies/G3MStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ contract G3MStrategy is IG3MStrategy {
return configs[poolId].weightX != 0;
}

function updatePool(uint64, address, bytes memory) external { }

/// @inheritdoc IStrategy
function beforeSwap(
uint64 poolId,
Expand Down
2 changes: 1 addition & 1 deletion contracts/strategies/NormalStrategy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ contract NormalStrategy is INormalStrategy {
error CannotUpdatePool();

/// @inheritdoc IStrategy
function updatePool(uint64, bytes memory) external {
function updatePool(uint64, address, bytes memory) external {
revert CannotUpdatePool();
}

Expand Down

0 comments on commit 9334c05

Please sign in to comment.