Git Product home page Git Product logo

moloch's People

Contributors

alcuadrado avatar ameensol avatar andygray avatar arjunbhuptani avatar daodesigner avatar dependabot[bot] avatar eolszewski avatar heikofisch avatar izqui avatar jamesmorgan avatar jamesyoung avatar lautarodragan avatar lex-node avatar petertheone avatar rhlsthrm avatar ro5s avatar santisiri avatar vince0656 avatar yeqbfgxjiq 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  avatar  avatar

moloch's Issues

buidler fails to compile: evmVersion: "byzantium" and CREATE2

Describe the issue

Trying to compile the code errors on CREATE2 since that is not enabled on byzantium.

Steps to Reproduce

  1. npx buidler moloch-deploy --network develop
  2. See error below

Error

contracts/gnosis-safe/proxies/ProxyFactory.sol:50:22: Warning: The "create2" instruction is only available for Constantinople-compatible VMs. You are currently compiling for "byzantium", where it will be interpreted as an invalid instruction.
            proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
                     ^------------------------------------------------------------------^

Error BDLR600: Compilation failed

Additional Information

evmVersion: 'byzantium'

Typo error ?

Hi , just to make sure, about the buidler.config.js

Does it should be buidler.config.js or builder.config.js

Cannot read property 'length' of undefined

Having some challenges getting started.
I worked through #98 and #102 but now i'm getting this:
Deploying... TypeError: Cannot read property 'length' of undefined at SimpleTaskDefinition.action (/dao/moloch/scripts/moloch-tasks.js:48:36)
any ideas?

Error: Invalid number of parameters for "approvedTokens". Got 0 expected 1!

Error: Invalid number of parameters for "approvedTokens". Got 0 expected 1!
    at getApprovedToken (/Users/richardmelkonian/0x-movie/moloch/scripts/utils.js:47:37)

I get this error when trying to deploy the pool. My deployment params :

module.exports.SUMMONER = '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266'
module.exports.TOKEN = ['0x6b175474e89094c44da98b954eedeac495271d0f', '0xdac17f958d2ee523a2206206994597c13d831ec7']
module.exports.PERIOD_DURATION_IN_SECONDS = 17280
module.exports.VOTING_DURATON_IN_PERIODS = 35
module.exports.GRACE_DURATON_IN_PERIODS = 35
module.exports.PROPOSAL_DEPOSIT = '100000000000000000' // Large numbers should be string or big numbers
module.exports.DILUTION_BOUND = 3
module.exports.PROCESSING_REWARD = '10000000000'

Not sure what could be causing this. Seems as if the deployment params are not setting the contract constructor?

Questions about Ragequit

Evnet Ragequit is used in the _ragequit method, the first argument is msg.sender. I'm not sure if that's a problem, but if I call the ragekick method, it's not the member that's kicked out. The event seemed meaningless.If I analyzed the data from evnet alone, I wouldn't know who was kicked out.

ReferenceError: buidlerArguments is not defined

trying a fresh deploy from master on gitpod, following instructions i get this error:

ReferenceError: buidlerArguments is not defined

Not sure if it's because it needs to be updated with hardhat, the new name for buidler...

Suggestion of code simplification: remove tributeTokens, lootTokens and GuildVault

I'm looking through the Moloch DAO in light of recent changes and would like to add one further simplification: remove completely GuildVault and TributeTokens. Instead, here's how a proposal would work:

  • An applicant writes a contract that supports the interface proposalApproved()
  • Adds a field to the proposal which is called rewardContract
  • When a proposal is approved, Moloch calls the rewardContract with the function proposalApproved() which can any of these things:
    1. Sends X tokens to the Moloch DAO (here's $100 euro-DAI)
    2. Transfers a NFT to a specific address (transfers moloch.eth to ameen)
    3. Orders another DAO to execute some action (like buying shares in a prediction market to increase the likelyhood of something happening)
    4. Does nothing but records a promise from someone to make something off-chain ("I promise to explain Moloch using the art of interpretative dance while wearing a dinosaur suit")

This simplifies the code and allows greater flexibility, because anything can be coded on the proposalContract address, so we don't need to imagine everything that can be created in the future.

But what about the GuildVault and lootTokens? Maybe I'm missing something but it seems to me the only purpose of LootTokens is to be a temporary step before someone can take tokens out. Instead we can remove all that functionality and just require that when someone wants to rageQuit they need to specify which tokens they want to take with them. The DAO then will go through that list and then use send them the equivalent percentage of the balance of that specific token.

This has a few advantages, one of them being that it's up to the users themselves signal which token they care about personally. If you ignore a token it means you are basically donating your share of that token back to the community, therefore increasing the share that the next person can take: so undervalued tokens will accumulate until it's worth for people to spend the gas to take them out too.

This proposal both simplifies code and also keeps Moloch flexible enough for it to do unpredictable stuff in the future.

Ability to receive ETH (ERC20, NFT) directly

At the risk of infringing privacy, but easier to illustrate the issue via genuine conversation:
image

I would like to put my Moloch V2 as the beneficiary: https://cryptounlocked.wetrust.io/


Another use case: some media attention, press coverage, QR code printed in a newspaper... Guys sending funds directly to the address.

Sending ETH directly to the Vault / Treasury seems cool, practical.

moloch.approvedToken is not a function

Getting an error when trying to deploy a pool, any ideas anyone?

npx hardhat pool-deploy --network develop --shares 100 --tokens 100

An unexpected error occurred:
TypeError: moloch.approvedToken is not a function
at getApprovedToken (/dao/moloch/scripts/utils.js:47:37)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

I did set the correct address in hardhat.config.js after the dao was deployed

Error Deploying DAO

npx buidler moloch-deploy --network mainnet
Compiling...
Downloading compiler version 0.5.3

contracts/Moloch.sol:505:46: Warning: This declaration shadows an existing declaration.
function _ragequit(uint256 sharesToBurn, IERC20[] memory approvedTokens) internal {
^----------------------------^
contracts/Moloch.sol:89:5: The shadowed declaration is here:
IERC20[] public approvedTokens;
^----------------------------^

contracts/gnosis-safe/proxies/ProxyFactory.sol:50:22: Warning: The "create2" instruction is only available for Constantinople-compatible VMs. You are currently compiling for "byzantium", where it will be interpreted as an invalid instruction.
proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt)
^------------------------------------------------------------------^

contracts/GuildBank.sol:13:54: Warning: Unreachable code.
for (uint256 i=0; i < approvedTokens.length; i++) {
^-^

contracts/gnosis-safe/libraries/CreateAndAddModules.sol:12:27: Warning: Unused function parameter. Remove or comment out the variable name to silence this warning.
function enableModule(Module module)
^-----------^

contracts/gnosis-safe/libraries/CreateAndAddModules.sol:12:5: Warning: Function state mutability can be restricted to pure
function enableModule(Module module)
^ (Relevant source part starts here and spans across multiple lines).

Compiled 35 contracts successfully
Deploying a new DAO to the network mainnet
Deployment parameters:
summoner: 0xfA5f6c326692019A550f31C3655aBF1fa732bD4B
token: 0xa1b3de85197f26e78016ccb8ac36594e03bee494
periodSeconds: 17280
votingPeriods: 35
gracePeriods: 35
abortPeriods: 5
proposalDeposit: 1000000000000000000
dilutionBound: 3
processingReward: 10000000000

? Please confirm that the deployment parameters are correct Yes
Deploying...
An unexpected error occurred: Returned error: Invalid JSON RPC response: "basic auth failure\n"

This shouldn't have happened, please report it to help us improve Buidler.
For more info run Buidler with --show-stack-traces.

Sponsor Proposal Throws Error

When calling sponsor proposal I get the following error:

Error: Returned error: execution reverted
    at SimpleTaskDefinition.action (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/src/scripts/moloch-tasks.js:225:18)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Environment._runTaskDefinition (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/runtime-environment.ts:217:14)
    at Environment.run (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/runtime-environment.ts:129:14)
    at main (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/cli/cli.ts:197:5) {
  data: {
    stack: 'ProviderError: execution reverted\n' +
      '    at HttpProvider.request (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)\n' +
      '    at LocalAccountsProvider.request (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/providers/accounts.ts:168:34)\n' +
      '    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n' +
      '    at AutomaticGasProvider._getMultipliedGasEstimation (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:72:31)\n' +
      '    at AutomaticGasProvider.request (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:131:18)\n' +
      '    at Web3HTTPProviderAdapter._sendJsonRpcRequest (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/@nomiclabs/hardhat-web3/src/web3-provider-adapter.ts:80:22)',
    name: 'ProviderError'
  },
  hijackedStack: 'Error: Returned error: execution reverted\n' +
    '    at Object.ErrorResponse (/Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/@truffle/interface-adapter/node_modules/web3-core-helpers/lib/errors.js:28:19)\n' +
    '    at /Users/matthewrodgers/Desktop/Eudaimonia/moloch/node_modules/@truffle/interface-adapter/node_modules/web3-core-requestmanager/lib/index.js:303:36\n' +
    '    at processTicksAndRejections (node:internal/process/task_queues:83:21)'
}

Any help with this would be appreciated.

Project "evil" ?

Is this project representing the evil inside or why did you dedicate the name into something devilish ?

Please let me know the intent, before I start working with the project.

Thanks a lot.

Tests fail with Error BDLR700: Artifact for contract "Token" not found.

...
> bash scripts/test.sh

Starting our own ganache instance
Waiting for ganache to launch on port 8545...
Ganache launched!
Buidler version 1.1.2
Compiling...
Downloading compiler version 0.5.3


contracts/Moloch.sol:700:57: Warning: This declaration shadows an existing declaration.
    function fairShare(uint256 balance, uint256 shares, uint256 totalShares) internal pure returns (uint256) {
                                                        ^-----------------^
contracts/Moloch.sol:53:5: The shadowed declaration is here:
    uint256 public totalShares = 0; // total shares across all members
    ^----------------------------^



contracts/Moloch.sol:494:5: Warning: Function state mutability can be restricted to view
    function _didPass(uint256 proposalIndex) internal returns (bool didPass) {
    ^ (Relevant source part starts here and spans across multiple lines).

Compiled 7 contracts successfully
Error BDLR700: Artifact for contract "Token" not found.

For more info go to https://buidler.dev/BDLR700 or run Buidler with --show-stack-traces
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `bash scripts/test.sh`
npm ERR! Exit status 1
npm ERR! 
...

Maybe they weren't updated since migration from v1?

Error while deploying a DAO

Im trying to deploy a new DAO and Im following instruction give on read.me

Here are the steps that I have followed.

  • Cloned this library and installed the dependencies using npm i

  • Then I edited buidler.config.js and set values for INFURA_API_KEY and MAINNET_PRIVATE_KEY(account private key exported from metamask).

  • Im keeping deployment-params.js as it is.

  • Now when I run npx buidler moloch-deploy --network mainnet

I'm getting following error.

Screenshot 2019-11-06 at 4 43 52 PM

what will be value of BuilderConfig.networks.develop.url?

UpdatePeriod() should be constant cost instead of while loop

If cost of loop (plus cost for rest of transaction) exceeds block gas limit, none of the functions depending on updatePeriod() will be executable. Having a constant cost for this function would prevent this issue.

My quick ballpark guess on how long it would take before contract becomes unusable: ~159-177 days

Update currentPeriod -> 5k
Update periods[currentPeriod] -> 40k (start & end)
Update pendingProposals -> average ~2.5k?

With block gas limit of 8m and periodDuration of 1 day, that's about 159-177 days before the contract is unusable. However, If storage costs are revised upward, it could be a lot less than 170 days.

Since periodDuration is "fixed" and since endTime and startTime are predictable, we can maybe have something like:

function getPeriodTimes(uint256 period) public returns (uint256 startTime, uint256 endTime) {
      startTime = now.sub(period.mul(periodDuration));
      endTime = startTime.add(periodDuration);
      return (startTime, endTime)
}

Need to account for change in period duration but that should be relatively easy by adding some other variables. Basically, we need to change how the updatePeriod() function works such that it has a contant cost, or we run the risk of making the other functions not executable.

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.