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

WIP: implement EIP-5806 (type 4) delegate transaction #4638

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Amxx
Copy link

@Amxx Amxx commented Mar 7, 2024

This is a work-in-progress implementation of EIP-5806 (type 4) delegate transactions.

For references:

TODO:

  • Tests
  • Documentation
  • Changelog

@ricmoo
Copy link
Member

ricmoo commented Mar 7, 2024

This is similar to eip-2803? I’d love to see something like this championed. :)

@Amxx
Copy link
Author

Amxx commented Mar 8, 2024

EIP-5806 is being actively developed. There are talks of a possible testnet, and inclusion in Prague.

We are still far from it, and it may not happen at all, but this PR is part of the "feasibility evaluation"

src.ts/contract/contract.ts Outdated Show resolved Hide resolved
src.ts/contract/contract.ts Outdated Show resolved Hide resolved
const fragment = getFragment(...args);
// If an overrides was passed in, copy it and normalize the values
if (fragment.inputs.length + 1 === args.length) {
Object.assign(args[args.length - 1], { type: 4 });
Copy link
Author

@Amxx Amxx Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current implementation "leaks" types: 4 into the args[args.length - 1] ... that may be reused elsewhere.

Suggested change
Object.assign(args[args.length - 1], { type: 4 });
args[args.length - 1] = Object.assign({}, args[args.length - 1], { type: 4 });

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we need to copy the args array first ?

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

Successfully merging this pull request may close these issues.

None yet

2 participants