Skip to content

Commit

Permalink
fix: wrong root permission check (#319)
Browse files Browse the repository at this point in the history
* fix: corrected wrong where address in test

* Revert "fix: corrected wrong where address in test"

This reverts commit bab1e58.

* fix daoAddress comparison

* update version and changelog

---------

Co-authored-by: Michael Heuer <michael.heuer@rwth-aachen.de>
  • Loading branch information
josemarinas and heueristik committed Jan 9, 2024
1 parent d1d1ab7 commit 4ee1a00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions modules/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ TEMPLATE:
-->

## [UPCOMING]
### Fixed
- Compare with dao address in `validatePluginUpdateProposal`

## [1.21.1]

### Changed
- Chore: Changed voters and approvers count to 1000 from the default value of 100 in Proposal Queries
Expand Down
2 changes: 1 addition & 1 deletion modules/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aragon/sdk-client",
"author": "Aragon Association",
"version": "1.21.1",
"version": "1.21.2",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/sdk-client.esm.js",
Expand Down
5 changes: 4 additions & 1 deletion modules/client/src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,13 +1033,16 @@ export function validateGrantRootPermissionAction(
);
}
// The action should be sent to the DAO
// both come from subgraph so they are already lowercase
if (action.to !== daoAddress) {
causes.push(
PluginUpdateProposalInValidityCause
.INVALID_GRANT_ROOT_PERMISSION_TO_ADDRESS,
);
}
if (decodedPermission.where !== daoAddress) {
// decodedPermission.where is checksummed so we need to lowercase it
// to compare it with the daoAddress because it comes from the subgraph
if (decodedPermission.where.toLowerCase() !== daoAddress) {
causes.push(
PluginUpdateProposalInValidityCause
.INVALID_GRANT_ROOT_PERMISSION_WHERE_ADDRESS,
Expand Down

0 comments on commit 4ee1a00

Please sign in to comment.