Skip to content

Commit

Permalink
✨ Timelock (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized authored Dec 2, 2024
1 parent 37919b8 commit 8e69515
Show file tree
Hide file tree
Showing 7 changed files with 728 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ accounts
├─ LibERC6551 — "Library for interacting with ERC6551 accounts"
├─ LibERC7579 — "Library for handling ERC7579 mode and execution data"
├─ Receiver — "Receiver mixin for ETH and safe-transferred ERC721 and ERC1155 tokens"
├─ Timelock — "Simple timelock"
auth
├─ Ownable — "Simple single owner authorization mixin"
├─ OwnableRoles — "Simple single owner and multiroles authorization mixin"
Expand Down
1 change: 1 addition & 0 deletions src/Milady.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "./accounts/ERC7821.sol";
import "./accounts/LibERC6551.sol";
import "./accounts/LibERC7579.sol";
import "./accounts/Receiver.sol";
import "./accounts/Timelock.sol";
import "./auth/Ownable.sol";
import "./auth/OwnableRoles.sol";
import "./auth/EnumerableRoles.sol";
Expand Down
17 changes: 11 additions & 6 deletions src/accounts/ERC7821.sol
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ contract ERC7821 is Receiver {
opData.length := calldataload(q)
}
}
return _execute(calls, opData);
return _execute(mode, executionData, calls, opData);
}

/// @dev Provided for execution mode support detection.
Expand Down Expand Up @@ -107,11 +107,16 @@ contract ERC7821 is Receiver {

/// @dev Executes the `calls` and returns the results.
/// Reverts and bubbles up error if any call fails.
function _execute(Call[] calldata calls, bytes calldata opData)
internal
virtual
returns (bytes[] memory)
{
/// The `mode` and `executionData` are passed along in case there's a need to use them.
function _execute(
bytes32 mode,
bytes calldata executionData,
Call[] calldata calls,
bytes calldata opData
) internal virtual returns (bytes[] memory) {
// Silence compiler warning on unused variables.
mode = mode;
executionData = executionData;
// Very basic auth to only allow this contract to be called by itself.
// Override this function to perform more complex auth with `opData`.
if (opData.length == uint256(0)) {
Expand Down
Loading

0 comments on commit 8e69515

Please sign in to comment.