LibUsdAccount
State Variables
ACCOUNT_SIZE
uint64 constant ACCOUNT_SIZE = 32
Functions
decode
Decode an account.
Reverts if account is not 32 bytes long.
function decode(bytes calldata account)
internal
pure
returns (address user, uint96 balance);
Parameters
| Name | Type | Description |
|---|---|---|
account | bytes | The account |
Returns
| Name | Type | Description |
|---|---|---|
user | address | The user address |
balance | uint96 | The user balance |
encode
Encode an account.
function encode(address user, uint96 balance)
internal
pure
returns (bytes memory account);
Parameters
| Name | Type | Description |
|---|---|---|
user | address | The user address |
balance | uint96 | The user balance |
Returns
| Name | Type | Description |
|---|---|---|
account | bytes | The account |
_checkAccountSize
function _checkAccountSize(uint256 accountSize) internal pure;