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 reentrancy guard
DeeJayElly committed Jan 28, 2025

Verified

This commit was signed with the committer’s verified signature.
JasonvanBrackel Jason L. van Brackel
commit 5780ff00d52e3eb31b19a1c404277c1c4634e5c0
7 changes: 3 additions & 4 deletions contracts/token/ERC20/extensions/ERC7540.sol
Original file line number Diff line number Diff line change
@@ -7,12 +7,11 @@
import {ERC4626} from "./ERC4626.sol";
import {SafeERC20} from "../utils/SafeERC20.sol";
import {Math} from "../../../utils/math/Math.sol";
import {ReentrancyGuard} from "../../../utils/ReentrancyGuard.sol";

/**
* @dev Abstract implementation of the ERC-7540 standard, extending ERC-4626.
*/
abstract contract ERC7540 is ERC4626, IERC7540, ReentrancyGuard {
abstract contract ERC7540 is ERC4626, IERC7540 {
using SafeERC20 for IERC20;
using Math for uint256;

@@ -22,8 +21,8 @@
}

// Mappings to track pending and claimable requests
mapping(address => mapping(uint256 => Request)) internal _pendingDepositRequests;

Check failure on line 24 in contracts/token/ERC20/extensions/ERC7540.sol

GitHub Actions / lint

State variables must be private
mapping(address => mapping(uint256 => Request)) internal _pendingRedeemRequests;

Check failure on line 25 in contracts/token/ERC20/extensions/ERC7540.sol

GitHub Actions / lint

State variables must be private

mapping(address => mapping(address => bool)) private _operators;

@@ -39,7 +38,7 @@
uint256 assets,
address controller,
address owner
) external override nonReentrant returns (uint256 requestId) {
) external override returns (uint256 requestId) {
require(assets > 0, "ERC7540: assets must be greater than zero");
require(owner == msg.sender || isOperator(owner, msg.sender), "ERC7540: unauthorized");

@@ -59,7 +58,7 @@
uint256 shares,
address controller,
address owner
) external override nonReentrant returns (uint256 requestId) {
) external override returns (uint256 requestId) {
require(shares > 0, "ERC7540: shares must be greater than zero");
require(owner == msg.sender || isOperator(owner, msg.sender), "ERC7540: unauthorized");