kkrt-labs/kakarot

admin: protocol handler implementation [4]

Opened this issue · 0 comments

See conception document
kakarot-governance.pdf

Implement the protocol handler which will be the owner of the kakarot contract.
This will be a cairo1 contract.
It needs to use access controls depending of the functions called on the kakarot contract and match the Kakarot interfaces.

The roles:

  • security council
  • guardians
  • operator
  • gas price admin
// Contants
soft_pause_expiration = 12 hours
hard_pause_expiration = 7 days

// Storage
struct Storage {
	kakarot_core: ContractAddress
	security_council: ContractAddress
	operator: ContractAddress
	gas_price_admin: ContractAddress
	guardians: Vec<ContractAddress>
	protocol_frozen_until: felt252
}

// Authorized operator selectors are set in construcor

// Admin 
* fn emergency_execution(call: Call) SECURITY_COUNCIL
* fn upgrade(new_class_hash: felt252) OPERATOR
* fn transfer_ownership(new_owner: ContractAddress) SECURITY_COUNCIL
* fn soft_pause() GUARDIAN
* fn hard_pause() SECURITY_COUNCIL
* fn unpause() SECURITY_COUNCIL or delay passed

// Storage modification
// check if the selector is authorized
* fn execute_call(ref self: ContractState, call: Call) OPERATOR

// Self management
* fn change_operator(new_address_operator: ContractAddress) SECURITY_COUNCIL
* fn change_security_council(new_security_council_address: ContractAddress) SECURITY_COUNCIL
* fn add_guardian(new_guardians_address: ContractAddress) SECURITY_COUNCIL
* fn remove_guardian(guardian_to_remove_address: ContractAddress) SECURITY_COUNCIL
* fn change_gas_price_admin(new_gas_price_admin: ContractAddres) SECURITY_COUNCIL

Tasks

Preview Give feedback