Comments (8)
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.
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.
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.
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.
-
Can't you just call
transferOwnership(address(this))
in the constructor (link)? -
While that is a cool idea, wouldn't be cleaner to
transferOwnership
insidestartDistribution
? 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). -
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.
-
No, I don't think so, since
transferOwnership
has to be called by the owner, that's why I usedelegatecall
. -
Yes.
-
Should I do this in
Issuance
?
from contracts.
- Interesting.
- Let's try in
startDistribution
then. - Yes, please remove from
Issuance
I just merged #226, please start a new branch from master
for this issue.
from contracts.
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.
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
-> ContinueamountRaised + msg.value > targetAmount
-> RevertamountRaised + 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)
- Include votes in `DAO.sol` for distributing dividends HOT 22
- Fix ERC20DividendableEth for supply changes.
- Fix ERC20DividendableEth for transfers. HOT 1
- Fix Fixidity conversions in ERC20DividendableEth HOT 1
- Add multiple base support to DecimalMath.sol HOT 4
- Replace Fixidity for DecimalMath in Issuance*.sol
- Get Voting out of drafts.
- Implement a generic `propose` function in DAO.sol. HOT 1
- Refactoring `Voting.enact()` - Multiple proposals HOT 1
- Remove unused return values in Lists
- Remove Fixidity imports
- DAO.sol needs a proposal to cancel an investment.
- Upgrade ERC20MultiDividendable
- "Contract code size exceeds 24576 bytes" during coverage HOT 6
- Consider adopting ERC1726 for ERC20DividendableEth HOT 1
- _grantRole in AccessControl.sol is private HOT 1
- Introduce array of roleIds HOT 3
- Crytic.io security analysis of the HQ20 contracts
- https://hq20-contracts.netlify.app/ Page not found
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from contracts.