Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Latest commit

 

History

History
96 lines (63 loc) · 2.87 KB

REP-0004.md

File metadata and controls

96 lines (63 loc) · 2.87 KB

REP-0004: Profile contract - Keep track and allow changes in all relevant addresses of a validator

Preamble

REP-0004
Title: Profile contract - Keep track and allow changes in all relevant addresses of a validator
Author: Ronin Core Team
Type: Standards Track
Status: Approved
Created: 2023-06-05

Abstract

REP-0004 outlines the requirement to implement the Profile contract, which addresses the challenges associated with tracking and modifying the relevant addresses of a validator.

Rationale

Currently, these addresses are scattered across different contracts, making maintenance difficult and potentially leading to inconsistencies. Additionally, the existing codebase does not allow for changes in these addresses. If a validator requires key rotation, they must renounce their status and reapply, resulting in financial loss since the stake amount from delegators is not automatically transferred upon reapplication. To mitigate these losses and ensure seamless transitions, the Profile contract streamlines the reapplication process, offering a more efficient and secure approach. Furthermore, if private keys are leaked, the Profile contract allows validators to update their addresses. It offers an alternative option alongside the emergency exit protocol, empowering validators to protect their operations and ensuring network integrity is maintained even in challenging circumstances.

Specification

Structure

CandidateProfile stores the following information:

  • id: the ID of the profile of a validator,
  • consensus: the concensus address,
  • admin: the pool admin address,
  • treasury: the treasury address,
  • governor: the address to vote proposals.
struct CandidateProfile{
    address id;
    TConsensus consensus;
    address admin;
    address payable treasury;
    address governor;
}

Methods

Add new profile

function addNewProfile(CandidateProfile memory profile) 
  • The profile must not be existent before.
  • Only contract admin can call this method.

Request change consensus address

function requestChangeConsensusAddr(address id, TConsensus newConsensusAddr)

Request change admin address

function requestChangeAdminAddress(address id, address newAdminAddr)

Events

Profile added

event ProfileAdded(address indexed id)

Event emitted when a profile with id is added.

Profile address changed

event ProfileAddressChanged(address indexed id, RoleAccess indexed addressType)

Event emitted when a address in a profile is changed.

Security analysis

With its comprehensive approach, the Profile contract significantly strengthens the overall reliability and security of the network while providing valuable support to validators in their essential roles.

License

The content is licensed under CC0.