From ce33fc6388bd7b6cb46c8e477f0294e4c022aac3 Mon Sep 17 00:00:00 2001 From: Megha-Dev-19 <100185149+Megha-Dev-19@users.noreply.github.com> Date: Fri, 16 Feb 2024 23:38:59 +0530 Subject: [PATCH] reduce deposit for set call (#162) --- apps/builddao/widget/Proposals.jsx | 4 +- .../widget/components/buttons/Connect.jsx | 42 +++++++++---------- 2 files changed, 21 insertions(+), 25 deletions(-) diff --git a/apps/builddao/widget/Proposals.jsx b/apps/builddao/widget/Proposals.jsx index c994e838..25087e42 100644 --- a/apps/builddao/widget/Proposals.jsx +++ b/apps/builddao/widget/Proposals.jsx @@ -174,9 +174,7 @@ const handleVote = ({ action, proposalId, proposer, showNotification }) => { data: notification, options: { refund_unused_deposit: true } }, - deposit: Big(JSON.stringify(notification).length * 16) - .mul(Big(10).pow(20)) - .toString() + deposit: 100000000000000000000000 } ] : null diff --git a/apps/builddao/widget/components/buttons/Connect.jsx b/apps/builddao/widget/components/buttons/Connect.jsx index 0c5f874a..e8da26aa 100644 --- a/apps/builddao/widget/components/buttons/Connect.jsx +++ b/apps/builddao/widget/components/buttons/Connect.jsx @@ -2,7 +2,7 @@ const { joinBtnChildren, connectedChildren, showActivity, className, href } = props; const { Bullet } = VM.require("buildhub.near/widget/components") || { - Bullet: () => <>, + Bullet: () => <> }; const DaoSDK = VM.require("sdks.near/widget/SDKs.Sputnik.DaoSDK") || (() => {}); @@ -18,14 +18,14 @@ const userAccountId = context.accountId; const data = sdk?.checkIsMemberOrPending({ accountId: userAccountId, - rolesToCheck: ["community", "council"], + rolesToCheck: ["community", "council"] }); const connectEdge = Social.keys( `${userAccountId}/graph/connect/${daoId}`, undefined, { - values_only: true, + values_only: true } ); @@ -44,29 +44,27 @@ const handleJoin = () => { [userAccountId]: { graph: { connect: { - [daoId]: "", - }, + [daoId]: "" + } }, index: { graph: JSON.stringify({ key: "connect", value: { type: "connect", - accountId: daoId, - }, - }), + accountId: daoId + } + }) }, notify: JSON.stringify({ key: daoId, value: { - type: "connect", - }, - }), - }, + type: "connect" + } + }) + } }; - const socialDeposit = Big(JSON.stringify(connectData).length * 16).mul( - Big(10).pow(20) - ); + sdk.createAddMemberProposal({ description: `add ${userAccountId} to the ${roleId} group`, memberId: userAccountId, @@ -77,10 +75,10 @@ const handleJoin = () => { { contractName: "social.near", methodName: "set", - deposit: socialDeposit.toFixed(), - args: { data: connectData, options: { refund_unused_deposit: true } }, - }, - ], + deposit: 100000000000000000000000, + args: { data: connectData, options: { refund_unused_deposit: true } } + } + ] }); }; @@ -120,7 +118,7 @@ const Container = styled.div` `; const { href: linkHref } = VM.require("buildhub.near/widget/lib.url") || { - href: () => {}, + href: () => {} }; const Component = () => { @@ -144,8 +142,8 @@ const Component = () => { to={linkHref({ widgetSrc: "buildhub.near/widget/app", params: { - page: "feed", - }, + page: "feed" + } })} > View Activity{" "}