NativeTokenGateway
NativeTokenGateway contract facilitates interactions with a vToken market for native tokens (Native or wNativeToken)
Address of wrapped native token contract
contract IWrappedNative wNativeToken
Address of wrapped native token market
contract IVToken vWNativeToken
Constructor for NativeTokenGateway
constructor(contract IVToken vWrappedNativeToken) public
Parameters
Address of wrapped native token market
To receive Native when msg.data is empty
To receive Native when msg.data is not empty
Wrap Native, get wNativeToken, mint vWNativeToken, and supply to the market.
Parameters
The address on behalf of whom the supply is performed.
π
Events
TokensWrappedAndSupplied is emitted when assets are supplied to the market
β Errors
ZeroAddressNotAllowed is thrown if address of minter is zero address
ZeroValueNotAllowed is thrown if mintAmount is zero
redeemUnderlyingAndUnwrap
Redeem vWNativeToken, unwrap to Native Token, and send to the user
Parameters
The amount of underlying tokens to redeem
π
Events
TokensRedeemedAndUnwrapped is emitted when assets are redeemed from a market and unwrapped
β Errors
ZeroValueNotAllowed is thrown if redeemAmount is zero
redeemAndUnwrap
Redeem vWNativeToken, unwrap to Native Token, and send to the user
Parameters
The amount of vWNative tokens to redeem
π
Events
TokensRedeemedAndUnwrapped is emitted when assets are redeemed from a market and unwrapped
β Errors
ZeroValueNotAllowed is thrown if redeemTokens is zero
Wrap Native, repay borrow in the market, and send remaining Native to the user
π
Events
TokensWrappedAndRepaid is emitted when assets are repaid to a market and unwrapped
β Errors
ZeroValueNotAllowed is thrown if repayAmount is zero
Sweeps native assets (Native) from the contract and sends them to the owner
π
Events
SweepNative is emitted when assets are swept from the contract
βοΈ Access Requirements
Sweeps the input token address tokens from the contract and sends them to the owner
Parameters
π
Events
SweepToken emits on success
βοΈ Access Requirements