The WEbdEXNetworkPoolV3 is a key smart contract within the Botmoney platform, developed in Solidity for managing liquidity pools and related financial functions.
Overview
The WEbdEXNetworkPoolV3 is a key smart contract within the WEbdEX platform, developed in Solidity for managing liquidity pools and related financial functions.
Imports and Interfaces
The contract employs the OpenZeppelin library for Ownable functionality, ensuring secure management of ownership. It also interacts with the IWEbdEXStrategiesV3 interface for specific LP token-related operations.
solidityCopy code// SPDX-License-Identifier: MITpragmasolidity ^0.8.18;import"@openzeppelin/contracts/access/Ownable.sol";import"@openzeppelin/contracts/token/ERC20/ERC20.sol";interface IWEbdEXStrategiesV3 {functionlpBurnFrom(address to,address coin,uint256 amount) external;}contractWEbdEXNetworkPoolV3isOwnable {// ... (continuation of the code)
Contract Structure and Key Components
Public Variables and LPToken Structure
solidityCopy code addresspublic webDexPaymentsV3;addresspublic webDexPass;uint16public fee_withdraw;mapping(address=>mapping(address=> LPToken)) internal balances;structLPToken {address coin;uint256 balance; }// ... (continuation of the code)
Events for Activity Logging
solidityCopy code eventExtractLogs(addressindexed from,addressindexed to,string method,uint256 timeStamp,uint256 value,uint256 fee,address user );// ... (continuation of the code)
Constructor and Modifiers
solidityCopy code constructor(address webDexPaymentsV3_,address webDexPass_) { webDexPaymentsV3 = webDexPaymentsV3_; webDexPass = webDexPass_; fee_withdraw =5; }modifieronlyWebDexPaymentsOrWebDexPass() { require(msg.sender == webDexPaymentsV3 || msg.sender == webDexPass, "You must be the WebDexPayments or the webDexPass");
_; }// ... (continuation of the code)
Main Contract Functions
Fee Management and Balance Operations
solidityCopy code functionchangeFeeWithdraw(uint16 amount) publiconlyOwner {// Adjusts the withdrawal fee }functionaddBalance(address to,address coin,uint256 amount,address lpToken,address user,stringmemory method ) externalonlyWebDexPaymentsOrWebDexPass {// Adds balance to the pool }functionwithdraw(address lpToken,uint256 amount,IWEbdEXStrategiesV3 webDexStrategiesV3 ) public {// Allows withdrawals from the pool }// ... (continuation of the code)
Balance Queries
solidityCopy code functiongetBalance(address lpToken) publicviewreturns (uint256) {return_getBalance(msg.sender, lpToken); }functiongetBalanceByWallet(address to,address lpToken ) publicviewonlyOwnerreturns (uint256) {return_getBalance(to, lpToken); }function_getBalance(address to,address lpToken ) internalviewreturns (uint256) {// Returns the balance of a specific address }// ... (continuation of the code)
Conclusion
The WEbdEXNetworkPoolV3 contract plays a vital role in managing liquidity pools and financial operations on the Botmoney platform.