EntangleDexV2
Inherits: Initializable, UUPSUpgradeable, AccessControlUpgradeable, ReentrancyGuardUpgradeable
This contract facilitates the exchange of LP tokens for synthetic assets and vice versa. It integrates with the MasterSynthChef and SynthFactory contracts to manage LP token staking and synthetic asset creation.
State Variables
ADMIN_ROLE
Constant that defines Admin role
sidInfo
Mapping to store SID information
masterSynthChef
Entangle MasterChef address
synthFactory
Entangle SynthFactory address
Functions
isPausedSID
Modifier to check if a SID is paused.
onlyLpStakingSid
Modifier to check if a SID is an LP staking synth.
onlyHomeChain
Modifier to check if a SID belongs to the home chain.
constructor
initialize
Initializes the contract.
Parameters
_authorizeUpgrade
setPausedSid
Sets the pause state of a SID.
Parameters
setSynthFactory
Sets the SynthFactory contract address.
Parameters
setMasterSynthChef
Sets the MasterSynthChef contract address.
Parameters
getDexSynthTokenBalance
Gets the balance of Dex Synth token for a given SID.
Parameters
Returns
buyForLP
Buys LP tokens for a given SID.
Parameters
sellForLP
Sells LP tokens for a given SID.
Parameters
sellForLPAndWithdraw
Sells LP tokens for a given SID and withdraws them.
Parameters
Returns
convertLpToSynth
Converts LP tokens to synthetic tokens for a given SID.
Parameters
Returns
convertSynthToLp
Converts synthetic tokens to LP tokens for a given SID.
Parameters
Returns
Events
LPStackingSynthSell
SynthFactorySetted
SynthStateChanged
MasterChefSetted
DepositLP
Errors
EntangleDex__E1
paused sid : EntangleDexV2
EntangleDex__E2
Non liquidable sid : EntangleDexV2
EntangleDex__E3
Not an lp staking synth : EntangleDexV2
EntangleDex__E4
Not the home network for synth : EntangleDexV2
EntangleDex__E5
zero amount : EntangleDexV2
EntangleDex__E6
crossChain operations are not allowed for this sid
Structs
SidInfo
Struct to store SID information
Last updated