A periphery contract for the Cron-Fi V1 Time-Weighted Average Market Maker (TWAMM) pools built upon Balancer Vault. While this contract's interface to the Cron-Fi TWAMM pools increases gas use, it provides reasonable safety checks on behalf of the user that the core contract does not. It is also convenient for users within Etherscan, Gnosis Safe and other contract web interfaces, eliminating the need for the construction of complex Solidity data types that are cumbersome in that environment.
For usage details, see the online Cron-Fi documentation at https://docs.cronfi.com/.
IMPORTANT: Users must approve this contract on the Balancer Vault before any transactions can be used.
This can be done by calling setRelayerApproval on the Balancer Vault contract and specifying
this contract's address.
constructor
constructor(contractIVault_vault,address_libraryAddress,contractICronV1PoolFactory_factory) public
Creates an instance of the Cron-Fi Time-Weighted Average Market Maker (TWAMM) periphery relayer contract.
IMPORTANT: This contract is not meant to be deployed directly by an EOA, but rather during construction of a library contract derived from BaseRelayerLibrary, which will provide its own address as this periphery relayer's library address, LIB_ADDR.
Parameters
Name
Type
Description
_vault
contract IVault
is the Balancer Vault instance this periphery relayer contract services.
_libraryAddress
address
is the address of the library contract this periphery relayer uses to interact with the Vault instance. Note as mentioned above in the "dev" note, the library contract is instantiated first and then constructs this contract with its address, _libraryAddress, as an argument.
_factory
contract ICronV1PoolFactory
is the Cron-Fi factory contract instance.
receive
receive()externalpayable
Do not accept ETH transfers from anyone. The relayer and Cron-Finance Time Weighted Average Market Maker (TWAMM) pools do not work with raw ETH.
NOTE: Unlike other Balancer relayer examples, the refund ETH functionality has been removed to prevent
self-destruct attacks, causing transactions to revert, since Cron-Finance TWAMM doesn't support
raw ETH.