Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateRequiredEth(gasParams RetryableGasParams, teleportationType TeleportationType) (*big.Int, *big.Int)
- func CalculateRetryableGasLimit(client *ethclient.Client, sender common.Address, deposit *big.Int, ...) (uint64, error)
- func CalculateRetryableSubmissionFee(calldata []byte, baseFee *big.Int) (*big.Int, error)
- func CalculateSafeTxHash(safeAddress common.Address, txData SafeTransactionData, chainID *big.Int) (common.Hash, error)
- func CreateBridgeCommand() *cobra.Command
- func CreateBridgeERC20Command() *cobra.Command
- func CreateBridgeERC20L1ToL2Command() *cobra.Command
- func CreateBridgeNativeTokenCommand() *cobra.Command
- func CreateBridgeNativeTokenL1ToL2Command() *cobra.Command
- func CreateBridgeNativeTokenL1ToL3Command() *cobra.Command
- func CreateSafeProposal(client *ethclient.Client, key *keystore.Key, safeAddress common.Address, ...) error
- func ERC20BridgeCall(routerAddress common.Address, keyFile string, password string, l1Rpc string, ...) (*types.Transaction, error)
- func ERC20BridgePropose(routerAddress common.Address, keyFile string, password string, l1Rpc string, ...) error
- func GetERC20BridgeCalldataAndValue(routerAddress common.Address, keyFile string, password string, l1Rpc string, ...) ([]byte, *big.Int, error)
- func GetForwarderAddress(client *ethclient.Client, teleporterAddress common.Address, key *keystore.Key, ...) (common.Address, error)
- func GetL1l2FeeTokenBridgeGasParams(l1Client *ethclient.Client, l2Client *ethclient.Client, l1BaseFee *big.Int, ...) (uint64, *big.Int, error)
- func GetL1l2TokenBridgeGasParams(l1Client *ethclient.Client, l2Client *ethclient.Client, l1BaseFee *big.Int, ...) (uint64, *big.Int, error)
- func GetL2ForwaderGasParams(client *ethclient.Client, key *keystore.Key, teleportParams *TeleportParams, ...) (uint64, *big.Int, error)
- func GetL2L3TokenBridgeGasParams(l2Client *ethclient.Client, l3Client *ethclient.Client, l2BaseFee *big.Int, ...) (uint64, *big.Int, error)
- func GetNativeTokenBridgeCalldata(key *keystore.Key, l1Client *ethclient.Client, l2Client *ethclient.Client, ...) ([]byte, error)
- func NativeTokenBridgeCall(inboxAddress common.Address, keyFile string, password string, l1Rpc string, ...) (*types.Transaction, error)
- func NativeTokenBridgePropose(inboxAddress common.Address, keyFile string, password string, l1Rpc string, ...) error
- func PercentIncrease(value *big.Int, percentage *big.Int) *big.Int
- func RemapL1Address(l1Addr common.Address) common.Address
- func SendTransaction(client *ethclient.Client, key *keystore.Key, password string, calldata []byte, ...) (*types.Transaction, error)
- func Teleport(teleporter common.Address, teleportParams *TeleportParams, keyFile string, ...) (*types.Transaction, error)
- type L2ForwarderParams
- type OperationType
- type RetryableGasParams
- type SafeTransactionData
- type TeleportParams
- type TeleportationType
Constants ¶
View Source
const (
NativeTokenAddress = "0x0000000000000000000000000000000000000000"
)
Variables ¶
View Source
var DEFAULT_GAS_LIMIT_PERCENT_INCREASE = big.NewInt(100)
View Source
var DEFAULT_GAS_PRICE_PERCENT_INCREASE = big.NewInt(500)
View Source
var DEFAULT_SUBMISSION_FEE_PERCENT_INCREASE = big.NewInt(300)
View Source
var L2_FORWARDER_FACTORY_DEFAULT_GAS_LIMIT = uint64(1_000_000)
View Source
var NODE_INTERFACE_ADDRESS = common.HexToAddress("0x00000000000000000000000000000000000000C8")
View Source
var ONE_ETHER = big.NewInt(1_000_000_000_000_000_000)
Functions ¶
func CalculateRequiredEth ¶
func CalculateRequiredEth(gasParams RetryableGasParams, teleportationType TeleportationType) (*big.Int, *big.Int)
func CalculateRetryableGasLimit ¶
func CalculateRetryableGasLimit(client *ethclient.Client, sender common.Address, deposit *big.Int, to common.Address, l2CallValue *big.Int, excessFeeRefundAddress common.Address, callValueRefundAddress common.Address, calldata []byte) (uint64, error)
Source: https://github.com/OffchainLabs/nitro-contracts/blob/main/src/node-interface/NodeInterface.sol#L25
func CalculateRetryableSubmissionFee ¶
Source: https://github.com/OffchainLabs/nitro-contracts/blob/main/src/bridge/Inbox.sol#L323
func CalculateSafeTxHash ¶
func CreateBridgeCommand ¶
func CreateSafeProposal ¶
func ERC20BridgeCall ¶
func ERC20BridgePropose ¶
func GetForwarderAddress ¶
func GetL2ForwaderGasParams ¶
func NativeTokenBridgeCall ¶
func RemapL1Address ¶
Types ¶
type L2ForwarderParams ¶
type OperationType ¶
type OperationType uint8
OperationType represents the type of operation for a Safe transaction
const ( Call OperationType = 0 DelegateCall OperationType = 1 )
func (OperationType) String ¶
func (o OperationType) String() string
String returns the string representation of the OperationType
type RetryableGasParams ¶
type RetryableGasParams struct { L2GasPriceBid *big.Int L3GasPriceBid *big.Int L2ForwarderFactoryGasLimit uint64 L1l2FeeTokenBridgeGasLimit uint64 L1l2TokenBridgeGasLimit uint64 L2l3TokenBridgeGasLimit uint64 L2ForwarderFactoryMaxSubmissionCost *big.Int L1l2FeeTokenBridgeMaxSubmissionCost *big.Int L1l2TokenBridgeMaxSubmissionCost *big.Int L2l3TokenBridgeMaxSubmissionCost *big.Int }
type SafeTransactionData ¶
type SafeTransactionData struct { To string `json:"to"` Value string `json:"value"` Data string `json:"data"` Operation OperationType `json:"operation"` SafeTxGas uint64 `json:"safeTxGas"` BaseGas uint64 `json:"baseGas"` GasPrice string `json:"gasPrice"` GasToken string `json:"gasToken"` RefundReceiver string `json:"refundReceiver"` Nonce *big.Int `json:"nonce"` SafeTxHash string `json:"safeTxHash"` Sender string `json:"sender"` Signature string `json:"signature"` Origin string `json:"origin"` }
SafeTransactionData represents the data for a Safe transaction
type TeleportParams ¶
type TeleportParams struct { L1Token common.Address L3FeeTokenL1Addr common.Address L1l2Router common.Address L2l3RouterOrInbox common.Address To common.Address Amount *big.Int GasParams RetryableGasParams L3CallData []byte }
func SetTeleporterGasParams ¶
func SetTeleporterGasParams(teleportParams *TeleportParams, teleporterAddress common.Address, l1Client *ethclient.Client, l2Client *ethclient.Client, l3Client *ethclient.Client, key *keystore.Key, teleportationType TeleportationType) (*TeleportParams, error)
type TeleportationType ¶
type TeleportationType int
const ( Standard TeleportationType = 0 // Teleporting a token to an ETH fee L3 OnlyCustomFee TeleportationType = 1 // Teleporting a L3's custom fee token to a custom (non-eth) fee L3 NonFeeTokenToCustomFee TeleportationType = 2 // Teleporting a non-fee token to a custom (non-eth) fee L3 )
func GetTeleportationType ¶
Click to show internal directories.
Click to hide internal directories.