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
3 changes: 2 additions & 1 deletion packages/ethereum-contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed
- Fixed deployment of SimpleForwarder (solved an issue which caused batch operation `OPERATION_TYPE_SIMPLE_FORWARD_CALL` to always revert)
- `SuperTokenV1Library.getFlowRate` and `SuperTokenV1Library.getFlowInfo` now also allow querying the flowrate between pools and pool members.
- `SuperTokenV1Library.getFlowRate` and `SuperTokenV1Library.getFlowInfo` now also allow querying the flowrate between pools and pool members
- Superfluid Pools now emit a Transfer event when changing units with `updateMemberUnits`.

### Breaking
- `SuperTokenV1Library.distributeFlow`: return `actualFlowRate` instead of a bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,15 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
function updateMemberUnits(address memberAddr, uint128 newUnits) external returns (bool) {
if (msg.sender != admin && msg.sender != address(GDA)) revert SUPERFLUID_POOL_NOT_POOL_ADMIN_OR_GDA();

_updateMemberUnits(memberAddr, newUnits);
uint128 oldUnits = _updateMemberUnits(memberAddr, newUnits);

// Unit updates by admin are effectively mint/burn operations when viewed through the ERC20 lens.
// We thus emit a Transfer event from/to the zero address accordingly.
if (oldUnits < newUnits) {
emit Transfer(address(0), memberAddr, newUnits - oldUnits);
} else if (oldUnits > newUnits) {
emit Transfer(memberAddr, address(0), oldUnits - newUnits);
}

return true;
}
Expand Down Expand Up @@ -433,7 +441,7 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
}
}

function _updateMemberUnits(address memberAddr, uint128 newUnits) internal returns (bool) {
function _updateMemberUnits(address memberAddr, uint128 newUnits) internal returns (uint128 oldUnits) {
// @note normally we keep the sanitization in the external functions, but here
// this is used in both updateMemberUnits and transfer
if (GDA.isPool(superToken, memberAddr)) revert SUPERFLUID_POOL_NO_POOL_MEMBERS();
Expand All @@ -447,7 +455,7 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
MemberData memory memberData = _membersData[memberAddr];
PDPoolMember memory pdPoolMember = _memberDataToPDPoolMember(memberData);

uint128 oldUnits = memberData.ownedUnits;
oldUnits = memberData.ownedUnits;

PDPoolMemberMU memory mu = PDPoolMemberMU(pdPoolIndex, pdPoolMember);

Expand All @@ -468,8 +476,6 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
emit MemberUnitsUpdated(superToken, memberAddr, oldUnits, newUnits);

_handlePoolMemberNFT(memberAddr, newUnits);

return true;
}

function _claimAll(address memberAddr, uint32 time) internal returns (int256 amount) {
Expand Down