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
burnfunction - only authorized users (according to the MkrAuthority's
wards) can call CGT'smint()function - only the
rootuser set in the authority can call otherauth-protected functions of the CGT contract - only the
rootuser can modify the MkrAuthority'swards or change theroot
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/
When deploying, use the following environment:
- Ubuntu 18.04 LTS
- A user in the
sudoersgroup - NixOS v2.11.1
Creating a new user:
- Create a new user
adduser ubuntu - Add the user to
sudoersgroupusermod -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
Compile contract:
dapp --use solc:0.5.12 build --optimizeDeploy 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 MkrAuthorityexport 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}