ditto icon indicating copy to clipboard operation
ditto copied to clipboard

Hardcoded gas limit can break on future gas cost change

Open 0xbok opened this issue 3 years ago • 4 comments

https://github.com/ditto-lab/ditto/blob/2dd8b7f20a0f223160466a8d2953551a796c5306/src/DittoMachine.sol#L592

0xbok avatar May 27 '22 01:05 0xbok

I'm wondering if we should increase the gas stipend? or if there is some way we can allow a user to increase some minimum amount.

calvbore avatar Oct 10 '22 23:10 calvbore

how about taking it as a function argument? any new attack vectors here?

0xbok avatar Oct 17 '22 06:10 0xbok

yeah, if there's a protocol built with the token ejector and and 0 is passed as the arg then none of their business logic will be executed, so there needs to be a minimum guaranteed amount of gas fro execution.

calvbore avatar Oct 19 '22 00:10 calvbore

Allowing user to increase minimum gas amount through an argument will not work in cases where the nft seller is not benefitting from ejector code execution. They'll always prefer the minimum gas amount.

Thinking out loud: what if we let the clone owner send eth to DittoMachine to be used as gas when ejector is called. So there is a mapping(cloneId => value) and anyone can bump up the value. I can't decide if this is a good or a bad idea.

0xbok avatar Oct 24 '22 08:10 0xbok