Skip to content

Commit

Permalink
Merge pull request #55 from near-ndc/gas-update
Browse files Browse the repository at this point in the history
Updated gas
  • Loading branch information
Megha-Dev-19 authored Feb 16, 2024
2 parents 53a0fbf + 28afd5d commit 4655050
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
23 changes: 15 additions & 8 deletions apps/astraplusplus/widget/DAO/Proposal/Create/FunctionCall.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ State.init({
method_name: state.method_name,
args: state.args || "{}",
deposit: state.deposit || "0",
gas: "50000000000000",
gas: "270",
error: undefined,
receiver_id: null,
description: null,
Expand Down Expand Up @@ -107,9 +107,16 @@ const handleFunctionCall = () => {
});
return;
}
if (state.gas > 300) {
State.update({
error: "Maximum gas allowed is 300Tgas"
});
return;
}
}

const deposit = Big(state.deposit).mul(Big(10).pow(24)).toFixed();
const gas = Big(state.gas).mul(Big(10).pow(12)).toFixed();
if (isVotingBodyDao) {
if (isEmpty(state.description)) {
State.update({
Expand All @@ -133,7 +140,7 @@ const handleFunctionCall = () => {
method_name: state.method_name,
args: fc_args,
deposit: deposit,
gas: state.gas ?? "50000000000000"
gas: gas
}
]
}
Expand Down Expand Up @@ -193,7 +200,7 @@ const handleFunctionCall = () => {
"utf-8"
).toString("base64"),
deposit: deposit,
gas: state.gas ?? "50000000000000"
gas: gas
}
]
}
Expand Down Expand Up @@ -240,7 +247,7 @@ const handleFunctionCall = () => {
method_name: state.method_name,
args: fc_args,
deposit: deposit,
gas: state.gas ?? "50000000000000"
gas: gas
}
]
}
Expand Down Expand Up @@ -271,7 +278,7 @@ const handleFunctionCall = () => {
method_name: state.method_name,
args: fc_args,
deposit: deposit,
gas: state.gas ?? "50000000000000"
gas: gas
}
]
}
Expand Down Expand Up @@ -504,19 +511,19 @@ return (
)}
{!isCongressDaoID && !isVotingBodyDao && (
<div className="mb-3">
<h5>Gas</h5>
<h5>Gas (Tgas)</h5>
<input
type="number"
value={state.gas}
onChange={(e) => onChangeGas(e.target.value)}
defaultValue="300000000000000"
defaultValue="270"
/>
</div>
)}
</>
)}
<div className="mb-3">
<h5>Deposit {(isCongressDaoID || isVotingBodyDao) && "(NEAR)"}</h5>
<h5>Deposit (NEAR)</h5>
<input
type="number"
value={state.deposit}
Expand Down
2 changes: 1 addition & 1 deletion apps/astraplusplus/widget/DAO/Proposals/Card/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ const handleVote = ({
contractName: daoId,
methodName: isCongressDaoID ? "vote" : "act_proposal",
args: args,
gas: 200000000000000
gas: 270000000000000
}
];
if (showNotification) {
Expand Down

0 comments on commit 4655050

Please sign in to comment.