Skip to content

mastercodingbear/Governance

Repository files navigation

Optino Governance DAO Smart Contracts

Status: Work In Progress

The Optino Governance (OptinoGov) smart contract is the Decentralised Autonomous Organisation (DAO) that operates the Optino Vending Machine.

Optino Governance token (OGToken) holders lock their OGTokens into the OptinoGov smart contract to submit and vote on proposals. If successful, the proposal will be executed, e.g., the minting of new OGTokens, the burning of staked tokens, and setting of fee rates.

When OGTOkens are locked into the OptinoGov smart contract, the equivalent number of Optino Governance Dividend token (OGDToken) are minted. These tokens will accrue fees generated by the Optino Vending Machine.

Following are the main smart contracts:

See also:



Remix

To test out these smart contracts in Remix, copy the contents of the files above into the same file names within Remix. Comment out the local import ".\{file.sol}" and uncomment the GitHub import "https://github.com/ogDAO/Governance/blob/master/contracts/{file}.sol";.



Testing

Clone Repository

Check out this repository into your projects subfolder:

git clone https://github.com/ogDAO/Governance.git
cd Governance

Install Hardhat

If not already installed, you will need NPM. NVM may take away some of your NPM versioning pain.

You will need to install the Hardhat testing framework:

npm install --save-dev hardhat @nomiclabs/hardhat-ethers chai ethers @nomiclabs/hardhat-waffle ethereum-waffle
npm install --save bignumber.js
npm install --save decimal.js

Install Truffle Flattener And Flatten Solidity Files

Install Truffle Flattener using the command:

npm install -g truffle-flattener
./10_flattenSolidityFiles.sh

The flattened files can be found in the ./flattened/ subdirectory.


Install Other Modules

You will need the following modules installed:

# npm install --save eth-sig-util
npm install --save bignumber.js

Compile

npx hardhat compile

Run OptinoGov Tests

./20_testOptinoGov.sh

You may need to chmod 700 20_testOptinoGov.sh before being able to execute it.

The latest output generated from the script test/TestOptinoGov.js can be found in results/TestOptinoGov.txt.


Run OGDToken Tests

./30_testOGDToken.sh

You may need to chmod 700 30_testOGDToken.sh before being able to execute it.

The latest output generated from the script test/TestOGDToken.js can be found in results/TestOGDToken.txt.


Run StakingFactory Tests

./40_testStakingFactory.sh

You may need to chmod 700 40_testStakingFactory.sh before being able to execute it.

The latest output generated from the script test/TestStakingFactory.js can be found in results/TestStakingFactory.txt.



Enjoy!

(c) The Optino Project 2020. GPLv2