BuyAndBurn Contract
Manages the Uniswap V3 LODE/WETH liquidity position, swaps WETH for LODE, and burns purchased tokens.
This contract uses Solidity 0.7.6 (required for Uniswap V3 compatibility). It does not have checked arithmetic by default.
Constructor
constructor(address ownerAddress)
| Parameter | Description |
|---|
ownerAddress | Contract owner (distinct from deployer) |
Core Functions
buynBurn
function buynBurn() public nonReentrant
Swap available WETH for LODE on Uniswap V3 and burn the LODE. Caller receives a 0.33% incentive fee in ETH. Requires initial LP to be created first.
collectFees
function collectFees() public nonReentrant
Collect LP trading fees from the Uniswap V3 position. LODE fees are burned immediately. WETH fees are tracked for future buy-and-burn swaps.
burnLPLode
function burnLPLode() public
Burns all LODE held by the BuyAndBurn contract via Obelisk.burnLPTokens().
createInitialPool
function createInitialPool() public
One-time function to create the LODE/WETH Uniswap V3 pool with the preset price ratio.
createInitialLiquidity
function createInitialLiquidity() public
One-time function to mint the initial full-range LP position. Requires WETH balance.
receive
receive() external payable
Accepts ETH and automatically wraps it into WETH (except when receiving from the WETH contract itself).
Admin Functions
| Function | Description |
|---|
setOwnerAddress(address) | Transfer ownership |
setLodeContractAddress(address) | Set LODE address (one-shot, cannot be reset) |
setGlobalWethBuyAndBurnCap(uint256) | Increase the global WETH cap |
setCapPerSwap(uint256) | Set per-swap WETH cap (minimum 0.01 WETH) |
renounceOwnership() | Remove owner permanently |
View Functions
| Function | Returns |
|---|
getPoolAddress() | Uniswap V3 pool address |
getWethBalance(address) | WETH balance of an address |
getLodeBalance(address) | LODE balance of an address |
getCurrentContractDay() | Current contract day |
getBuyAndBurnFunds() | Available non-fee WETH for buy-and-burn |
getFeesBuyAndBurnFunds() | WETH from collected LP fees |
getTotalWethBuyAndBurn() | Cumulative WETH used (excluding fees) |
getTotalLodeBuyAndBurn() | Cumulative LODE burned from swaps |
getGlobalWethBuyAndBurnCap() | Current global WETH cap |
getWethBuyAndBurnCap() | Current per-swap WETH cap |
getCurrentSqrtPriceX96() | Current pool sqrt price |
getCurrentEthPrice() | Current ETH price in LODE |
getTokenInfo() | LP NFT token ID, liquidity, tick range |