erc20Bridger
Classes
AdminErc20Bridger
Admin functionality for the token bridge
Extends
Constructors
new AdminErc20Bridger()
new AdminErc20Bridger(childNetwork: ArbitrumNetwork): AdminErc20Bridger
Bridger for moving ERC20 tokens back and forth between parent-to-child
Parameters
Parameter | Type |
---|---|
childNetwork | ArbitrumNetwork |
Returns
Inherited from
Source
assetBridger/erc20Bridger.ts:201
Properties
Property | Modifier | Type | Description | Inherited from |
---|---|---|---|---|
nativeToken? | readonly | string | In case of a chain that uses ETH as its native/gas token, this is either undefined or the zero addressIn case of a chain that uses an ERC-20 token from the parent network as its native/gas token, this is the address of said token on the parent network | Erc20Bridger .nativeToken |
Accessors
nativeTokenIsEth
get protected nativeTokenIsEth(): boolean
Whether the chain uses ETH as its native/gas token
Returns
boolean
Source
assetBridger/assetBridger.ts:71
Methods
approveGasToken()
approveGasToken(params: ApproveParamsOrTxRequest): Promise<ContractTransaction>
Approves the custom gas token to be spent by the relevant gateway on the parent network
Parameters
Parameter | Type | Description |
---|---|---|
params | ApproveParamsOrTxRequest |
Returns
Promise
<ContractTransaction
>
Inherited from
Source
assetBridger/erc20Bridger.ts:272
approveToken()
approveToken(params: ApproveParamsOrTxRequest): Promise<ContractTransaction>
Approve tokens for deposit to the bridge. The tokens will be approved for the relevant gateway.
Parameters
Parameter | Type | Description |
---|---|---|
params | ApproveParamsOrTxRequest |
Returns
Promise
<ContractTransaction
>
Inherited from
Source
assetBridger/erc20Bridger.ts:335
checkChildNetwork()
protected checkChildNetwork(sop: SignerOrProvider): Promise<void>
Check the signer/provider matches the child network, throws if not
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider |
Returns
Promise
<void
>
Inherited from
Erc20Bridger
.checkChildNetwork
Source
assetBridger/assetBridger.ts:60
checkParentNetwork()
protected checkParentNetwork(sop: SignerOrProvider): Promise<void>
Check the signer/provider matches the parent network, throws if not
Parameters
Parameter | Type | Description |
---|---|---|
sop | SignerOrProvider |
Returns
Promise
<void
>
Inherited from
Erc20Bridger
.checkParentNetwork
Source
assetBridger/assetBridger.ts:49
deposit()
deposit(params: Erc20DepositParams | ParentToChildTxReqAndSignerProvider): Promise<ParentContractCallTransaction>
Execute a token deposit from parent to child network
Parameters
Parameter | Type | Description |
---|---|---|
params | Erc20DepositParams | ParentToChildTxReqAndSignerProvider |
Returns
Promise
<ParentContractCallTransaction
>
Inherited from
Source
assetBridger/erc20Bridger.ts:754
getApproveGasTokenRequest()
getApproveGasTokenRequest(params: ProviderTokenApproveParams): Promise<Required<Pick<TransactionRequest, "data" | "value" | "to">>>
Creates a transaction request for approving the custom gas token to be spent by the relevant gateway on the parent network
Parameters
Parameter | Type | Description |
---|---|---|
params | ProviderTokenApproveParams |
Returns
Promise
<Required
<Pick
<TransactionRequest
, "data"
| "value"
| "to"
>>>
Inherited from
Erc20Bridger
.getApproveGasTokenRequest
Source
assetBridger/erc20Bridger.ts:256
getApproveTokenRequest()
getApproveTokenRequest(params: ProviderTokenApproveParams): Promise<Required<Pick<TransactionRequest, "data" | "value" | "to">>>
Get a tx request to approve tokens for deposit to the bridge. The tokens will be approved for the relevant gateway.
Parameters
Parameter | Type | Description |
---|---|---|
params | ProviderTokenApproveParams |
Returns
Promise
<Required
<Pick
<TransactionRequest
, "data"
| "value"
| "to"
>>>
Inherited from
Erc20Bridger
.getApproveTokenRequest
Source
assetBridger/erc20Bridger.ts:302
getChildErc20Address()
getChildErc20Address(erc20ParentAddress: string, parentProvider: Provider): Promise<string>
Get the corresponding child network token address for the provided parent network token
Parameters
Parameter | Type | Description |
---|---|---|
erc20ParentAddress | string | |
parentProvider | Provider |
Returns
Promise
<string
>
Inherited from
Erc20Bridger
.getChildErc20Address
Source
assetBridger/erc20Bridger.ts:487
getChildGatewayAddress()
getChildGatewayAddress(erc20ParentAddress: string, childProvider: Provider): Promise<string>
Get the address of the child gateway for this token
Parameters
Parameter | Type | Description |
---|---|---|
erc20ParentAddress | string | |
childProvider | Provider |
Returns
Promise
<string
>
Inherited from
Erc20Bridger
.getChildGatewayAddress
Source
assetBridger/erc20Bridger.ts:240
getChildGatewaySetEvents()
getChildGatewaySetEvents(
childProvider: Provider,
filter: object,
customNetworkL2GatewayRouter?: string): Promise<object[]>
Get all the gateway set events on the L2 gateway router
Parameters
Parameter | Type |
---|---|
childProvider | Provider |
filter | object |
filter.fromBlock | BlockTag |
filter.toBlock ? | BlockTag |
customNetworkL2GatewayRouter ? | string |
Returns
Promise
<object
[]>
Source
assetBridger/erc20Bridger.ts:1201