Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic decoder #1

Open
huahuayu opened this issue Jan 5, 2021 · 0 comments
Open

generic decoder #1

huahuayu opened this issue Jan 5, 2021 · 0 comments

Comments

@huahuayu
Copy link
Owner

huahuayu commented Jan 5, 2021

In order to unpack input data, I have to define the input fields.

But if I want to make a generic decoder apply to any contract, for any function input, I can't define all of the input structs in the program.

So if there's a way I can have FunctionInputs struct dynamically, make the fields inside the struct auto reference to the abi?

	// create strut that matches input names to unpack
	type FunctionInputs struct {
		AmountOutMin *big.Int
		Path []common.Address
		To common.Address
		Deadline *big.Int
	}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant