StargateSynthChef
(coming soon..)
Inherits: IProtocolSynthChef, Initializable, UUPSUpgradeable, AccessControlUpgradeable, OwnableUpgradeable
A contract for managing interactions with Stargate Finance for yield farming purposes.
This contract provides functionalities to interact with Pancake pools, deposit and withdraw LP tokens, harvest rewards, and more.
State Variables
stargateRouter
Interface of Stargate Router
lpStaking
Interface of LpStaking contract of Stargate ecosystem.
masterChefEnt
Entangle MasterChef address
ADMIN
Role identifier for the admin.
MASTER
Role identifier for the master.
pools
Mapping from Entangle internal pool ID to Stargate pool details.
isPoolInitialized
Mapping to track if a pool is initialized.
Functions
isPoolExist
Modifier to ensure that the LP token exists.
onlyCompounder
Modifier to restrict function access to the Compounder.
initialize
0 - Stargate Router, 1 - ADMIN, 2 - MASTER, 3 - Entangle Master Chef
_authorizeUpgrade
addPool
Add a new pool. Can only be called by the ADMIN.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
|
| Information required to communicate with Stargate. |
reinvest
Provide liquidity to pool and stake LP tokens. Can only be called by the Compounder.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
withdraw
Withdraw LP tokens from farm and remove liquidity. Transfer all to entangle MasterChef. Can only be called by the MASTER.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
|
| Amount of LP tokens to witdraw |
|
|
depositLP
Deposit LP tokens to farm. Can only be called by the MASTER.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
|
| Amount of LP tokens to deposit |
withdrawLP
Withdraw LP tokens from farm and transfer it to entangle MasterChef. Can only be called by the MASTER.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
|
| Amount of LP tokens to withdraw |
harvest
Accrue rewards and transfer it to Compounder. Can only be called by the Compounder.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
getTotalLpBalance
View function to get balance of LP tokens.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
Returns
Name | Type | Description |
---|---|---|
|
| Balance of LP tokens of this contract |
getPoolTokens
View function to get pool tokens addresses.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
Returns
Name | Type | Description |
---|---|---|
|
| array of pool token addresses. |
lpTokenAddress
View function to get address of lp tokens of specific pool.
Parameters
Name | Type | Description |
---|---|---|
|
| Entangle internal poolId |
Errors
StargateSynthChef__E1
StargateSynthChef__E2
StargateSynthChef__E3
StargateSynthChef__NotACompounder
Structs
Pool
Struct representing Stargate pool details.
Last updated