Skip to content

CommonHelpers ​

Git Source

Inherits:ReentrancyGuard

Functions ​

_getGovernanceAddr ​

Returns the current admin (governance).

solidity
function _getGovernanceAddr() internal view returns (address governance_);

_afterTransferIn ​

Hook invoked after assets are transferred into the contract. Must be implemented for chain specific implementation version.

ATTENTION: THIS IS NOT CALLED FOR NATIVE TOKEN (e.g. ETH).

solidity
function _afterTransferIn(address token_, uint256 amount_) internal virtual;

Parameters

NameTypeDescription
token_addressThe address of the transferred-in token.
amount_uint256The amount of tokens transferred in.

_preTransferOut ​

Hook invoked before assets are transferred out of the contract. Must be implemented for chain specific implementation version.

ATTENTION: THIS IS NOT CALLED FOR NATIVE TOKEN (e.g. ETH).

solidity
function _preTransferOut(address token_, uint256 amount_) internal virtual;

Parameters

NameTypeDescription
token_addressThe address of the token to be transferred out.
amount_uint256The amount of tokens to be transferred out.

_getExternalBalances ​

Returns the contract's own balance of the given token currently re-hypothecated or otherwise sitting externally.

solidity
function _getExternalBalances(address token_) internal view virtual returns (uint256);

Parameters

NameTypeDescription
token_addressThe address of the token to check.

Returns

NameTypeDescription
<none>uint256The total balance of the contract re-hypothecated assets.