Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Curio Governance Token Authority

Custom authority for allowing CGT (Curio Governance Token) to govern CGT.

Intentionally simple. Once set as the CGT token's authority, if the CGT token's owner field is subsequently set to zero, the following properties obtain:

  • any user may call CGT's burn function
  • only authorized users (according to the MkrAuthority's wards) can call CGT's mint() function
  • only the root user set in the authority can call other auth-protected functions of the CGT contract
  • only the root user can modify the MkrAuthority's wards or change the root

Though this contract could be used in different ways, it was designed in the context of an overall design for control of the CGT token via CGT governance as illustrated below.

<~~~ : points to source's authority
<=== : points to source's root or owner

-------    -------    ------------    --------------    -----
|Chief|<~~~|Pause|<===|PauseProxy|<===|MkrAuthority|<~~~|CGT|===>0
-------    -------    ------------    --------------    -----

Such a structure allows governance proposals voted in on the Chief to make arbtirary changes to the CGT token and its permissions subject to a delay. (See DappHub contracts DSChief and DSPause for implementations of the voting contract and the delay contract, respectively.)

Note that the MkrAuthority allows for upgrading of the CGT token's authority or owner by the root.

K specifications of the contract's functionality can be found in: https://github.com/makerdao/k-mkr-authority/

For developers

Deployment environment

When deploying, use the following environment:

  • Ubuntu 18.04 LTS
  • A user in the sudoers group
  • NixOS v2.11.1

Creating a new user:

  • Create a new user adduser ubuntu
  • Add the user to sudoers group usermod -aG sudo ubuntu
  • Optionally, if you don't want to enter your password each time the installation process asks, run sudo visudo
  • Add the following line at the end of the file: ubuntu ALL=(ALL) NOPASSWD: ALL

Preparing deployment environment:

  • Install Nix environment curl -L https://nixos.org/nix/install | sh
  • Run this or login again to use Nix . "$HOME/.nix-profile/etc/profile.d/nix.sh"
  • Clone this repo and cd into it
  • Drop into a Nix Bash shell with all dependency installed nix-shell -p
  • Install dapp tools curl https://dapp.tools/install | sh
  • Use ETH v3 encoded private key and copy JSON part to ./keystore/me.json
  • Copy the password from the step above to ./keystore/pwd

Contract deployment

Compile contract:

dapp --use solc:0.5.12 build --optimize

Deploy contract:

ETH_FROM={deployer_address} \
ETH_PASSWORD=./keystore/pwd \
ETH_KEYSTORE=./keystore \
ETH_GAS=400000 \
ETH_GAS_PRICE={gas_price_in_wei} \
ETH_RPC_URL=https://{eth_network}.infura.io/v3/{infura_project_id} \
TMPDIR=/tmp \
dapp create MkrAuthority

Etherscan contract verification

export ETH_RPC_URL=https://{eth_network}.infura.io/v3/{infura_project_id}
export ETHERSCAN_API_KEY={etherscan_api_key}
dapp verify-contract src/MkrAuthority.sol:MkrAuthority {token_contract_address}

About

Custom authority for allowing CGT to govern CGT.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages