codefordao / contracts Goto Github PK
View Code? Open in Web Editor NEWSolidity smart contracts of CodeforDAO
Solidity smart contracts of CodeforDAO
contracts/contracts/core/Module.sol
Lines 201 to 217 in e6d820c
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 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 |
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 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.
➜ 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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.