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

ERC-7540: Asynchronous ERC-4626 Tokenized Vaults #5457

Closed
wants to merge 32 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9c8b97d
ERC-7540 - Add IERC7540 interface
DeeJayElly Jan 24, 2025
6e276bd
ERC-7540 - Add ERC7540 initial implementation - requestDeposit & pend…
DeeJayElly Jan 24, 2025
d11665c
ERC-7540 - Add ERC7540 - requestRedeem & pendingRedeemRequest/claimab…
DeeJayElly Jan 24, 2025
7c0d1e6
ERC-7540 - Add ERC7540 - ERC7540Fees.sol and ERC7540FeesMock.sol
DeeJayElly Jan 26, 2025
deb2490
ERC-7540 - Add ERC7540 - add additional Events
DeeJayElly Jan 26, 2025
ff2d631
ERC-7540 - Add ERC7540 - add ERC7540LimitsMock.sol
DeeJayElly Jan 26, 2025
37d6252
ERC-7540 - Add ERC7540 - add ERC7540Mock.sol
DeeJayElly Jan 26, 2025
6c2d9f6
ERC-7540 - Add ERC7540 - add ERC7540OffsetMock.sol
DeeJayElly Jan 26, 2025
d2c8762
ERC-7540 - Add ERC7540 - fix ordering
DeeJayElly Jan 28, 2025
5780ff0
ERC-7540 - Add ERC7540 - remove reentrancy guard
DeeJayElly Jan 28, 2025
7146c97
ERC-7540 - Add ERC7540 - fixing state variables and methods visibility
DeeJayElly Jan 28, 2025
41688b8
ERC-7540 - Add ERC7540 - fixing state variables and methods visibility
DeeJayElly Jan 28, 2025
d6b1569
ERC-7540 - Add ERC7540 - fixing reentrancy
DeeJayElly Jan 28, 2025
4015f6f
ERC-7540 - Add ERC7540 - add virtual to _generateRequestId
DeeJayElly Jan 28, 2025
e5cd1ab
ERC-7540 - Add ERC7540 - fixing state variables and methods visibility
DeeJayElly Jan 28, 2025
3a49372
ERC-7540 - Add ERC7540 - dont revert, but instead just do no-op
DeeJayElly Jan 28, 2025
36eb007
ERC-7540 - Add ERC7540 - adding custom errors
DeeJayElly Jan 28, 2025
31500c7
ERC-7540 - Add ERC7540 - adding custom errors
DeeJayElly Jan 28, 2025
dc5529f
ERC-7540 - Add ERC7540 - remove duplicated method
DeeJayElly Jan 28, 2025
bcb8bec
ERC-7540 - Add ERC7540 - removing events which are not under the ERC
DeeJayElly Jan 28, 2025
981069c
ERC-7540 - Add ERC7540 - removing events which are not under the ERC
DeeJayElly Jan 28, 2025
f4092f3
ERC-7540 - Add ERC7540 - cumulative generate request id approach
DeeJayElly Jan 28, 2025
ff8585d
ERC-7540 - Add ERC7540 - cumulative generate request id approach - ad…
DeeJayElly Jan 28, 2025
891b3a0
ERC-7540 - Add ERC7540 - cumulative generate request id approach - ad…
DeeJayElly Jan 28, 2025
6135402
Merge branch 'master' into feat/ERC-7540
DeeJayElly Jan 28, 2025
94ce32b
ERC-7540 - Add ERC7540 - review updates
DeeJayElly Jan 30, 2025
f46e0f5
ERC-7540 - Add ERC7540 - refactoring the contracts to align more with…
DeeJayElly Jan 30, 2025
859ab4d
ERC-7540 - Add ERC7540 - fixing state variables and methods visibility
DeeJayElly Jan 30, 2025
fff03c9
Merge branch 'master' into feat/ERC-7540
DeeJayElly Jan 30, 2025
ef00685
ERC-7540 - Add ERC7540 - add changeset
DeeJayElly Jan 31, 2025
30776ad
ERC-7540 - Add ERC7540 - fixing state variables and methods visibility
DeeJayElly Jan 31, 2025
f3a616a
ERC-7540 - Add ERC7540 - add unit tests
DeeJayElly Jan 31, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ERC-7540 - Add ERC7540 - remove duplicated method
DeeJayElly committed Jan 28, 2025
commit dc5529f061a064c520e38e0979ddc63dd6d6549e
8 changes: 0 additions & 8 deletions contracts/interfaces/IERC7540.sol
Original file line number Diff line number Diff line change
@@ -140,12 +140,4 @@ interface IERC7540 is IERC4626 {
address controller,
uint256 requestId
) external view returns (Request memory request);

/**
* @dev Gets the status of an operator for a given controller.
* @param controller The address of the controller.
* @param operator The address of the operator.
* @return status Whether the operator is approved.
*/
function getOperator(address controller, address operator) external view returns (bool status);
}
12 changes: 4 additions & 8 deletions contracts/token/ERC20/extensions/ERC7540.sol
Original file line number Diff line number Diff line change
@@ -65,7 +65,10 @@ abstract contract ERC7540 is ERC4626, IERC7540 {
if (shares == 0) {
revert ERC7540ZeroSharesNotAllowed(sender, shares);
}
require(owner == sender || isOperator(owner, sender), "ERC7540: unauthorized");

if (owner != sender && !isOperator(owner, sender)) {
revert ERC7540Unauthorized(sender, owner);
}

requestId = _generateRequestId(controller, shares);

@@ -135,13 +138,6 @@ abstract contract ERC7540 is ERC4626, IERC7540 {
return _pendingRedeemRequests[controller][requestId];
}

/**
* @dev Function to return operator.
*/
function getOperator(address controller, address operator) public view returns (bool) {
return _operators[controller][operator];
}

/**
* @dev Internal function to generate a unique request ID.
*/