From 908c4c239cecab97d133c4ad2039ce2af197c67a Mon Sep 17 00:00:00 2001 From: DaveVodrazka Date: Tue, 8 Oct 2024 12:36:46 +0200 Subject: [PATCH] fix: add options payload --- src/components/AddProposal/proposeOptions.ts | 8 +++--- src/pages/governance.tsx | 26 ++++++++++++-------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/components/AddProposal/proposeOptions.ts b/src/components/AddProposal/proposeOptions.ts index 7d9ea1bd..d19573bb 100644 --- a/src/components/AddProposal/proposeOptions.ts +++ b/src/components/AddProposal/proposeOptions.ts @@ -1,5 +1,5 @@ import { AccountInterface } from "starknet"; -import { GOVERNANCE_ADDRESS } from "../../constants/amm"; +import { AMM_ADDRESS, GOVERNANCE_ADDRESS } from "../../constants/amm"; export const proposeOptions = async ( options: string[], @@ -9,8 +9,10 @@ export const proposeOptions = async ( contractAddress: GOVERNANCE_ADDRESS, entrypoint: "submit_custom_proposal", calldata: [ - 2, // add options custom proposal prop id - options.length, + "0x2", // add options custom proposal prop id + options.length + 2, // length of the payload Span + AMM_ADDRESS, + options.length / 11, // length of the array of options (each option is 11 fields) ...options, ], }; diff --git a/src/pages/governance.tsx b/src/pages/governance.tsx index c65faf40..4674183c 100644 --- a/src/pages/governance.tsx +++ b/src/pages/governance.tsx @@ -13,6 +13,8 @@ import { useEffect } from "react"; import styles from "./governance.module.css"; import { AddProposal } from "../components/AddProposal"; +import { useAccount } from "../hooks/useAccount"; +import { coreTeamAddresses } from "../constants/amm"; const VotingSubpage = () => { return ( @@ -67,6 +69,7 @@ const ProposeOptionsSubpage = () => { }; const Governance = () => { + const account = useAccount(); const subpage = useGovernanceSubpage(); const navigate = useNavigate(); @@ -131,16 +134,19 @@ const Governance = () => { > Staking - + {/* CURRENTLY ONLY SHOW TO THE CORE TEAM MEMBERS */} + {account?.address && coreTeamAddresses.includes(account.address) && ( + + )}