-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/rd 1193 add openzeppelin foundry upgrades to the repo #51
base: develop
Are you sure you want to change the base?
Changes from 9 commits
ae29651
f883436
6065ced
7d9e84d
f4e49ea
c7b85ba
e5e832c
0988488
ec18ada
de71bbc
836dc78
dc6fbf8
cd4ef26
70c3555
050b895
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
# Foundry | ||
cache/ | ||
out/ | ||
ref_builds/ | ||
broadcast/ | ||
|
||
# JS | ||
|
+193 −0 | CONTRIBUTING.md | |
+18 −2 | README.md | |
+2 −0 | foundry.toml | |
+1 −1 | package.json | |
+12 −1 | scripts/vm.py | |
+28 −0 | src/StdChains.sol | |
+17 −5 | src/StdCheats.sol | |
+104 −0 | src/StdJson.sol | |
+104 −0 | src/StdToml.sol | |
+0 −17 | src/StdUtils.sol | |
+408 −26 | src/Vm.sol | |
+471 −463 | src/console.sol | |
+2 −2 | src/interfaces/IERC4626.sol | |
+0 −234 | src/mocks/MockERC20.sol | |
+0 −231 | src/mocks/MockERC721.sol | |
+1 −5 | test/StdAssertions.t.sol | |
+19 −18 | test/StdChains.t.sol | |
+10 −10 | test/StdCheats.t.sol | |
+12 −12 | test/StdError.t.sol | |
+1 −1 | test/StdJson.t.sol | |
+4 −14 | test/StdMath.t.sol | |
+25 −8 | test/StdStorage.t.sol | |
+1 −1 | test/StdStyle.t.sol | |
+1 −1 | test/StdToml.t.sol | |
+12 −12 | test/StdUtils.t.sol | |
+9 −6 | test/Vm.t.sol | |
+0 −441 | test/mocks/MockERC20.t.sol | |
+0 −721 | test/mocks/MockERC721.t.sol |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
{ | ||
"name": "ve-governance", | ||
"version": "1.0.0", | ||
"devDependencies": { | ||
"prettier": "^3.3.3", | ||
"prettier-plugin-solidity": "^1.4.1" | ||
}, | ||
"scripts": { | ||
"build": "forge build", | ||
"build-clean": "forge build --force", | ||
"build-refs": "bash script/build-reference-builds.sh", | ||
"build-all": "bun run build-refs && bun run build-clean" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
rm -rf ref_builds | ||
mkdir -p ref_builds | ||
|
||
for file in lib/ve-governance/*; | ||
do | ||
echo "Processing $file" | ||
filename=$(echo $file | sed 's/\//-/g') | ||
filename=$(echo $filename | sed 's/lib-ve-governance-//g') | ||
mkdir -p ref_builds/build-info-$filename | ||
forge build --force --root=$file | ||
mv $file/out/build-info/*.json ref_builds/build-info-$filename | ||
done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
pragma solidity ^0.8.17; | ||
|
||
import "forge-std/Test.sol"; | ||
import {MockERC20} from "@solmate/test/utils/mocks/MockERC20.sol"; | ||
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. why are we using the solmate erc20?: 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. Forge-std deprecated the ERC20Mock |
||
import {GaugesDaoFactory, Deployment, DeploymentParameters, TokenParameters} from "../../src/factory/GaugesDaoFactory.sol"; | ||
import {MockPluginSetupProcessor} from "@mocks/osx/MockPSP.sol"; | ||
import {MockPluginSetupProcessorMulti} from "@mocks/osx/MockPSPMulti.sol"; | ||
|
@@ -382,12 +383,12 @@ contract GaugesDaoFactoryTest is Test { | |
|
||
TokenParameters[] memory tokenParameters = new TokenParameters[](2); | ||
tokenParameters[0] = TokenParameters({ | ||
token: address(deployMockERC20("T1", "T1", 18)), | ||
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.
|
||
token: address(new MockERC20("T1", "T1", 18)), | ||
veTokenName: "Name 1", | ||
veTokenSymbol: "TK1" | ||
}); | ||
tokenParameters[1] = TokenParameters({ | ||
token: address(deployMockERC20("T2", "T2", 18)), | ||
token: address(new MockERC20("T2", "T2", 18)), | ||
veTokenName: "Name 2", | ||
veTokenSymbol: "TK2" | ||
}); | ||
|
@@ -767,17 +768,17 @@ contract GaugesDaoFactoryTest is Test { | |
|
||
TokenParameters[] memory tokenParameters = new TokenParameters[](3); | ||
tokenParameters[0] = TokenParameters({ | ||
token: address(deployMockERC20("T3", "T3", 18)), | ||
token: address(new MockERC20("T3", "T3", 18)), | ||
veTokenName: "Name 3", | ||
veTokenSymbol: "TK3" | ||
}); | ||
tokenParameters[1] = TokenParameters({ | ||
token: address(deployMockERC20("T4", "T4", 18)), | ||
token: address(new MockERC20("T4", "T4", 18)), | ||
veTokenName: "Name 4", | ||
veTokenSymbol: "TK4" | ||
}); | ||
tokenParameters[2] = TokenParameters({ | ||
token: address(deployMockERC20("T5", "T5", 18)), | ||
token: address(new MockERC20("T5", "T5", 18)), | ||
veTokenName: "Name 5", | ||
veTokenSymbol: "TK5" | ||
}); | ||
|
@@ -1261,17 +1262,17 @@ contract GaugesDaoFactoryTest is Test { | |
|
||
TokenParameters[] memory tokenParameters = new TokenParameters[](3); | ||
tokenParameters[0] = TokenParameters({ | ||
token: address(deployMockERC20("T3", "T3", 18)), | ||
token: address(new MockERC20("T3", "T3", 18)), | ||
veTokenName: "Name 3", | ||
veTokenSymbol: "TK3" | ||
}); | ||
tokenParameters[1] = TokenParameters({ | ||
token: address(deployMockERC20("T4", "T4", 18)), | ||
token: address(new MockERC20("T4", "T4", 18)), | ||
veTokenName: "Name 4", | ||
veTokenSymbol: "TK4" | ||
}); | ||
tokenParameters[2] = TokenParameters({ | ||
token: address(deployMockERC20("T5", "T5", 18)), | ||
token: address(new MockERC20("T5", "T5", 18)), | ||
veTokenName: "Name 5", | ||
veTokenSymbol: "TK5" | ||
}); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
pragma solidity ^0.8.17; | ||
|
||
import {Upgrades} from "openzeppelin-foundry-upgrades/LegacyUpgrades.sol"; | ||
import {Test} from "forge-std/Test.sol"; | ||
//import {Clock} from '@aragon/ve-governance-v101/clock/Clock.sol'; | ||
//import {Clock as ClockV2} from '@clock/Clock.sol'; | ||
|
||
import { Options } from "openzeppelin-foundry-upgrades/Options.sol"; | ||
|
||
contract AragonTest is Test { | ||
function testUpgrades() public { | ||
//Clock clock = new Clock(); | ||
|
||
Options memory options; | ||
options.referenceBuildInfoDir = "ref_builds/build-info-v101"; | ||
options.referenceContract = "build-info-v101:Clock"; | ||
|
||
Upgrades.validateUpgrade("Clock.sol", options); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This annotation is needed in all the contracts with a constructor (also in the old ones)