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

Token Trade Implementation #2055

Merged
merged 34 commits into from
Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
db82d0e
[WIP] Token Trade Plugin
namesty Jul 28, 2020
46dfc7f
CreateProposal and ProposalSummary created for TokenTrade (untested)
namesty Jul 31, 2020
0eff4b2
Token trade fixes for BN.js amoun types
namesty Aug 6, 2020
ca106be
[WIP] Create token trade proposal
namesty Aug 10, 2020
55bdf54
updating images
cbrzn Aug 10, 2020
b2ec716
TokenTrade proposal summary fixed
namesty Aug 11, 2020
702b49f
Eliminated console.logs
namesty Aug 11, 2020
615eea0
Merge branch 'dev-2' into token-trade
namesty Aug 12, 2020
0aea5b9
Updated arc.js, test env and subgraph (#2072)
roienatan Aug 16, 2020
2ea45ff
Form service - i18next
namesty Aug 16, 2020
9057ad9
[WIP] styling details
namesty Aug 16, 2020
c81df3c
Plugin manager create proposal modal has a left border and padding li…
roienatan Aug 17, 2020
0110ed3
fix UI where votes screwed up (#2070)
roienatan Aug 17, 2020
1ccb143
Better UI for DAO history page (#2069)
roienatan Aug 17, 2020
fa0f07d
Update documentation (#2062)
roienatan Aug 17, 2020
da3b547
refactor and fix issues relating 3box operations (#2018)
dkent600 Aug 17, 2020
4bbd8fe
fix issue when a proposal card is not always clickable (#2077)
roienatan Aug 17, 2020
adf2aae
revert subgraph endpoint domain (#2078)
dkent600 Aug 17, 2020
875ef5a
Support DAOs sort by total holdings (#2085)
roienatan Aug 18, 2020
268434b
Styling for Token Trade Proposal Summary and Changed JoinAndQuit naming
namesty Aug 19, 2020
3e768e6
Merge branch 'dev-2' into token-trade
namesty Aug 19, 2020
713aea8
Merge fixes
namesty Aug 19, 2020
f807f0f
Added package.lock
namesty Aug 19, 2020
e28be5b
Minor adjustments due to changes in DAOs balances serivce that now re…
roienatan Aug 30, 2020
b635fa6
bumping arc.js version
cbrzn Sep 1, 2020
61ca1b4
Updated chrome driver for tests (#2093)
roienatan Sep 1, 2020
060cbe2
dev-2 merged
cbrzn Sep 1, 2020
64ebe1f
lint error fix
cbrzn Sep 1, 2020
2d8fce9
dev2 updated
cbrzn Sep 8, 2020
1d91489
tests for token trade proposal implemented
cbrzn Sep 8, 2020
e5e50df
fix lint
cbrzn Sep 8, 2020
1413377
removed unused import
cbrzn Sep 9, 2020
ebfc5f3
conflict fixed
cbrzn Sep 10, 2020
cad610d
added token trade to required plugin permissions object
cbrzn Sep 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
160 changes: 160 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/actions/arcActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import {
ReputationFromTokenPlugin,
Proposal,
FundingRequestProposal,
JoinProposal,
IProposalState,
TokenTradeProposal,
JoinProposal,
} from "@daostack/arc.js";
import { IAsyncAction } from "actions/async";
import { getArc } from "arc";
Expand Down Expand Up @@ -91,6 +92,9 @@ async function tryRedeemProposal(proposalId: string, accountAddress: string, obs
case "Join":
await (proposal as JoinProposal).redeem().subscribe(...observer);
break;
case "TokenTrade":
await (proposal as TokenTradeProposal).redeem().subscribe(...observer);
break;
default:
break;
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Proposal/Create/CreateProposalPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { pluginName } from "lib/pluginUtils";
import * as css from "./CreateProposal.scss";
import CreatePluginManagerProposal from "./PluginForms/CreatePluginManagerProposal";
import { of } from "rxjs";
import CreateTokenTradeProposal from "./PluginForms/CreateTokenTradeProposal";
import { ITokenTradeState } from "@daostack/arc.js";

type IExternalProps = RouteComponentProps<any>;

Expand Down Expand Up @@ -120,6 +122,8 @@ class CreateProposalPage extends React.Component<IProps, IStateProps> {
createPluginComponent = <CreatePluginRegistrarProposal {...props} pluginState={pluginState as IPluginRegistrarState} />;
} else if (pluginState.name === "SchemeFactory") {
createPluginComponent = <CreatePluginManagerProposal {...props} pluginState={pluginState as IPluginManagerState} />;
} else if (pluginState.name === "TokenTrade") {
createPluginComponent = <CreateTokenTradeProposal {...props} pluginState={pluginState as ITokenTradeState} />;
} else if (pluginState.name === "GenericScheme") {
const contractToCall = (pluginState as IGenericPluginState).pluginParams.contractToCall;
if (!contractToCall) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export interface IFormValues {
fundingGoalDeadline: number;
rageQuitEnable: boolean;
};
TokenTrade: {
permissions: IPermissions;
votingParams: IGenesisProtocolFormValues;
}
SchemeRegistrar: {
permissions: IPermissions;
votingParamsRegister: IGenesisProtocolFormValues;
Expand Down Expand Up @@ -189,6 +193,15 @@ const defaultValues: IFormValues = {
genericCall: false,
},
},
TokenTrade: {
votingParams: { ...votingParams },
permissions: {
registerPlugins: false,
changeConstraints: false,
upgradeController: false,
genericCall: false,
},
},
Competition: {
votingParams: { ...votingParams },
permissions: {
Expand Down Expand Up @@ -392,6 +405,15 @@ class CreatePluginManagerProposal extends React.Component<IProps, IState> {
daoFactory: arc.getContractInfoByName("DAOFactoryInstance", LATEST_ARC_VERSION).address,
};
break;
case "TokenTrade":
proposalOptions.add.pluginInitParams = {
daoId: daoId,
votingMachine: votingMachine,
votingParams: gpFormValuesToVotingParams(values.ContributionReward.votingParams),
voteOnBehalf: values.ContributionReward.votingParams.voteOnBehalf,
voteParamsHash: values.ContributionReward.votingParams.voteParamsHash,
};
break;
case "SchemeRegistrar":
proposalOptions.add.pluginInitParams = {
daoId: daoId,
Expand Down
Loading