diff --git a/docs/guides/create-strategy.mdx b/docs/guides/create-strategy.mdx
index 6676837..cb0ba3e 100644
--- a/docs/guides/create-strategy.mdx
+++ b/docs/guides/create-strategy.mdx
@@ -4,70 +4,142 @@ title: Create a Strategy
custom_edit_url: https://github.com/EnsoFinance/enso-docs/blob/main/docs/guides/create-strategy.mdx
---
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
-##### Build a permissionless Auction House with the Enso protocol
+##### Create an Enso strategy and open it up for investment from other Enso users
---
-Enso has created a [Github Repo](https://github.com/EnsoFinance/create-strategy) that makes it easy for anyone to launch their own auction house.
-Compatible with any ERC-721 token contract, quickly list and sell NFTs using the Enso Auction House smart contract.
-
## Getting Started
-
-
-
-```bash
-yarn create next-app project-name -e https://github.com/EnsoFinance/create-strategy
+To create a strategy, a manager must first decide on a number of parameters to initialize their strategy. Every strategy is also an ERC-20, so the manager has to decide on the `name` (e.g. Awesome Successful Strategy) and `symbol` (e.g. ASS). Additionally, the manager will have to determine the intitial state of the strategy. There are a number of values that are used by the strategy to restrict the behaviour of the manager so that users know exactly what risks or costs are associated with investing in the strategy. The `InitialState` object is defined like so:
+
+```typescript
+type InitialState = {
+ timelock: BigNumber
+ rebalanceThreshold: BigNumber
+ rebalanceSlippage: BigNumber
+ restructureSlippage: BigNumber
+ performanceFee: BigNumber
+ social: boolean
+ set: boolean
+}
```
-
-
-
-
-```bash
-npx create-next-app project-name -e https://github.com/EnsoFinance/create-strategy
+The following table gives a description of each value:
+
+| Parameter | Description | Possible values |
+| ----------|-------------|----------------:|
+| timelock | The amount of time (in seconds) that must pass between a manager initiating a state change (such as changing any of the following values or restructuring the strategy) and finalizing it in the strategy. This gives investors time to exit a strategy in case of objectionable changes. The `timelock` value is ignored in private strategies. | 0+ |
+| rebalanceThreshold | The percentage (`rebalanceThreshold/1000`) that a token needs to be out-of-balance from it's intended balance before a manager is able to call `rebalance` on the contract. A low rebalance threshold means that a strategy can be rebalanced when there is very little change in the strategy's token distribution. However, frequent unnecessary rebalances could cause considerable value loss due to slippage. | 0-1000 |
+| rebalanceSlippage | The percentage (`rebalanceSlippage/1000`) that the strategy value may slip down to due to a `rebalance` call. The lower the slippage value, the higher risk of value loss to the strategy. However, some slippage is inevitable (such as due to DEX fees and disparity between the oracle price and market spot price) and consequently there always needs to be some room for legitimate slippage | 0-1000 |
+| restructureSlippage | Same as `rebalanceSlippage` except it's the slippage value that is checked during a `restructure` call which is expected to have more slippage than a `rebalance` call since restructuring will sometimes involve liquidating all the tokens in a strategy. Consequently, one would expect `restructureSlippage` to be lower than `rebalanceSlippage`. | 0-1000 |
+| performanceFee | The fee that is distributed to the manager and Enso stakers based on the increase in the value of the strategy tokens. The earnings are split 70% / 30% in favour of the manager. The fee is received via the inflation of strategy tokens and so issuance of the fee causes a small drop in token value. Performance fees can only be charged on social strategies. | 0-1000 |
+| social | A boolean that allows other users to deposit into the strategy. While private strategies don't allow depositing by anyone other than a manager, they always allow token holders to withdraw. So a manger could still mint tokens in a private strategy and then sell them on a secondary market such as Uniswap or Sushi. This value can be changed from `false` to `true` at a later time by calling `openStrategy`, but it cannot be changed back. | `true` or `false` |
+| set | A boolean that restricts restructuring of a strategy. If set to true, a manager will be unable to call `restructure` and so they won't be able to change to tokens or the relative token balance of the strategy. This value can be changed from `false` to `true` at a later time by calling `setStrategy`, but it cannot be changed back. | `true` or `false` |
+
+Most importantly, the manager needs to define the composition of the strategy, i.e. what tokens are in the strategy, what percentage of the strategy value should be held in each token, and the trading paths necessary to get into the token position. This is done by passing an array of `StrategyItem` objects:
+
+```typescript
+type StrategyItem = {
+ item: string
+ percentage: BigNumber
+ data: TradeData
+}
+
+type TradeData = {
+ adapters: string[]
+ path: string[]
+ cache: string
+}
```
-
-
-
-
-The application accepts the below environment variables. You will need to specify the network ID along with either a `Curator Address` or a `Contract Address`.
-Once you have created your repo locally, make sure to install all dependencies by running yarn.
-
-Next, modify the values below in the .env file:
-
+The following table gives a description of each value:
+
+| Parameter | Description | Possible values |
+| ----------|-------------|----------------:|
+| item | The address of the ERC-20 token that will be held by the strategy | Ethereum address |
+| percentage | The percentage (`percentage/1000`) of the strategy's total value that this token will comprise. | 0-1000 |
+| adapters | An array of approved adapter addresses. Each convsersion from one token (e.g. WETH) into another (e.g. DAI) requires a an adapter (e.g. UniswapV3Adapter). Multiple adapters are used for multi-hop trades. | Ethereum address array |
+| path | An array of token addresses that represent intermediary steps on a multi-hop trade. If the trade is simply going from WETH to another token on an exchange, it likely doesn't need multiple hops and therfore this array can be empty. | Ethereum address array |
+| cache | A flexible bytes value for advanced use cases such as leveraged token positions | Hex string |
+
+There are a few rules in order to successfully define the StrategyItem array:
+1. The percentages of all the StrategyItems must add up to 1000, any more or less and call will fail.
+2. Address `0x00...00` and `0xFF...FF` are reserved and cannot be passed in the `StrategyItem.item` parameter.
+3. In order to cheaply check that there are no duplicate tokens in the contract, we require that the StrategyItems are ordered by address from smallest to largest.
+
+Finally, once a strategy is deployed and initialized, any funds sent during the `createStrategy` call will need to be converted into the strategy's underlying token positions. So the manager will need to pass the address of the `Router` that will handle all the trading logic. If the router used is the `GenericRouter`, the manager will also need to pass the multicall `bytes` data that will handle all the trading logic.
+
+You can see it all come together in the following code:
+
+```typescript
+// Define ERC-20 metadata
+const name = 'Awesome Successful Strategy'
+const symbol = 'ASS' // Too cheeky?
+
+// Define initial state
+const timelock = BigNumber.from('604800') // 1 Week
+const rebalanceThreshold = 50 // 5%
+const rebalanceSlippage = 995 // 99.5%
+const restructureSlippage = 990 // 99%
+const performanceFee = 50 // 5%
+const social = true
+const set = false
+
+const initialState = {
+ timelock,
+ rebalanceThreshold,
+ rebalanceSlippage,
+ restructureSlippage,
+ performanceFee,
+ social,
+ set
+}
+
+// Define strategy composition
+const daiItem = {
+ item: dai.address,
+ percentage: 50,
+ data: {
+ adapters: [uniswapV3Adapter.address],
+ path: [],
+ cache: '0x'
+ }
+}
+const wbtcItem = {
+ item: wbtc.address,
+ percentage: 50,
+ data: {
+ adapters: [uniswapV3Adapter.address],
+ path: [],
+ cache: '0x'
+ }
+}
+const strategyItems = [daiItem, wbtcItem].sort((a, b) => {
+ // Convert addresses to number
+ const aNum = BigNumber.from(a.item)
+ const bNum = BigNumber.from(b.item)
+ return aNum.gt(bNum) ? 1 : -1 // Sort strategy items
+})
+
+// Create strategy
+const strategyFactoryContract = new ethers.Contract(
+ strategyFactoryAddress,
+ StrategyProxyFactory.abi,
+ signer
+)
+const tx = await strategyFactoryContract.createStrategy(
+ managerAddress,
+ name,
+ symbol,
+ initialState,
+ strategyItems,
+ loopRouterAddress, // A basic router with on-chain trading logic
+ '0x' // No data needs to be sent to router
+)
+const receipt = await tx.wait()
+
+// Get strategy address from events
+const strategyAddress = receipt.events.find(
+ (ev: Event) => ev.event === 'NewStrategy'
+).args.strategy
```
-NEXT_PUBLIC_APP_TITLE=[default app title]
-
-NEXT_PUBLIC_DEFAULT_DESCRIPTION=[default meta description]
-
-NEXT_PUBLIC_BASE_URL=[production-url]
-
-# NETWORK ID: Ethereum Mainnet(1) Rinkeby Testnet(4)
-
-NEXT_PUBLIC_NETWORK_ID=1
-
-NEXT_PUBLIC_CURATORS_ID=[The address of a curator or NFT creator]
-
-NEXT_PUBLIC_TARGET_CONTRACT_ADDRESS=[the address of the NFT contract]
-```
-
-Run `yarn dev` to run the development server locally at `localhost:3000`
-
-## Going Live
-
-The easiest way to deploy your auction house is to use the [Vercel Platform](https://vercel.com/).
-Check out the [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. Don't forget to update the necessary environment variables.
-
-## Make it Yours
-This repo builds off of [Enso's NFT Components](../developer-tools/nft-rendering/introduction), you can go about customizing the components by viewing the details [here.](https://EnsoFinance.github.io/nft-components/?path=/story/introduction--page)
-Feel free to leave feedback in the repository’s [issues](https://github.com/EnsoFinance/create-strategy).
+Congratulations, you've successfully created an Enso strategy!
diff --git a/docs/guides/manage-strategy.mdx b/docs/guides/manage-strategy.mdx
index 8e1613a..47aa74a 100644
--- a/docs/guides/manage-strategy.mdx
+++ b/docs/guides/manage-strategy.mdx
@@ -4,172 +4,75 @@ title: Manage a Strategy
custom_edit_url: https://github.com/EnsoFinance/enso-docs/blob/main/docs/guides/manage-strategy.mdx
---
-##### Programmatically mint an NFT on Enso
-
+##### Manage your Enso strategy
---
-To create new Enso NFT using the ZDK, you must call the `mint` function. The `mint` function on a `Enso` instance expects two parameters: `MediaData` and `BidShares`
+The main responsibility of the manager is keep their strategy balanced as the prices of the underlying tokens changes. One of the primary differences between Enso and AMM's such as Uniswap or Balancer is that it avoids impermanent loss by manually rebalancing at the discretion of the manager. A skilled manager will choose the right times to rebalance, and the right time to *refrain* from rebalancing, in order to maximize their gains.
-## MediaData
+### Rebalance
+Calling rebalance is a relatively simple process. The manager just needs to define what router they would like to use to handle the trading logic. For simple use-cases, they can pass the `LoopRouter` address and no `bytes` data and all the trading logic will be handled on-chain. For advanced users, we provide the `GenericRouter` which allows the manager to define each trade off-chain and then pass a `Call[]` array that has been encoded into `bytes` to the `data` parameter of the `rebalance` function. While use of the `GenericRouter` is often cheaper, it comes with a higher risk of failed transactions due to encoding errors or stale price data.
```typescript
-const metadata = {
- version: 'enso-20210604', // The version of metadata you are generating
- name: someName,
- description: someDescription,
- mimeType: someMimeType, // Media type: audio, image, etc etc
- image: "", // IPFS url for a preview image of the media on opensea
-}
+const controllerContract = new ethers.Contract(
+ controllerAddress,
+ StrategyController.abi,
+ signer
+)
+await controllerContract.rebalance(
+ strategyAddress,
+ loopRouterAddress,
+ '0x'
+)
```
-To construct the metadata for a zNFT, use the `generateMetadata` function defined in `metadata.ts`.
-For more info visit the [Generate Metadata](../developer-tools/zdk/metadata#generate-metadata) section.
-
-### URIs
-
-- **tokenURI:** A pointer to where a zNFT's content is hosted
-- **metadataURI:** A pointer to where a zNFT's metadata is hosted
-
-Enso strongly recommends hosting both the content and metadata on a _decentralized_ storage provider such as [IPFS](https://ipfs.io/) or [arweave](https://www.arweave.org/).
-
-### Hashes
-
-- **contentHash:** A `sha256` hash of the content the zNFT's represents
-- **metadataHash:** A `sha256` hash of the zNFT's metadata
-
-It is imperative that this hash is correct, because once it is written to the
-blockchain it **cannot** be changed. To generate this hash use any of the sha256 utils defined in the [ZDK utils](../developer-tools/zdk/utility#hashing-utilities).
-
-#### Example
+### Restructure
+A restructure is a restricted action. What this means is that there is a delay between initiating a restructure and finalizing the new structure in the strategy. This delay gives investors a chance to exit the strategy in case they don't like the proposed changes. The first step is to propose a new `StrategyItem[]` array:
```typescript
-import { constructMediaData, sha256FromBuffer, generateMetadata } from '@ensolabs/zdk'
-
-const metadataJSON = generateMetadata('enso-20210604', {
- description: '',
- mimeType: 'text/plain',
- name: '',
- // to make token work with opensea previews:
- // include {image: "preview_image_ipfs"}
- // and {animation: "preview_video_audio_ipfs"} if there is a video or audio associated
- // to show both an audio player and image,
- // include the animation as audio and image as the poster image
- version: 'enso-20210604',
-})
-
-const contentHash = sha256FromBuffer(Buffer.from('Ours Truly,'))
-const metadataHash = sha256FromBuffer(Buffer.from(metadataJSON))
-const mediaData = constructMediaData(
- 'https://ipfs.io/ipfs/bafybeifyqibqlheu7ij7fwdex4y2pw2wo7eaw2z6lec5zhbxu3cvxul6h4',
- 'https://ipfs.io/ipfs/bafybeifpxcq2hhbzuy2ich3duh7cjk4zk4czjl6ufbpmxep247ugwzsny4',
- contentHash,
- metadataHash
+await controllerContract.restructure(
+ strategyAddress,
+ strategyItems
)
```
-## BidShares
+All data will get cached in the contract and the timelock will be initiated. The manager must wait for `timelock` seconds to pass before they may finalize the structure. During this time investors may exit if the don't like the new structure.
-The `BidShares` type is composed of three fields:
+Since the StrategyItems are already cached, the manager just needs to send the router address and any necessary data to the `finalizeStructure` function.
```typescript
-type DecimalValue = { value: BigNumber }
-
-type BidShares = {
- owner: DecimalValue
- prevOwner: DecimalValue
- creator: DecimalValue
-}
+await controllerContract.finalizeStructure(
+ strategyAddress,
+ loopRouterAddress,
+ '0x'
+)
```
-Each field represents the share that each stakeholder of a zNFT has on the **next** accepted bid. At the
-time of mint, the indivduals bid shares (creator, owner, prevOwner) **must** sum to 100.
+This function will set the new structure in the Strategy contract and then make the necessary trades to reposition the strategy into the new composition.
-- **owner:** The equity (%) the current owner gets from the next accepted bid
-- **prevOwner:** The equity (%) the previous owner gets from the next accepted bid
-- **creator:** The immutable, perpetual equity (%) the creator gets from each accepted bid
-
-#### Example
-
-The enso Media Contract allows for 18 decimals of precision. To simplify precision, we created the `constructBidShares` method with accepts JS `numbers` and converts them to `ethers` `BigDecimal` types rounded to the **fourth** decimal.
+### Update State
+Similar to `restructure`, the `updateValue` function is also restricted by the timelock. This allows a manager to initiate the change of one of the strategy's state variables.
```typescript
-import { constructBidShares } from '@ensolabs/zdk'
+enum TIMELOCK_CATEGORY {
+ RESTRUCTURE,
+ REBALANCE_THRESHOLD,
+ REBALANCE_SLIPPAGE,
+ RESTRUCTURE_SLIPPAGE,
+ TIMELOCK,
+ PERFORMANCE
+}
-const bidShares = constructBidShares(
- 10, // creator share
- 90, // owner share
- 0 // prevOwner share
+await controllerContract.updateValue(
+ strategyAddress,
+ TIMELOCK_CATEGORY.REBALANCE_THRESHOLD, // 1
+ 100, // 10%
)
```
-## Complete Minting Code
+The function will fail if the manager passes `0` for the timelock category. This value represent a restructure, which is updated using the `restructure` function.
-```typescript
-import { constructMediaData, sha256FromBuffer, generateMetadata, isMediaDataVerified, enso } from '@ensolabs/zdk'
-
-async function uploadToDecentralizedStorage(data: Buffer) {
- // function that uploads buffer to decentralized storage
- // and returns url of uploaded file from a gateway.
- return 'https://ipfs.io/ipfs/CID';
-}
+After the timelock has passed, the manager may call `finalizeValue` to finalize it.
-async function mintZNFT({
- enso: typeof enso,
- content: Buffer,
- mimeType: string,
- name: string,
- description: string,
- previewImageUrl?: string
- animationUrl?: string
-}) {
-
- const metadataJSON = generateMetadata('enso-20210604', {
- description,
- mimeType: 'text/plain',
- image: previewImageUrl,
- animation_url: animationUrl,
- name,
- version: 'enso-20210604',
- })
-
- const contentURI = await uploadToDecentralizedStorage(content);
- const metadataURI = await uploadToDecentralizedStorage(Buffer.from(metadataJSON));
-
- const contentHash = sha256FromBuffer(content);
- const metadataHash = sha256FromBuffer(Buffer.from(metadataJSON));
- const mediaData = constructMediaData(
- contentURI,
- metadataURI,
- contentHash,
- metadataHash
- );
-
- // Verifies hashes of content to ensure the hashes match
- const verified = await isMediaDataVerified(mediaData);
- if (!verified){
- throw new Error("MediaData not valid, do not mint");
- }
-
- // BidShares should sum up to 100%
- const bidShares = constructBidShares(
- 10, // creator share percentage
- 90, // owner share percentage
- 0 // prevOwner share percentage
- );
-
- const tx = await enso.mint(mediaData, bidShares);
- return new Promise((resolve) => {
- // This listens for the nft transfer event
- enso.media.on(
- "Transfer",
- (from: string, to: string, tokenId: BigNumber) => {
- if (
- from === "0x0000000000000000000000000000000000000000" &&
- to === tx.from.address
- ) {
- promise.resolve(tokenId);
- }
- });
- });
-}
+```typescript
+await controllerContract.finalizeValue(strategyAddress)
```
diff --git a/docs/guides/vampire-attack.mdx b/docs/guides/vampire-attack.mdx
index f3fa8ed..dc29bb1 100644
--- a/docs/guides/vampire-attack.mdx
+++ b/docs/guides/vampire-attack.mdx
@@ -15,91 +15,76 @@ custom_edit_url: https://github.com/EnsoFinance/enso-docs/blob/main/docs/guides/
First introduced by [SushiSwap](https://sushi.com/) to liquidity providers of [UniSwap](https://uniswap.org/) to migrate their liquidity over to Sushi through token and community incentivization.
-:::note
-
- rP: Receiving platform(e.g. Enso, Sushiswap)
- sP: Sending platform(E.g. Tokensets, UniSwap)
- U : User that provides liquidity
- LPt : Liquidity Pool Token
-
-:::
-
-**Steps for migration**
-> 1. U stakes sP LPt on rP
-2. rP publicly notifies of migration date
-3. rP migrates LPt from sP
- 1. rP uses approval of U LPt
- 2. burns U LPt from sP
- 3. obtains underlying tokens from LPt
- 4. creates 1:1 replication of LPt on rP
- 5. deposits underlying LPt into rP liquidity pool
- 6. U gets LPt token from rP
-4. rP activates retroactive distribution based upon TVL migrated
-
-Following this method ensures that platforms continuously have to be at the cutting edge, and build products that their users want. As well as having token incentives aligned with community needs, and governance of the product.
-
-
#### Who is Enso vampire attacking?
-| Tables | Cool |
-| ------------- |-----:|
-| [Tokensets](https://tokensets.com/) | $520,360,000 |
-| [IndexCoop](https://www.indexcoop.com/) | $466,880,000 |
-| [Indexed](https://indexed.finance/) | $14,500,000 |
-| [PieDAO](https://www.piedao.org/) | $16,500,000 |
-| [dHedge](https://www.dhedge.org/) | $21,700,000 |
-| [PowerPool](https://powerpool.finance/) | $19,000,000 |
+| Platform | TVL | Adapter Address |
+| ---------|------|----------------:|
+| [Tokensets](https://tokensets.com/) | $520,360,000 | |
+| [IndexCoop](https://www.indexcoop.com/) | $466,880,000 | |
+| [Indexed](https://indexed.finance/) | $14,500,000 | |
+| [PieDAO](https://www.piedao.org/) | $16,500,000 | |
+| [dHedge](https://www.dhedge.org/) | $21,700,000 | |
+| [PowerPool](https://powerpool.finance/) | $19,000,000 | |
// TODO: full list of pools available
+**Steps for migration**
+> 1. Enso deploys the liquditymigration contract, setting the migration date.
+2. User stakes the liqudity pool token from the competing platform in the liquidity-migration contract.
+3. Enso migrates the liquidity pool token from the competing platform:
+ 1. An Enso strategy is created that replicates the LP of the competing platform.
+ 2. The 'withdraw' function is called and the LP token is burned.
+ 3. Enso receives the LP's underlying tokens.
+ 4. Deposits underlying tokens into the equivalent Enso strategy.
+ 5. User gets tokens representing their share in the Enso strategy.
+4. Enso activates retroactive distribution of Enso tokens based upon TVL migrated
+
#### Staking
-```
+The first step for a user to migrate their liquidity from a competing platform is to stake the liquidity pool tokens from the pool they want to migrate from. First they must approve the liquidity-migration contract to transfer their LP tokens:
+```typescript
+const poolContract = new ethers.Contract(
+ poolAddress,
+ ERC20.abi,
+ signer
+)
+await poolContract.approve(
+ liquidityMigrationAddress,
+ amount
+)
```
-
-
-
-#### Migration
-
-
-
-#### Incentivization
-
-
-
+Then the user calls the `stake` function on the liquidity migration contract:
```typescript
-import { useWeb3React } from '@web3-react/core'
-
-function MyComponent() {
- const { library, chainId } = useWeb3React()
- // library is a ethers provider/signer instance
- // Ethereum Mainnet (1) Rinkeby (4) for the chainId
-
- const auctionHouse = useMemo(() => {
- if (library && chainId) {
- return new AuctionHouse(library.getSigner(), chainId)
- }
- }, [library, chainId])
- return auctionHouse ? (
-
- ) : (
-
Please connect wallet
- )
-}
+const liquidityMigrationContract = new ethers.Contract(
+ liquidityMigrationAddress,
+ LiquidityMigration.abi,
+ signer
+)
+await liquidityMigrationContract.stake(
+ poolAddress,
+ amount,
+ platformAdapterAddress
+)
```
-#### Hosted URLs
+#### Migration
-If you want to allow easy bidding and listing of NFTs, Enso supports hosted urls where the user can interact with the [enso.finance](https://www.enso.finance/)
-interface without you needing to setup any wallet login.
+After the timelock period has passed users will be able to migrate their liquidity to a new Enso strategy. To do this, the user must call the `migrate` function in the liquidity migration contract:
```typescript
-https://enso.co/collections/{TOKEN_ADDRESS}/{TOKEN_ID}/auction/list
-// Lists the given token for an auction house auction
-
-https://enso.co/collections/{TOKEN_ADDRESS}/{TOKEN_ID}/auction/bid
-// Allows the user to bid on the active auction for the given token
+const liquidityMigrationContract = new ethers.Contract(
+ liquidityMigrationAddress,
+ LiquidityMigration.abi,
+ signer
+)
+await liquidityMigrationContract.migrate(
+ poolAddress,
+ platformAdapterAddress,
+ strategyAddress,
+ slippage
+)
```
+This will burn the other platform's LP tokens, mint Enso strategy tokens and send them to the user.
diff --git a/docs/smart-contracts/token/token-contract.mdx b/docs/smart-contracts/token/token-contract.mdx
index 7b0e6c8..c348255 100644
--- a/docs/smart-contracts/token/token-contract.mdx
+++ b/docs/smart-contracts/token/token-contract.mdx
@@ -27,10 +27,10 @@ ENSO extends the base [ERC-20 standard](https://eips.ethereum.org/EIPS/eip-20) i
### Audited and open source
-Contract source code can be found in [Github repository](https://github.com/EnsoFinance/ENSO-ETH-Token).
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/ENSO-ETH-Token).
Chainsecurity audit can be found [here](https://github.com/EnsoFinance/ENSO-ETH-Token/blob/main/audits/ChainSecurity_EnsoLabs_Enso_Token_audit.pdf).
-![have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/ENSO-ETH-Token/main/architecture/architecture.png?token=AR3VNP3FS7DKJ7QYEEFWGYLBS7EOS)
+![Have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/ENSO-ETH-Token/main/architecture/architecture.png?token=AR3VNP3FS7DKJ7QYEEFWGYLBS7EOS)
@@ -40,4 +40,4 @@ Chainsecurity audit can be found [here](https://github.com/EnsoFinance/ENSO-ETH-
| **Contract** | **Network** | **Address** |
| ------------ | -------------- | ------------------------------------------ |
| ENSO(ERC20) | Eth Mainnet | 0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7 |
-| ENSO(ERC20) | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
\ No newline at end of file
+| ENSO(ERC20) | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
diff --git a/docs/smart-contracts/token/token-vesting.mdx b/docs/smart-contracts/token/token-vesting.mdx
index ebfa8ac..45b37de 100644
--- a/docs/smart-contracts/token/token-vesting.mdx
+++ b/docs/smart-contracts/token/token-vesting.mdx
@@ -28,7 +28,7 @@ Enso multisig will approve ERC20 tokens to the Vesting contract, and then `regis
### Audited and open source
-Contract source code can be found in [Github repository](https://github.com/EnsoFinance/token-vesting).
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/token-vesting).
Chainsecurity audit can be found [here](https://github.com/EnsoFinance/token-vesting/blob/main/audits/ChainSecurity_EnsoLabs_Enso_Vesting_audit.pdf).
![have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/token-vesting/main/architecture/architecture.png?token=AR3VNP2WDCUIFRYTZVU4QVDBS7FSO)
diff --git a/docs/smart-contracts/vampire-attack/liquidity-migration.mdx b/docs/smart-contracts/vampire-attack/liquidity-migration.mdx
index 59e162d..2176a82 100644
--- a/docs/smart-contracts/vampire-attack/liquidity-migration.mdx
+++ b/docs/smart-contracts/vampire-attack/liquidity-migration.mdx
@@ -5,9 +5,6 @@ sidebar_position: 1
custom_edit_url: https://github.com/EnsoFinance/enso-docs/blob/main/docs/smart-contracts/vampire-attack/liquidity-migration.mdx
---
-import Tabs from '@theme/Tabs'
-import TabItem from '@theme/TabItem'
-
##### Liquidity Migration Contracts for Enso Vampire Attack
---
@@ -16,103 +13,22 @@ import TabItem from '@theme/TabItem'
Refer to [Vampire attack guide](../../guides/vampire-attack.mdx) prior to reading this documentation.
+## Stake
-Enso NFTs extends the base ERC-721 NFT standard and allows anyone to easliy mint their own NFTs.
-NFTs minted from this contract are known as `zNFTs` (aka cryptomedia) and have a few addtional characterists.
-
-##### Enso NFTs vs Regular NFTs
-
-- zNFTs separate the content from the metadata by having both a `metadataURI` and a `contentURI`
-- zNFTs store a hash of both the metadata and the content
-- The `contentURI` and `metadataURI` linking to external storage can be updated, but a zNFT's metadata and content hashes can not
-
-##### Enso NFTs are composed of two contracts
-
-- The `Media` contract which mints and stores token data
-- The `Market` contract which allows for built-in market functionality for zNFTs.
-
-![have a look](https://raw.githubusercontent.com/EnsoFinance/liquidity-migration/master/architecture/liquidityMigrationArchitecture.png?token=AR3VNP4YVFTG3A77UMGGP23BS7MB6)
-
-The source code for both contracts can be found in this [Github repository](https://github.com/EnsoFinance/core).
-
-### Media and Market Addresses
-
-| **Contract** | **Network** | **Address** |
-| ------------ | -------------- | ------------------------------------------ |
-| LiquidityMigration | Eth Mainnet | 0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7 |
-| TokenSetAdapter | Eth Mainnet | 0xE5BFAB544ecA83849c53464F85B7164375Bdaac1 |
-| IndexCoop | Eth Mainnet | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
-| Indexed | Eth Mainnet | 0x85e946e1Bd35EC91044Dc83A5DdAB2B6A262ffA6 |
-| Powerpool | Eth Mainnet | 0x6953190AAfD8f8995e8f47e8F014d0dB83E92300 |
-| PieDAO | Eth Mainnet | 0xE20bd7dC76e09AEBC2A9A732AB6AEE616c5a17Eb |
-| Media | Eth Mainnet | 0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7 |
-| Market | Eth Mainnet | 0xE5BFAB544ecA83849c53464F85B7164375Bdaac1 |
-
-
-
-
-```bash
-yarn add @ensolabs/core
-```
-
-
-
-
-```bash
-npm i -S @ensolabs/core
-```
-
-
-
-
-
-
-## Auction House
-
-The Enso Auction House contract is an open and permissionless system that allows any creator, community, platform or DAO to create and run their own curated auction houses for any ERC-721 NFT.
-
-These auction houses run reserve timed auctions, with special emphasis given to the role of curators. If an owner of an NFT chooses to list with a curator, that curator can charge a curator fee and has to approve any auction before it commences with that curators auction house.
-Anyone is able to run an NFT auction on the protocol with no fee by simply not specifying a curator.
-
-The duration of auction can be set to any length, but if a bid is placed within the last 15 minutes, the countdown will reset back to 15 minutes.
-This 15 minute reset window can continue as many times as necessary until the timer has ended. In addition, every bid must be 5% higher than the current bid amount.
+To take part in the liquidity migration, a user must first stake the token that represents their share in the liquidity pool that they will be migrating from. First, they must call `approve()` on the LP token contract. Then, they need to call `stake()` on the `LiquidityMigration` contract. This function transfers the token to the `LiquidityMigration` contract and stores the `amount` staked in the contract state.
-The source code is available in this [Github repository](https://github.com/EnsoFinance/auction-house).
+## Buy and Stake
-### Auction House Addresses
+If a user does not own the LP token that they want to stake, they are able to call `buyAndStake()` in order first purchase the token then immediately stake it inside the `LiquidityMigration` contract.
-| **Network** | **Address** |
-| -------------- | ------------------------------------------ |
-| Eth Mainnet | 0xE468cE99444174Bd3bBBEd09209577d25D1ad673 |
-| Rinkeby | 0xE7dd1252f50B3d845590Da0c5eADd985049a03ce |
-| Polygon | 0x48F1C97259Dc7f3900965391651693BaeBfd59A2 |
-| Polygon Mumbai | 0x6953190AAfD8f8995e8f47e8F014d0dB83E92300 |
+## Migrate
-
-
+After a waiting period in which the staked tokens are locked, users may migrate their liquidity to an Enso Strategy. To do this, they pass the LP token address, the protocol adapter address, and the strategy address to the `migrate()` function. This function then withdraws the underlying assets from the liquidity pool and deposits them into the Enso Strategy, burning the old LP tokens and minting new Strategy tokens.
-```bash
-yarn add @ensolabs/auction-house
-```
+## Create Strategy
-
-
+To create a strategy that allows other users to migrate their liquidity to, a manager needs to deploy the strategy via the `LiquidityMigration` contract by calling `createStrategy()`. This will deploy a strategy and map it to a specific liqudity pool that other users may migrate from.
-```bash
-npm i -S @ensolabs/auction-house
-```
+### Open source
-
-
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/LiquidityMigration.sol).
diff --git a/docs/smart-contracts/vampire-attack/nft-claiming.mdx b/docs/smart-contracts/vampire-attack/nft-claiming.mdx
index 2b62007..cc4c06f 100644
--- a/docs/smart-contracts/vampire-attack/nft-claiming.mdx
+++ b/docs/smart-contracts/vampire-attack/nft-claiming.mdx
@@ -13,7 +13,7 @@ import TabItem from '@theme/TabItem'
## NFT Claim
-Custom contact, enabling users who have Staked token from 6 victims on [LiquidityMigration contracts](liquidity-migration.mdx) to claim NFT. Each victim has it's own unique NFT, and can be viewed on the [Vampire Attack guide](../../guides/vampire-attack.mdx). When you have staked on [Liquidity Migration Contract](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/LiquidityMigration.sol#L60), you can call `Claim()` on [Claimable](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol#L59) with the associated index/LP token you have staked, and also the adapter address for the victim(addresses can be seen below).
+Custom contact, enabling users who have Staked token from 6 victims on [LiquidityMigration contracts](liquidity-migration.mdx) to claim NFT. Each victim has it's own unique NFT, and can be viewed on the [Vampire Attack guide](../../guides/vampire-attack.mdx). When you have staked on [Liquidity Migration Contract](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/LiquidityMigration.sol#L60), you can call `Claim()` on [Claimable](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol#L59) with the associated index/LP token you have staked, and also the adapter address for the victim(addresses can be seen below).
Claiming is only available prior to migration.
@@ -29,7 +29,7 @@ Claiming is only available prior to migration.
### Open source
-Contract source code can be found in [Github repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol).
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol).
![have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/liquidity-migration/master/architecture/NFTClaimArchitecture.png?token=AR3VNP62MKEP2BDDT7PIPQ3BS7M4C)
@@ -39,4 +39,4 @@ Contract source code can be found in [Github repository](https://github.com/Enso
| **Contract** | **Network** | **Address** |
| ------------ | -------------- | ------------------------------------------ |
| Claimable | Eth Mainnet | 0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7 |
-| Claimable | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
\ No newline at end of file
+| Claimable | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
diff --git a/docs/smart-contracts/vampire-attack/nft-contract.mdx b/docs/smart-contracts/vampire-attack/nft-contract.mdx
index d8a05fa..2df17b0 100644
--- a/docs/smart-contracts/vampire-attack/nft-contract.mdx
+++ b/docs/smart-contracts/vampire-attack/nft-contract.mdx
@@ -26,7 +26,7 @@ Enso extends base [ERC-1155 standard](https://docs.openzeppelin.com/contracts/3.
### Open source
-Contract source code can be found in [Github repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Root1155.sol).
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Root1155.sol).
![have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/liquidity-migration/master/architecture/nftArchitecture.png?token=AR3VNPYF75EJQ6BB74WQ3RLBS7FAS)
@@ -43,7 +43,7 @@ Contract source code can be found in [Github repository](https://github.com/Enso
## NFT Claim
-Custom contact, enabling users who have Staked token from 6 victims on [LiquidityMigration contracts](liquidity-migration.mdx) to claim NFT. Each victim has it's own unique NFT, and can be viewed on the [Vampire Attack guide](../../guides/vampire-attack.mdx). When you have staked on [Liquidity Migration Contract](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/LiquidityMigration.sol#L60), you can call `Claim()` on [Claimable](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol#L59) with the associated index/LP token you have staked, and also the adapter address for the victim(addresses can be seen below).
+Custom contact, enabling users who have Staked token from 6 victims on [LiquidityMigration contracts](liquidity-migration.mdx) to claim NFT. Each victim has it's own unique NFT, and can be viewed on the [Vampire Attack guide](../../guides/vampire-attack.mdx). When you have staked on [Liquidity Migration Contract](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/LiquidityMigration.sol#L60), you can call `Claim()` on [Claimable](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol#L59) with the associated index/LP token you have staked, and also the adapter address for the victim(addresses can be seen below).
Claiming is only available prior to migration.
@@ -59,7 +59,7 @@ Claiming is only available prior to migration.
### Open source
-Contract source code can be found in [Github repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol).
+Contract source code can be found in [GitHub repository](https://github.com/EnsoFinance/liquidity-migration/blob/master/contracts/nft/Claimable.sol).
![have a look at the architecture](https://raw.githubusercontent.com/EnsoFinance/liquidity-migration/master/architecture/NFTClaimArchitecture.png?token=AR3VNP62MKEP2BDDT7PIPQ3BS7M4C)
@@ -69,4 +69,4 @@ Contract source code can be found in [Github repository](https://github.com/Enso
| **Contract** | **Network** | **Address** |
| ------------ | -------------- | ------------------------------------------ |
| Claimable | Eth Mainnet | 0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7 |
-| Claimable | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |
\ No newline at end of file
+| Claimable | Rinkeby | 0x7C2668BD0D3c050703CEcC956C11Bd520c26f7d4 |