Admin Functions
The Estimator contract implements a comprehensive administrative governance system with time-delayed proposals for all critical address updates. This system ensures security through a 24-hour delay period for all administrative changes.
Governance Architecture
Time-Delayed Proposal System
All administrative functions follow a secure three-step process:
- Proposal Creation: Admin proposes a new address with 24-hour delay
- Waiting Period: 24-hour security delay before acceptance
- Proposal Execution: Anyone can execute the proposal after the delay period
Managed Addresses
The system manages four critical contract addresses:
- Activator: Controls epoch notifications and system activation
- EVVM Address: Core EVVM contract for payment processing
- Staking Address: Staking contract for user data access
- Admin: Primary administrative control address
Activator Address Management
setActivatorProposal
Access Control: onlyActivator
Function Signature: setActivatorProposal(address)
Creates a proposal to change the activator address.
Parameters:
_proposal
(address): New proposed activator address
Process:
- Sets the proposed activator address
- Establishes acceptance time as current timestamp + 24 hours
- Requires current activator authorization
cancelActivatorProposal
Access Control: onlyActivator
Function Signature: cancelActivatorProposal()
Cancels any pending activator address proposal.
Process:
- Resets proposal address to zero address
- Resets acceptance time to zero
- Prevents unauthorized address changes
acceptActivatorProposal
Access Control: public
Function Signature: acceptActivatorProposal()
Executes the activator address change after the delay period.
Requirements:
- Current timestamp must exceed the acceptance time
- Valid proposal must exist
Process:
- Verifies delay period has elapsed
- Updates actual activator address to proposed address
- Clears proposal data
EVVM Address Management
setEvvmAddressProposal
Access Control: onlyAdmin
Function Signature: setEvvmAddressProposal(address)
Creates a proposal to update the EVVM contract address.
Parameters:
_proposal
(address): New proposed EVVM contract address
cancelEvvmAddressProposal
Access Control: onlyAdmin
Function Signature: cancelEvvmAddressProposal()
Cancels any pending EVVM address proposal.
acceptEvvmAddressProposal
Access Control: onlyAdmin
Function Signature: acceptEvvmAddressProposal()
Executes the EVVM address change after verification of the delay period.
Staking Address Management
setAddressStakingProposal
Access Control: onlyAdmin
Function Signature: setAddressStakingProposal(address)
Creates a proposal to update the staking contract address.
Parameters:
_proposal
(address): New proposed staking contract address
cancelAddressStakingProposal
Access Control: onlyAdmin
Function Signature: cancelAddressStakingProposal()
Cancels any pending staking address proposal.
acceptAddressStakingProposal
Access Control: onlyAdmin
Function Signature: acceptAddressStakingProposal()
Executes the staking address change after the required delay period.
Admin Address Management
setAdminProposal
Access Control: onlyAdmin
Function Signature: setAdminProposal(address)
Creates a proposal to transfer administrative control to a new address.
Parameters:
_proposal
(address): New proposed admin address
cancelAdminProposal
Access Control: onlyAdmin
Function Signature: cancelAdminProposal()
Cancels any pending admin address proposal.
acceptAdminProposal
Access Control: public
Function Signature: acceptAdminProposal()
Executes the admin address transfer after the delay period.
Note: This function is publicly callable to ensure admin transfer can occur even if the current admin becomes unavailable.
Security Features
Time-Lock Protection
- 24-Hour Delay: All address changes require a 24-hour waiting period
- Proposal Visibility: All proposals are publicly visible during the waiting period
- Emergency Cancellation: Current authorized addresses can cancel proposals
Access Control Patterns
- Role-Based Permissions: Each function has specific role requirements
- Separation of Concerns: Different roles for different administrative functions
- Public Execution: Some acceptance functions are public to prevent admin lockout
Proposal Structure
Each address proposal includes:
struct AddressTypeProposal {
address actual; // Current active address
address proposal; // Proposed new address
uint256 timeToAccept; // Timestamp when proposal can be executed
}
Integration Points
With Core Contracts
- Staking Contract: Maintains connection for user data access
- EVVM Contract: Coordinates payment processing integration
- Activator System: Controls epoch and system activation functions
With Governance
- Decentralized Control: Time delays provide community oversight opportunity
- Emergency Response: Cancellation functions provide emergency controls
- Transparent Process: All proposals are publicly visible and verifiable
Usage Workflows
Standard Address Update
- Proposal Creation: Authorized address creates proposal
- Community Review: 24-hour period for community oversight
- Proposal Execution: Anyone executes proposal after delay
- System Update: Contract begins using new address
Emergency Cancellation
- Threat Detection: Unauthorized or malicious proposal detected
- Immediate Cancellation: Authorized address cancels proposal
- System Protection: Prevents unauthorized address changes
All administrative functions include time delays for security. Plan address updates in advance to accommodate the 24-hour waiting period.
The public nature of acceptance functions ensures that administrative changes can be completed even if the current admin becomes unavailable, preventing system lockout scenarios.