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

Variable eth value in proposal template #1510

Merged
merged 9 commits into from
Apr 4, 2024

Conversation

mudrila
Copy link
Contributor

@mudrila mudrila commented Apr 1, 2024

Closes #1207

Logic of these changes is following:
We're displaying ETH value input in ProposalTemplateModal if there's no value at all, but also if "Show All" switcher turned on. This logic might be debatable as we're disabling parameters inputs if value is set from the template.

Знімок екрана 2024-04-01 о 19 08 01 Знімок екрана 2024-04-01 о 19 08 15

For testing

Target the WETH9 contract on Sepolia
0xfff9976782d46cc05630d1f6ebab18b2324d6b14

@mudrila mudrila added the enhancement New feature or request label Apr 1, 2024
@mudrila mudrila self-assigned this Apr 1, 2024
Copy link

netlify bot commented Apr 1, 2024

Deploy Preview for fractal-dev ready!

Name Link
🔨 Latest commit 95e8924
🔍 Latest deploy log https://app.netlify.com/sites/fractal-dev/deploys/660b11329b77c90008663565
😎 Deploy Preview https://deploy-preview-1510.app.dev.fractalframework.xyz
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

Was able to create the templates with a "variable ETH value", but having trouble actually using them. Would have been hard to explain, so I created two videos showing two different bugs:

https://youtu.be/6JZq5-tXuZo

https://youtu.be/eAdGNxBGyZQ

@mudrila mudrila requested a review from adamgall April 1, 2024 19:56
Copy link
Contributor

@Da-Colon Da-Colon left a comment

Choose a reason for hiding this comment

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

I was able to create the template and when I went to use it got a estimate gas error. Is this because there is a ethValue added or should this pass even if I add ETH Value

(added 0.0001)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm very nervous about changes to this file. This file is used pretty heavy in all the other forms in the app. Why are these changes needed? I ask this because this Component is really sensitive to changes as it will affect every other place it is used.

That being said I have done some live testing 'creating a DAO' and don't see any problems with the BigNumber Inputs.

Copy link
Member

@adamgall adamgall left a comment

Choose a reason for hiding this comment

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

Comments

The Good

Am able to submit a variable amount of ETH along with a transaction created via Proposal Template

Happy path seemed to work well! I created a proposal template that called the deposit function on the WETH9 contract. I was able to use this template and manually input an amount of ETH (0.0001), which was then successfully wrapped into WETH.

The Not So Good

"Submit and create proposal" button

"Submit and Create Proposal" button IMO should only be clickable if all inputs are populated. In the screenshot below, clicking the button results in an toast error.

What's the effort involved to do this?

Screenshot 2024-04-03 at 8 55 42 AM

Proposal (from template) that simply "sends ETH" fails

Creating a proposal template with no function specified on the target contract works, but trying to create a proposal with that template fails (very likely because there is no function name specified in the template JSON).

See these two templates. Both target the WETH9 contract. The first one wraps ETH by calling the deposit function, the intention of the second one is to wrap ETH by sending ETH directly to the contract. I was able to create both of these through Fractal's UI.

[
  {
    "title": "WETH9 Deposit thru function",
    "description": "Deposit ETH into the WETH9 contract through calling the `deposit` function.",
    "transactions": [
      {
        "targetAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
        "ethValue": {
          "value": ""
        },
        "functionName": "deposit",
        "parameters": []
      }
    ]
  },
  {
    "title": "Wrap ETH to WETH w/o `deposit` function",
    "description": "Just send ETH directly to the contract and trigger the fallback function.",
    "transactions": [
      {
        "targetAddress": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
        "ethValue": {
          "value": ""
        },
        "functionName": "",
        "parameters": []
      }
    ]
  }
]

Here is the error in Chrome's console when clicking "Submit and create proposal" while trying to use the second template:

console.js:213 Error: invalid identifier "" (argument="value", value="", code=INVALID_ARGUMENT, version=abi/5.7.0)
    at _Logger.makeError (chunk-ANHLTHON.js?v=2b819a64:207:23)
    at _Logger.throwError (chunk-ANHLTHON.js?v=2b819a64:216:20)
    at _Logger.throwArgumentError (chunk-ANHLTHON.js?v=2b819a64:219:21)
    at verifyIdentifier (chunk-ANHLTHON.js?v=2b819a64:8003:14)
    at _FunctionFragment.fromObject (chunk-ANHLTHON.js?v=2b819a64:8431:17)
    at _FunctionFragment.fromString (chunk-ANHLTHON.js?v=2b819a64:8467:34)
    at _Fragment.fromString (chunk-ANHLTHON.js?v=2b819a64:8214:35)
    at _Fragment.from (chunk-ANHLTHON.js?v=2b819a64:8184:28)
    at chunk-ANHLTHON.js?v=2b819a64:8690:27
    at Array.map (<anonymous>) Array(0)

For reference, here are the relevant details from the DAO being used to test this:


@mudrila @Da-Colon @tomstuart123 do you think either of these two issues I'm describing fall under the umbrella of this PR, or should we simply open new issues for them and tackle them later?

@adamgall
Copy link
Member

adamgall commented Apr 3, 2024

I was able to create the template and when I went to use it got a estimate gas error. Is this because there is a ethValue added or should this pass even if I add ETH Value

(added 0.0001)

@Da-Colon Can you please give steps to reproduce this?

@Da-Colon
Copy link
Contributor

Da-Colon commented Apr 3, 2024

@mudrila @Da-Colon @tomstuart123 do you think either of these two issues I'm describing fall under the umbrella of this PR, or should we simply open new issues for them and tackle them later?

This feels like separate issues to the goal of this PR.

@Da-Colon
Copy link
Contributor

Da-Colon commented Apr 3, 2024

I was able to create the template and when I went to use it got a estimate gas error. Is this because there is a ethValue added or should this pass even if I add ETH Value
(added 0.0001)

You answered my question yesterday that I can't do that. where you told us that testing with the WETH contract was best for this

@adamgall
Copy link
Member

adamgall commented Apr 3, 2024

I was able to create the template and when I went to use it got a estimate gas error. Is this because there is a ethValue added or should this pass even if I add ETH Value

(added 0.0001)

@Da-Colon Can you please give steps to reproduce this?

You answered my question yesterday that I can't do that. where you told us that testing with the WETH contract was best for this

@Da-Colon are you saying that you can't recreate the original issue you called out? Or are you saying you can recreate the issue, but we said it's known and expected? Sorry, I'm confused what this reply means.

@Da-Colon
Copy link
Contributor

Da-Colon commented Apr 3, 2024

@Da-Colon are you saying that you can't recreate the original issue you called out? Or are you saying you can recreate the issue, but we said it's known and expected? Sorry, I'm confused what this reply means.

Saying The answer to my question was that I was incorrectly testing and that was going to fail because the function I'm calling isn't payable.

@adamgall
Copy link
Member

adamgall commented Apr 3, 2024

@Da-Colon are you saying that you can't recreate the original issue you called out? Or are you saying you can recreate the issue, but we said it's known and expected? Sorry, I'm confused what this reply means.

Saying The answer to my question was that I was incorrectly testing and that was going to fail because the function I'm calling isn't payable.

Ohhhh that's right. Thank you

@adamgall
Copy link
Member

adamgall commented Apr 3, 2024

@mudrila @Da-Colon @tomstuart123 do you think either of these two issues I'm describing fall under the umbrella of this PR, or should we simply open new issues for them and tackle them later?

This feels like separate issues to the goal of this PR.

I tend to agree...

Will approve this PR and open up issues for the other things I'm seeing.

@tomstuart123
Copy link

duplicating this from here - https://decentdao.slack.com/archives/C06QZTUTKRC/p1712169164168019

hey @trainface / @Kirill - I've struggled to find time to test PR 1510 today and want to spend any loose time tomorrow AM drafting the rest of the comms to Shutter out so we can push to Prod asap.

I'm not sure I should block this 1510PR though as - tbh @trainface - I would only be testing the same case as you talked me through with WETH9... and it looks like via the comments you've already proven this.

I agree, though, we should get the templates 'lack of function' fixed as a part of @Kirill’s next effort. In this case though, recommend @trainface and @Epicbadtiming act as reviewers.

Have duplicated this comment in github and can you confirm this is fine?

@mudrila mudrila merged commit 99cf8f3 into develop Apr 4, 2024
7 checks passed
@mudrila mudrila deleted the enhancement/#1207-variable-eth-value branch April 4, 2024 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal Templates Improvements: Variable Eth Value
4 participants