Skip to main content

AREC Port

The standard process of utilizing AREC (Arkreen Renewable Energy Certificate) to offset one's energy consumption is as follows: purchase and redeem AREC NFTs to commit climate actions, or buy and offset ART tokens to commit climate actions. Then, based on the climate action(s), mint a climate badge, which may serve as proof of carbon neutrality for the badge beneficiary.

This process seems too technical and difficult to understand for individuals or institutions, potentially affecting the promotion and popularization of AREC applications and impeding its role in driving the transition to green energy. For ordinary people who have not yet entered the Web3 field and do not possess their own Crypto wallets, the technical threshold for using AREC is quite higher. Even for a large number of projects already in the Web3 domain, quickly integrating green energy carbon reduction features into their projects still involves significant technological complexity.

Therefore, enabling the general public and traditional institutions to easily access AREC applications, participate in, and promote the progress of green energy carbon reduction has become a challenge that needs to be solved. AREC Port offers the solution to this technical challenge.

The AREC Port integrates the entire process from purchasing ART tokens using various crypto tokens, offsetting the ART tokens to generate climate actions, to finally minting a climate Badge based on the climate actions. This process can be completed by ordinary users with one-click operation or by third-party applications with one-line calling.

The following diagram illustrates how individuals and institutions are linked to the AREC ecosystem through AREC Port with open-access AREC Port UI and AREC Port library modules. It also showcases how AREC Port offers a one-stop carbon offset service with the support of underlying smart contracts, including Arkreen Builder, Arkreen DEX, Arkreen Bank, Arkreen ART, Arkreen Badge, and others.

AREC Port position

AREC Port Interface

The primary purpose of the AREC Port is to offer users a one-click interface to complete personal carbon offsetting. The AREC Dapp integrates the features of the AREC Port, serving as the main entry point for users to access various carbon reduction features within the AREC ecosystem.

Additionally, other third-party Web3 applications can also direct their users to the AREC Port UI, enabling them to easily carry out carbon offset operations. AREC Port provides APIs for these Web3 applications to query the status and results of users' carbon offsetting actions

AREC Port Library

AREC Port Library aims to provide basic carbon offsetting services for Web2 and Web3 applications. By integrating the AREC Port Library, these applications can design their own UI tailored to their specific features and needs while utilizing the AREC Port library to complete carbon offset execution for their users.

AREC Port Library is planned to support multiple development frameworks, including NodeJS, React, Vue, React Native, Android, iOS, and more. NodeJS and React are the initial supported frameworks, and others will be gradually incorporated. We also welcome members of the Arkreen community to participate in the development and maintenance of the AREC Port Library Modules.

Arkreen Builder

Arkreen Builder is the core smart contract designed and developed to support the functionality of AREC Port. Its function is to receive various Crypto tokens paid by users, exchange these tokens for a certain amount of ART tokens through Arkreen DEX or Arkreen Bank smart contract, and then use these ART Tokens for carbon offsetting to generate climate actions. Finally, based on the climate action, it mints a climate badge for the user.

Arkreen Builder accepts multiple types of Crypto tokens, including MATIC, USDC, USDT, and others. Users can choose to exchange for ART tokens through Arkreen DEX or Arkreen Bank and can provide additional information to be included in the climate badge, such as the purpose of the carbon offsetting and the beneficiary of the climate badge, among others.

Arkreen Bank

The primary function of Arkreen Bank is to sell ART tokens at a pre-determined fixed price. Unlike Arkreen DEX, where the price of ART tokens fluctuates during buying and selling transactions due to the constraints of the AMM mechanism, Arkreen Bank maintains a constant price for ART tokens until the provider of ART tokens sets a new selling price.

Arkreen Bank is capable of managing various ART tokens with different attributes. Each ART token corresponds to a specific AREC issuer, and this issuer has the authority to deposit ART tokens into Arkreen Bank and set the selling price for those ART tokens.

Arkreen Builder ABI Interface

Arkreen Builder smart contract provides open interfaces for anyone to engage in climate actions by offsetting ART tokens and/or minting climate badges. If no ART tokens are available, Arkreen Builder can purchase ART from the AREC bank smart contract or a DEX pool using popular tokens. Below is the Arkreen Builder ABI interface:

  • actionBuilderWithART

actionBuilderWithART is called to offset some ART tokens and generate a climate action. With one or more climate actions, the caller can mint a AREC climate badge at anytime later.

actionBuilderWithART
    /** 
* @dev Offset the specified amount of ART tokens to create a climate action.
* @param tokenART Address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountART Amount of the ART token to offset.
* @param deadline Deadline to handle the transaction.
*/
function actionBuilderWithART(
address tokenART,
uint256 amountART,
uint256 deadline
)
  • actionBuilder

actionBuilder is called to buy ART tokens with the given payment token first, and then offset these ART tokens and generate a climate action. With one or more climate actions, the caller can mint a AREC climate badge at anytime later. Before calling this interface, the caller should approve Arkreen Builder to transfer the payment token from the caller's wallet. If more payment amount is given in the parameters, extra amount will be paid back to the caller.

actionBuilder
    /** 
* @dev Buy the ART token with specified token, then offset the bought ART to create a climate action.
* @param tokenPay The address of the token to pay for the ART token.
* @param tokenART The address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountPay The amount of the payment token.
* if modeAction bit0 is true, amountPay should be paid to swap tokenART.
* if modeAction bit0 is false, amountPay means the maximum amount to pay.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
*/
function actionBuilder(
address tokenPay,
address tokenART,
uint256 amountPay,
uint256 amountART,
uint256 modeAction,
uint256 deadline
)
  • actionBuilderNative

actionBuilderNative is called to buy ART tokens with native token, which is MATIC on polygon, and CELO on Celo. Then the bought ART tokens are offset and a climate action is generated for the caller.

actionBuilderNative
    /** 
* @dev Buy the ART token with Native token, then offset the bought ART.
* @param tokenART The address of the ART token. There may be several different ART tokens in the AREC ecosystem.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
*/
function actionBuilderNative(
address tokenART,
uint256 amountART,
uint256 modeAction,
uint256 deadline
)
  • actionBuilderWithPermit

actionBuilderWithPermit is called to buy ART tokens with the given payment token. The user permit Arkreen Builder to transfer user's payment token via the signature in the calling parameter. If more payment amount is given in the parameters, extra amount will be paid back to the caller.

actionBuilderWithPermit
   /** 
* @dev Buy the ART token with specified token, then offset the bought ART.
* @param tokenART The address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
* @param permitToPay The permit information to approve the payment token to swap for ART token
*/
function actionBuilderWithPermit(
address tokenART,
uint256 amountART,
uint256 modeAction,
Signature calldata permitToPay
)

  • actionBuilderBadgeWithART

actionBuilderBadgeWithART is called to offset some ART tokens and mint a climate badge at same time.

actionBuilderBadgeWithART
    /** 
* @dev Offset the specified amount of ART tokens to create a climate action.
* @param tokenART Address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountART Amount of the ART token to offset.
* @param deadline Deadline to handle the transaction.
* @param badgeInfo The information to be included for climate badge.
*/
function actionBuilderBadgeWithART(
address tokenART,
uint256 amountART,
uint256 deadline,
BadgeInfo calldata badgeInfo
)
  • actionBuilderBadge

actionBuilderBadge is called to buy ART tokens with the given payment token and mint a climate badge at same time. Before calling this interface, the caller should approve Arkreen Builder to transfer the payment token from the caller's wallet. If more payment amount is given in the parameters, extra amount will be paid back to the caller.

actionBuilderBadge
    /** 
* @dev Buy the ART token, then offset the bought ART and mint a climate badge.
* @param tokenPay The address of the token to pay for the ART token.
* @param tokenART The address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountPay The amount of the payment token.
* if modeAction bit0 is true, amountPay should be same as the value in permitToPay.
* if modeAction bit0 is false, amountPay means the maximum amount available to pay, if it not zero.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
* @param badgeInfo The information to be included for climate badge.
*/
function actionBuilderBadge(
address tokenPay,
address tokenART,
uint256 amountPay,
uint256 amountART,
uint256 modeAction,
uint256 deadline,
BadgeInfo calldata badgeInfo
)
  • actionBuilderBadgeNative

actionBuilderBadgeNative is called to buy ART tokens with native token and mint a climate badge at same time.

actionBuilderBadgeNative
    /** 
* @dev Buy the ART token, then offset the bought ART and mint a climate badge.
* @param tokenART The address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
* @param badgeInfo The information to be included for climate badge.
*/
function actionBuilderBadgeNative(
address tokenART,
uint256 amountART,
uint256 modeAction,
uint256 deadline,
BadgeInfo calldata badgeInfo
)
  • actionBuilderBadgeWithPermit

actionBuilderBadgeWithPermit is called to buy ART tokens with the given payment token and mint a climate badge at same time. The user permit Arkreen Builder to transfer user's payment token via the signature in the calling parameter. If more payment amount is given in the parameters, extra amount will be paid back to the caller.

actionBuilderBadgeWithPermit
   /** 
* @dev Buy the ART token, then offset the bought ART and mint a climate badge.
* @param tokenART The address of the ART token. There may be several different ART tokens in AREC ecosystem.
* @param amountART The amount of the ART token.
* if modeAction bit0 is true, amountART means the minimum ART token to receive, which may be zero for no checking.
* if modeAction bit0 is false, amountART is the amount of ART token to receive.
* @param modeAction Which amount is the exact amount, and which source to get ART
* bit0 = 1, amountPay is the exact amount of the payment token to pay.
* bit0 = 0, amountART is the exact amount of the ART token to receive.
* bit1 = 0, Swap ART from Dex
* bit1 = 1, Buy ART from AREC bank
* @param badgeInfo The information to be included for climate badge.
* @param permitToPay The permit information to approve the payment token to swap for ART token
*/
function actionBuilderBadgeWithPermit(
address tokenART,
uint256 amountART,
uint256 modeAction,
BadgeInfo calldata badgeInfo,
Signature calldata permitToPay
)