AdminAuth.sol
Overview
The AdminAuth contract is a Solidity smart contract designed to manage owner and admin privileges over other smart contracts. It provides a set of modifiers and functions that allow the owner and admin to perform certain actions, such as withdrawing stuck funds and destroying the contract. This contract is used to control access and permissions within a decentralized application (DApp) or smart contract ecosystem.
Contract Information
SPDX-License-Identifier: MIT
Solidity Version: 0.8.10
Public Functions
withdrawStuckFunds(address _token, address _receiver, uint256 _amount)Visibility: Public
Modifiers:
onlyOwnerParameters:
_token: The address of the token to be withdrawn. Use0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeEfor Ether._receiver: The address to receive the withdrawn tokens or Ether._amount: The amount of tokens or Ether to withdraw.
This function allows the owner to withdraw stuck funds from the contract. If the
_tokenaddress is the Ethereum address, the function transfers Ether to the_receiver. Otherwise, it uses theSafeERC20library to transfer ERC-20 tokens to the_receiver.
Modifiers
Custom Errors
The contract defines two custom errors that can be thrown during execution:
SenderNotOwner(): This error is thrown when a function with theonlyOwnermodifier is called, but the sender is not the owner according to theadminVaultcontract.SenderNotAdmin(): This error is thrown when a function with theonlyAdminmodifier is called, but the sender is not the admin according to theadminVaultcontract.
Last updated
Was this helpful?