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

ERC20 Token with Blacklist

Audited

ERC20 Token with a built-in blacklist that allows the owner to prevent certain addresses from receiving the token.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

Liquity

Recent Use

🍞 0x705c downloaded
🥐 0xbad8 downloaded
🥖 0x33AC downloaded
🥨 0x70F8 downloaded

Last Publish

9/26/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
mint(address,uint256) :
This function is part of an Ethereum smart contract and is used to mint a specific amount of tokens to a given address. It requires that the caller is the borrower operations, and then calls the _mint() function to mint the tokens. The _mint() function is responsible for actually minting the tokens, and is likely to involve updating the token balance of the given address. (autogenerated documentation)
burn(address,uint256) :
This function allows the caller to burn a specified amount of tokens from a given address. It requires that the caller is either the BO (Burner Oracle), Trove Mor, or a Service Provider. The function first checks that the caller is one of these three entities, and then calls the _burn() function, which will reduce the balance of the given address by the specified amount. (autogenerated documentation)
sendToPool(address,address,uint256) :
This function allows a user to send a specified amount of tokens to a designated pool address. The function requires that the caller is a stability pool, and it uses the _requireCallerIsStabilityPool() function to verify this. If the caller is a stability pool, the function then uses the _transfer() function to transfer the specified amount of tokens from the sender's address to the pool address. (autogenerated documentation)
returnFromPool(address,address,uint256) :
This function allows a Trove Manager or Service Provider to return a specified amount of tokens from a pool address to a specified receiver address. It does this by calling the _transfer() function, which is responsible for transferring tokens from one address to another. The function requires that the caller is either a Trove Manager or Service Provider, and it takes in three parameters: the pool address, the receiver address, and the amount of tokens to be transferred. (autogenerated documentation)
totalSupply() :
This function is an external view function that returns the total supply of a token. It works by accessing the _totalSupply variable, which is a private variable that stores the total supply of the token. The function then returns the value stored in the _totalSupply variable. (autogenerated documentation)
balanceOf(address) :
This function is used to check the balance of a given account. It takes an address as an argument and returns the balance of that account as a uint256. The function accesses the _balances mapping, which stores the balances of all accounts, and returns the balance associated with the given address. (autogenerated documentation)
transfer(address,uint256) :
This function is an override of the transfer function in the ERC20 token standard. It allows for the transfer of tokens from one address to another. The function takes two parameters, an address of the recipient and an amount of tokens to be transferred. It first checks to make sure that the recipient address is valid, and then it calls the _transfer function to transfer the tokens from the sender to the recipient. Finally, it returns a boolean value indicating whether the transfer was successful. (autogenerated documentation)
allowance(address,address) :
This function allows a user to check the amount of tokens that have been approved for transfer from one address (the owner) to another address (the spender). It does this 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 returns the amount of tokens that have been approved for transfer from the owner to the spender. (autogenerated documentation)
approve(address,uint256) :
This function allows a user to approve a spender to spend a certain amount of tokens from their account. The function takes two parameters, the address of the spender and the amount of tokens to be approved. The function then calls the _approve() function, passing in the sender's address, the spender's address, and the amount of tokens to be approved. Finally, the function returns a boolean value of true to indicate that the approval was successful. (autogenerated documentation)
transferFrom(address,address,uint256) :
This function allows a user 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. The function first checks that the recipient is a valid address, then it transfers the tokens from the sender to the recipient. Finally, it updates the allowance of the sender to the msg.sender (the address of the person calling the function) by subtracting the amount of tokens transferred. The function returns true if the transfer is 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, which updates the _allowances mapping with the new allowance amount. The function returns true if the allowance was successfully increased. (autogenerated documentation)
decreaseAllowance(address,uint256) :
This function decreases the allowance of a spender for a particular address. The function takes two parameters, the address of the spender and the amount to be subtracted from the allowance. The function first checks if the subtracted value is greater than the current allowance, and if so, it subtracts the value from the allowance and returns true. If the subtracted value is greater than the current allowance, the function returns false. The function also checks to make sure that the allowance does not go below zero. (autogenerated documentation)
domainSeparator() :
This function is used to retrieve the domain separator for a given contract. The domain separator is a 32-byte value that is used to identify a particular contract. It is calculated by hashing together the contract's type hash, name hash, and version hash. If the chain ID of the current chain matches the cached chain ID, then the cached domain separator is returned. Otherwise, the domain separator is calculated and returned. (autogenerated documentation)
permit (address,address,uint8,bytes32,bytes32) :
This function is an override of the ERC-20 approve function. It is used to permit a spender to transfer a certain amount of tokens from the owner's account to another account. The function requires the owner, spender, amount, deadline, v, r, and s parameters. The function first checks if the deadline is greater than the current time. If it is, it then calculates a digest using the keccak256 hashing algorithm. This digest is used to verify the signature of the owner. The function then uses the ecrecover function to recover the address of the owner from the signature. If the recovered address matches the owner address, the function approves the transfer of the specified amount of tokens from the owner to the spender. (autogenerated documentation)
nonces(address) :
This function is used to retrieve the nonce associated with a given address. A nonce is a number that is used to uniquely identify a transaction. This function takes an address as an input and returns the nonce associated with that address. The nonce is stored in a mapping called _nonces, which is a data structure that stores key-value pairs. The key is the address and the value is the nonce associated with that address. The function then looks up the nonce associated with the given address and returns it. (autogenerated documentation)
_chainID() :
This function is a private function that returns the chain ID of the current Ethereum network. It does this by using the assembly keyword to access the chainid() function, which returns the chain ID of the current Ethereum network. The chain ID is then stored in the variable chainID and returned. (autogenerated documentation)
_buildDomainSeparator(bytes32,bytes32,bytes32) :
This function is used to build a domain separator for a given typeHash, name, and version. It does this by taking the given typeHash, name, and version and encoding them using the ABI encoding standard. It then takes the encoded data and passes it to the keccak256 hashing function, which returns a 32 byte hash. The hash is then combined with the chainID, and the address of the contract, and passed back to the keccak256 hashing function, which returns the domain separator. (autogenerated documentation)
_transfer(address,address,uint256) :
This function is an internal function that is used to transfer tokens from one address to another. It takes three parameters: the address of the sender, the address of the recipient, and the amount of tokens to be transferred. It first checks that the sender and recipient addresses are not equal to 0, and then subtracts the amount of tokens from the sender's balance and adds it 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 an internal function that is used to mint a new supply of a token. It takes two parameters, an address of the account to mint the tokens to, and the amount of tokens to mint. It first checks that the address is not the address of 0, then it adds the amount of tokens to the total supply of the token, adds the amount of tokens to the account's balance, and emits a Transfer event with the address of 0 as the sender, the account as the receiver, and the amount of tokens as the amount. (autogenerated documentation)
_burn(address,uint256) :
This function is used to burn a certain amount of tokens from a given account. It first checks that the given account is not the address 0. It then subtracts the given amount from the account's balance and from 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 to be transferred from one address (the owner) to another address (the spender). It does this by setting the amount of tokens that the spender is allowed to transfer from the owner's address in the _allowances mapping. The function also emits an Approval event, which can be used to track the approval of the transfer. (autogenerated documentation)
_requireValidRecipient(address) :
This function is used to ensure that tokens are not transferred directly to the LUSD token contract, the zero address, the StabilityPool, the TroveManager, or the BorrowerOps address. It does this by checking that the recipient address is not equal to any of these addresses and then throwing an error if it is. This helps to ensure that tokens are not sent to an address that cannot receive them. (autogenerated documentation)
_requireCallerIsBorrowerOperations() :
This function is used to ensure that the caller of the function is the BorrowerOperations address. It does this by using the require() function to check if the sender of the message (msg.sender) is equal to the BorrowerOperations address. If the condition is not met, an error message is thrown. (autogenerated documentation)
_requireCallerIsBOorTroveMorSP() :
This function is an internal view function that checks whether the caller of the function is either the BorrowerOperations address, the TroveManager address, or the StabilityPool address. If the caller is not one of these addresses, the function will throw an error. This function is used to ensure that only the specified addresses are allowed to call certain functions. (autogenerated documentation)
_requireCallerIsStabilityPool() :
This function is an internal view function that checks if the caller of the function is the StabilityPool address. It does this by using the require() function to check if the msg.sender (the address of the caller) is equal to the stabilityPoolAddress. If the condition is not met, an error message is thrown. (autogenerated documentation)
_requireCallerIsTroveMorSP() :
This function is an internal view function that checks whether the caller of the function is either the TroveManager or the StabilityPool. If the caller is not either of these two, then the function will throw an error. This function is used to ensure that only the TroveManager or the StabilityPool can call certain functions. (autogenerated documentation)
name() :
This function is an external view override that returns a string memory. It is used to retrieve the name of the contract, which is stored in the _NAME variable. The function is declared as external view, meaning that it can be called from outside the contract, but it does not modify the state of the contract. (autogenerated documentation)
symbol() :
This function is an external view function that returns the symbol of the token. It is used to get the symbol of the token from outside the contract. The function does not modify the state of the contract and does not require any input parameters. It simply returns the value of the _SYMBOL variable, which is a string memory variable that stores the symbol of the token. (autogenerated documentation)
decimals() :
This function is an external view override that returns the number of decimals associated with a particular token. This is useful for displaying the token's value in a user-friendly way. For example, if the token has 18 decimals, the function will return 18, and the token's value can be displayed as 0.0000000000000001 instead of just 1. (autogenerated documentation)
version() :
This function is an external view function that returns a string memory containing the version of the contract. It does not modify the state of the contract and does not require any input parameters. The function simply returns the value of the _VERSION variable, which is a string memory containing the version of the contract. (autogenerated documentation)
permitTypeHash() :
This function returns the bytes32 hash of the permit type. This hash is used to identify the type of permit that is being used. It is used to ensure that the permit is valid and that the user has the correct permissions to access the permit. The hash is generated by hashing the permit type and is used to verify the authenticity of the permit. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i erc20-token-with-blacklist
copy icon

Recent Use

🍞 0x705c downloaded
🥐 0xbad8 downloaded
🥖 0x33AC downloaded
🥨 0x70F8 downloaded

Last Publish

9/26/2022

Version

1.0.0

Creator

Liquity

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