Canonical deployer contract for the RMM-01 PrimitiveEngine.
/// @notice Deploys a new Engine contract and sets the `getEngine` mapping for the tokens
/// @param risky Risky token, the underlying token
/// @param stable Stable token, the quote token
function deploy(address risky, address stable) external returns (address engine);
Creates a new Engine contract with immutable parameters
new, and passing in a salt of:
salt: keccak256(abi.encode(risky, stable)).
getEngine mapping is updated with the deployed Engine address. Using
getEngine(risky, stable) will return the Engine address.
Deployed is emitted with the parameters,
The Engine contract does not take constructor parameters, as this would modify the runtime bytecode. Additionally, the
stable are immutable state variables of the Engine, which means they cannot be set outside of the constructor. To set these values in the constructor, but not through the constructor arguments, the new Engine contract will call the Factory's
args state variable to get the
args state variable in the Factory is set prior to the deployment of the new Engine, and deleted after.