relevant tag icon
UniswapV2ERC20
copy icon
Uniswap-Labs
• version 1.0.0
ERC20
Token
DEX

UniswapV2ERC20

ERC-20 token for Uniswap V2. Used to track ownership in Uniswap liquidity pools. When providing liquidity, Uniswap issues this token to the LP in order to track their ownership of the pool. It is based on the IUniswapV2ERC20 interface and uses the SafeMath library for uint operations. It includes standard ERC-20 functions such as approve, transfer, and transferFrom, as well as internal functions for minting, burning, and approving tokens. It also includes a permit function which allows for approval of tokens using a signature, and it is using the EIP-712 for signing purpose. It also uses the chainId from the Ethereum network to set the DOMAIN_SEPARATOR variable for the EIP-712 signing process.

*Visit desktop site to download or deploy

Version

1.0.0

Last Publish

1/13/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
_mint(address) :
This function is used to mint new tokens and add them to the total supply. It takes two parameters, an address to which the tokens should be sent and the amount of tokens to be minted. The total supply is increased by the amount of tokens minted, and the balance of the address to which the tokens were sent is also increased by the same amount. Finally, a Transfer event is emitted to indicate that the tokens have been transferred from the address 0 (the contract) to the specified address. (autogenerated documentation)
_burn(address) :
This function is used to burn a certain amount of tokens from a given address. It subtracts the given value from the balance of the address and from the total supply of tokens. It then emits a Transfer event to indicate that the tokens have been burned. (autogenerated documentation)
_approve(address,address) :
This function is used to approve a spender to transfer a certain amount of tokens from the owner's account. It sets the allowance of the spender to the specified value and emits an Approval event. The owner can then use the allowance to transfer tokens from their account to the spender's account. (autogenerated documentation)
_transfer(address,address) :
This function is a private function that transfers a specified amount of tokens from one address to another. It subtracts the value from the balance of the 'from' address and adds it to the balance of the 'to' address. It also emits a Transfer event to log the transaction. (autogenerated documentation)
approve(address) :
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 value. The function returns true if the approval was successful. (autogenerated documentation)
transfer(address) :
This function is used to transfer a specified amount of tokens from the sender's address to a specified address. It uses the _transfer() function to complete the transfer, which is a built-in function of the ERC20 token standard. The function returns a boolean value of true to indicate that the transfer was successful. (autogenerated documentation)
transferFrom(address,address) :
This function allows a user to transfer tokens from one address to another. It first checks if the sender has the allowance to transfer the tokens, and if so, subtracts the value from the allowance. It then calls the _transfer function to complete the transfer. (autogenerated documentation)
permit(address,address,uint8,bytes32,bytes32) :
This function is used to approve a spender to transfer a certain amount of tokens from an owner's account. It requires the owner to provide a signature, which is used to verify the owner's identity. The signature is generated using the keccak256 hashing algorithm, and the recovered address is compared to the owner's address to ensure that the signature is valid. If the signature is valid, the function will call the _approve function to approve the spender to transfer the specified amount of tokens. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i UniswapV2ERC20
copy icon

Last Publish

1/13/2023

Version

1.0.0

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