From ec54029652f944d15f94a44f170e3030bd4608ac Mon Sep 17 00:00:00 2001 From: Cesar Brazon Date: Sun, 26 Jul 2020 11:46:03 +0200 Subject: [PATCH 1/5] daocreator 1.0 stack redirects to base url (#1994) --- package-lock.json | 20 ++++++++++---------- package.json | 2 +- src/components/DaoCreator/index.tsx | 1 + 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5c5b5e284..672a2011b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2289,9 +2289,9 @@ "integrity": "sha512-b0JQb10Lie07iW2/9uKCQSrXif262d6zfYBstCLLJUk0JVA+7o/yLDg5p2+GkjgJbmodjHozIXs4Bi34RRhL8Q==" }, "@dorgtech/daocreator-lib": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@dorgtech/daocreator-lib/-/daocreator-lib-1.0.3.tgz", - "integrity": "sha512-oQ0oa/3MAjsOSCnme+W5EBvYNA3OieJJeopgEPDduO3ikylP2ciwjGKOapSMHbC2Iby+1M3deR5MakLR+WmprQ==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@dorgtech/daocreator-lib/-/daocreator-lib-1.0.2.tgz", + "integrity": "sha512-SkZHUSdlhP9ZYnX16yDiaMX4r5uCKUaDOKeB9jzw5I49g3ir02OejeXmyUpc77WjddVCZ9j09TlG+FKxNxmT/A==", "requires": { "bn.js": "^5.0.0", "csv": "^5.1.2", @@ -2309,13 +2309,13 @@ } }, "@dorgtech/daocreator-ui": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@dorgtech/daocreator-ui/-/daocreator-ui-1.0.11.tgz", - "integrity": "sha512-vVtReJkCBuwyhJwqaPSm+tmuwHDnysdebgaZJAwx0A5sPis+708CAOVmN3n6ynQsWL5hcKoN2tz6IfN02iCnig==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@dorgtech/daocreator-ui/-/daocreator-ui-1.0.13.tgz", + "integrity": "sha512-LGXQHlUiamZlgB2hqVxuDK+3Px/2tlwCzcjZXj+7VNLZhijMfN7raVu7ArBtrmE81w/b9vLVoGBBPIO5F5BpDw==", "requires": { "@date-io/core": "^1.3.6", "@date-io/date-fns": "^1.3.11", - "@dorgtech/daocreator-lib": "1.0.3", + "@dorgtech/daocreator-lib": "1.0.2", "@fortawesome/fontawesome-free": "^5.11.2", "@material-ui/core": "^4.7.2", "@material-ui/pickers": "3.2.2", @@ -2833,9 +2833,9 @@ "integrity": "sha512-cY+QfDTbZ7XVxzx7jxbC98Oxr/zc7R2QpTLqTxqlfyXDrAJjzi/xUIqAUsygELB62JIrbsWxtSRhayKFkGI7MA==" }, "@fortawesome/fontawesome-free": { - "version": "5.13.1", - "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.13.1.tgz", - "integrity": "sha512-D819f34FLHeBN/4xvw0HR0u7U2G7RqjPSggXqf7LktsxWQ48VAfGwvMrhcVuaZV2fF069c/619RdgCCms0DHhw==" + "version": "5.14.0", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-5.14.0.tgz", + "integrity": "sha512-OfdMsF+ZQgdKHP9jUbmDcRrP0eX90XXrsXIdyjLbkmSBzmMXPABB8eobUJtivaupucYaByz6WNe1PI1JuYm3qA==" }, "@fortawesome/fontawesome-svg-core": { "version": "1.2.29", diff --git a/package.json b/package.json index 68491fb9e..cd6d0d0b3 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "3box": "1.17.1", "@burner-wallet/burner-connect-provider": "^0.1.1", "@daostack/arc.js": "^0.2.70", - "@dorgtech/daocreator-ui": "^1.0.10", + "@dorgtech/daocreator-ui": "^1.0.13", "@fortawesome/fontawesome-svg-core": "^1.2.10", "@fortawesome/free-brands-svg-icons": "^5.6.1", "@fortawesome/react-fontawesome": "^0.1.3", diff --git a/src/components/DaoCreator/index.tsx b/src/components/DaoCreator/index.tsx index 3120cb9d6..d0095a1b1 100644 --- a/src/components/DaoCreator/index.tsx +++ b/src/components/DaoCreator/index.tsx @@ -48,6 +48,7 @@ class DaoCreator extends React.Component { return await getWeb3Provider(); }} noDAOstackLogo + redirectURL={process.env.BASE_URL} /> ); From cde276bf44b5511a179e1ca732b4aa06724f3e7a Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Mon, 3 Aug 2020 09:33:39 -0400 Subject: [PATCH 2/5] expand genericscheme docs (#2036) --- src/genericSchemeRegistry/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/genericSchemeRegistry/README.md b/src/genericSchemeRegistry/README.md index c34ff68ac..dc666e13b 100644 --- a/src/genericSchemeRegistry/README.md +++ b/src/genericSchemeRegistry/README.md @@ -8,15 +8,15 @@ This is a scheme in which proposals can be made to execute any transaction on-ch Alchemy contains a system with which is is relatively easy to build an interface for interacting with any GenericScheme, and to generate forms such as the [dutchX controller form](https://alchemy.daostack.io/dao/0x519b70055af55a007110b4ff99b0ea33071c720a/scheme/0xeca5415360191a29f12e1da442b9b050adf22c81b08230f1dafba908767e604f/proposals/create/) -# Registering the scheme in a DAOstack - -[...] +# Registering the scheme in DAOstack A GenericScheme instance is always registered for a single contract - i.e. it can call any function on the given `contractToCall` address. +The [Hackers-Toolkit](https://github.com/daostack/DAOstack-Hackers-Kit) contains [full instructions](https://github.com/daostack/DAOstack-Hackers-Kit/blob/master/docs/gettingStarted/setupGenericScheme.md) on how to instantiate your GenericScheme scheme, how to register it with a DAO and how to index it in the DAOstack subgraph, and optionally how to add a custom Alchemy user interface for your scheme. + # Creating a custom interface for the Generic Scheme in Alchemy -Alchemy contains a system for generating forms for creating proposals in a Generic Scheme. +Alchemy contains a system for automatically generating forms for creating proposals in a Generic Scheme. You can add your own scheme by adding your Generic Scheme to the registry. (At the moment, the registry is a [directory in Alchemy](https://github.com/daostack/alchemy/tree/dev/src/genericSchemeRegistry/schemes), but in the future this may be moved to another location). From a85a2626ec87f2807316409722bd4cd63882fe12 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Mon, 3 Aug 2020 09:34:01 -0400 Subject: [PATCH 3/5] expose app version - 1.0 (#2037) * add tooltip to app icon * add instructions to the bug template * revise bug report * further bug report edits * get version at build time * remove unneeded changes --- .github/ISSUE_TEMPLATE/bug_report.md | 8 +++++++- src/layouts/Header.tsx | 21 +++++++++++++-------- typings/build.d.ts | 4 ++-- webpack.base.config.js | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index aa4d9a157..c58b9bdb0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. +A clear and concise description of the bug. **To Reproduce** Steps to reproduce the behavior: @@ -20,6 +20,12 @@ Steps to reproduce the behavior: **Expected behavior** A clear and concise description of what you expected to happen. +**Alchemy Version Number** +You may obtain the Alchemy version number as follows: + +1. Hover your mouse over the Alchemy logo image in the upper left corner of any page in Alchemy. Below the icon a tooltip will appear which will contain the Alchemy version number. +2. In the tooltip, select the version number, copy it to your clipboard and paste it into this bug report. + **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/src/layouts/Header.tsx b/src/layouts/Header.tsx index 6390818c4..2e8712151 100644 --- a/src/layouts/Header.tsx +++ b/src/layouts/Header.tsx @@ -24,6 +24,7 @@ import { Address, IDAOState } from "@daostack/arc.js"; import { ETHDENVER_OPTIMIZATION } from "../settings"; import * as css from "./App.scss"; import ProviderConfigButton from "layouts/ProviderConfigButton"; +import Tooltip from "rc-tooltip"; interface IExternalProps extends RouteComponentProps { } @@ -100,12 +101,16 @@ class Header extends React.Component { private toggleDiv: RefObject; public componentDidMount() { - this.toggleDiv.current.onmouseenter = (_ev: MouseEvent) => { - this.props.enableTrainingTooltipsShowAll(); - }; - this.toggleDiv.current.onmouseleave = (_ev: MouseEvent) => { - this.props.disableTrainingTooltipsShowAll(); - }; + if (this.toggleDiv.current) { + this.toggleDiv.current.onmouseenter = (_ev: MouseEvent) => { + this.props.enableTrainingTooltipsShowAll(); + }; + this.toggleDiv.current.onmouseleave = (_ev: MouseEvent) => { + this.props.disableTrainingTooltipsShowAll(); + }; + } + + this.setState({ alchemyVersion: PACKAGE_VERSION ?? "Not found" }); } public handleClickLogin = async (_event: any): Promise => { @@ -179,13 +184,13 @@ class Header extends React.Component { : } - +
-
+
> } diff --git a/typings/build.d.ts b/typings/build.d.ts index 404e7f4ef..87109b978 100644 --- a/typings/build.d.ts +++ b/typings/build.d.ts @@ -1,2 +1,2 @@ -declare const VERSION: string; -declare const TOKENS: { [symbol: string]: string }; \ No newline at end of file +declare const PACKAGE_VERSION: string; +declare const TOKENS: { [symbol: string]: string }; diff --git a/webpack.base.config.js b/webpack.base.config.js index 39dd2d485..d2f63780b 100644 --- a/webpack.base.config.js +++ b/webpack.base.config.js @@ -119,7 +119,7 @@ module.exports = { template: "src/index.html" }), new webpack.DefinePlugin({ - VERSION: JSON.stringify(require("./package.json").version) + PACKAGE_VERSION: JSON.stringify(require("./package.json").version) }), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new MiniCssExtractPlugin() From 40d3bb0f60232b7db6e6860f1dce1d213af03508 Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Tue, 4 Aug 2020 03:13:13 -0400 Subject: [PATCH 4/5] show raw calldata (1.0) (#2026) * KnownGeneric * change label text * other three --- .../ProposalSummary/ProposalSummaryCO2ken.tsx | 18 ++++++++++++++- .../ProposalSummary/ProposalSummaryDutchX.tsx | 18 ++++++++++++++- .../ProposalSummaryKnownGenericScheme.tsx | 7 +++++- .../ProposalSummaryStandardBounties.tsx | 23 ++++++++++++++++++- 4 files changed, 62 insertions(+), 4 deletions(-) diff --git a/src/components/Proposal/ProposalSummary/ProposalSummaryCO2ken.tsx b/src/components/Proposal/ProposalSummary/ProposalSummaryCO2ken.tsx index 0588ea1b8..0a4d64174 100644 --- a/src/components/Proposal/ProposalSummary/ProposalSummaryCO2ken.tsx +++ b/src/components/Proposal/ProposalSummary/ProposalSummaryCO2ken.tsx @@ -3,9 +3,10 @@ import { IProposalState } from "@daostack/arc.js"; import BN = require("bn.js"); import classNames from "classnames"; import { GenericSchemeInfo } from "genericSchemeRegistry"; -import { formatTokens } from "lib/util"; +import { formatTokens, truncateWithEllipses } from "lib/util"; import * as React from "react"; import * as css from "./ProposalSummary.scss"; +import CopyToClipboard from "components/Shared/CopyToClipboard"; interface IProps { genericSchemeInfo: GenericSchemeInfo; @@ -16,6 +17,15 @@ interface IProps { export default class ProposalSummaryCO2ken extends React.Component { + private rawCallData(proposal: IProposalState) { + return <> +

Raw call data:

+
+        { truncateWithEllipses(proposal.genericScheme.callData, 66) }
+      
+ ; + } + public render(): RenderOutput { const { proposal, detailView, genericSchemeInfo, transactionModal } = this.props; let decodedCallData: any; @@ -64,6 +74,7 @@ export default class ProposalSummaryCO2ken extends React.Component {ipfsHashValue}
+ {this.rawCallData(proposal)} : "" } @@ -84,6 +95,7 @@ export default class ProposalSummaryCO2ken extends React.Component
{-1}
It allows the the CO2ken contract to move DAI held by the DAO. This way, the DAO can offset its emissions by calling:
offsetCarbon()
+ {this.rawCallData(proposal)} : "" } @@ -100,6 +112,7 @@ export default class ProposalSummaryCO2ken extends React.Component Executing this proposal will call the function
{action.id}()
It transfers all the DAI stored in the CO2ken contract to the DAO. + {this.rawCallData(proposal)} : "" } @@ -122,6 +135,7 @@ export default class ProposalSummaryCO2ken extends React.Component
                   {formatTokens(new BN(value), field.unit, field.decimals)}
                 
+ {this.rawCallData(proposal)} : "" } @@ -146,6 +160,7 @@ export default class ProposalSummaryCO2ken extends React.Component { field.label }: {formatTokens(new BN(value), field.unit, field.decimals)} The value describes the amount of carbon tons the DAO wants to offset. + {this.rawCallData(proposal)} : "" } @@ -165,6 +180,7 @@ export default class ProposalSummaryCO2ken extends React.Component
{action.id}()
with the new owner‘s address being
{decodedCallData.values[0]}
+ {this.rawCallData(proposal)} : "" } diff --git a/src/components/Proposal/ProposalSummary/ProposalSummaryDutchX.tsx b/src/components/Proposal/ProposalSummary/ProposalSummaryDutchX.tsx index 5321ee7d4..1cbb0e56f 100644 --- a/src/components/Proposal/ProposalSummary/ProposalSummaryDutchX.tsx +++ b/src/components/Proposal/ProposalSummary/ProposalSummaryDutchX.tsx @@ -3,9 +3,10 @@ import { IProposalState } from "@daostack/arc.js"; import BN = require("bn.js"); import classNames from "classnames"; import { GenericSchemeInfo } from "genericSchemeRegistry"; -import { formatTokens, linkToEtherScan } from "lib/util"; +import { formatTokens, linkToEtherScan, truncateWithEllipses } from "lib/util"; import * as React from "react"; import * as css from "./ProposalSummary.scss"; +import CopyToClipboard from "components/Shared/CopyToClipboard"; interface IProps { genericSchemeInfo: GenericSchemeInfo; @@ -16,6 +17,16 @@ interface IProps { export default class ProposalSummaryDutchX extends React.Component { + private rawCallData(proposal: IProposalState) { + return <> +

Raw call data:

+
+        {truncateWithEllipses(proposal.genericScheme.callData, 66)}
+      
+ ; + } + + public render(): RenderOutput { const { proposal, detailView, genericSchemeInfo, transactionModal } = this.props; let decodedCallData: any; @@ -57,6 +68,7 @@ export default class ProposalSummaryDutchX extends React.Component { detailView ?
{ action.fields[0].label}: {decodedCallData.values[0]}
+ {this.rawCallData(proposal)}
: "" } @@ -73,6 +85,7 @@ export default class ProposalSummaryDutchX extends React.Component { detailView ?
New oracle address: {decodedCallData.values[0]} + {this.rawCallData(proposal)}
: "" } @@ -89,6 +102,7 @@ export default class ProposalSummaryDutchX extends React.Component { detailView ?
New owner address: {decodedCallData.values[0]} + {this.rawCallData(proposal)}
: "" } @@ -107,6 +121,7 @@ export default class ProposalSummaryDutchX extends React.Component
    {decodedCallData.values[0].map((token: string) =>
  • {token}
  • )}
+ {this.rawCallData(proposal)} : "" } @@ -126,6 +141,7 @@ export default class ProposalSummaryDutchX extends React.Component {detailView ?
+ {this.rawCallData(proposal)}
: "" } diff --git a/src/components/Proposal/ProposalSummary/ProposalSummaryKnownGenericScheme.tsx b/src/components/Proposal/ProposalSummary/ProposalSummaryKnownGenericScheme.tsx index 9f7017a3c..9af37d8c7 100644 --- a/src/components/Proposal/ProposalSummary/ProposalSummaryKnownGenericScheme.tsx +++ b/src/components/Proposal/ProposalSummary/ProposalSummaryKnownGenericScheme.tsx @@ -95,7 +95,7 @@ export default class ProposalSummary extends React.Component {
Executing this proposal will call the function:
{decodedCallData.action.abi.name}
-        ({decodedCallData.action.abi.inputs.map(this.inputHtml)})
+            ({decodedCallData.action.abi.inputs.map(this.inputHtml)})
           
with values:
{
             decodedCallData.values.map((value: string | Array) => {
@@ -114,6 +114,11 @@ export default class ProposalSummary extends React.Component {
           
{proposal.genericScheme.contractToCall}
sending to contract:
{formatTokens(proposal.genericScheme.value)} ETH
+ + Raw call data: +
+            {truncateWithEllipses(proposal.genericScheme.callData, 66)}
+          
: "" } diff --git a/src/components/Proposal/ProposalSummary/ProposalSummaryStandardBounties.tsx b/src/components/Proposal/ProposalSummary/ProposalSummaryStandardBounties.tsx index a620f335e..e7ed8ddca 100644 --- a/src/components/Proposal/ProposalSummary/ProposalSummaryStandardBounties.tsx +++ b/src/components/Proposal/ProposalSummary/ProposalSummaryStandardBounties.tsx @@ -1,9 +1,10 @@ import { IProposalState } from "@daostack/arc.js"; import * as classNames from "classnames"; import { GenericSchemeInfo } from "genericSchemeRegistry"; -import { linkToEtherScan } from "lib/util"; +import { linkToEtherScan, truncateWithEllipses } from "lib/util"; import * as React from "react"; import * as css from "./ProposalSummary.scss"; +import CopyToClipboard from "components/Shared/CopyToClipboard"; const web3 = require("web3"); @@ -16,6 +17,15 @@ interface IProps { export default class ProposalSummaryStandardBounties extends React.Component { + private rawCallData(proposal: IProposalState) { + return <> +
Raw call data: + {truncateWithEllipses(proposal.genericScheme.callData, 66)} +
+ ; + } + + public render(): RenderOutput { const { proposal, detailView, genericSchemeInfo, transactionModal } = this.props; @@ -70,6 +80,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Approver: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -91,6 +102,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Sender: {decodedCallData.values[0]} + {this.rawCallData(proposal)} } @@ -122,6 +134,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -143,6 +156,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -164,6 +178,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Approver ID: {decodedCallData.values[3]} + {this.rawCallData(proposal)} } @@ -211,6 +226,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -232,6 +248,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -253,6 +270,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -287,6 +305,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Bounty Details: {decodedCallData.values[3]} + {this.rawCallData(proposal)} } @@ -318,6 +337,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } @@ -349,6 +369,7 @@ export default class ProposalSummaryStandardBounties extends React.Component Issuer ID: {decodedCallData.values[2]} + {this.rawCallData(proposal)} } From 7a3e1a0f1db18234d497f850f08d45906c5c151a Mon Sep 17 00:00:00 2001 From: Doug Kent Date: Tue, 4 Aug 2020 03:40:14 -0400 Subject: [PATCH 5/5] changelog for 0.10.14 (#2039) * bump tp 0.10.14 * update changelog * fix typo --- CHANGELOG.md | 9 +++++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6515176..a09bcce29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 0.10.14 + - Features Added + - show raw calldata in proposal details for relevant plugins + - improve doc about adding GenericSchemes to Alchemy + - show the Alchemy package version as tooltip over the Alchemy header icon + + - Bugs Fixed + - upgrade DaoCreator to fix a bug when creating a new DAO + ## 0.10.13 - Features Added - added support for awarding the DMG token diff --git a/package-lock.json b/package-lock.json index 672a2011b..004c7cb9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "alchemy-client", - "version": "0.10.13", + "version": "0.10.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index cd6d0d0b3..25a1e2bf5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alchemy-client", - "version": "0.10.13", + "version": "0.10.14", "description": "An app for collaborative networks (DAOs), based on the DAO stack.", "author": "DAOstack", "license": "GPL-3.0",