Coder Social home page Coder Social logo

Comments (4)

PatrickAlphaC avatar PatrickAlphaC commented on July 17, 2024
  1. Nope! The way this is set up, anyone can make a proposal.
  2. We setup the executor of a proposal like this:
    const executorTx = await timeLock.grantRole(executorRole, ADDRESS_ZERO)

This makes it so that once a proposal has:

  1. Been proposed
  2. Passed the vote
  3. Passed the time lock period

Anyone can "execute" the proposal.

  1. Not quite.
    You'd still want the timelock controller to own your treasury wallet. You could put some functionality of payment in the GT contract, but I think it would make more sense for the timelock controller contract to own all the GT tokens and just make people pay for them (if that's what you want to do)

from dao-template.

codesport avatar codesport commented on July 17, 2024

Thank you @PatrickAlphaC

Your Answers are very thorough and educational.

Just some clarifying followups.

So anyone can propose, but only token holders may vote. So is it safe to assume the chain of imported contracts from GovernorContract.sol and ERCXXVotes.sol ensure that only valid token holders can vote?

Linking Contracts

I noticed there was no special solidity code to somehow 'link" these 3 contracts. So this linking is only handled within our deployment scripts? However, I do know OpenZeppelin's Ownable and onlyOwner directive does allow an owner to be specified and customized.

In conclusion, the linkages are through the contract deployer (me) or whatever contract is designated as the Owner using Ownable.sol

Treasury Wallet
Is the "Treasury Wallet" typically a separate contract or do we typically leave the funds in the contract that mints the tokens? Or do we make TimeLock.sol the "Treasury Wallet"? I'm not quite sure what is a best practice.

I guess no matter which contract serves as the Treasury Wallet, some sort of payable and receiver functionality is needed in its solidity code.

Time Lock
I think I may understand now. It's best practice for only TimeLock.sol to deposit and withdraw funds from that Treasury wallet/contract. Being a DAO, this ensures that funds are only moved by the democratic consensus of its members.

Do you recommend importing Ownable.sol into the TimeLock.sol? Or only into GovernorToken.sol and GovernorContract.sol?

from dao-template.

PatrickAlphaC avatar PatrickAlphaC commented on July 17, 2024

So anyone can propose, but only token holders may vote. So is it safe to assume the chain of imported contracts from GovernorContract.sol and ERCXXVotes.sol ensure that only valid token holders can vote?

Yes.

I noticed there was no special solidity code to somehow 'link" these 3 contracts.

There is:

This "links" the governance token of choice to the governor contract:

This "links" the governor contract to the timelock:

const proposerTx = await timeLock.grantRole(proposerRole, governor.address)

Treasury Wallet
The treasury wallet can simply be the timelock contract.

Do you recommend importing Ownable.sol into the TimeLock.sol? Or only into GovernorToken.sol and GovernorContract.sol?

Neither. All the permissions are handled inside the contracts imported already.

from dao-template.

codesport avatar codesport commented on July 17, 2024

@PatrickAlphaC Thank you again.

It all makes a lot more sense now!

from dao-template.

Related Issues (20)

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.