Skip to content

Update docs for Entropy v2 #748

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

Merged
merged 9 commits into from
Jul 23, 2025
Merged

Update docs for Entropy v2 #748

merged 9 commits into from
Jul 23, 2025

Conversation

tejasbadadare
Copy link
Contributor

@tejasbadadare tejasbadadare commented Jul 17, 2025

Description

Update docs for Entropy v2

Type of Change

  • New Page
  • Page update/improvement
  • Fix typo/grammar
  • Restructure/reorganize content
  • Update links/references
  • Other (please describe):

Checklist

  • I ran pre-commit run --all-files to check for linting errors
  • I have reviewed my changes for clarity and accuracy
  • All links are valid and working
  • Images (if any) are properly formatted and include alt text
  • Code examples (if any) are complete and functional
  • Content follows the established style guide
  • Changes are properly formatted in Markdown
  • Preview renders correctly in development environment

Copy link

vercel bot commented Jul 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 0:12am
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 0:12am

Copy link
Contributor

@nidhi-singh02 nidhi-singh02 left a comment

Choose a reason for hiding this comment

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

nit: Prettier is failing in the build. Can we ensure it passes.

@nidhi-singh02
Copy link
Contributor

Fixed the prettier in c9a4feb, unrelated to this PR though.

I like to see build passing.

@@ -200,3 +161,20 @@ Check the [Current Fees](../current-fees) to find the current fee for each provi
### Best Practices

Check out the [Best Practices](../best-practices) guide for tips to limit gas usage, or generate multiple random numbers in a single transaction.

<Callout type="info">
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the callout here needs some wordsmithing because you don't always need to select a provider. Probably something like "Some methods on Entropy require selecting..."

who participates in the generation process. Each provider is identified by an address and hosts
a keeper service for fullfilling requests.

The simplest way to choose a provider is to use the [default provider](../contract-addresses).
Copy link
Contributor

Choose a reason for hiding this comment

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

and the best way to get this is to call the getDefaultProvider() method on the contract. It's much better to use the method than hardcode the address (what if we change the provider??)


The fees differs for every chain and can be found at the [Current Fees](../current-fees) page. \
You can use the onchain method [`getFee`](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/entropy_sdk/solidity/IEntropy.sol#L101) to calculate the fee for the default provider and send it as the value of the `requestWithCallback` call:
The fees differs for every chain and also varies over time depending on the chain's current gas price.
Copy link
Contributor

Choose a reason for hiding this comment

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

the fee differs

function requestRandomNumber(bytes32 userRandomNumber) external payable {
uint256 fee = entropy.getFee(entropyProvider);
function requestRandomNumber() external payable {
uint256 fee = entropy.getFeeV2();
Copy link
Member

@aditya520 aditya520 Jul 17, 2025

Choose a reason for hiding this comment

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

Shouldn't we mention that getFeeV2() will use DefaultProvider?

@tejasbadadare tejasbadadare merged commit febaa61 into main Jul 23, 2025
3 of 5 checks passed
@tejasbadadare tejasbadadare deleted the entropy_update branch July 23, 2025 00:09
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.

4 participants