-
Notifications
You must be signed in to change notification settings - Fork 8
DDLayerZeroHub
A direct deposit module that sends ZAI to an L2 chain
Assumes that the destination on the L2 chain is a valid contract with proper controls.
bytes32 destinationL2contract IOFT oftAdapteruint256 bridgeduint32 dstEidaddress ethRefundAddressfunction initialize(address _hub, address _zai, bytes32 _destinationL2, address _oftAdapter, uint32 _dstEid) externalreceive() external payablefunction deposit(uint256 wad) externalDeposit assets (ZAI) in the external pool.
If the external pool requires a different amount to be passed in, the conversion should occur here as the Hub passes ZAI amounts. msg.sender must be the hub.
| Name | Type | Description |
|---|---|---|
| wad | uint256 |
function depositToBridge(uint256 wad) external payablefunction withdraw(uint256 wad) externalWithdraw assets (ZAI) from the external pool.
Any withdrawn amount will be held in the contract
| Name | Type | Description |
|---|---|---|
| wad | uint256 |
function preDebtChange() externalSome external pools require actions before debt changes
function postDebtChange() externalSome external pools require actions after debt changes
function assetBalance() external view returns (uint256)Balance of assets this pool "owns".
This could be greater than the amount the pool can withdraw due to lack of liquidity.
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | uint256 number of assets in ZAI |
function maxDeposit() external pure returns (uint256)Maximum number of assets the pool could deposit at present.
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | uint256 number of assets in ZAI |
function maxWithdraw() external view returns (uint256)Maximum number of assets the pool could withdraw at present.
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | uint256 number of assets in ZAI |
function redeemable() external view returns (address)returns address of redeemable tokens (if any)