-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #144 from valory-xyz/addressing_issue_16
refactor and test: addressing audit issue 16
- Loading branch information
Showing
8 changed files
with
186 additions
and
34 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# autonolas-governance-audit | ||
The review has been performed based on the contract code in the following repository:<br> | ||
`https://github.com/valory-xyz/autonolas-governance` <br> | ||
commit: `59aa1c8732397c826bb67fc567b81b8d0cd82b00` or `tag: v1.2.2-pre-internal-audi` <br> | ||
|
||
Update: 05-07-2024 <br> | ||
|
||
## Objectives | ||
The audit focused on fixing VoteWeighting after C4A external audit. <BR> | ||
|
||
### Coverage | ||
Hardhat coverage has been performed before the audit and can be found here: | ||
```sh | ||
--------------------------------------|----------|----------|----------|----------|----------------| | ||
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | | ||
--------------------------------------|----------|----------|----------|----------|----------------| | ||
VoteWeighting.sol | 100 | 98.94 | 100 | 99.56 | 484 | | ||
|
||
int128 userSlope = IVEOLAS(ve).getLastUserPoint(msg.sender).slope; | ||
if (userSlope < 0) { | ||
revert NegativeSlope(msg.sender, userSlope); | ||
} | ||
The fact that this case is not covered is not a problem, since it is very difficult to create such conditions in a real test. | ||
``` | ||
#### Checking the corrections made after C4A | ||
64. Less active nominees can be left without rewards after an year of inactivity #64 | ||
https://github.com/code-423n4/2024-05-olas-findings/issues/64 <br> | ||
[x] fixed | ||
36. pointsSum.slope Not Updated After Nominee Removal and Votes Revocation #36 | ||
https://github.com/code-423n4/2024-05-olas-findings/issues/36 <br> | ||
[x] fixed | ||
16. Incorrect Handling of Last Nominee Removal in removeNominee Function #16 | ||
https://github.com/code-423n4/2024-05-olas-findings/issues/16 <br> | ||
[x] fixed | ||
#### Low issue | ||
QA Report #109 | ||
https://github.com/code-423n4/2024-05-olas-findings/issues/109 | ||
``` | ||
Lack of event emission for important state changes in revokeRemovedNomineeVotingPower() | ||
``` | ||
[x] fixed | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*global process*/ | ||
|
||
const { ethers } = require("hardhat"); | ||
|
||
async function main() { | ||
const fs = require("fs"); | ||
const globalsFile = "globals.json"; | ||
const dataFromJSON = fs.readFileSync(globalsFile, "utf8"); | ||
let parsedData = JSON.parse(dataFromJSON); | ||
|
||
const signers = await ethers.getSigners(); | ||
|
||
// EOA address | ||
const EOA = signers[0]; | ||
|
||
const deployer = await EOA.getAddress(); | ||
console.log("EOA is:", deployer); | ||
|
||
// Get all the necessary contract addresses | ||
const buOLASAddress = parsedData.buOLASAddress; | ||
|
||
// Get the contracts | ||
const bu = await ethers.getContractAt("buOLAS", buOLASAddress); | ||
|
||
// Proposal preparation | ||
console.log("Revoking from buOLAS"); | ||
// Modify the address to the required one | ||
const revokeAddress = signers[1].address; | ||
const targets = [buOLASAddress]; | ||
const values = [0]; | ||
const callDatas = [bu.interface.encodeFunctionData("revoke", [[revokeAddress]])]; | ||
|
||
// Proposal details | ||
console.log("targets:", targets); | ||
console.log("values:", values); | ||
console.log("call datas:", callDatas); | ||
} | ||
|
||
main() | ||
.then(() => process.exit(0)) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters