diamond

package
v0.0.0-...-821c63f Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Add     uint8 = 0
	Replace uint8 = 1
	Remove  uint8 = 2
)

Variables

This section is empty.

Functions

func PrintUsage

func PrintUsage(w io.Writer, c *cli.Command)

Types

type ContractMetadata

type ContractMetadata struct {
	ABI      abi.ABI `json:"abi"`
	Bytecode struct {
		Object string `json:"object"`
	} `json:"bytecode"`
	MethodIdentifiers map[string]string `json:"methodIdentifiers"`
	AST               struct {
		Nodes []struct {
			Name string `json:"name"`
		} `json:"nodes"`
	} `json:"ast"`
}

func GetContractMetadataByFile

func GetContractMetadataByFile(path string) (ContractMetadata, error)

type CutMode

type CutMode struct {
	// contains filtered or unexported fields
}

func (*CutMode) Execute

func (c *CutMode) Execute(cmd *cli.Command, flags *pflag.FlagSet, params ...interface{}) error

func (*CutMode) GetCommands

func (c *CutMode) GetCommands() *cli.Command

func (*CutMode) PrintUsage

func (c *CutMode) PrintUsage()

type DeployMode

type DeployMode struct {
	// contains filtered or unexported fields
}

func (*DeployMode) Execute

func (d *DeployMode) Execute(cmd *cli.Command, flags *pflag.FlagSet, modeParams ...interface{}) error

func (*DeployMode) GetCommands

func (d *DeployMode) GetCommands() *cli.Command

func (*DeployMode) PrintUsage

func (d *DeployMode) PrintUsage()

type DeploymentData

type DeploymentData struct {
	Address   common.Address `json:"address"`
	Deployer  common.Address `json:"deployer"`
	Name      string         `json:"name"`
	Selectors [][]string     `json:"selectors"`
	ChainID   big.Int        `json:"chainId"`
	TxHash    string         `json:"tx"`
}

type DiamondBox

type DiamondBox struct {
	Config    config.Config
	Sugar     *zap.SugaredLogger
	Mode      Mode
	Eth       *ethereum.EthereumWrapper
	Contracts map[string]ContractMetadata
}

func NewDiamondBox

func NewDiamondBox(config config.Config,
	sugar *zap.SugaredLogger,
	modeName string,
	rpcId string,
	chainId *big.Int,
) (*DiamondBox, error)

func (*DiamondBox) Close

func (box *DiamondBox) Close()

func (*DiamondBox) Run

func (box *DiamondBox) Run()

type FacetCut

type FacetCut struct {
	FacetAddress      common.Address
	Action            uint8
	FunctionSelectors [][4]byte
}

type LoupeFacet

type LoupeFacet struct {
	FacetAddress      common.Address
	FunctionSelectors [][4]byte
}

type LoupeMode

type LoupeMode struct {
	// contains filtered or unexported fields
}

func (*LoupeMode) Execute

func (l *LoupeMode) Execute(cmd *cli.Command, flags *pflag.FlagSet, params ...interface{}) error

func (*LoupeMode) GetCommands

func (l *LoupeMode) GetCommands() *cli.Command

func (*LoupeMode) PrintUsage

func (l *LoupeMode) PrintUsage()

type MockBoundContract

type MockBoundContract struct {
	mock.Mock
}

MockBoundContract is a mock object that implements the BoundContract interface.

func (*MockBoundContract) Call

func (m *MockBoundContract) Call(opts *bind.CallOpts, results *[]interface{}, method string, params ...interface{}) error

func (*MockBoundContract) Transact

func (m *MockBoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)

type MockEthereumWrapper

type MockEthereumWrapper struct {
	mock.Mock
}

MockEthereumWrapper is a mock object that implements the EthereumWrapper interface.

func (*MockEthereumWrapper) Close

func (m *MockEthereumWrapper) Close()

func (*MockEthereumWrapper) Dial

func (m *MockEthereumWrapper) Dial(rawurl string) (*ethclient.Client, error)

func (*MockEthereumWrapper) GetClient

func (m *MockEthereumWrapper) GetClient() *ethclient.Client

func (*MockEthereumWrapper) HexToECDSA

func (m *MockEthereumWrapper) HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)

func (*MockEthereumWrapper) NetworkID

func (m *MockEthereumWrapper) NetworkID(ctx context.Context) (*big.Int, error)

func (*MockEthereumWrapper) NewKeyedTransactorWithChainID

func (m *MockEthereumWrapper) NewKeyedTransactorWithChainID(key *ecdsa.PrivateKey, chainID *big.Int) (*bind.TransactOpts, error)

func (*MockEthereumWrapper) SetClient

func (m *MockEthereumWrapper) SetClient(client *ethclient.Client)

func (*MockEthereumWrapper) SuggestGasPrice

func (m *MockEthereumWrapper) SuggestGasPrice(ctx context.Context) (*big.Int, error)

type Mode

type Mode interface {
	Execute(cmd *cli.Command, flags *pflag.FlagSet, params ...interface{}) error
	GetCommands() *cli.Command
	PrintUsage()
}

func NewCutMode

func NewCutMode(box *DiamondBox) Mode

func NewDeployMode

func NewDeployMode(box *DiamondBox) Mode

func NewLoupeMode

func NewLoupeMode(box *DiamondBox) Mode

type ModeFactory

type ModeFactory struct {
	// contains filtered or unexported fields
}

func NewModeFactory

func NewModeFactory(box *DiamondBox) *ModeFactory

func (*ModeFactory) CreateMode

func (f *ModeFactory) CreateMode(name string) Mode

Jump to

Keyboard shortcuts

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