Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

Added endpoints with default values#97

Closed
Rubilmax wants to merge 2 commits into
devfrom
feat/endpoints
Closed

Added endpoints with default values#97
Rubilmax wants to merge 2 commits into
devfrom
feat/endpoints

Conversation

@Rubilmax

@Rubilmax Rubilmax commented Sep 6, 2022

Copy link
Copy Markdown
Contributor

Pull Request

Keep in mind that doing so has an advantage and an inconvenient (I do support the change):

  • Etherscan and the contract itself will expose a broader API with default values
  • ethers.js and all off-chain integrations will require to interact with the vault by specifying the type of function they want to interact with (and not its name only; e.g. deposit(uint256,address) instead of deposit)

The latter is of no importance to me, as the integrator that I may be

@MerlinEgalite MerlinEgalite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes LGTM but want to hear the thoughts of others before we merge this PR

Comment thread src/ERC4626UpgradeableSafe.sol Outdated
@MerlinEgalite
MerlinEgalite requested a review from a team September 6, 2022 12:26

@QGarchery QGarchery left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

/// @notice Deposit a given amount of underlying asset into the vault.
/// @param assets The amount of underlying asset to deposit. The caller must have approved this contract to spend this amount.
/// @return The amount of shares minted.
function deposit(uint256 assets) external returns (uint256) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add underscore before the arguments of the functions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's not the convention used this implementation, as it inherits OZ's conventions... So I don't think it's welcomed here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok np, it's just that there is one in the functions above

@MerlinEgalite MerlinEgalite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To update

Comment thread src/ERC4626UpgradeableSafe.sol Outdated

@MathisGD MathisGD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that it should be tested quickly.

@Rubilmax
Rubilmax requested review from a team, MathisGD, MerlinEgalite and QGarchery and removed request for julien-devatom September 17, 2022 08:40

@MerlinEgalite MerlinEgalite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure it's worth it. These functions will only be used by our frontend as every other protocol will use the ERC-4626 interface (else why bother with a standard?). This PR also increases the attack surface and the likelihood to make mistakes later in the future. What do you think @morpho-dao/solidity ?

@Rubilmax

Rubilmax commented Sep 17, 2022

Copy link
Copy Markdown
Contributor Author

This PR also increases the attack surface

Adding external functions is not enough to increase the attack surface: here for example, we add external functions without adding features; we're only constraining the usage of the more generic entrypoint to a safe scenario - from the point of view of any caller (background focus being that when calling such a function, a caller always has access to their funds afterwards)

Otherwise, I agree with the other point

I support this change as an integrator (on & off-chain, it's just easier and trustless to call deposit(1 ether))

@Rubilmax

Copy link
Copy Markdown
Contributor Author

Dropping this

@Rubilmax Rubilmax closed this Nov 15, 2022
@Rubilmax
Rubilmax deleted the feat/endpoints branch November 23, 2022 13:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants