ozPayMe

Main implementation on L1 that starts the bridging process, possess all Account modification methods.

Since the beginning of the flow doesn't necesserily starts with the user's knowledge nor attention (the user can't be sleeping for example when they receive a transfer), it is mandatory to implement different mechanisms that will allow the user's funds to be either in constant movement or held in their position (aka not stuck).

As last resort, there's a function that would allow the user to retrieve their ETH from the Account in case the stuck scenario does occur.

circle-info

Github repo herearrow-up-right.

System methods

sendToArb

function sendToArb( 
        uint gasPriceBid_,
        struct StorageBeacon.AccountConfig calldata acc_,
        uint amountToSend_ 
) external payable onlyOps filterDetails(acc_);

Parameters:

Struct:

Name
Type
Description

user

address

User who created the Account

token

address

Coin the user will receive in L2

slippage

uint256

Slippage used on swaps from ETH to token

name

string

Name of the Account

Function:

Name
Type
Description

gasPriceBid_

uint256

Gas price used on L2 execution

acc_

struct StorageBeacon.AccountConfig

Configuration of the Account being transacted on

amountToSend_

uint256

Gross ETH amount being sent to L2

Account methods

changeAccountSlippage

Changes the slippage of the Account that will be used in all user swaps.

Parameters:

Name
Type
Description

newSlippage_

uint16

New Slippage of the Account expressed in basis points.

changeAccountToken

Change the stablecoin of the Account (token that the user will receive in L2).

Parameters:

Name
Type
Description

newToken_

address

New stablecoin of the Account

changeAccountTokenNSlippage

Changes the Account's token and slippage at the same time in one call.

Parameters:

Name
Type
Description

newToken_

address

New token for the Account

newSlippage_

uint16

New slippage for the Account (in basis points)

getAccountDetails

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

Return values:

Name
Type
Description

user

address

Owner of the Account

token

address

Token of the Account

slippage

uint16

Slippage of the Account

withdrawETH_lastResort

In case of catastrophic failure of the entire bridging mechanism, this function would allow the user to withdraw the ETH from their Account.

Last updated