FundLockAdmin

View Source: contracts/fund-lock/FundLockAdmin.sol

↗ Extends: FundLockStorage, IFundLockAdmin

FundLockAdmin

Administrative contract that initializes storage of FundLock group and sets main state variables.

Contract Members

Constants & Variables

bytes32 private constant ADMIN_ROLE_NAME;

bytes32 private constant GOVERNOR_ROLE_NAME;

Functions

  • init(address _roleManager, address _tokenManager, uint256 _tradeLock, uint256 _releaseLock)

  • setRegistry(address _registry)

  • setReleaseLockInterval(uint256 interval)

  • setTradeLockInterval(uint256 interval)

init

Main initialization function that checks if initialization has been previously done and sets storage vars.

function init(address _roleManager, address _tokenManager, uint256 _tradeLock, uint256 _releaseLock) external nonpayable onlyRouterAccess 

Arguments

NameTypeDescription

_roleManager

address

- address of the {RoleManager} contract

_tokenManager

address

- address of the {TokenManager} contract

_tradeLock

uint256

- time period during which user's {fundsToWithdrawS} can still be used for funding trades

_releaseLock

uint256

- time period after withdrawal request a user has to wait to release his funds (between {withdraw()} and {release()})

setRegistry

Setter for {registry} storage var which holds {ElektroRegistryRouter} address

function setRegistry(address _registry) external nonpayable onlyRouterAccess onlyRole 

Arguments

NameTypeDescription

_registry

address

- {ElektroRegistryRouter} address to be set

setReleaseLockInterval

Sets {releaseLock} interval variable on the contract that will be used for all {fundsToWithdraw}. This interval represents time that user has to wait after he called {withdraw()} function before he can {release()} funds. Can only be called by the Admin account.

function setReleaseLockInterval(uint256 interval) public nonpayable onlyRouterAccess onlyRole 
returns(bool)

Arguments

NameTypeDescription

interval

uint256

- {releaseLock} interval to be set

setTradeLockInterval

Sets {tradeLock} interval variable on the contract that will be used for all {fundsToWithdraw}. This interval represents time during which user's {fundsToWithdraw} can still be used to cover trades. Starts after {withdraw()} is called, at the same time as {releaseLock}, but is shorter. Can only be called by the Admin account.

function setTradeLockInterval(uint256 interval) public nonpayable onlyRouterAccess onlyRole 
returns(bool)

Arguments

NameTypeDescription

interval

uint256

- {tradeLock} interval to be set

Last updated