CollateralSpenderManager
This contract handles the collateral spender for OverlayerWrap
CollateralSpenderManagerInvalidSpenderAddress
error CollateralSpenderManagerInvalidSpenderAddress()
Error thrown when spender address is invalid (zero address)
CollateralSpenderManagerIntervalNotRespected
error CollateralSpenderManagerIntervalNotRespected()
Error thrown when proposal time interval is not respected
CollateralSpenderManagerOperatioNotAllowed
error CollateralSpenderManagerOperatioNotAllowed()
Error thrown when operation is not allowed for the caller
ProposedCollateralSpender
event ProposedCollateralSpender(address, uint256)
Emitted when a new collateral spender is proposed
AcceptedProposedCollateralSpender
event AcceptedProposedCollateralSpender(uint256)
Emitted when a new collateral spender has accepted the proposal
COLLATERAL_MANAGER_ROLE
bytes32 COLLATERAL_MANAGER_ROLE
role enabling to transfer collateral to custody wallets
PROPOSAL_TIME_INTERVAL
uint256 PROPOSAL_TIME_INTERVAL
@notice The time interval needed to changed a spender address
approvedCollateralSpender
address approvedCollateralSpender
@notice The unique approved collateral spender
proposedSpender
address proposedSpender
@notice The proposed new spender
proposalTime
uint256 proposalTime
@notice The last proposal time
constructor
constructor() internal
_initalize
function _initalize(address admin_, struct OverlayerWrapCoreTypes.StableCoin collateral_, struct OverlayerWrapCoreTypes.StableCoin aCollateral_) internal
Initializes the contract with admin and collateral configurations
Parameters
| Name | Type | Description |
|---|---|---|
| admin_ | address | Address of the contract administrator |
| collateral_ | struct OverlayerWrapCoreTypes.StableCoin | Configuration for the main collateral token |
| aCollateral_ | struct OverlayerWrapCoreTypes.StableCoin | Configuration for the associated collateral token |
getSpender
function getSpender() public view returns (address)
@notice View the spender
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | address | The active spender |
proposeNewCollateralSpender
function proposeNewCollateralSpender(address spender_) external
@notice Propose a new spender
Can not be zero address
Parameters
| Name | Type | Description |
|---|---|---|
| spender_ | address | The proposed new spender |
acceptProposedCollateralSpender
function acceptProposedCollateralSpender() external
@notice The proposed spender accepts to be the spender
If it is the initial spender, the PROPOSAL_TIME_INTERVAL is not respected