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

[ETHEREUM-CONTRACTS] [GDA] Fixes for GDA #1729

Merged
merged 75 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
9bba415
[ETHEREUM-CONTRACTS] BatchLiquidator: don't revert for non-transferra…
d10r Oct 16, 2023
2da9bb9
patch getUnderlyingToken (#1718)
0xdavinchee Oct 16, 2023
7177a50
Bump undici from 5.21.0 to 5.26.3 (#1719)
dependabot[bot] Oct 17, 2023
de7df25
add error hashes, use currentContext.timestamp
0xdavinchee Oct 17, 2023
1616671
use getHost.getTimestamp()
0xdavinchee Oct 17, 2023
72f1611
Bump @babel/traverse from 7.21.3 to 7.23.2 (#1723)
dependabot[bot] Oct 18, 2023
ffe6790
[SDK-CORE/ METADATA] SDK-Core No Governance Fix + Metadata Types (#1728)
0xdavinchee Oct 20, 2023
1798815
remove tests flakiness
0xdavinchee Oct 20, 2023
99e2d6d
remove forge.sh
0xdavinchee Oct 20, 2023
8ab5829
[SDK-CORE] GoodDollar sdk core fix (#1734)
0xdavinchee Oct 24, 2023
e8990d8
[ETHEREUM-CONTRACTS] make deploy script compatible with ethers v6 (#1…
0xdavinchee Oct 24, 2023
da9f3e6
update deploy.sh (#1738)
0xdavinchee Oct 27, 2023
ddc8213
Bump browserify-sign in /packages/sdk-core/previous-versions-testing …
dependabot[bot] Oct 30, 2023
99f4a68
Bump browserify-sign from 4.2.1 to 4.2.2 (#1739)
dependabot[bot] Oct 30, 2023
7f68614
fix verification script
d10r Oct 31, 2023
b50c82f
change GDA forwarder address (needed to redeploy)
d10r Oct 31, 2023
081415f
change GDA forwarder address for polygon-mumbai
d10r Nov 3, 2023
50c3ccf
fix tests to fuzz with different pool configs and fix distributeFlow …
0xdavinchee Nov 6, 2023
5bb4aa2
fix TOB-SUPERFLUID-2: Incorrect event emission in connectPool
0xdavinchee Nov 6, 2023
42e0448
fix TOB-SUPERFLUID-5: Large encoded buffer amount could manipulate pr…
0xdavinchee Nov 6, 2023
66bae97
fix TOB-SUPERFLUID-6: Off-by-one gas left check
0xdavinchee Nov 6, 2023
500e787
fix broken test
0xdavinchee Nov 6, 2023
ae6b2f1
wrangle with reducing the code size of GDA...
0xdavinchee Nov 6, 2023
5e1024b
cleanup
0xdavinchee Nov 6, 2023
23acb2c
fix build + tests
0xdavinchee Nov 6, 2023
86d0e27
cleanup
0xdavinchee Nov 6, 2023
761ce76
add update beacon proxy update paths
0xdavinchee Nov 8, 2023
a56dc42
fix broken deploy script, add tests, add transfer ownership of beacon…
0xdavinchee Nov 8, 2023
697e497
fix broken deploy script attempt 2
0xdavinchee Nov 8, 2023
3297168
[WORKFLOWS] Use nix in `handler.run-ethereum-contracts-script.yml` (#…
0xdavinchee Nov 14, 2023
4227f0a
[ETHEREUM-CONTRACTS] App credit test (#1743)
0xdavinchee Nov 14, 2023
2295e0f
add cliName (#1748)
0xdavinchee Nov 15, 2023
5389948
doConnect != isConnected fixed
0xdavinchee Nov 15, 2023
ce89da0
remove extra whitespace
0xdavinchee Nov 15, 2023
e345e10
add assertEq in SFGovII test and import PoolConfig in ISuperfluid for…
0xdavinchee Nov 15, 2023
3516a61
merge conflict resolved
0xdavinchee Nov 15, 2023
fffedd0
fix build
0xdavinchee Nov 15, 2023
eba67b0
merge metadata changes in
0xdavinchee Nov 15, 2023
10e8f9d
fuzzing fix
0xdavinchee Nov 15, 2023
570812f
EXPECT BREAKAGE IN FUZZ
0xdavinchee Nov 15, 2023
7efa597
fix build but echidna should break
0xdavinchee Nov 15, 2023
27ead42
undo breakage
0xdavinchee Nov 15, 2023
fd83f01
fix the test
0xdavinchee Nov 15, 2023
c6322e0
bump sdk-core version, fix sdk-core operation functions, fix subgraph…
0xdavinchee Nov 16, 2023
e44ec01
fix unit tests
0xdavinchee Nov 16, 2023
ce55850
fix again
0xdavinchee Nov 16, 2023
9f51f3e
hot fuzz additions
0xdavinchee Nov 17, 2023
bfa428c
[ETHEREUM-CONTRACTS] Fix canary build (#1742)
d10r Nov 20, 2023
8d7d403
distributeFlow: fix order of args to be consistent
d10r Nov 21, 2023
651cbe6
fix build
0xdavinchee Nov 22, 2023
9f32e90
add fix back in
0xdavinchee Nov 22, 2023
a98c3c6
[ETHEREUM-CONTRACTS] new resolver and loader, updated and bumped meta…
d10r Nov 24, 2023
9122e24
fix build
d10r Nov 24, 2023
690b599
new resolver and loader, refs #1004
d10r Nov 24, 2023
566fce8
remove getIsListed workaround assuming resolver exists (#1751)
0xdavinchee Nov 24, 2023
37038b4
merge dev
0xdavinchee Nov 24, 2023
b892785
fix broken unit test
0xdavinchee Nov 27, 2023
3cb0782
fix gda logic
0xdavinchee Nov 27, 2023
a429e11
[ETHEREUM-CONTRACTS] new resolver & loader address for mainnets (#1752)
d10r Nov 27, 2023
4065973
remove unimplemented function from yaml (#1753)
0xdavinchee Nov 28, 2023
7f2e5cf
map the name from subgraph to unknown entity (#1754)
kasparkallas Dec 1, 2023
886c0f1
Merge branch 'dev' into gda-fixes
hellwolf Dec 6, 2023
8516ec6
fix mapping
0xdavinchee Dec 7, 2023
a3a5a61
add total units
0xdavinchee Dec 11, 2023
9577da2
missing import
0xdavinchee Dec 11, 2023
655cc5b
missing import pt 2
0xdavinchee Dec 12, 2023
e3dcef5
[WORKFLOW] Subgraph deloy all networks (#1760)
mmd-afegbua Dec 14, 2023
b182e1d
fix
0xdavinchee Dec 14, 2023
e5da4ec
fix mapping (#1758)
0xdavinchee Dec 14, 2023
5f66bbb
added new supported subgraphs (#1761)
mmd-afegbua Dec 18, 2023
941f460
remove duplicate verification
d10r Jan 3, 2024
5526913
subgraph mapping addition
0xdavinchee Jan 3, 2024
1bf8e7c
type fix (#1771)
0xdavinchee Jan 4, 2024
abaeb14
readme fix
0xdavinchee Jan 5, 2024
a7e370a
Merge branch 'dev' into gda-fixes
0xdavinchee Jan 5, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
uint256 private constant _POOL_SUBS_BITMAP_STATE_SLOT_ID = 1;
/// @dev Pool member state slot id starting point for pool connections
uint256 private constant _POOL_CONNECTIONS_DATA_STATE_SLOT_ID_START = 1 << 128;
/// @dev CFAv1 PPP Config Key
bytes32 private constant CFAV1_PPP_CONFIG_KEY =
keccak256("org.superfluid-finance.agreements.ConstantFlowAgreement.v1.PPPConfiguration");

/// @dev SuperToken minimum deposit key
bytes32 private constant SUPERTOKEN_MINIMUM_DEPOSIT_KEY =
keccak256("org.superfluid-finance.superfluid.superTokenMinimumDeposit");

Expand All @@ -105,19 +102,21 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
superfluidPoolBeacon = superfluidPoolBeacon_;
}

function realtimeBalanceVectorAt(ISuperfluidToken token, address account, uint256 time)
function realtimeBalanceOf(ISuperfluidToken token, address account, uint256 time)
public
view
returns (int256 available, int256 fromPools, int256 buffer)
override
returns (int256 rtb, uint256 buf, uint256 owedBuffer)
{
UniversalIndexData memory universalIndexData = _getUIndexData(abi.encode(token), account);

if (_isPool(token, account)) {
available = ISuperfluidPool(account).getDisconnectedBalance(uint32(time));
rtb = ISuperfluidPool(account).getDisconnectedBalance(uint32(time));
} else {
available = Value.unwrap(_getBasicParticleFromUIndex(universalIndexData).rtb(Time.wrap(uint32(time))));
rtb = Value.unwrap(_getBasicParticleFromUIndex(universalIndexData).rtb(Time.wrap(uint32(time))));
}

int256 fromPools;
{
(uint32[] memory slotIds, bytes32[] memory pidList) = _listPoolConnectionIds(token, account);
for (uint256 i = 0; i < slotIds.length; ++i) {
Expand All @@ -126,24 +125,12 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
_getPoolMemberData(token, account, ISuperfluidPool(pool));
assert(exist);
assert(poolMemberData.pool == pool);
fromPools = fromPools + ISuperfluidPool(pool).getClaimable(account, uint32(time));
fromPools += ISuperfluidPool(pool).getClaimable(account, uint32(time));
}
}
rtb += fromPools;

buffer = universalIndexData.totalBuffer.toInt256();
}

function realtimeBalanceOf(ISuperfluidToken token, address account, uint256 time)
public
view
override
returns (int256 rtb, uint256 buf, uint256 owedBuffer)
{
(int256 available, int256 fromPools, int256 buffer) = realtimeBalanceVectorAt(token, account, time);
rtb = available + fromPools;

buf = uint256(buffer); // upcasting to uint256 is safe
owedBuffer = 0;
buf = uint256(universalIndexData.totalBuffer.toInt256()); // upcasting to uint256 is safe
}

/// @dev ISuperAgreement.realtimeBalanceOf implementation
Expand Down Expand Up @@ -322,9 +309,14 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
ISuperfluid.Context memory currentContext = AgreementLibrary.authorizeTokenAccess(token, ctx);
address msgSender = currentContext.msgSender;
newCtx = ctx;
bool isConnected = _isMemberConnected(token, address(pool), msgSender);
if (doConnect) {
if (!isMemberConnected(token, address(pool), msgSender)) {
assert(SuperfluidPool(address(pool)).operatorConnectMember(msgSender, true, uint32(block.timestamp)));
if (!isConnected) {
assert(
SuperfluidPool(address(pool)).operatorConnectMember(
msgSender, true, uint32(currentContext.timestamp)
)
);

uint32 poolSlotID =
_findAndFillPoolConnectionsBitmap(token, msgSender, bytes32(uint256(uint160(address(pool)))));
Expand All @@ -338,31 +330,32 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
);
}
} else {
if (isMemberConnected(token, address(pool), msgSender)) {
assert(SuperfluidPool(address(pool)).operatorConnectMember(msgSender, false, uint32(block.timestamp)));
if (isConnected) {
assert(
SuperfluidPool(address(pool)).operatorConnectMember(
msgSender, false, uint32(currentContext.timestamp)
)
);
(, PoolMemberData memory poolMemberData) = _getPoolMemberData(token, msgSender, pool);
token.terminateAgreement(_getPoolMemberHash(msgSender, pool), 1);

_clearPoolConnectionsBitmap(token, msgSender, poolMemberData.poolID);
}
}

emit PoolConnectionUpdated(token, pool, msgSender, doConnect, currentContext.userData);
// we only emit PoolConnectionUpdated if the connection state has changed
if (doConnect && !isConnected || !doConnect && isConnected) {
0xdavinchee marked this conversation as resolved.
Show resolved Hide resolved
emit PoolConnectionUpdated(token, pool, msgSender, doConnect, currentContext.userData);
}
}

/// @inheritdoc IGeneralDistributionAgreementV1
function isMemberConnected(ISuperfluidToken token, address pool, address member)
public
view
override
returns (bool)
{
function _isMemberConnected(ISuperfluidToken token, address pool, address member) internal view returns (bool) {
(bool exist,) = _getPoolMemberData(token, member, ISuperfluidPool(pool));
return exist;
}

function isMemberConnected(ISuperfluidPool pool, address member) public view override returns (bool) {
return isMemberConnected(pool.superToken(), address(pool), member);
function isMemberConnected(ISuperfluidPool pool, address member) external view override returns (bool) {
return _isMemberConnected(pool.superToken(), address(pool), member);
}

function appendIndexUpdateByPool(ISuperfluidToken token, BasicParticle memory p, Time t) external returns (bool) {
Expand Down Expand Up @@ -404,12 +397,15 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
revert GDA_ONLY_SUPER_TOKEN_POOL();
}

// you cannot distribute if admin is not equal to the ctx.msgSender
if (!pool.distributionFromAnyAddress()) {
if (pool.admin() != currentContext.msgSender) {
revert GDA_DISTRIBUTE_FROM_ANY_ADDRESS_NOT_ALLOWED();
}
}

// the from address must be the same as the ctx.msgSender
// there is no ACL support
if (from != currentContext.msgSender) {
revert GDA_DISTRIBUTE_FOR_OTHERS_NOT_ALLOWED();
}
Expand Down Expand Up @@ -467,7 +463,10 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi

newCtx = ctx;

if (!pool.distributionFromAnyAddress()) {
// we must check if the requestedFlowRate is greater than 0 here
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's improve our echidna fuzzing with better assertions on expected liquidations.

// otherwise we will block liquidators from closing streams in pools
// where the pool config has distributionFromAnyAddress set to false
if (requestedFlowRate > 0 && !pool.distributionFromAnyAddress()) {
if (pool.admin() != flowVars.currentContext.msgSender) {
revert GDA_DISTRIBUTE_FROM_ANY_ADDRESS_NOT_ALLOWED();
}
Expand All @@ -479,7 +478,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
address(pool),
flowVars.distributionFlowHash,
FlowRate.wrap(requestedFlowRate),
Time.wrap(uint32(block.timestamp))
Time.wrap(uint32(flowVars.currentContext.timestamp))
);

// handle distribute flow on behalf of someone else
Expand Down Expand Up @@ -515,14 +514,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
}

{
_adjustBuffer(
abi.encode(token),
address(pool),
from,
flowVars.distributionFlowHash,
flowVars.oldFlowRate,
actualFlowRate
);
_adjustBuffer(token, address(pool), from, flowVars.distributionFlowHash, actualFlowRate);
}

// ensure sender has enough balance to execute transaction
Expand Down Expand Up @@ -636,7 +628,6 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
_getFlowDistributionData(ISuperfluidToken(data.token), data.distributionFlowHash);
int256 signedSingleDeposit = flowDistributionData.buffer.toInt256();

bytes memory liquidationTypeData;
bool isCurrentlyPatricianPeriod;

{
Expand All @@ -652,10 +643,9 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
// critical case
if (totalRewardLeft >= 0) {
int256 rewardAmount = (signedSingleDeposit * totalRewardLeft) / data.signedTotalGDADeposit;
liquidationTypeData = abi.encode(2, isCurrentlyPatricianPeriod ? 0 : 1);
data.token.makeLiquidationPayoutsV2(
data.distributionFlowHash,
liquidationTypeData,
abi.encode(2, isCurrentlyPatricianPeriod ? 0 : 1),
data.liquidator,
isCurrentlyPatricianPeriod,
data.sender,
Expand All @@ -677,15 +667,9 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
}
}

function _adjustBuffer(
bytes memory eff,
address pool,
address from,
bytes32 flowHash,
FlowRate, // oldFlowRate,
FlowRate newFlowRate
) internal returns (bytes memory) {
address token = abi.decode(eff, (address));
function _adjustBuffer(ISuperfluidToken token, address pool, address from, bytes32 flowHash, FlowRate newFlowRate)
internal
{
// not using oldFlowRate in this model
// surprising effect: reducing flow rate may require more buffer when liquidation_period adjusted upward
ISuperfluidGovernance gov = ISuperfluidGovernance(ISuperfluid(_host).getGovernance());
Expand Down Expand Up @@ -718,7 +702,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
ISuperfluidToken(token).updateAgreementData(flowHash, data);
}

UniversalIndexData memory universalIndexData = _getUIndexData(eff, from);
UniversalIndexData memory universalIndexData = _getUIndexData(abi.encode(token), from);
universalIndexData.totalBuffer =
// new buffer
(universalIndexData.totalBuffer.toInt256() + Value.unwrap(bufferDelta)).toUint256();
Expand All @@ -736,8 +720,6 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
universalIndexData.totalBuffer
);
}

return eff;
}

// Solvency Related Getters
Expand Down Expand Up @@ -810,7 +792,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
data = new bytes32[](2);
data[0] = bytes32(
(uint256(int256(FlowRate.unwrap(p.flow_rate()))) << 160) | (uint256(Time.unwrap(p.settled_at())) << 128)
| (buffer << 32) | (isPool_ ? 1 : 0)
| (uint256(buffer.toUint96()) << 32) | (isPool_ ? 1 : 0)
);
data[1] = bytes32(uint256(Value.unwrap(p._settled_value)));
}
Expand All @@ -823,7 +805,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
data = new bytes32[](2);
data[0] = bytes32(
(uint256(int256(uIndexData.flowRate)) << 160) | (uint256(uIndexData.settledAt) << 128)
| (uint256(uIndexData.totalBuffer) << 32) | (uIndexData.isPool ? 1 : 0)
| (uint256(uIndexData.totalBuffer.toUint96()) << 32) | (uIndexData.isPool ? 1 : 0)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

cc @hellwolf please take a closer look

);
data[1] = bytes32(uint256(uIndexData.settledValue));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
override
returns (int256 claimableBalance, uint256 timestamp)
{
// TODO, GDA.getHost().getTimestamp() should be used in principle
return (getClaimable(memberAddr, uint32(block.timestamp)), block.timestamp);
timestamp = ISuperfluid(superToken.getHost()).getNow();
return (getClaimable(memberAddr, uint32(timestamp)), timestamp);
}

/// @inheritdoc ISuperfluidPool
Expand Down Expand Up @@ -402,7 +402,7 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {
PDPoolMemberMU memory mu = PDPoolMemberMU(pdPoolIndex, pdPoolMember);

// update pool's disconnected units
if (!GDA.isMemberConnected(superToken, address(this), memberAddr)) {
if (!GDA.isMemberConnected(ISuperfluidPool(address(this)), memberAddr)) {
// trigger the side effect of claiming all if not connected
// @note claiming is a bit surprising here given the function name
int256 claimedAmount = _claimAll(memberAddr, time);
Expand Down Expand Up @@ -442,9 +442,8 @@ contract SuperfluidPool is ISuperfluidPool, BeaconProxiable {

/// @inheritdoc ISuperfluidPool
function claimAll(address memberAddr) public returns (bool) {
bool isConnected = GDA.isMemberConnected(superToken, address(this), memberAddr);
// TODO, GDA.getHost().getTimestamp() should be used in principle
uint32 time = uint32(block.timestamp);
bool isConnected = GDA.isMemberConnected(ISuperfluidPool(address(this)), memberAddr);
uint32 time = uint32(ISuperfluid(superToken.getHost()).getNow());
int256 claimedAmount = _claimAll(memberAddr, time);
if (!isConnected) {
_shiftDisconnectedUnits(Unit.wrap(0), Value.wrap(claimedAmount), Time.wrap(time));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ library SuperTokenV1Library {

function isMemberConnected(ISuperToken token, address pool, address member) internal view returns (bool) {
(, IGeneralDistributionAgreementV1 gda) = _getHostAndGDA(token);
return gda.isMemberConnected(token, pool, member);
return gda.isMemberConnected(ISuperfluidPool(pool), member);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
ISuperfluid host,
address hostNewLogic,
address[] calldata agreementClassNewLogics,
address superTokenFactoryNewLogic
address superTokenFactoryNewLogic,
address poolBeaconNewLogic
)
external override
onlyAuthorized(host)
Expand All @@ -87,6 +88,9 @@ abstract contract SuperfluidGovernanceBase is ISuperfluidGovernance
// solhint-disable-next-line no-empty-blocks
catch {}
}
if (poolBeaconNewLogic != address(0)) {
host.updatePoolBeaconLogic(poolBeaconNewLogic);
}
}

function batchUpdateSuperTokenLogic(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ abstract contract IGeneralDistributionAgreementV1 is ISuperAgreement {
/// Check if an address is connected to the pool
function isMemberConnected(ISuperfluidPool pool, address memberAddr) external view virtual returns (bool);

/// Check if an address is connected to the pool
function isMemberConnected(ISuperfluidToken token, address pool, address memberAddr)
external
view
virtual
returns (bool);

/// Get pool adjustment flow information: (recipient, flowHash, flowRate)
function getPoolAdjustmentFlowInfo(ISuperfluidPool pool) external view virtual returns (address, bytes32, int96);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ pragma solidity >=0.8.4;
import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

interface IPoolNFTBase is IERC721Metadata {
error POOL_NFT_APPROVE_TO_CALLER();
error POOL_NFT_ONLY_SUPER_TOKEN_FACTORY();
error POOL_NFT_INVALID_TOKEN_ID();
error POOL_NFT_APPROVE_TO_CURRENT_OWNER();
error POOL_NFT_APPROVE_CALLER_NOT_OWNER_OR_APPROVED_FOR_ALL();
error POOL_NFT_NOT_REGISTERED_POOL();
error POOL_NFT_TRANSFER_NOT_ALLOWED();
error POOL_NFT_TRANSFER_CALLER_NOT_OWNER_OR_APPROVED_FOR_ALL();
error POOL_NFT_APPROVE_TO_CALLER(); // 0x9212b333
error POOL_NFT_ONLY_SUPER_TOKEN_FACTORY(); // 0x1fd7e3d8
error POOL_NFT_INVALID_TOKEN_ID(); // 0x09275994
error POOL_NFT_APPROVE_TO_CURRENT_OWNER(); // 0x020226d3
error POOL_NFT_APPROVE_CALLER_NOT_OWNER_OR_APPROVED_FOR_ALL(); // 0x1e82f255
error POOL_NFT_NOT_REGISTERED_POOL(); // 0x6421912e
error POOL_NFT_TRANSFER_NOT_ALLOWED(); // 0x432fb160
0xdavinchee marked this conversation as resolved.
Show resolved Hide resolved
error POOL_NFT_TRANSFER_CALLER_NOT_OWNER_OR_APPROVED_FOR_ALL(); // 0x4028ee0e

/// @notice Informs third-party platforms that NFT metadata should be updated
/// @dev This event comes from https://eips.ethereum.org/EIPS/eip-4906
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,19 @@ interface ISuperfluid {
*/
function changeSuperTokenAdmin(ISuperToken token, address newAdmin) external;

/**
* @notice Change the implementation address the pool beacon points to
* @dev Updating the logic the beacon points to will update the logic of all the Pool BeaconProxy instances
*/
function updatePoolBeaconLogic(address newBeaconLogic) external;

/**
* @dev Pool Beacon logic updated event
* @param beaconProxy addrss of the beacon proxy
* @param newBeaconLogic address of the new beacon logic
*/
event PoolBeaconLogicUpdated(address indexed beaconProxy, address newBeaconLogic);

/**************************************************************************
* App Registry
*************************************************************************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ interface ISuperfluidGovernance {
ISuperfluid host,
address hostNewLogic,
address[] calldata agreementClassNewLogics,
address superTokenFactoryNewLogic
address superTokenFactoryNewLogic,
address beaconNewLogic
Copy link
Contributor

Choose a reason for hiding this comment

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

@d10r we need to upgrade the governance contract, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes

) external;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ library SafeGasLibrary {
error OUT_OF_GAS(); // 0x20afada5

function _isOutOfGas(uint256 gasLeftBefore) internal view returns (bool) {
return gasleft() <= gasLeftBefore / 63;
return gasleft() <= gasLeftBefore / 64;
}

/// @dev A function used in the catch block to handle true out of gas errors
Expand Down
Loading