immutables

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 added in v1.3.0

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 added in v1.3.0

type PredeploysImmutableConfig struct {
	L2ToL1MessagePasser struct{}
	/* [Kroma: START]
	DeployerWhitelist      struct{}
	[Kroma: END] */
	WETH9                  struct{}
	L2CrossDomainMessenger struct {
		// [Kroma: START]
		OtherMessenger common.Address
	}
	L2StandardBridge struct {
		// [Kroma: START]
		OtherBridge common.Address
	}
	/* [Kroma: START]
	SequencerFeeVault struct {
		Recipient           common.Address
		MinWithdrawalAmount *big.Int
		WithdrawalNetwork   uint8
	}
	[Kroma: END] */
	KromaMintableERC20Factory struct {
		Bridge common.Address
	}
	L1BlockNumber   struct{}
	GasPriceOracle  struct{}
	L1Block         struct{}
	GovernanceToken struct{}
	/* [Kroma: START]
	LegacyMessagePasser struct{}
	[Kroma: END] */
	L2ERC721Bridge struct {
		OtherBridge common.Address
		Messenger   common.Address
	}
	KromaMintableERC721Factory struct {
		Bridge        common.Address
		RemoteChainId *big.Int
	}
	ProxyAdmin struct{}
	// [Kroma: START]
	ProtocolVault struct {
		Recipient common.Address
	}
	L1FeeVault struct {
		Recipient common.Address
	}
	// [Kroma: END]
	/* [Kroma: START]
	SchemaRegistry struct{}
	EAS            struct {
		Name string
	}
	[Kroma: END] */
	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{}

	// [Kroma: START]
	ValidatorRewardVault struct {
		ValidatorPoolAddress common.Address
		RewardDivider        *big.Int
	}
}

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 added in v1.3.0

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 added in v1.3.0

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.

Jump to

Keyboard shortcuts

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