Skip to content

shivam2320/erc20r

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Summary

A new token standard for recurring approvals

Abstract

The following standard allows for the implementation of a standard API for tokens within smart contracts. This standard provides basic functionality to transfer tokens, as well as allows tokens to be periodically approved so they can be spent by another on-chain third party. It is compatible with ERC20.

Motivation

A standard interface allows any tokens on Ethereum to be re-used by other applications: from wallets to decentralized exchanges. It also provides a way for dApps to get recurring approvals for their token.

Specification

Functions

This function is responsible for setting a specific amount as the allowance of spender over the caller’s tokens for a particular time period and within a time limit. For example -> Allowing spender 100 tokens per month for a time limit of 6 months.
Returns a boolean value indicating whether the operation succeeded.
Emits RecurringApproval event.

function recurringApprove(
      address spender,
      uint256 amount,
      uint256 timePeriod,
      uint256 timeLimit
  )

This function is responsible for moving amount tokens from from to to using the allowance mechanism. Only amount specified in recurringApprove can be transferred by the spender within the specific time period and time limit.
For example -> Spender can transfer 100 tokens each month for a time limit of 6 months. Returns a boolean value indicating whether the operation succeeded.

function transferFromRecurring(
      address from,
      address to,
      uint256 amount
  )

Events

event RecurringApproval(
      address indexed owner,
      address indexed spender,
      uint256 amount,
      uint256 timePeriod,
      uint256 timeLimit
  );

Important Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published