Complete the code to declare a public variable named 'delay' of type uint.
uint public [1];The variable delay holds the time delay for the timelock. It must be declared as public and of type uint.
Complete the function signature to set a new admin address.
function [1](address newAdmin) external onlyAdmin { admin = newAdmin; }The function to set a new admin is commonly named setAdmin to clearly indicate its purpose.
Fix the error in the require statement to check if the current time is past the unlock time.
require(block.timestamp [1] unlockTime, "Timelock not expired");
The require statement should check if the current time is greater than or equal to the unlock time to allow execution after the delay.
Fill both blanks to create a mapping that stores queued transactions and a function to queue a transaction.
mapping(bytes32 => bool) public [1]; function [2](bytes32 txHash) public onlyAdmin { queuedTransactions[txHash] = true; }
The mapping is named queuedTransactions to store transaction hashes. The function to add a transaction is queueTransaction.
Fill all three blanks to implement the executeTransaction function with checks for queued status, timelock, and deletion after execution.
function [1](bytes32 txHash) public onlyAdmin { require(queuedTransactions[txHash], "Transaction not queued"); require(block.timestamp [2] unlockTime, "Timelock not expired"); queuedTransactions[txHash] = [3]; // execute transaction logic here }
The function is named executeTransaction. It checks if the current time is greater than or equal to the unlock time, then sets the queued transaction to false after execution.