diff --git a/flake.lock b/flake.lock index e01a8e212a..83f4a97425 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1707037862, - "narHash": "sha256-jCNrmFDx+neh7Uz0Q2kmqz19Yyz8OxnGoZpzd2w3SME=", + "lastModified": 1717405880, + "narHash": "sha256-qcXXOnRSl0sGKm7JknntBU4su8/342YKZvjklHsIl+Q=", "owner": "shazow", "repo": "foundry.nix", - "rev": "03b8af1efb00c51dceaac92462dc77b1b57683e0", + "rev": "708c0df1e36b5185a727a3c517a5100e46392792", "type": "github" }, "original": { diff --git a/packages/ethereum-contracts/CHANGELOG.md b/packages/ethereum-contracts/CHANGELOG.md index 76bd6f606e..d1b5f4420c 100644 --- a/packages/ethereum-contracts/CHANGELOG.md +++ b/packages/ethereum-contracts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to the ethereum-contracts will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [unreleased] + +### Changed + +- fix a few types and build warnings +- rename '.prop.sol' to '.prop.t.sol' +- upgrade flake lock input: foundry + ## [v1.9.1] - 2024-03-19 ### Breaking diff --git a/packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol b/packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol index 286a65e093..b389f658f6 100644 --- a/packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol +++ b/packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol @@ -837,7 +837,7 @@ library SuperTokenV1Library { * @dev get flow info of a distributor to a pool for given token * @param token The token used in flow * @param distributor The sitributor of the flow - * @param pool The GDA pool + * @param pool The GDA pool * @return lastUpdated Timestamp of flow creation or last flowrate change * @return flowRate The flow rate * @return deposit The amount of deposit the flow @@ -922,7 +922,7 @@ library SuperTokenV1Library { deposit += cfaDeposit; owedDeposit += cfaOwedDeposit; } - + { (uint256 lastUpdatedGDA, int96 gdaNetFlowRate, uint256 gdaDeposit) = gda.getAccountFlowInfo(token, account); @@ -964,10 +964,11 @@ library SuperTokenV1Library { function getGDANetFlowInfo(ISuperToken token, address account) internal view - returns (uint256 lastUpdated, int96 flowRate, uint256 deposit, uint256 /* owedDeposit unused */) + returns (uint256 lastUpdated, int96 flowRate, uint256 deposit, uint256 owedDeposit) { (, IGeneralDistributionAgreementV1 gda) = _getHostAndGDA(token); (lastUpdated, flowRate, deposit) = gda.getAccountFlowInfo(token, account); + owedDeposit = 0; // unused in GDA } /** diff --git a/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol index f9a1f97109..fb2f3dbe8f 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol @@ -8,7 +8,7 @@ contract SuperfluidDestructorMock { fallback() external { // this == impl in this call - selfdestruct(payable(0)); + assembly { selfdestruct(0) } } } diff --git a/packages/ethereum-contracts/foundry.toml b/packages/ethereum-contracts/foundry.toml index 55b6f5502f..052a997e02 100644 --- a/packages/ethereum-contracts/foundry.toml +++ b/packages/ethereum-contracts/foundry.toml @@ -1,10 +1,12 @@ [profile.default] root = '../..' src = 'packages/ethereum-contracts/contracts' -test = 'packages/ethereum-contracts/test/foundry/' +test = 'packages/ethereum-contracts/test/foundry' solc_version = "0.8.23" -ignored_error_codes = [5159] # selfdestruct in contracts/mocks/SuperfluidDestructorMock.sol -# deny_warnings = true +#deny_warnings = true +ignored_error_codes = [ + 1699 # assembly { selfdestruct } in contracts/mocks/SuperfluidDestructorMock.sol +] # keep in sync with truffle-config.js evm_version = 'paris' remappings = [ diff --git a/packages/ethereum-contracts/package.json b/packages/ethereum-contracts/package.json index 63dd9f3dfe..52e4ece8e2 100644 --- a/packages/ethereum-contracts/package.json +++ b/packages/ethereum-contracts/package.json @@ -13,11 +13,12 @@ "/contracts/**/*", "!/contracts/mocks/*", "/build/truffle/*.json", - "/build/hardhat/**/*", "!/build/truffle/*Mock*.json", "!/build/truffle/*Tester*.json", "!/build/truffle/*Anvil.json", "!/build/truffle/*Properties.json", + "/build/hardhat/**/*", + "!/build/hardhat/contracts/mocks/**/*", "/build/contracts-sizes.txt", "/build/bundled-abi.js", "/build/bundled-abi.json", diff --git a/packages/ethereum-contracts/test/foundry/FoundrySuperfluidTester.sol b/packages/ethereum-contracts/test/foundry/FoundrySuperfluidTester.sol index ce0477ddea..9dd1946818 100644 --- a/packages/ethereum-contracts/test/foundry/FoundrySuperfluidTester.sol +++ b/packages/ethereum-contracts/test/foundry/FoundrySuperfluidTester.sol @@ -1606,7 +1606,6 @@ contract FoundrySuperfluidTester is Test { PoolUnitData memory poolUnitDataBefore = _helperGetPoolUnitsData(pool_); - (int256 claimableBalance,) = pool_.getClaimableNow(member_); (int256 balanceBefore,,,) = poolSuperToken.realtimeBalanceOfNow(member_); { _updateMemberUnits(pool_, poolSuperToken, caller_, member_, newUnits_, useBools_); diff --git a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.sol b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.sol rename to packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol diff --git a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol index 12e2ff9aee..c95b0c52ec 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol @@ -559,9 +559,9 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste for (uint256 i = 0; i < members.length; ++i) { if (sf.gda.isPool(superToken, members[i]) || members[i] == address(0)) continue; - uint128 memberUnits = pool.getUnits(members[i]); + uint128 memberIUnits = pool.getUnits(members[i]); - assertEq(perUnitDistributionAmount * memberUnits, pool.getTotalAmountReceivedByMember(members[i])); + assertEq(perUnitDistributionAmount * memberIUnits, pool.getTotalAmountReceivedByMember(members[i])); } } @@ -594,9 +594,9 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste for (uint256 i = 0; i < members.length; ++i) { if (sf.gda.isPool(superToken, members[i]) || members[i] == address(0)) continue; - uint128 memberUnits = pool.getUnits(members[i]); + uint128 memberIUnits = pool.getUnits(members[i]); - assertEq(perUnitDistributionAmount * memberUnits, pool.getTotalAmountReceivedByMember(members[i])); + assertEq(perUnitDistributionAmount * memberIUnits, pool.getTotalAmountReceivedByMember(members[i])); } } diff --git a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.sol rename to packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol diff --git a/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.sol b/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.sol rename to packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol diff --git a/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.sol b/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.sol rename to packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol diff --git a/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.sol b/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.sol rename to packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol diff --git a/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.sol b/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol similarity index 100% rename from packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.sol rename to packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol diff --git a/packages/hot-fuzz/contracts/superfluid-tests/ConstantFlowAgreementV1.prop.sol b/packages/hot-fuzz/contracts/superfluid-tests/ConstantFlowAgreementV1.prop.t.sol similarity index 100% rename from packages/hot-fuzz/contracts/superfluid-tests/ConstantFlowAgreementV1.prop.sol rename to packages/hot-fuzz/contracts/superfluid-tests/ConstantFlowAgreementV1.prop.t.sol