ozMiddlewareL2

Contract in charge of forwarding the call from each Account (ozAccountProxyL2) to ozDiamond.

The main reason of its implementation is to change the msg.sender on each call, and produce a unique sender for all Accounts of the system, in order to have an unified caller to check in ozDiamond, and in this way, avoid unauthorized calls to the main entry function (exchangeToAccountToken()).

Open methods

getDetails

function getDetails() external view returns(
        address user, 
        address token, 
        uint16 slippage
);

Gets the configuration of an Account (except for the name).

Return values:

Name
Type
Description

user

address

User who created the Account

token

address

Token of the Account

slippage

uint16

Slippage of the Account

Account methods

changeSlippage

Changes the slippage of an Account.

Parameters:

Name
Type
Description

newSlippage_

uint16

New Account slippage represented in basis points

changeToken

Changes the token of an Account.

Parameters:

Name
Type
Description

newToken_

address

Changes the stablecoin being swapped into at the end of the L2 flow.

changeTokenNSlippage

Changes both the slippage and token of an Account.

Parameters:

Name
Type
Description

newToken_

address

New Account stablecoin

newSlippage_

uint16

New Account slippage represented in basis points

withdrawETH_lastResort

Withdraws the ETH from an Account in case it's stuck, as a failsafe mechanism.

System methods

exchangeToAccountToken

Forwards the original call from each Account to ozDiamond.

Parameters:

Name
Type
Description

accData_

bytes

Details of the Account being forwarded

amountToSend_

uint256

ETH amount that account_ received

account_

address

Account being transacted with

Last updated