Code Monkey home page Code Monkey logo

contracts's People

Contributors

guo-yu avatar shunkakinoki avatar tracy-e 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

contracts's Issues

A Question About Proposal Status Checking in Module.sol

/**
* @dev Cancel MicroProposal
* cancel a micro-proposal, It is not possible to cancel a proposal that has already been executed.
* If the proposal is scheduled by the timelock, call the cancel method of the timelock.
*/
function cancel(bytes32 id) public virtual onlyOperator {
DataTypes.MicroProposal memory _proposal = _proposals[id];
if (_proposal.status != DataTypes.ProposalStatus.Executed)
revert Errors.InvalidProposalStatus();
if (_proposal.status == DataTypes.ProposalStatus.Scheduled) {
timelock.cancel(id);
}
emit ModuleProposalCancelled(address(this), id, _msgSender(), block.timestamp);
delete _proposals[id];
}

Hi. I wanna ask a question: why you wrote _proposal.status != DataTypes.ProposalStatus.Executed in Line 208? And why is it not written as sth. like _proposal.status == DataTypes.ProposalStatus.Executed?
You've said "It is not possible to cancel a proposal that has already been executed", so does it mean that: though the status has been changed, the proposal might have not been executed? Maybe I got misunderstanding in the underlying mechanisms in blockchain?

Thanks.

can't run any tests when execute npm run test

can't run any tests when execute npm run test and npm run test:coverage is also invalid.

➜  coderfordao git:(main) npm run test

> [email protected] test
> npx hardhat test --network hardhat

Compiled 68 Solidity files successfully


  0 passing (0ms)

npm run test:coverage:

Compiled 68 Solidity files successfully

Network Info
============
> HardhatEVM: v2.9.0
> network:    hardhat



  0 passing (0ms)

-----------------------|----------|----------|----------|----------|----------------|
File                   |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
-----------------------|----------|----------|----------|----------|----------------|
 core/                 |        0 |        0 |        0 |        0 |                |
  Governor.sol         |        0 |        0 |        0 |        0 |... 118,127,136 |
  Membership.sol       |        0 |        0 |        0 |        0 |... 273,284,294 |
  Module.sol           |        0 |        0 |        0 |        0 |... 216,226,227 |
  Share.sol            |        0 |        0 |        0 |        0 |... 55,59,67,75 |
  Treasury.sol         |        0 |        0 |        0 |        0 |... 241,242,243 |

Add test suite for foundry?

I've come to really dig Foundry for all purposes testing
Would you mind if i create a test suite to demonstrate its capabilities?
It's really fast. Writing tests in solidity makes you feel like a magician without any context swtiching required

Failed to compile contracts with TypeError: Function needs to specify overridden contract "GovernorVotes"

Failed to run npm run compile on OSX 12.6 with Node.js v16.4.2.

The message says TypeError: Function needs to specify overridden contract "GovernorVotes".

It appears that override(Governor, IGovernor) should be override(GovernorVotes, IGovernor) to pass the compilation according to the message tip.

Detailed Output

➜  contracts git:(main) ✗ npm run compile

> [email protected] compile
> npx hardhat compile

Solidity 0.8.12 is not fully supported yet. You can still use Hardhat, but some features, like stack traces, might not work correctly.

Learn more at https://hardhat.org/hardhat-runner/docs/reference/solidity-support

TypeError: Function needs to specify overridden contract "GovernorVotes".
  --> contracts/core/Governor.sol:69:9:
   |
69 |         override(Governor, IGovernor)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This contract: 
  --> @openzeppelin/contracts/governance/extensions/GovernorVotes.sol:14:1:
   |
14 | abstract contract GovernorVotes is Governor {
   | ^ (Relevant source part starts here and spans across multiple lines).


TypeError: Invalid contract specified in override list: "Governor".
  --> contracts/core/Governor.sol:69:9:
   |
69 |         override(Governor, IGovernor)
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Note: This contract: 
  --> @openzeppelin/contracts/governance/Governor.sol:26:1:
   |
26 | abstract contract Governor is Context, ERC165, EIP712, IGovernor {
   | ^ (Relevant source part starts here and spans across multiple lines).


Error HH600: Compilation failed

For more info go to https://hardhat.org/HH600 or run Hardhat with --show-stack-traces

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.