-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
…o "uncontrolled to controlled switching"
✅ Deploy Preview for fractal-dev ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this 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:
There was a problem hiding this 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)
There was a problem hiding this comment.
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.
There was a problem hiding this 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?
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:
- Network: Sepolia
- Address: 0x0FAB989675bcbE3adFBAE4eC8E54061CcCE85020
- IPFS Hash for Proposal Templates: https://cloudflare-ipfs.com/ipfs/QmdcwXNLeGo3ibqzYHc2oNHRkLVLcyfhVY7tN9ASgs5enu (see the last two)
@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?
@Da-Colon Can you please give steps to reproduce this? |
This feels like separate issues to the goal of this PR. |
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. |
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 |
I tend to agree... Will approve this PR and open up issues for the other things I'm seeing. |
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? |
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.For testing
Target the WETH9 contract on Sepolia
0xfff9976782d46cc05630d1f6ebab18b2324d6b14