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:
onlyOwner
Parameters:
_token
: The address of the token to be withdrawn. Use0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
for 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
_token
address is the Ethereum address, the function transfers Ether to the_receiver
. Otherwise, it uses theSafeERC20
library 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 theonlyOwner
modifier is called, but the sender is not the owner according to theadminVault
contract.SenderNotAdmin()
: This error is thrown when a function with theonlyAdmin
modifier is called, but the sender is not the admin according to theadminVault
contract.
Last updated