Challenge 19
Missing ownership check
MediumAccess control
Challenge
A function can change the admin address without any authorization check. Which guard is missing?
Starter code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract AdminVault {
address public admin;
constructor() {
admin = msg.sender;
}
function transferAdmin(address newAdmin) public {
admin = newAdmin;
}
}Show hint
Only authorized callers should be able to reassign critical roles.