Forums
Talk about anything you want!
Login to get your referral link.
This is the third and last article on a series on how to use the Ethereum portfolio to create your own autonomous organizations. On First post, we detailed how to create a tokenand on the Second, we have shown how to generate a digital democracy controlled by these tokens. Now we are going to make the circle and create a token control by the organization!
We will modify the token contract to allow it to be struck by your DAO. So save the address of your current DAO in a note of note (pay attention to the icon) and Take this source code And you know the exercise: Contracts> Deploy a new contract> Source of solidity> Pick Contract
You can fill out the settings as you wish (yes, the emojis are authorized on the champs of the chain), but you will notice a new field which did not exist before: Central Minter. Here, add the address of your newly created democracy contract.
Click Deploy and wait for the transaction to be recovered. After having at least two confirmations, go to your democracy contract and you will notice that it now has one million of your new parts. Now, if you access the Contracts tab, you will see that there is a new DAO Dollar (Administration page) contract on your collection.
Select the “Minttoke” function to your right, then put any address that you have as “target”, then the quantity of new mints that you want to create from the thin air in their account. Press “execute” but Do not press on Send! You will notice that there is a warning indicating that the transaction cannot be executed. It happens because only the Minor (which is currently defined on the DAO address) can call this function and you call it with your main account. But the call code is the same, which is why you can simply copy it.
Instead, Copy the contract execution code from the “data” field And put it aside on a notebook. Also get the address of your new “Mint” contract and save it somewhere.
Now come back to the democracy contract and create a new proposal with these parameters:
In a few seconds, you should be able to see that the details of the proposal. Unlike other fields, transactionbytecode can be extremely long and therefore expensive to store on the blockchain. Thus, instead of archiving it, the person who executes the call later will provide bytecode.
But this of course creates a security hole: how can a proposal be voted without the real code being there? And what prevents a user from executing a different code after the proposal was voted? This is why we keep the hatching of bytecode. Scroll down a little on the list of “Read from the contract” functions and you will see a proposal verification function, where anyone can put all the function parameters and check if they correspond to the one voted. This also guarantees that the proposals are only executed if the hatching of bytecode corresponds exactly to that of the code provided.
It is an older code, but it checks
Now, everyone can vote on the proposal and after the passage of the voting period, anyone with the right Bytecode can ask the votes to be recorded and the contract to be executed. If the proposal has enough support, the newly created parts should appear on Alice’s account, as if it were a transfer of the zero address.
Why a transfer of zero address? Because doing the opposite, sending a part to 0x00 is a way to destroy it effectively, but more importantly, because it says it on the contract code. You can change this as you prefer.
And now, you have a central minister contract which exists only on the blockchain, being the test of fraud, because all their activities are recorded transparently. Mint can also take traffic parts by simply sending the parts it owes to zero, or by freeze the funds on any account, but it is Mathematically impossible For mint to do one of these actions or generate more parts without the support of enough mint shareholders.
Possible uses of this DAO:
There are several ways of which this structure can still be improved, but we will leave it as an exercise and a challenge to the reader:
1
Voice
0
Replies