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

Add RichQuack Staking amount strategy [richquack-staked-amount] #1121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ephdtrg
Copy link

@ephdtrg ephdtrg commented Apr 5, 2023

Changes proposed in this pull request:

  • Create new strategy [richquack-staked-amount] to calculate votes from staking amounts of RichQuack Staking

Comment on lines +43 to +55
const blockTag = typeof snapshot === 'number' ? snapshot : 'latest';

const multi = new Multicaller(network, provider, abi, { blockTag });
addresses.forEach((address) =>
multi.call(address, options.stakingAddress, 'stakeInfo', [address])
);
const result: Record<string, BigNumberish> = await multi.execute();

return Object.fromEntries(
Object.entries(result).map(([address]) => [
address,
parseFloat(formatUnits(result[address][0], 18))
])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ephdtrg i think contract-call strategy should work for you, can try?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @ChaituVR ! Thank you for response

Do you mean to use existing contract-call strategy for this workflow, instead of writing new strategy, correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep @ephdtrg Can use it in your space directly :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for suggestion @ChaituVR !
Was not aware of this strategy, will check it out and close this PR if it works as intended :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants