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

Chainlink ERC4626: allow to pass the vault decimals directly #19

Merged
merged 16 commits into from
Oct 15, 2023

Conversation

QGarchery
Copy link
Contributor

To fix that #7 (comment)

@QGarchery QGarchery requested review from MathisGD and a team October 11, 2023 15:58
@QGarchery QGarchery self-assigned this Oct 11, 2023
@QGarchery QGarchery requested review from Rubilmax, MerlinEgalite and Jean-Grimal and removed request for a team October 11, 2023 15:58
Copy link
Contributor

@MerlinEgalite MerlinEgalite left a comment

Choose a reason for hiding this comment

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

Well in fact I'm still not convinced about this.

EDIT: I may be convinced but I feel that the solution is incomplete.

src/ChainlinkOracle.sol Outdated Show resolved Hide resolved
src/ChainlinkOracle.sol Outdated Show resolved Hide resolved
src/ChainlinkOracle.sol Outdated Show resolved Hide resolved
Copy link
Contributor

@MerlinEgalite MerlinEgalite left a comment

Choose a reason for hiding this comment

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

Just commented that when you pushed lol: #19 (comment)

I'm not a fan of sample tbh..

@QGarchery
Copy link
Contributor Author

I'm not a fan of sample tbh..

Why not ? I feel like it fits pretty well: we take a sample, price it, scale it down to get the generic price

@MerlinEgalite
Copy link
Contributor

I'm not a fan of sample tbh..

Why not ? I feel like it fits pretty well: we take a sample, price it, scale it down to get the generic price

I have the feeling that a sample is something that can change from the definition (else why taking a sample) while here study the evaluate the value of the same amount of shares each time. So to me it feels more like a reference.

I'm approving as I don't think it's a big deal

);
}

/* PRICE */

/// @inheritdoc IOracle
function price() external view returns (uint256) {
return (VAULT.getAssets(10 ** VAULT_PRECISION) * BASE_FEED_1.getPrice() * BASE_FEED_2.getPrice() * SCALE_FACTOR)
uint256 sample = 10 ** CONVERSION_SAMPLE_DECIMALS;
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps it could be an immutable as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

#26, saves 300 gas apparently

@MathisGD MathisGD merged commit 741561e into feat/chainlink-factorized Oct 15, 2023
2 checks passed
@MathisGD MathisGD deleted the feat/chainlink-vault-decimals branch October 15, 2023 11:46
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