Skip to content

Feat/v0.6.0 various features - #264

Merged
GuiDupont merged 21 commits into
feat/v0.6.0from
feat/v0.6.0-various-features
Feb 3, 2026
Merged

Feat/v0.6.0 various features#264
GuiDupont merged 21 commits into
feat/v0.6.0from
feat/v0.6.0-various-features

Conversation

@GuiDupont

Copy link
Copy Markdown
Contributor

No description provided.

@jfrancai jfrancai 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.

Mainly naming concerns ^^

Comment thread src/v0.6.0/ERC7540.sol Outdated
uint128 totalAssetsLifespan;
// New variables introduce with v0.6.0
uint256 maxCap;
bool gaveUpOperatorPrivileges;

@jfrancai jfrancai Feb 2, 2026

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 would use hasGivenUpSafePrivileges or gaveUpSafePrivileges if the length really matter more to you

Comment thread src/v0.6.0/ERC7540.sol
uint128 totalAssetsExpiration;
uint128 totalAssetsLifespan;
// New variables introduce with v0.6.0
uint256 maxCap;

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 don't see any getter for this value, I think it's important:

   function maxCap() external view returns (uint256) {
       return ERC7540Lib._getERC7540Storage().maxCap;
   }

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.

agree

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.

Test are being removed, should we reactivate them?

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.

no they take too long
we can reactivate them if you manage to make the execution faster
some tests run in parallel, some don't
the remaining tests cover what we need:

  • a wrapped native token
  • a standard ERC20 token

Comment thread src/v0.5.0/Roles.sol

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.

we should not change v0.5.0 files

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.

you are right

Comment thread src/v0.5.0/Vault.sol Outdated
}

/// @notice Deposit in a sychronous fashion into the vault.
/// @notice Deposit in a synchronous fashion into the vault.

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.

we should not change v0.5.0 files

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.

agree

Comment thread src/v0.6.0/vault/Vault-v0.6.0.sol Outdated
// ## OPERATOR PRIVILEGES ## //
//////////////////////////////

function giveUpOperatorPrivileges() external onlyOwner {

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 we should name this giveUpSafePrivileges

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.

I am fine with this

Comment thread src/v0.6.0/vault/Vault-v0.6.0.sol Outdated
//////////////////////////////

function giveUpOperatorPrivileges() external onlyOwner {
_giveUpOperatorPrivileges();

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.

same here

Comment thread src/v0.6.0/ERC7540.sol Outdated
) public virtual;

function safe() public view virtual returns (address);
function _protocolFeeReceiver() internal view virtual returns (address);

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 but I think we can remove this

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.

I let you check

Comment thread src/v0.6.0/vault/VaultInit.sol Outdated
return address(0);
}

function _protocolFeeReceiver() internal view override returns (address) {

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 but I think we can remove this

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.

if solc doesn't complain, sure

Comment thread src/v0.6.0/vault/Vault-v0.6.0.sol Outdated
uint256 shares
) internal virtual override {
if (caller != owner && !isOperator(owner, caller)) {
if (caller != owner && !_isOperator(owner, caller, true)) {

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.

same here

jfrancai and others added 4 commits February 2, 2026 20:42
- revert v0.5.0 file changes (import path and typo)
- rename OperatorPrivileges to SafePrivileges for clarity
- add maxCap() and gaveUpSafePrivileges() getters
- update tests to reflect naming changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
… to library

	- Replace onlyOperator(controller, bool) with two modifiers:
	- onlyOperator(controller): excludes safe as operator
	- onlyOperatorOrSafe(controller): includes safe as operator
	- Move _isOperator, _isSafeAnOperator logic to ERC7540Lib
	- Move _protocolFeeReceiver to RolesLib
	- Add isOperatorOrSafe() public view function
	- Remove _protocolFeeReceiver abstract function from ERC7540
@GuiDupont
GuiDupont merged commit 2f20042 into feat/v0.6.0 Feb 3, 2026
3 checks passed
@GuiDupont
GuiDupont deleted the feat/v0.6.0-various-features branch February 3, 2026 08:35
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