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

v5 ContractFactory.deploy() ignores transaction overrides #796

Closed
pyggie opened this issue Apr 23, 2020 · 5 comments
Closed

v5 ContractFactory.deploy() ignores transaction overrides #796

pyggie opened this issue Apr 23, 2020 · 5 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@pyggie
Copy link

pyggie commented Apr 23, 2020

In ethers-v5 a deployment transaction such as factory.deploy({ gasPrice, gasLimit }) ignores the transaction overrides. I think the problem is in resolveAddresses() called from here:

deploy(...args: Array<any>): Promise<Contract> {
return resolveAddresses(this.signer, args, this.interface.deploy.inputs).then((args) => {

function resolveAddresses(signerOrProvider: Signer | Provider, value: any, paramType: ParamType | Array<ParamType>): Promise<any> {
if (Array.isArray(paramType)) {
return Promise.all(paramType.map((paramType, index) => {
return resolveAddresses(
signerOrProvider,
((Array.isArray(value)) ? value[index]: value[paramType.name]),
paramType
);

which maps on paramType = this.interface.deploy.inputs = [] and so returns nothing.

@ricmoo ricmoo added investigate Under investigation and may be a bug. on-deck This Enhancement or Bug is currently being worked on. labels Apr 23, 2020
@ricmoo
Copy link
Member

ricmoo commented Apr 23, 2020

I’ll look into this shortly. Thanks!

@ricmoo ricmoo added bug Verified to be an issue. and removed investigate Under investigation and may be a bug. labels Apr 24, 2020
@ricmoo
Copy link
Member

ricmoo commented Apr 24, 2020

I've reproduced it and am re-factoring a bit of that code now which should address this issue and clean things up a bit.

@ricmoo
Copy link
Member

ricmoo commented Apr 24, 2020

This should be fixed in 5.0.0-beta.183. Try it out and let me know. :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Apr 24, 2020
@pyggie
Copy link
Author

pyggie commented Apr 27, 2020

It works!

@ricmoo
Copy link
Member

ricmoo commented May 7, 2020

Awesome! :)

@ricmoo ricmoo closed this as completed May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants