CS48001
I have built a Governance contract on top of our exchange and token contracts. Its purpose is to control the tokens that exchange contract can use with a voting system. I improved the exchange contract and added a check for the token that has been using and added an "addtoken" function which can be used only by the Governance contract for adding tokens to the contract. I have implemented the Governance contract by also putting the "governancetoken" into it. It was similar to the token contracts functions. Only the name and symbol were predefined. Governance contract has a proposal struct and receipt struct for the votes. It has a created proposal function. With that, you can propose new tokens for the exchange contract. Proposals have a predefined time for the voting process which is calculated by the blocks passed in the blockchain. User must have min %1 of all tokens to propose a contract. After the proposal is created when 1 block passes, the voting period starts and by using the “castvote” function, governance token holders can vote with their tokens until time ends. Every voter can vote only once yo every proposal and can’t change their votes. The delegation has been solved by using the transfer function of the token. After the voting period ends anyone can cancel or execute the proposal according to the results. The state of the proposal is always calculated by using state function and it says if it’s succeeded, failed, active, closed, or executed. To improve further we can analyze security problems and optimize our contract for less gas usage. We can add a timelock stage for the execution process.