-
Notifications
You must be signed in to change notification settings - Fork 258
[ETHEREUM-CONTRACTS] Migrate to OpenZeppelin v5 #2097
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
base: dev
Are you sure you want to change the base?
Changes from all commits
ba1b067
f76ce16
62697d9
ab01e42
ea53653
9c433c5
b56c0f3
d6687ab
5dad0c3
882f654
e27cb41
5a0fb64
b856b8a
cd864bd
88e17f3
8db285b
101bdfc
701ea33
4dce3b7
5a603b2
77e3f9d
d3bfd95
d6c9135
2aa5ccd
b4e6342
c195923
bd1d158
c76c167
64484ae
d8ea0dc
79109ec
d578842
dff96ab
c855ecf
e0ca43f
4ca4195
ae36ff0
365b087
5ec58cd
7b2e30f
7aef0ee
cdf0482
9b4da71
283402a
c5fd4d5
088eba3
03b81ba
5652c9d
21da9df
5608475
5a3639d
31bf0b3
eee4100
d4cebf3
b296937
b012934
248f289
253ab3b
e34e685
9fde692
aa88d2d
33aac3e
9bb6b92
116fe41
6b53d00
deef970
db9cefe
bc35b72
288b660
b3c6a8c
a24ef82
67415dd
91f26a7
dd78939
075a1c0
a7686ff
e6ffae8
5093e4c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts.git | ||
branch = release-v5.4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,10 +4,22 @@ require("@nomiclabs/hardhat-etherscan"); | |
require("hardhat-deploy"); | ||
require("hardhat/config"); | ||
require("./script/addStrategy"); | ||
const {TASK_COMPILE_GET_REMAPPINGS} = require("hardhat/builtin-tasks/task-names"); | ||
|
||
// You need to export an object to set up your config | ||
// Go to https://hardhat.org/config/ to learn more | ||
|
||
// Remapping for OpenZeppelin contracts | ||
subtask(TASK_COMPILE_GET_REMAPPINGS).setAction( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider to drop a section in the https://github.com/superfluid-org/protocol-monorepo/blob/dev/packages/ethereum-contracts/README.md |
||
async (_, __, runSuper) => { | ||
const remappings = await runSuper(); | ||
return { | ||
...remappings, | ||
"@openzeppelin/contracts/": "@openzeppelin-v5/contracts/", | ||
}; | ||
} | ||
); | ||
|
||
/** | ||
* @type import('hardhat/config').HardhatUserConfig | ||
*/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ import { IVestingSchedulerV2 } from "./../contracts/interface/IVestingSchedulerV | |
import { VestingSchedulerV2 } from "./../contracts/VestingSchedulerV2.sol"; | ||
import { FoundrySuperfluidTester } from "@superfluid-finance/ethereum-contracts/test/foundry/FoundrySuperfluidTester.t.sol"; | ||
import { SuperTokenV1Library } from "@superfluid-finance/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol"; | ||
import { SafeMath } from "@openzeppelin/contracts/utils/math/SafeMath.sol"; | ||
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; | ||
import "forge-std/console.sol"; | ||
|
||
|
@@ -899,7 +898,7 @@ contract VestingSchedulerV2Tests is FoundrySuperfluidTester { | |
); | ||
|
||
console.log("Revert with overflow."); | ||
vm.expectRevert("SafeCast: value doesn't fit in 96 bits"); | ||
vm.expectRevert(); // SafeCastOverflowedIntDowncast | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there is no reference to it? |
||
vestingScheduler.createVestingScheduleFromAmountAndDuration( | ||
superToken, | ||
bob, | ||
|
@@ -1961,7 +1960,7 @@ contract VestingSchedulerV2Tests is FoundrySuperfluidTester { | |
); | ||
|
||
console.log("Revert with overflow."); | ||
vm.expectRevert("SafeCast: value doesn't fit in 96 bits"); | ||
vm.expectRevert(); // SafeCastOverflowedIntDowncast | ||
vestingScheduler.createVestingScheduleFromAmountAndDuration( | ||
superToken, | ||
bob, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1105,7 +1105,7 @@ contract VestingSchedulerV3Tests is FoundrySuperfluidTester { | |
); | ||
|
||
console.log("Revert with overflow."); | ||
vm.expectRevert("SafeCast: value doesn't fit in 96 bits"); | ||
vm.expectRevert(); // SafeCastOverflowedIntDowncast | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
vestingScheduler.createVestingScheduleFromAmountAndDuration( | ||
superToken, | ||
bob, | ||
|
@@ -2189,7 +2189,7 @@ contract VestingSchedulerV3Tests is FoundrySuperfluidTester { | |
); | ||
|
||
console.log("Revert with overflow."); | ||
vm.expectRevert("SafeCast: value doesn't fit in 96 bits"); | ||
vm.expectRevert(); // SafeCastOverflowedIntDowncast | ||
vestingScheduler.createVestingScheduleFromAmountAndDuration( | ||
superToken, | ||
bob, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
// solhint-disable not-rely-on-time | ||
pragma solidity ^0.8.23; | ||
|
||
import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; | ||
import { SafeCast } from "@openzeppelin-v5/contracts/utils/math/SafeCast.sol"; | ||
|
||
import { ISuperfluid, ISuperfluidGovernance, IAccessControl } from "../../interfaces/superfluid/ISuperfluid.sol"; | ||
import { | ||
|
@@ -319,7 +319,7 @@ contract GeneralDistributionAgreementV1 is AgreementBase, TokenMonad, IGeneralDi | |
{ | ||
newCtx = ctx; | ||
|
||
if (pool.superToken().isPool(this, memberAddr)) { | ||
if (memberAddr == address(0) || pool.superToken().isPool(this, memberAddr)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sneaky. |
||
revert GDA_CANNOT_CONNECT_POOL(); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.