diff --git a/.dockerignore b/.dockerignore index 78ff653..1ddcf07 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,8 +3,9 @@ out/ broadcast/ node_modules README.md -RELEASE.txt SECURITY.md SECURITY.md.asc public_key.asc build.sh +CHANGELOG.md +LICENSE diff --git a/.github/workflows/testnet.yml b/.github/workflows/testnet.yml index 2b654e1..1e798f8 100644 --- a/.github/workflows/testnet.yml +++ b/.github/workflows/testnet.yml @@ -17,6 +17,7 @@ env: GOVERNANCE_BUILDER_ADDRESS: "0x9fB5a925E61c31617129B5D030808939DADA99f7" TREASURY_BUILDER_ADDRESS: "0x49753b58270ae454d4ec555ff88294a4fab01660" ECDSA_LIB_ADDRESS: "0xe9e21aaEaEad9c57C1F4c622915fFB54f9Ebe338" + RELEASE_TAG: ${{ github.ref_name }} jobs: check: @@ -54,8 +55,8 @@ jobs: with: draft: false prerelease: false - tag_name: ${{ github.ref }} - release_name: ${{ github.ref }} + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} body_path: CHANGELOG.md - name: Deploy Constant Library diff --git a/.gitmodules b/.gitmodules index be790eb..b133a0e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "lib/forge-std"] path = lib/forge-std url = https://github.com/foundry-rs/forge-std - branch = v1.5.6 + branch = v1.6.0 [submodule "lib/openzeppelin-contracts"] path = lib/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts diff --git a/.prettierrc.json b/.prettierrc.json index 3ff4800..3dbe20e 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -15,4 +15,4 @@ } } ] -} \ No newline at end of file +} diff --git a/.solhint.json b/.solhint.json index 52d7710..94facf6 100644 --- a/.solhint.json +++ b/.solhint.json @@ -12,4 +12,4 @@ } ] } -} \ No newline at end of file +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index de5fb4e..2bb60f9 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -3,6 +3,17 @@ // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ + { + "label": "preinstall", + "type": "shell", + "command": "forge install", + "options": { + "cwd": "${workspaceFolder}" + }, + "group": { + "kind": "build" + } + }, { "label": "install", "type": "shell", @@ -10,6 +21,7 @@ "options": { "cwd": "${workspaceFolder}" }, + "dependsOn": "preinstall", "group": { "kind": "build" } diff --git a/README.md b/README.md index dabbf09..4d4a4b4 100644 --- a/README.md +++ b/README.md @@ -47,13 +47,29 @@ Collective Governance has been designed from the ground up to be very easy to us | CommunityBuilder | 0x011b543b69236aca83406edc051e8a6dd3bcda1c | 0.9.7 | | GovernanceBuilder | 0x2c57560BF19b7c088488104D02506D87f63e414C | 0.9.7 | +### Submodules + +This repo is using submodules. Check out the repository with the `--recursive` argument: + +``` +$ git clone --recursive https://github.com/collectivexyz/Revolution2 +``` + +Or simply init submodules from within the codebase + +``` +$ git submodule update --recursive --init -f +``` + ### Command line build using docker - 1. docker build . -t collective-governance-v1:1 + ``` + $ docker build . -t collective-governance-v1:1 + ``` ### VS Code -Using the Remote module in VSCode simply reopen the project in it's container. +Using the Remote Containers extension in VSCode simply reopen the project in it's container. `Reopen in Container` diff --git a/RELEASE.txt b/RELEASE.txt deleted file mode 100644 index ffe1443..0000000 --- a/RELEASE.txt +++ /dev/null @@ -1,6 +0,0 @@ -0.8.5: Time locked execution for passing votes -0.8.4: Cancellation -0.8.3: Documentation upgrade -0.8.2: One token one vote -0.8.1: Intial version simple voting works - diff --git a/lib/forge-std b/lib/forge-std index 2b58ecb..74cfb77 160000 --- a/lib/forge-std +++ b/lib/forge-std @@ -1 +1 @@ -Subproject commit 2b58ecbcf3dfde7a75959dc7b4eb3d0670278de6 +Subproject commit 74cfb77e308dd188d2f58864aaf44963ae6b88b1 diff --git a/package.json b/package.json index 8327fdc..3fbd95c 100644 --- a/package.json +++ b/package.json @@ -11,9 +11,9 @@ }, "scripts": { "build": "forge build --sizes", - "prettier:check": "prettier --check \"(contracts|test)/**.sol\"", - "prettier:fix": "prettier --write \"(contracts|test)/**.sol\"", - "hint": "solhint contracts/**/*.sol test/**/*.sol", + "prettier:check": "prettier --check \"(contracts|test|script)/**.sol\"", + "prettier:fix": "prettier --write \"(contracts|test|script)/**.sol\"", + "hint": "solhint contracts/**/*.sol test/**/*.sol script/**/*.sol", "test": "forge test -vvv", "clean": "forge cache clean && if [ -d out ]; then forge clean; fi" }, diff --git a/script/UpgradeCommunityClass.sol b/script/UpgradeCommunityClass.sol index 7775f45..8d23811 100644 --- a/script/UpgradeCommunityClass.sol +++ b/script/UpgradeCommunityClass.sol @@ -121,7 +121,7 @@ contract UpgradeCommunityClass is Script { _prototype.maximumVoteDuration(), _prototype.maximumGasUsedRebate(), _prototype.maximumBaseFeeRebate(), - uint8(_implVersion.version()) + uint8(_implVersion.version()) ); vm.stopBroadcast(); } diff --git a/test/governance/GovernanceBuilder.t.sol b/test/governance/GovernanceBuilder.t.sol index 64cc645..0fe495a 100644 --- a/test/governance/GovernanceBuilder.t.sol +++ b/test/governance/GovernanceBuilder.t.sol @@ -78,14 +78,7 @@ contract GovernanceBuilderTest is Test { vm.prank(_VOTER1, _VOTER1); uint256 proposalId = _gov.propose(); assertEq(_class.minimumVoteDelay(), testVoteDelay); - vm.expectRevert( - abi.encodeWithSelector( - Storage.DelayNotPermitted.selector, - proposalId, - testVoteDelay - 1, - testVoteDelay - ) - ); + vm.expectRevert(abi.encodeWithSelector(Storage.DelayNotPermitted.selector, proposalId, testVoteDelay - 1, testVoteDelay)); vm.prank(_VOTER1, _VOTER1); _gov.configure(proposalId, 100, testVoteDelay - 1, Constant.MINIMUM_VOTE_DURATION); } @@ -106,14 +99,7 @@ contract GovernanceBuilderTest is Test { vm.prank(_VOTER1, _VOTER1); uint256 proposalId = _gov.propose(); assertEq(_class.maximumVoteDelay(), testVoteDelay); - vm.expectRevert( - abi.encodeWithSelector( - Storage.DelayNotPermitted.selector, - proposalId, - testVoteDelay + 1, - testVoteDelay - ) - ); + vm.expectRevert(abi.encodeWithSelector(Storage.DelayNotPermitted.selector, proposalId, testVoteDelay + 1, testVoteDelay)); vm.prank(_VOTER1, _VOTER1); _gov.configure(proposalId, 100, testVoteDelay + 1, Constant.MINIMUM_VOTE_DURATION); } @@ -135,12 +121,7 @@ contract GovernanceBuilderTest is Test { uint256 proposalId = _gov.propose(); assertEq(_class.minimumVoteDuration(), testVoteDuration + 1); vm.expectRevert( - abi.encodeWithSelector( - Storage.DurationNotPermitted.selector, - proposalId, - testVoteDuration, - testVoteDuration + 1 - ) + abi.encodeWithSelector(Storage.DurationNotPermitted.selector, proposalId, testVoteDuration, testVoteDuration + 1) ); vm.prank(_VOTER1, _VOTER1); _gov.configure(proposalId, 100, Constant.MINIMUM_VOTE_DELAY, testVoteDuration); @@ -163,12 +144,7 @@ contract GovernanceBuilderTest is Test { uint256 proposalId = _gov.propose(); assertEq(_class.maximumVoteDuration(), testVoteDuration); vm.expectRevert( - abi.encodeWithSelector( - Storage.DurationNotPermitted.selector, - proposalId, - testVoteDuration + 1, - testVoteDuration - ) + abi.encodeWithSelector(Storage.DurationNotPermitted.selector, proposalId, testVoteDuration + 1, testVoteDuration) ); vm.prank(_VOTER1, _VOTER1); _gov.configure(proposalId, 100, Constant.MINIMUM_VOTE_DELAY, testVoteDuration + 1);