Skip to content

Commit

Permalink
fix some of the gda invariance issues
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdavinchee committed Aug 17, 2023
1 parent f4dc04f commit e49b358
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi
returns (int256 rtb, uint256 buf, uint256 owedBuffer)
{
(int256 available, int256 fromPools, int256 buffer) = realtimeBalanceVectorAt(token, account, time);
rtb = available + fromPools - buffer;
rtb = available + fromPools;

buf = uint256(buffer); // upcasting to uint256 is safe
owedBuffer = 0;
Expand Down Expand Up @@ -687,8 +687,6 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi

Value bufferDelta = newBufferAmount - Value.wrap(uint256(flowDistributionData.buffer).toInt256());

eff = _doShift(eff, from, address(this), bufferDelta);

{
bytes32[] memory data = _encodeFlowDistributionData(
FlowDistributionData({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ contract FoundrySuperfluidTester is Test {
require(nTesters <= TEST_ACCOUNTS.length, "too many testers");
N_TESTERS = nTesters;

_addAccount(address(sf.gda));

// Set the token type being tested
string memory tokenType = vm.envOr(TOKEN_TYPE_ENV_KEY, DEFAULT_TEST_TOKEN_TYPE);
bytes32 hashedTokenType = keccak256(abi.encode(tokenType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste
);
}

function testDistributeFlowToDisconnectedMembers(UpdateMemberData memory member, int32 flowRate, uint16 warpTime) public {
function testDistributeFlowToDisconnectedMember(UpdateMemberData memory member, int32 flowRate) public {
vm.assume(flowRate > 0);

_helperUpdateMemberUnits(currentPool, alice, member.member, 1);
Expand Down
2 changes: 2 additions & 0 deletions packages/hot-fuzz/contracts/HotFuzzBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ contract HotFuzzBase {
);
nTesters = nTesters_;
otherAccounts = new address[](0);

_addAccount(address(sf.gda));
}

function _initTesters() virtual internal {
Expand Down

0 comments on commit e49b358

Please sign in to comment.