-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from valory-xyz/lp_bridging_info
doc and chore: Adding LP bridging info
- Loading branch information
Showing
9 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# LP Token Bridging | ||
|
||
In a table below one can find LP token addresses on corresponding chains and bridges to transfer them from L2 to L1 | ||
in order to participate in bonding. | ||
|
||
| Network | Exchange | Pool Symbol | LP Token Address on Native Chain | Bridged LP Token Address on Ethereum | Bridge (OLAS from Chain to Ethereum) | | ||
|-------------|----------------------------------------------------------------------------------------------------------------------------|-------------|------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------| | ||
| Ethereum | [Uniswap](https://app.uniswap.org/swap?inputCurrency=ETH&outputCurrency=0x0001a500a6b18995b03f44bb040a5ffc28e45cb0) | OLAS-WETH | [0x09D1d767eDF8Fa23A64C51fa559E0688E526812F](https://etherscan.io/token/0x09d1d767edf8fa23a64c51fa559e0688e526812f) | N/A | N/A | | ||
| Gnosis | [Balancer](https://app.balancer.fi/#/gnosis-chain/pool/0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985000200000000000000000067) | OLAS-WXDAI | [0x79C872Ed3Acb3fc5770dd8a0cD9Cd5dB3B3Ac985](https://gnosisscan.io/token/0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985) | [0x27df632fd0dcf191C418c803801D521cd579F18e](https://etherscan.io/token/0x27df632fd0dcf191c418c803801d521cd579f18e) | [OmniBridge](https://omni.gnosischain.com/bridge) | | ||
| Polygon PoS | [Balancer](https://app.balancer.fi/#/polygon/pool/0x62309056c759c36879cde93693e7903bf415e4bc000200000000000000000d5f) | OLAS-WMATIC | [0x62309056c759c36879Cde93693E7903bF415E4Bc](https://polygonscan.com/token/0x62309056c759c36879cde93693e7903bf415e4bc) | [0xf9825A563222f9eFC81e369311DAdb13D68e60a4](https://etherscan.io/token/0xf9825A563222f9eFC81e369311DAdb13D68e60a4) | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) | | ||
| Solana | [Orca](https://www.orca.so/liquidity?address=5dMKUYJDsjZkAD3wiV3ViQkuq9pSmWQ5eAzcQLtDnUT3) | OLAS-WSOL | TBC | TBC | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) | | ||
| Arbitrum | [Balancer](https://app.balancer.fi/#/arbitrum/pool/0xaf8912a3c4f55a8584b67df30ee0ddf0e60e01f80002000000000000000004fc) | OLAS-WETH | [0xAF8912a3C4f55a8584B67DF30ee0dDf0e60e01f8](https://arbiscan.io/token/0xaf8912a3c4f55a8584b67df30ee0ddf0e60e01f8) | [0x36B203Cb3086269f005a4b987772452243c0767f](https://etherscan.io/token/0x36B203Cb3086269f005a4b987772452243c0767f) | [Wormhole Portal](https://portalbridge.com/advanced-tools/#/transfer) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# LP Token Guide | ||
## UniswapV2 | ||
To illustrate the mechanism, the well-known DAI / wETH pair is used: https://app.zerion.io/tokens/UNI-V2-0xa478c2975ab1ea89e8196811f51a7b7ade33eb11 | ||
|
||
That LP token has the following address: `0xa478c2975ab1ea89e8196811f51a7b7ade33eb11`. | ||
|
||
- Get a description of what is inside the LP token pool, one of the tokens has to be [OLAS](https://etherscan.io/address/0x0001A500A6B18995B03f44bb040A5fFc28E45CB0). | ||
In this example, we consider DAI in place of OLAS. DAI token has the following address: `0x6B175474E89094C44Da98b954EedeAC495271d0F`. | ||
- Open an ETH explorer in a chosen network (here the ETH mainnet is used): https://etherscan.io/token/0xa478c2975ab1ea89e8196811f51a7b7ade33eb11#readContract | ||
- Read the output of methods `token0()`, `token1()`: | ||
- `token0: 0x6B175474E89094C44Da98b954EedeAC495271d0F`, | ||
- `token1: 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`. | ||
In the example, these addresses are DAI and wETH addresses. In the case of OLAS-wETH LP token, these addresses have to match with OLAS and wETH addresses. | ||
- Check the pool address: | ||
- Verification logic (no need to do it every time): | ||
- Open the Uniswap documentation and find its router address: https://docs.uniswap.org/contracts/v2/reference/smart-contracts/router-02. | ||
- On that page, one can find the following text: `UniswapV2Router02 is deployed at 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D address on the Ethereum mainnet, and the Ropsten, Rinkeby, Görli, and Kovan testnets. It was built from commit 6961711.` | ||
- Open the contract reading page: https://etherscan.io/address/0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D#readContract. | ||
- Read the `factory()` method and check that it returns the following address: `0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f`. | ||
|
||
- Open the UniswapV2Factory contract: https://etherscan.io/address/0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f#readContract | ||
- Call the `getPair()` method with `OLAS token address` and `wETH token address` as inputs. In our DAT-wETH examples, the inputs are the following: | ||
- `0x6B175474E89094C44Da98b954EedeAC495271d0F`, | ||
- `0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2`. | ||
- The output will be the LP token address. In this example, this is the following address: `0xA478c2975Ab1Ea89e8196811F51A7B7Ade33eB11`. | ||
- If the address match with the given original LP-token address (in this example, `0xa478c2975ab1ea89e8196811f51a7b7ade33eb11`), everything is correct. | ||
- In correctly created LP token, the first internal transaction must be originated by the UniswapV2Factory address: https://etherscan.io/address/0xa478c2975ab1ea89e8196811f51a7b7ade33eb11#internaltx. | ||
- Optionally, the followign link works for well-known LP tokens: https://v2.info.uniswap.org/pair/0xa478c2975ab1ea89e8196811f51a7b7ade33eb11. | ||
However, the absence of requested token information does not mean there is something wrong with the token. In that case just use the verification described above. |
Submodule forge-std
updated
16 files
+1 −1 | package.json | |
+18 −3 | src/StdChains.sol | |
+14 −2 | src/StdCheats.sol | |
+15 −0 | src/StdInvariant.sol | |
+18 −14 | src/StdJson.sol | |
+50 −3 | src/StdStorage.sol | |
+497 −243 | src/Vm.sol | |
+93 −77 | test/StdAssertions.t.sol | |
+22 −21 | test/StdChains.t.sol | |
+52 −44 | test/StdCheats.t.sol | |
+10 −10 | test/StdError.t.sol | |
+10 −10 | test/StdMath.t.sol | |
+58 −36 | test/StdStorage.t.sol | |
+4 −4 | test/StdStyle.t.sol | |
+28 −28 | test/StdUtils.t.sol | |
+15 −0 | test/Vm.t.sol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"providerName":"gnosis","olasAddress":"0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f","XOLAS_WXDAI_PairAddress":"0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985","XOLAS_WXDAI_PoolId":"0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985000200000000000000000067","vaultAddress":"0xba12222222228d8ba445958a75a0704d566bf2c8"} | ||
{"providerName":"gnosis","olasAddress":"0xcE11e14225575945b8E6Dc0D4F2dD4C570f79d9f","OLAS_WXDAI_PairAddress":"0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985","OLAS_WXDAI_PoolId":"0x79c872ed3acb3fc5770dd8a0cd9cd5db3b3ac985000200000000000000000067","vaultAddress":"0xba12222222228d8ba445958a75a0704d566bf2c8"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"providerName":"polygon","olasAddress":"0xFEF5d947472e72Efbb2E388c730B7428406F2F95","OLAS_WMATIC_PairAddress":"0x62309056c759c36879Cde93693E7903bF415E4Bc","OLAS_WMATIC_PoolId":"0x62309056c759c36879cde93693e7903bf415e4bc000200000000000000000d5f","vaultAddress":"0xba12222222228d8ba445958a75a0704d566bf2c8"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters