immutables

package
v0.0.0-...-011bec4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertRouterParameters

func ConvertRouterParameters(localParams RouterParameters) bindings.RouterParameters

ConvertRouterParameters converts local RouterParameters to bindings RouterParameters.

func PrepareNonfungiblePositionManager

func PrepareNonfungiblePositionManager(deployment deployer.Constructor) (common.Address, common.Address, common.Address, error)

Types

type DeploymentResults

type DeploymentResults map[string]hexutil.Bytes

DeploymentResults represents the output of deploying each of the contracts so that the immutables can be set properly in the bytecode.

func Deploy

Deploy will deploy L2 predeploys that include immutables. This is to prevent the need for parsing the solc output to find the correct immutable offsets and splicing in the values. Skip any predeploys that do not have immutables as their bytecode will be directly inserted into the state. This does not currently support recursive structs.

type PredeploysImmutableConfig

type PredeploysImmutableConfig struct {
	LegacyERC20NativeToken struct {
		RemoteToken common.Address
		Bridge      common.Address
		Decimals    uint8
	}
	L2ToL1MessagePasser    struct{}
	DeployerWhitelist      struct{}
	WNativeToken           struct{}
	L2CrossDomainMessenger struct{}
	L2StandardBridge       struct{}
	SequencerFeeVault      struct {
		Recipient           common.Address
		MinWithdrawalAmount *big.Int
		WithdrawalNetwork   uint8
	}
	OptimismMintableERC20Factory  struct{}
	L1BlockNumber                 struct{}
	GasPriceOracle                struct{}
	L1Block                       struct{}
	GovernanceToken               struct{}
	LegacyMessagePasser           struct{}
	L2ERC721Bridge                struct{}
	OptimismMintableERC721Factory struct {
		Bridge        common.Address
		RemoteChainId *big.Int
	}
	ProxyAdmin   struct{}
	BaseFeeVault struct {
		Recipient           common.Address
		MinWithdrawalAmount *big.Int
		WithdrawalNetwork   uint8
	}
	L1FeeVault struct {
		Recipient           common.Address
		MinWithdrawalAmount *big.Int
		WithdrawalNetwork   uint8
	}
	SchemaRegistry struct{}
	EAS            struct {
		Name string
	}
	ETH struct {
		RemoteToken common.Address
		Bridge      common.Address
		Decimals    uint8
	}
	L2UsdcBridge     struct{}
	SignatureChecker struct{}
	MasterMinter     struct {
		MinterManager common.Address
	}
	FiatTokenV2_2 struct{}
	QuoterV2      struct {
		Factory common.Address
		WETH9   common.Address
	}
	SwapRouter02 struct {
		FactoryV2       common.Address
		FactoryV3       common.Address
		PositionManager common.Address
		WETH9           common.Address
	}
	UniswapV3Factory           struct{}
	NFTDescriptor              struct{}
	NonfungiblePositionManager struct {
		Factory          common.Address
		WETH9            common.Address
		TokenDescriptor_ common.Address
	}
	NonfungibleTokenPositionDescriptor struct {
		WETH9                    common.Address
		NativeCurrencyLabelBytes [32]byte
	}
	TickLens                  struct{}
	UniswapInterfaceMulticall struct{}
	UniversalRouter           struct {
		Permit2                     common.Address
		Weth9                       common.Address
		SeaportV15                  common.Address
		SeaportV14                  common.Address
		OpenseaConduit              common.Address
		NftxZap                     common.Address
		X2y2                        common.Address
		Foundation                  common.Address
		Sudoswap                    common.Address
		ElementMarket               common.Address
		Nft20Zap                    common.Address
		Cryptopunks                 common.Address
		LooksRareV2                 common.Address
		RouterRewardsDistributor    common.Address
		LooksRareRewardsDistributor common.Address
		LooksRareToken              common.Address
		V2Factory                   common.Address
		V3Factory                   common.Address
		PairInitCodeHash            [32]byte
		PoolInitCodeHash            [32]byte
	}
	UnsupportedProtocol          struct{}
	Create2Deployer              struct{}
	MultiCall3                   struct{}
	Safe_v130                    struct{}
	SafeL2_v130                  struct{}
	MultiSendCallOnly_v130       struct{}
	SafeSingletonFactory         struct{}
	DeterministicDeploymentProxy struct{}
	MultiSend_v130               struct{}
	Permit2                      struct{}
	SenderCreator                struct{}
	EntryPoint                   struct{}
}

PredeploysImmutableConfig represents the set of L2 predeploys. It includes all L2 predeploys - not just ones with immutable values. This is to be very explicit about the configuration of the predeploys. It is important that the inner struct fields are in the same order as the constructor arguments in the solidity code.

func (*PredeploysImmutableConfig) Check

func (c *PredeploysImmutableConfig) Check() error

Check will ensure that the required fields are set on the config. An error returned by `GetImmutableReferences` means that the solc compiler output for the contract has no immutables in it.

func (*PredeploysImmutableConfig) ForEach

func (c *PredeploysImmutableConfig) ForEach(cb func(string, any) error) error

ForEach will iterate over each of the fields in the config and call the callback with the value of the field as well as the field's name.

type RouterParameters

type RouterParameters struct {
	Permit2                     common.Address
	Weth9                       common.Address
	SeaportV15                  common.Address
	SeaportV14                  common.Address
	OpenseaConduit              common.Address
	NftxZap                     common.Address
	X2y2                        common.Address
	Foundation                  common.Address
	Sudoswap                    common.Address
	ElementMarket               common.Address
	Nft20Zap                    common.Address
	Cryptopunks                 common.Address
	LooksRareV2                 common.Address
	RouterRewardsDistributor    common.Address
	LooksRareRewardsDistributor common.Address
	LooksRareToken              common.Address
	V2Factory                   common.Address
	V3Factory                   common.Address
	PairInitCodeHash            [32]byte
	PoolInitCodeHash            [32]byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL