Skip to content

Commit

Permalink
Merge pull request #858 from EricDevito/patch-1
Browse files Browse the repository at this point in the history
fix nouns.wtf voting
  • Loading branch information
solimander authored Aug 29, 2024
2 parents c86b278 + 789b590 commit c0a805b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/nouns-webapp/src/wrappers/nounsDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -842,15 +842,16 @@ export const useCastVoteWithReason = () => {

export const useCastRefundableVote = () => {
const { library } = useEthers();
const functionSig = 'castRefundableVote(uint256,uint8)';
const { send: castRefundableVote, state: castRefundableVoteState } = useContractFunction(
nounsDaoContract,
'castRefundableVote',
functionSig
);

return {
castRefundableVote: async (...args: any[]): Promise<void> => {
const contract = connectContractToSigner(nounsDaoContract, undefined, library);
const gasLimit = await contract.estimateGas.castRefundableVote(...args);
const gasLimit = await contract.estimateGas[functionSig](...args);
return castRefundableVote(...args, {
gasLimit: gasLimit.add(30_000), // A 30,000 gas pad is used to avoid 'Out of gas' errors
});
Expand All @@ -862,15 +863,14 @@ export const useCastRefundableVote = () => {
export const useCastRefundableVoteWithReason = () => {
const { library } = useEthers();
// prettier-ignore
const { send: castRefundableVoteWithReason, state: castRefundableVoteWithReasonState } = useContractFunction(
nounsDaoContract,
'castRefundableVoteWithReason',
);
const functionSig = 'castRefundableVoteWithReason(uint256,uint8,string)';
const { send: castRefundableVoteWithReason, state: castRefundableVoteWithReasonState } =
useContractFunction(nounsDaoContract, functionSig);

return {
castRefundableVoteWithReason: async (...args: any[]): Promise<void> => {
const contract = connectContractToSigner(nounsDaoContract, undefined, library);
const gasLimit = await contract.estimateGas.castRefundableVoteWithReason(...args);
const gasLimit = await contract.estimateGas[functionSig](...args);
return castRefundableVoteWithReason(...args, {
gasLimit: gasLimit.add(30_000), // A 30,000 gas pad is used to avoid 'Out of gas' errors
});
Expand Down

0 comments on commit c0a805b

Please sign in to comment.