Request form
ETH Faucet
  • Faucet
  • ETH
Docs
Source
ChefGPT

ETH Faucet

A faucet contract that allows users to request a small amount of ETH. Users can request ETH once every 24 hours. The contract has a balance that can be funded by the owner. The owner can also change the amount of ETH given on each request

EvmFaucet :
A faucet contract that allows users to request a small amount of ETHUsers can request ETH once every 24 hoursThe contract has a balance that can be funded by the ownerThe owner can also change the amount of ETH given on each request
constructor :
constructor to set the default value of transferEthAmount
owner() :
Returns the address of the current owner.
renounceOwnership() :
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
requestEth(address) :
function to request a small amount of ETHThe function checks if the contract has enough balanceThe function also checks if the user has requested beforeIf all the conditions are met, the function will transfer the amount stored in transferEthAmount to the user address
setTransferEthAmount(uint256) :
function that allows the owner to change the value of the transferEthAmountThe function will be executed only by the owner of the contract
transferOwnership(address) :
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
withdraw() :
function that allows the owner to withdraw the contract balancethe function checks that the contract has a balance greater than zeroThe function will be executed only by the owner of the contract
Ownable :
Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.
constructor :
Initializes the contract setting the deployer as the initial owner.
owner() :
Returns the address of the current owner.
renounceOwnership() :
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
transferOwnership(address) :
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
Context :
Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.
EvmFaucet.sol
Ownable.sol
Context.sol

33 downloads

Solidity Version

v0.8.17

Creator

anarancio
anarancio / ETH Faucet
  • Faucet
  • ETH
Docs
Source
ChefGPT
Expand
Share

Get Cookin'
star icon33

33 downloads

Solidity Version

v0.8.17

Creator

anarancio

ETH Faucet

A faucet contract that allows users to request a small amount of ETH. Users can request ETH once every 24 hours. The contract has a balance that can be funded by the owner. The owner can also change the amount of ETH given on each request

EvmFaucet :
A faucet contract that allows users to request a small amount of ETHUsers can request ETH once every 24 hoursThe contract has a balance that can be funded by the ownerThe owner can also change the amount of ETH given on each request
constructor :
constructor to set the default value of transferEthAmount
owner() :
Returns the address of the current owner.
renounceOwnership() :
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
requestEth(address) :
function to request a small amount of ETHThe function checks if the contract has enough balanceThe function also checks if the user has requested beforeIf all the conditions are met, the function will transfer the amount stored in transferEthAmount to the user address
setTransferEthAmount(uint256) :
function that allows the owner to change the value of the transferEthAmountThe function will be executed only by the owner of the contract
transferOwnership(address) :
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
withdraw() :
function that allows the owner to withdraw the contract balancethe function checks that the contract has a balance greater than zeroThe function will be executed only by the owner of the contract
Ownable :
Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.
constructor :
Initializes the contract setting the deployer as the initial owner.
owner() :
Returns the address of the current owner.
renounceOwnership() :
Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
transferOwnership(address) :
Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.
Context :
Provides information about the current execution context, including the sender of the transaction and its data. While these are generally available via msg.sender and msg.data, they should not be accessed in such a direct manner, since when dealing with meta-transactions the account sending and paying for execution may not be the actual sender (as far as an application is concerned). This contract is only required for intermediate, library-like contracts.
EvmFaucet.sol
Ownable.sol
Context.sol