RampAController
Inherits: IRampAController, Initializable, OwnableUpgradeable
Contract for managing gradual changes to A coeff (A) parameter Allows for smooth transitions between different A values.
State Variables
MAX_A
uint256 private constant MAX_A = 10 ** 6;
DEFAULT_RAMP_TIME
uint256 private constant DEFAULT_RAMP_TIME = 30 minutes;
initialA
uint256 public override initialA;
futureA
uint256 public override futureA;
initialATime
uint256 public override initialATime;
futureATime
uint256 public override futureATime;
minRampTime
uint256 public minRampTime;
Functions
constructor
constructor();
initialize
Initializer for RampAController
function initialize(uint256 _initialA, uint256 _minRampTime, address _owner) external initializer;
Parameters
Name | Type | Description |
---|---|---|
_initialA | uint256 | is the initial value of A |
_minRampTime | uint256 | is min ramp time |
_owner | address | is the address of the owner |
setMinRampTime
Set the minimum ramp time (default is 30 minutes)
function setMinRampTime(uint256 _minRampTime) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_minRampTime | uint256 | is the new minimum ramp time |
rampA
Initiate a ramp to a new A value
function rampA(uint256 _futureA, uint256 _futureTime) external override onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_futureA | uint256 | is the target value of A |
_futureTime | uint256 | is UNIX timestamp when the ramp should complete |
stopRamp
Force-stop ramping A coeff
function stopRamp() external override onlyOwner;
isRamping
Check if ramping in progress
function isRamping() external view override returns (bool);
Returns
Name | Type | Description |
---|---|---|
<none> | bool | true if it is, false otherwise |
getA
Public getter which is used in SPA
function getA() public view override returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | the current value of A coeff |
Events
RampInitiated
event RampInitiated(uint256 initialA, uint256 futureA, uint256 initialATime, uint256 futureATime);
RampStopped
event RampStopped(uint256 currentA);
MinRampTimeUpdated
event MinRampTimeUpdated(uint256 oldValue, uint256 newValue);
Errors
InvalidFutureTime
error InvalidFutureTime();
RampAlreadyInProgress
error RampAlreadyInProgress();
NoOngoingRamp
error NoOngoingRamp();
AOutOfBounds
error AOutOfBounds();
InsufficientRampTime
error InsufficientRampTime();
Unauthorized
error Unauthorized();