The Dao

Overall thoughts

old, no pragma, no inheritance from OpenZeppelin, no modifiers or guards. (ie, swift)

DaoTokenCreationProxyTransferer.sol

Token.sol

Creates a token, defines TokenInterface for basic functions needed as a token. Nowadays people should inherit some kind of ERC, most likely a ERC20 token.

Managed Account.sol

looks like a bank account, if payOwnerOnly is set to true, only the owner can widthdraw from this contract.

Again, there are contracts that you will inherit if you were to do it today.

TokenCreation.sol

imports Token and Managed Account.

TokenCreationInterface

initiates and tracks eth put into this DAO? Comments say its still about eth not dai. There is a closing time for token creation, meaning that after a period, tokens are not issued?

TokenCreation

createTokenProxy()

creates tokens. There is a conversion rate from eth to this token.

uint token = (msg.value * 20 ) / divisor();

the divisor() can starts with, 20 goes up till 30. The last four days will have a 1:1.5, token: eth rate. so if msg.value was 15, only 10 will be create.

The difference between the two gets recorded uisng a Managed Account. Each time tokens get created, a CreatedToken event emits, and when the number of tokens surpasses the minTokensToCreate it emits a FuelingToDate event.

refund()

Dao.sol

imports TokenCreation and ManagedAccount.

lots of periods!

a list of Proposals

struct Proposal {
 ...
}

DAOInterface

What kind of storage method? on chain? single recipient? or can this be a contract? is the amount fixed? description can this be suuuuper long? (gas fees? or penalties?) why is it a unix timestamp? why not the block count?

so Proposal can split the DAO, creating a new DAO, but looks like it's using the same token as the first DAO. But no, line 244 says they are different tokens.

users can split the DAO, putting a new curator (organizer?)

DAO

we see the use of modifiers. A limiter for only allowing the tokenholders to execute a given action.

constructor

there is a single curator, but it's (doesn't have to be) not the caller of this contract.

it uses the TokenCreation() function in conjuct?

minquorum is set to 20%… isn't this too low?

newProposal

sanity check looks like it's in a rush… all these pitfalls, should be handled by a contract that is audited.. or tested.

checkProposalCode

Checks the validity, when recipient, amount, transactionData are given.

vote

you can only vote once? if yes, your tokens go to votedNo.

executeProposal

why are we checking the transactionDate for validity here?

not surprisingly, most of the code is for checking.

  • is the voting deadline yet to come?
  • is the proposal open?
  • does the transactionalData match the Hash?
  • L531-537??
  • is the proposal amount bigger then the actualBalance()?
  • does it meet the quorum

    L565 calls p.recipient.call.value(p.amount)(_transactionData)

    what is a "proxy address".

splitDAO

If this function is runnning, and the same function is running before the first function goes to the end, the balance is not cleared, hence you can transfer the new DAO

Created: 2021-11-23 Tue 22:16