Code Monkey home page Code Monkey logo

council's People

Contributors

aleph-v avatar cashd avatar cpstl avatar dannydelott avatar jrhea avatar nicholasdotsol avatar ryangoree avatar sentilesdal avatar smmackey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

council's Issues

Add method to voluntarily leave the GSC

The only way to be removed from the GSC today is for your voting power to drop below the required threshold, then get kicked. If voting power comes from delegation, you have no control over this.

Ideally, inactive voters that don't want to be on the GSC will naturally drop below the threshold and be kicked, but adding the ability to manually leave is trivial and gives the voter more control.

Missing, incorrect, or unordered NatSpec comments

audit issues fix line 1

File: contracts\features\OptimisticGrants.sol
83: /// WARNING: A contract _recipient will log msg.sender as this contract's address // REVIEW: Note, outdated comment? Which _recipient?

File: contracts\libraries\History.sol
079: require(data < uint256(1) << 192, "OoB"); // REVIEW: Note, require statement could be made more readable with data <= type(uint192).max.

File: contracts\libraries\VestingVaultStorage.sol
03: import "./Storage.sol"; // REVIEW: Note, import is not used.

File: contracts\vaults\GSCVault.sol
23: uint256 public idleDuration = 60 * 60 * 24 * 4; // REVIEW: Note, instead of '60 * 60 * 24 * 4' use '4 days' for readability.

94: members[msg.sender].joined // REVIEW: Optimization, no need to rewrite joined, just update votingVaults.

File: contracts\vaults\LockingVault.sol
141: emit VoteChange(fundedAccount, delegate, int256(amount)); // REVIEW: Minor, wrong order of params in VoteChange.

163: emit VoteChange(msg.sender, delegate, -1 * int256(amount)); // REVIEW: Minor, wrong order of params in VoteChange.

186: emit VoteChange(msg.sender, oldDelegate, -1 * int256(userBalance)); // REVIEW: Minor, wrong order of params in VoteChange.

192: emit VoteChange(msg.sender, newDelegate, int256(userBalance)); // REVIEW: Minor, wrong order of params in VoteChange.

160: // Add the newly deposited votes to the delegate // Note: the comments are not relevant (copy of comments from deposit function).

162: // Emit a event to track added votes // Note: the comments are not relevant (copy of comments from deposit function).

185: // Emit a event to track added votes // Note: the comments are not relevant (copy of comments from deposit function).

File: contracts\vaults\OptimisticRewards.sol
27: uint256 public challengePeriod = 60 * 60 * 24 * 7; // REVIEW: Note, instead of '60 * 60 * 24 * 7' user '7 days' for readability.

File: contracts\vaults\VestingVault.sol
145: address _delegatee = _delegatee == address(0) ? _who : _delegatee; // REVIEW: Note, no need to redeclare _delegatee.

Possible Spelling/Grammar/Typos

Hash on chain in the Timelock

This would make it possible to see what actions have been registered.

It would also make it possible to see what actions are being proposed in CoreVoting. When the actions are hashed off chain, we can only see a callHash for Timelock proposals.

Double execution vulnerability in Timelock

A batch of calls may be doubly executed in Timelock.

Scenario

Consider the following two scenarios where increaseTime() is executed after execute() for the same callHash:

  1. The authorized GSC contract accidentally or maliciously calls increaseTime() for the callHash that has already been executed. (Difficulty: High)
  2. OR, the GSC legitimately calls increaseTime() near the end of the original waiting period, but increaseTime() is delayed for some reason until the original waiting period passes, and immediately adversaries front-run execute() before the increaseTime() transaction. (Difficulty: Medium)

Then, callTimestamps[callHash] becomes non-zero again, and the subsequent execute() may lead to double execution of the same batch of calls.

Recommendation

Add an extra condition require(callTimestamps[callHash] != 0); in the increaseTime() function to ensure that the given callHash is active.

GSC voting power update

Currently proving membership puts the entire voting power on a time delay. This makes topping-up votes to maintain membership difficult.

simple solution:
Implement a top-up method that does not adhere to the locking period.

Switch to Min + Max Vote Period

https://github.com/element-fi/elf-council/blob/3ca2a3242dd6dee2bd6facfc072bb503d92f3800/contracts/CoreVoting.sol#L199

Currently votes last forever till a contract call deletes them, plus they can be deleted after the min voting time has passed. This means (1) we need constant execution on chain to remove old proposals (2) even though we allow longer voting times it's hard to coordinate.

We should swap so that the proposal is unlocked after a min voting time and expired after max voting time. It can be executed during the period between min and max but only deleted without execution after the max.

Minimum quorem requirement regarding abstentions

In the current design, merely having more YES votes than that of NO votes is enough to execute a proposal. This means that a proposal will be executed, even if we have only a single YES ballot, zero NO ballot, and a lot of MAYBE ballots. There may exist scenarios where this behavior is problematic, and it may be considered to require a certain minimum quorum (ratio) of YES ballots.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.