Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
BEP20 Token
copy icon
PancakeSwap
• version 1.0.0
BEP20
Token
Audited

BEP20 Token

Audited

Standard token contract used on Binance Smart Chain. Implemented by PancakeSwap.

*Visit desktop site to download or deploy

Version

1.0.0

Last Publish

1/15/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
getOwner() :
This function is an override of the owner() function, which returns the address of the owner of the contract. This function is marked as external and view, meaning that it can be called from outside the contract and does not modify the state of the contract. (autogenerated documentation)
name() :
This function is an override of the public view function name() which returns a string memory. It returns the value of the private variable _name which is set in the constructor. (autogenerated documentation)
decimals() :
This function returns the number of decimals used by the token. It works by returning the value of the "_decimals" variable, which is set when the token is created. (autogenerated documentation)
symbol() :
This function is a public view function that returns the symbol of the token. It works by returning the value of the _symbol variable, which is a string memory type. This function is an override of the symbol() function from the ERC20 interface. (autogenerated documentation)
totalSupply() :
This function returns the total supply of a token. It works by accessing the _totalSupply variable, which stores the total amount of tokens in circulation. (autogenerated documentation)
balanceOf(address) :
This function returns the balance of a given account. It takes in an address as an argument and uses this address to look up the balance of the account in the _balances mapping. The function then returns the balance of the account as a uint256. (autogenerated documentation)
transfer(address,uint256) :
This function is an override of the transfer function from the ERC20 token standard. It allows users to transfer tokens from their own address to another address. The function takes two parameters, the recipient address and the amount of tokens to be transferred. It then calls the _transfer function, passing in the sender's address, the recipient's address, and the amount of tokens to be transferred. Finally, it returns a boolean value indicating whether the transfer was successful or not. (autogenerated documentation)
allowance(address,address) :
This function allows users to check the amount of tokens that have been approved for transfer from one address (the owner) to another address (the spender). It works by accessing the _allowances mapping, which stores the amount of tokens that have been approved for transfer from the owner to the spender. The function then returns the amount of tokens that have been approved for transfer. (autogenerated documentation)
approve(address,uint256) :
This function allows a user to approve a spender to spend a certain amount of tokens from their account. It works by calling the _approve() function, which sets the allowance for the spender to the specified amount. The function returns true if the approval was successful. (autogenerated documentation)
transferFrom(address,address,uint256) :
This function allows a user to transfer tokens from one address to another. It first calls the _transfer function to move the tokens from the sender to the recipient. It then calls the _approve function to update the allowances of the sender, subtracting the amount of tokens transferred from the allowance. Finally, it returns true to indicate that the transfer was successful. (autogenerated documentation)
increaseAllowance(address,uint256) :
This function increases the allowance of a given spender address by a given amount. It does this by calling the _approve function, passing in the msg.sender (the address of the account that is calling the function), the spender address, and the sum of the current allowance and the added value. If the function is successful, it returns true. (autogenerated documentation)
decreaseAllowance(address,uint256) :
This function decreases the allowance of a given spender address by a given subtracted value. It works by subtracting the subtracted value from the existing allowance of the spender address, and then calling the _approve function to update the allowance. (autogenerated documentation)
mint(uint256) :
This function allows the owner of the contract to mint a specified amount of tokens and add them to the sender's balance. It takes in a uint256 amount as an argument and returns a boolean value. The function calls the _mint() internal function, which adds the specified amount of tokens to the sender's balance. (autogenerated documentation)
_transfer(address,address,uint256) :
This function is an internal function that is used to transfer tokens from one address to another. It requires three parameters: the address of the sender, the address of the recipient, and the amount of tokens to be transferred. It first checks that neither the sender nor the recipient address is the zero address. It then subtracts the amount of tokens from the sender's balance and adds the amount of tokens to the recipient's balance. Finally, it emits a Transfer event with the sender, recipient, and amount of tokens transferred. (autogenerated documentation)
_mint(address,uint256) :
This function is used to mint a new token to a given address. It requires the address of the account to mint to and the amount of tokens to mint. It then adds the amount to the total supply of the token and adds the amount to the balance of the given address. Finally, it emits a Transfer event to indicate that the tokens have been minted. (autogenerated documentation)
_burn(address,uint256) :
This function is used to burn a certain amount of tokens from a given address. It requires that the address is not the zero address, and then subtracts the amount from the account's balance and the total supply of tokens. Finally, it emits a Transfer event to indicate that the tokens have been burned. (autogenerated documentation)
_approve(address,address,uint256) :
This function is used to approve a certain amount of tokens from the owner to the spender. It requires that both the owner and spender addresses are not the zero address. It then sets the amount of tokens approved in the _allowances mapping and emits an Approval event. (autogenerated documentation)
_burnFrom(address,uint256) :
This function is used to burn a certain amount of tokens from a given address. It first calls the _burn() function to burn the specified amount of tokens from the given address. It then calls the _approve() function to update the allowance of the given address for the message sender, subtracting the amount that was just burned. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i BEP20-Token
copy icon

Last Publish

1/15/2023

Version

1.0.0

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.