vdAMM Contracts
vdAMM-I.sol
Note
Split reference
This reference file was too long so it is split into multiple chunks. This is chunk number I.
This Solidity file is a contract for a decentralized automated market maker (AMM) with a focus on token swap. It includes interfaces for interacting with WETH, LSDVault, Darknet, and unshETH contract. The main contract, VDAMM, contains functionalities for setting fee, approving new LSD tokens, fee curve logic, and other admin functions. The file also contains several events to log changes in the contract state.
IWETH
This interface is used for interacting with WETH contract to deposit and withdraw funds.
ILSDVault
This interface is used for interacting with LSDVault contract to perform various operations like checking if a token is enabled, getting the target amount, etc.
IDarknet
This interface is used for interacting with Darknet contract to check the price of a token.
IunshETH
This interface is used for interacting with unshETH contract to get the timelock address.
VDAMM
This is the main contract that includes functionalities for setting fee, approving new LSD tokens, fee curve logic, and other admin functions. It also includes several events to log changes in the contract state.
setBaseFee
function setBaseFee(uint256 _baseFeeBps) external
This function is used to set the base fee in the contract.
Parameters
- _baseFeeBps uint256: This is the base fee to be set in basis points.
setDynamicFeeSlopes
function setDynamicFeeSlopes(uint256 _dynamicFeeSlope_x, uint256 _dynamicFeeSlope_x2) external
This function is used to set the dynamic fee slopes in the contract.
Parameters
- _dynamicFeeSlope_x uint256: This is the dynamic fee slope x to be set.
- _dynamicFeeSlope_x2 uint256: This is the dynamic fee slope x2 to be set.
approveNewLsd
function approveNewLsd(address lsdAddress) external
This function is used to approve a new LSD token in the contract.
Parameters
- lsdAddress address: This is the address of the new LSD token to be approved.