Skip to main content
Version: mainnet (v0.71)

ETH Bridge Logic (ETH_Bridge_Logic.sol)

View Source: contracts/ETH_Bridge_Logic.sol

↗ Extends: IETH_Bridge_Logic

ETH_Bridge_Logic

This contract is used by Vega network users to deposit and withdraw ETH to/from Vega.

Contract Members

Constants & Variables

address payable internal ETH_asset_pool_address;

uint256 internal minimum_deposit;

uint256 internal maximum_deposit;

bytes32 internal vega_asset_id;

Functions

function (address payable ETH_asset_pool) public nonpayable

Arguments

NameTypeDescription
ETH_asset_pooladdress payableInitial Asset Pool contract address

multisig_control_address

function multisig_control_address() internal view
returns(address)

Arguments

NameTypeDescription

set_deposit_minimum

This function sets the minimum allowable deposit for ETHEmits ETH_Deposit_Minimum_Set if successful

function set_deposit_minimum(uint256 minimum_amount, uint256 nonce, bytes signatures) public nonpayable

Arguments

NameTypeDescription
minimum_amountuint256Minimum deposit amount
nonceuint256Vega-assigned single-use number that provides replay attack protection
signaturesbytesVega-supplied signature bundle of a validator-signed order

set_deposit_maximum

This function sets the maximum allowable deposit for ETHEmits ETH_Deposit_Maximum_Set if successful

function set_deposit_maximum(uint256 maximum_amount, uint256 nonce, bytes signatures) public nonpayable

Arguments

NameTypeDescription
maximum_amountuint256Maximum deposit amount
nonceuint256Vega-assigned single-use number that provides replay attack protection
signaturesbytesVega-supplied signature bundle of a validator-signed order

withdraw_asset

This function allows the withdrawal of ETHEmits ETH_Withdrawn if successful

function withdraw_asset(uint256 amount, uint256 expiry, address payable target, uint256 nonce, bytes signatures) public nonpayable

Arguments

NameTypeDescription
amountuint256Amount of ETH to withdraw
expiryuint256Vega-assigned timestamp of withdrawal order expiration
targetaddress payableTarget Ethereum address to receive withdrawn ETH
nonceuint256Vega-assigned single-use number that provides replay attack protection
signaturesbytesVega-supplied signature bundle of a validator-signed order

deposit_asset

This function allows a user to deposit ETH into VegaEmits ETH_Deposited if successful

function deposit_asset(bytes32 vega_public_key) public payable

Arguments

NameTypeDescription
vega_public_keybytes32Target vega public key to be credited with this deposit

get_deposit_minimum

This view returns minimum valid deposit

function get_deposit_minimum() public view
returns(uint256)

Returns

Minimum valid deposit of ETH

Arguments

NameTypeDescription

get_deposit_maximum

This view returns maximum valid deposit

function get_deposit_maximum() public view
returns(uint256)

Returns

Maximum valid deposit of ETH

Arguments

NameTypeDescription

get_multisig_control_address

function get_multisig_control_address() public view
returns(address)

Returns

current multisig_control_address

Arguments

NameTypeDescription

get_vega_asset_id

function get_vega_asset_id() public view
returns(bytes32)

Returns

The assigned Vega Asset Id

Arguments

NameTypeDescription