Module 8 - About Perps Adapters
Adapters for Perps
This Module is Useful for Understanding the Parifi Adapter which is important for Learning about Perp Adapters. Refer this Repository for Smart Contracts.
Perps Adapter
Welcome to the ParifiFairsale
Smart Contract Tutorial! This Guide will help you Understand the functionality of the ParifiFairsale
Contract, its Purpose, and how to Interact with it. By the end of this Tutorial, you will have a Good Understanding of how to Participate in the Parifi Fairsale for PRF Tokens using this Contract.
-
Contract Structure - The
ParifiFairsale
Contract is Designed to facilitate Participation in the Parifi Fairsale for PRF Tokens. This Contract Leverages theRouterIntentEoaAdapterWithoutDataProvider
from the Router Protocol, ensuring Seamless Integration and Interaction with Parifi. TheParifiFairsale
Contract inherits fromRouterIntentEoaAdapterWithoutDataProvider
and Utilizes various Interfaces and Libraries to ensure Safe and Efficient tToken Transfers.a) RouterIntentEoaAdapterWithoutDataProvider and EoaExecutorWithoutDataProvider: Contracts from the Router Protocol.
b) IERC20 and SafeERC20: Interface and Library for ERC20 Token Operations.
c) Errors: Utility Contract for Standardized Error messages.
d) Interfaces: The Contract Defines the
IParifiFairsale
Interface to Interact with the Parifi Fairsale Contract.e) State Variables: The Contract Defines the following Immutable State Variables -
-
parifiFairsaleContract: The Address of the Parifi Fairsale Contract.
-
stable: The Address of the Stable Token accepted by the Parifi Fairsale Contract.
-
-
Functions -
a) constructor() - The Constructor initializes the Contract with the addresses of the Native Token, Wrapped Native Token, and Parifi Fairsale Contract.
b) name() - Returns the name of the Contract.
c) execute() - Executes the Deposit Operation by Parsing the Input Data, Transferring the required amount of Tokens, and Calling the
_depositIntoParifi
function.d) _depositIntoParifi() - Handles the actual Deposit of Funds into the Parifi Fairsale Contract.
e) parseInputs() - Parses the Input Data.
f) ExecutionEvent() - Emitted when an execution Occurs.
-
Usage - To use the
DexSpanAdapter
, Deploy the Contract with the required Parameters --
Deploying the Contract - To Deploy the
ParifiFairsale
Contract, you will need to Provide the Addresses of the Native Token, Wrapped Native Token, and Parifi Fairsale Contract. -
Supplying Funds - To Participate in the Parifi Fairsale using this Contract, Call the execute function with the appropriate Input Data, including the recipient and Amount. For Example -
-
Conclusion
The ParifiFairsale
Contract Simplifies the Process of Participating in the Parifi Fairsale for PRF Tokens. By Understanding and following this Tutorial, you should be able to Interact with the Contract effectively and Leverage its functionality to Manage your assets in the Fairsale.