Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
SudoSwap ETH AMM Pair
copy icon
sudoswap
• version 1.0.0
Pair
AMM
ETH

SudoSwap ETH AMM Pair

Pairs are either LSSVMPairEnumerable or LSSVMPairMissingEnumerable depending on whether or not the pair's ERC721 contract supports Enumerable or not. If it doesn't, we implement our own ID set to allow for easy access to NFT IDs in the pool.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

sudoswap

Last Publish

1/27/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
_pullTokenInputAndPayProtocolFee(uint256,uint256) :
This function is used to pull a token input and pay the protocol fee for a given transaction. It first checks that the amount of ETH sent is greater than or equal to the input amount. It then transfers the input amount minus the protocol fee to the asset recipient. If the protocol fee is greater than 0, it checks that the balance of the contract is greater than or equal to the protocol fee, and if so, transfers the protocol fee to the ILSSVMPairFactoryLike contract. (autogenerated documentation)
_refundTokenToSender(uint256) :
This function is used to refund a token to the sender. It takes in an input amount as a parameter and checks if the value of the message sent is greater than the input amount. If it is, it will transfer the difference between the two amounts back to the sender. (autogenerated documentation)
_payProtocolFeeFromPair(uint256) :
This function is used to pay the protocol fee from a given ILSSVMPairFactoryLike. It first checks if the protocol fee is greater than 0, and if it is, it checks if the protocol fee is greater than the balance of the contract. If it is, it sets the protocol fee to the balance of the contract. Finally, it transfers the protocol fee to the given ILSSVMPairFactoryLike. (autogenerated documentation)
_sendTokenOutput(address,uint256) :
This function is an internal override of the _sendTokenOutput function in the ERC20 contract. It is used to transfer a specified amount of tokens from the contract to a specified address. The function checks if the output amount is greater than 0, and if so, it calls the safeTransferETH function to transfer the tokens to the specified address. (autogenerated documentation)
_immutableParamsLength() :
This function returns the length of the immutable parameters stored in the contract. It works by returning the value of the IMMUTABLE_PARAMS_LENGTH constant, which is set when the contract is deployed. (autogenerated documentation)
withdrawAllETH() :
This function allows the owner of a contract to withdraw all of the ETH stored in the contract. It works by calling the withdrawETH() function with the balance of the contract as the argument. (autogenerated documentation)
withdrawETH(uint256) :
This function allows the owner of the contract to withdraw a specified amount of ETH from the contract. It does this by transferring the amount of ETH from the contract to the owner's address. The function also emits an event called TokenWithdrawal, which records the amount of ETH that was withdrawn. (autogenerated documentation)
withdrawERC20(uint256) :
This function allows the owner of a smart contract to withdraw a specified amount of ERC20 tokens from the contract. It does this by using the safeTransfer() function of the ERC20 token contract, which transfers the specified amount of tokens from the contract to the msg.sender (the owner of the contract). (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i sudoswap-pair-eth
copy icon

Last Publish

1/27/2023

Version

1.0.0

Creator

sudoswap

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