Hey! Quick question. So, I’ve been searching online for a few hours now, regarding an issue I’ve been having. Here is some code I’ve written:
assembly {
pool := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
But, I want to access pool outside of the assembly block. How do I do this? Uniswap does something similar, and, as far as I know, this has worked for them.
assembly {
pair := create2(0, add(bytecode, 32), mload(bytecode), salt)
}
IUniswapV2Pair(pair).initialize(token0, token1);
getPair[token0][token1] = pair;
getPair[token1][token0] = pair; // populate mapping in the reverse direction
allPairs.push(pair);