Giter Site home page Giter Site logo

Comments (8)

alcueca avatar alcueca commented on June 14, 2024

I think that transferring ownership to the DAO contract is an elegant solution.

Once that is done we can put all actions through votes.

To allow the several functions to be called we can put them all together in a DAO function, when they all can be executed in the same transaction (for example transition, setIssuePrice and startIssuance).

We probably should also allow the DAO to accept proposals with arbitrary proposalData, so that a proposal can be done for any single function and parameter combination in the DAO contract. Instead of proposeVenture and proposeDividends we would have propose(contractAddress, proposalData)

Thoughts @uivlis?

from contracts.

uivlis avatar uivlis commented on June 14, 2024

Sure, I'll do this.

And I think there might be an even more elegant solution for the ownership issue, that does not require any call on behalf of the owner, but that will be a surprise (because I'm not sure it will work).

from contracts.

uivlis avatar uivlis commented on June 14, 2024

I've been thinking about your suggestion of having propose(address, data) replace all the other propose functions, but I see some major setbacks: it would require participants to manually check (if it's available) the contract code of every proposal in order to know what they are voting for. It would also make room for memory abuse of the proposals storage variable. Should we better stay with individuated propose functions? After all, we still have to keep the individuated enacting functions in the DAO.

Oh, and regarding that surprise: I was thinking at calling address(this).delegatecall(abi.encodeWithSignature("transferOwnership(address)", address(this))); inside the DAO constructor, apparently it works. However, that would mean that I have to override setIssuePrice, startIssuance and so on for the initial round since now, only the DAO could call these functions and there's no voting since there are no tokens, yet. So I would do this:

function startDistribution() public {
        require(
            totalSupply() == 0 || proposals.contains(msg.sender),
            "Could not start distribution."
        );
        super.startDistribution();
        proposals.remove(msg.sender);
    }

for example, which would work both for the initial round, and for future voted rounds.

Let me know your thought on these.

from contracts.

alcueca avatar alcueca commented on June 14, 2024

Oh, and regarding that surprise: I was thinking at calling address(this).delegatecall(abi.encodeWithSignature("transferOwnership(address)", address(this))); inside the DAO constructor, apparently it works.

  1. Can't you just call transferOwnership(address(this)) in the constructor (link)?

  2. While that is a cool idea, wouldn't be cleaner to transferOwnership inside startDistribution? To mee it seems like the point in time when the DAO actually comes to life. During the initial funding round the DAO doesn't actually exist, it's only a proposal (coded as an issuance process).

  3. I'm thinking of getting rid of setIssuePrice and take price as a constructor parameter (inheriting contracts can create a function to reset the issue price if they need to).

from contracts.

uivlis avatar uivlis commented on June 14, 2024
  1. No, I don't think so, since transferOwnership has to be called by the owner, that's why I use delegatecall.

  2. Yes.

  3. Should I do this in Issuance?

from contracts.

alcueca avatar alcueca commented on June 14, 2024
  1. Interesting.
  2. Let's try in startDistribution then.
  3. Yes, please remove from Issuance

I just merged #226, please start a new branch from master for this issue.

from contracts.

uivlis avatar uivlis commented on June 14, 2024

I've been thinking at another issue. When opening a new investment round, the startDistribution call must be voted (as the DAO is now the owner, after the initial phase), as well as in the case of cancelAllInvestments, which made me think at this: why do we need the states in Issuances? That is, why can't we just have invest and claim and cancel called haphazardly? It would simplify a lot, not just the DAO, but also the Issuance.

from contracts.

alcueca avatar alcueca commented on June 14, 2024

invest cannot be called at will, because that would allow anyone to mint more issuance tokens at the ICO price, regardless of the market price.

cancelAllInvestments can be simply removed from IssuanceEth.sol, IMHO.

To remove startDistribution we could modify IssuanceEth.sol so that it takes a targetAmount at the constructor, and then invest checks msg.value:

  • amountRaised + msg.value < targetAmount -> Continue
  • amountRaised + msg.value > targetAmount -> Revert
  • amountRaised + msg.value = targetAmount -> _transition("LIVE")

The latest one would be hard to achieve if the gas used is removed from msg.value (is it?).

In plain English this issuance would be "I want to raise this much, if I get it go live immediately.". If the funds are not raised the issuance would be come a kind of zombie.

I'm not too bothered about changing the mechanics of IssuanceEth as long as we keep it a simple contract.

from contracts.

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.