Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article covers ERC7425, a proposed standard for transparent on-chain reserve funds in which stakeholders can participate.

This article translates, summarizes, and expands on the proposal below.

As of November 1, 2023, ERC7425 was at the Draft stage.

I have also covered a range of other ERCs.

Overview

The proposal describes a tokenized reserve mechanism, or pool of funds. The reserve is designed to make the owner's on-chain actions observable. Using ERC4626, stakeholders can create shares to support actions involving the reserve.

For more on ERC4626, see the following article.

[ERC4626] Understanding Tokenized Vaults and Token-Based Rewards

Reserve

A reserve is a pool of funds held by an entity or organization as a backup in case its ordinary funds are insufficient. This proposal describes tokenizing such a reserve and using it to meet specified criteria and make interactions with stakeholders more transparent.

  • Reserve (pool of funds)
    • The reserve represents a pool of funds.
    • The pool is intended for a particular purpose.
  • Monitoring on-chain actions
    • The reserve owner's actions within the contract can be monitored.
    • This allows participants to inspect those actions for transparency and fairness.
  • ERC4626 tokens
    • Stakeholders can create shares using ERC4626 to support specific actions involving the reserve.
    • This provides a way for the wider community to express support.

The mechanism can promote transparency and community participation on the blockchain. The reserve owner provides information about actions performed through the contract, and the community can create shares to support those actions. This helps communicate intentions clearly and facilitates interaction with stakeholders.

Motivation

A tokenized reserve is a form of tokenized vault intended to resemble the reserves that entities hold in the real world as a backup when their ordinary funds are insufficient.

Entity

The term generally refers to a legal person, organization, or other distinct body. In this proposal, it refers to the party administering the reserve or the organization or individual interacting with stakeholders.

In the real world, entities may need to meet specific criteria before accessing reserve funds. On a blockchain, an entity can incorporate stakeholders into its own criteria. This makes the entity's interactions with stakeholders more transparent.

  • Tokenized reserves
    • A tokenized representation of the reserves an entity holds in case its ordinary funds are insufficient.
    • Like real-world reserves, they may be subject to specified criteria.
  • Defining criteria
    • In the real world, entities must meet certain conditions to access reserve funds.
    • On a blockchain, an entity can incorporate stakeholder participation into its criteria.
    • In other words, it can take stakeholder preferences or support into account when defining those criteria.
  • Improving transparency
    • The mechanism enables entities operating on a blockchain to make their reserve access criteria transparent to stakeholders.
    • This can facilitate interactions with stakeholders and increase trust.

This approach provides organizations and other entities operating on a blockchain with a way to manage reserves and coordinate with stakeholders.

Specification

Definitions

  • owner (owner)
    • The creator of the reserve.
    • The owner manages and controls the reserve.
  • user (user)
    • A stakeholder in a particular proposal.
    • A party with an interest in a proposal who can influence it.
  • reserve (reserve)
    • The tokenized reserve contract.
    • The contract tokenizes the reserve and enables funds to be held and managed.
  • proposal (proposal)
    • An action initiated when the owner wishes to withdraw funds from the contract.
    • A proposal represents a request to withdraw funds from the reserve and can involve stakeholder approval. The concrete approval criteria are left to the implementation.

Constructor

The contract constructor is a function executed once when the contract is initialized.

  • name (name)
    • The name of the ERC20 token.
    • The name identifies the token.
  • ticker (ticker)
    • The ticker symbol of the ERC20 token.
    • Usually an abbreviation that identifies the token concisely.
  • asset (asset)
    • The address of the underlying ERC20 token used by ERC4626.
    • This asset serves as the backing asset for the reserve.
  • rAuth (rAuth)
    • The primary authorized user.
    • The principal authorized party, which may have permission to operate the reserve.
  • rOwner (rOwner)
    • The owner of the reserve.
    • The party that owns and manages the reserve contract.

Interface

javascript
// SPDX-License-Identifier: CC0-1.0

pragma solidity ^0.8.0;
import "./ERC4626.sol";
    
interface TokenReserve is ERC4626{
	/**
	* @dev Event emitted after a new proposal is created
	*/
	event proposals(
	    	address indexed token,
	    	uint256 indexed proposalNum,
	    	uint256 indexed amount,
		address recipient
	);
	/**
	* @dev Event emitted after a new deposit is made by the owner
	*/
	event depositR(
		address indexed token,
	    	uint256 indexed amount,
	    	uint256 indexed time,
	    	uint256 count
	);
	/** 
	* @dev Get time of a deposit made to reserve with depositReserve()
	* @param count Number matching deposit
	* @return block.timestamp format
	*/
	function depositTime(uint256 count) external view returns (uint256);
	/** 
	* @dev Get amount deposited to reserve with depositReserve() 
	* @param count Number of deposit
	* @return uint256 number of any asset that were deposited
	*/
	function ownerDeposit(uint256 count) external view returns(uint256);
	/**
	* @dev Token type deposited to reserve with depositReserve()
	* - MUST be an address of ERC20 token
	* @param count Number of deposit
	*/
	function tokenDeposit(uint256 count) external view returns(address);
	/**
	* @dev Amount deposited for shares of proposal by the user
	* - MUST be an ERC20 address
	* @param user address of user
	* @param proposal number of the proposal the user deposited
	*/
	function userDeposit(address user, uint256 proposal) external view returns(uint256);
	/**
	* @dev Token used for given proposal
	* - MUST be ERC20 address
	* @param proposal number for requested token
	* @return token address
	*/
	function proposalToken(uint256 proposal) external view returns(address);
	/**
	* @dev Amount withdrawn for given opened proposal
	*/
	function proposalWithdrew(uint256 proposal) external view returns(uint256);
	/**
	* @dev Amount received for given closed proposal
	*/
	function proposalDeposited(uint256 proposal) external view returns(uint256);
	/**
	* @dev Make a deposit to a proposal creating new shares with deposit function from ERC-4626
	* - MUST be opened proposal
	* - MUST NOT be opened proposal that was closed
	* NOTE: using the deposit() will cause assets to not be accounted for in a proposal
	* @param assets Amount being deposited
	* @param receiver Address of depositor
	* @param proposal Number associated proposal
	*/
	function proposalDeposit(uint256 assets, address receiver, uint256 proposal) external virtual returns(uint256);
	/**
	* @dev Burn shares, receive 1 to 1 value of shares
	* - MUST have closed proposalNumber
	* - MUST have userDeposit greater than or equal to userWithdrawal
	* @param assets Amount being deposited
	* @param receiver Address of receiver
	* @param owner Address of token owner
	* @param proposal Number associated proposal
	*/
	function proposalWithdraw(uint256 assets, address receiver, address owner, uint256 proposal)external virtual returns(uint256);
	/**
	* @dev Issue new proposal
	* - MUST create new proposal number
	* - MUST account for amount withdrawn
	* - MUST emit proposals event
	* @param token Address of ERC-20 token
	* @param amount Token amount being withdrawn
	* @param receiver Address of token recipient
	*/
	function proposalOpen(address token, uint256 amount, address receiver) external virtual returns (uint256);
	/**
	* @dev Make deposit and/or choose to close an opened proposal
	* - MUST account for amount received
	* - MUST be a proposal that is less than or equal to current proposal
	* - MUST emit proposals event
	* @param token Address of ERC-20 token
	* @param proposal Number of desired proposal
	* @param amount Token amount being deposited to the reserve
	* @param close Choose to close the proposal
	*/
	function proposalClose(address token, uint256 proposal, uint256 amount, bool close) external virtual returns (bool);
	/**
	* @dev Optional accounting for tokens deposited by owner
	* - MUST be reserve owner
	* - MUST emit depositR event
	* NOTE: No shares are issued, funds can not be redeemed. Only withdrawn from proposalOpen
	* @param token Address of ERC-20 token
	* @param sender Address of where tokens from
	* @param amount Token amount being deposited
	*/
	function depositReserve(address token, address sender, uint256 amount) external virtual;
}

proposals

javascript
event proposals(
    address indexed token,
    uint256 indexed proposalNum,
    uint256 indexed amount,
    address recipient
)

Overview

An event emitted when a new proposal is created.

Details

The event is triggered when a new proposal is created within the reserve. It helps notify other users and applications when a transaction containing important proposal information occurs.

Parameters

  • token
    • The address of the token associated with the proposal.
  • proposalNum
    • The proposal number or identifier.
  • amount
    • The amount or quantity associated with the proposal.
  • recipient
    • The address of the proposal recipient.

depositR

javascript
event depositR(
    address indexed token,
    uint256 indexed amount,
    uint256 indexed time,
    uint256 count
)

Overview

An event emitted when the owner makes a new deposit.

Details

The event is triggered when the reserve owner makes a new deposit. It provides information about assets in the reserve and records the deposit transaction.

Parameters

  • token
    • The address of the token used for the deposit.
  • amount
    • The amount or quantity deposited.
  • time
    • The timestamp of the deposit.
  • count
    • The deposit count or identifier.

depositTime

javascript
function depositTime(uint256 count) external view returns (uint256);

Overview

Retrieves the time of a reserve deposit corresponding to a specified deposit count.

Details

The function retrieves the time, expressed as a block timestamp, at which the reserve deposit associated with the specified count was made. The timestamp helps track when deposits occurred.

Parameters

  • count
    • The count identifying the deposit to query.

Return value

  • uint256
    • The timestamp of the specified deposit.

ownerDeposit

javascript
function ownerDeposit(uint256 count) external view returns(uint256);

Overview

Retrieves the amount deposited into the reserve by the owner for a specified deposit count.

Details

The function retrieves the amount that the owner deposited into the reserve for the specified deposit count. It returns the quantity of assets deposited by the owner.

Parameters

  • count
    • The count identifying the deposit to query.

Return value

  • uint256
    • The owner's deposit amount associated with the specified count.

tokenDeposit

javascript
function tokenDeposit(uint256 count) external view returns(address);

Overview

Retrieves the address of the token used for a reserve deposit identified by a specified deposit count.

Details

The function returns the token address associated with the specified reserve deposit. It helps identify which token was used for a particular deposit.

Parameters

  • count
    • The count identifying the deposit to query.

Return value

  • address
    • The token address associated with the specified deposit count.

userDeposit

javascript
function userDeposit(address user, uint256 proposal) external view returns(uint256);

Overview

Retrieves the amount a particular user deposited for a particular proposal.

Details

The function retrieves the deposit amount associated with the specified user and proposal. It returns how much the user deposited in support of that proposal.

Parameters

  • user
    • The address of the user whose deposit information is requested.
  • proposal
    • The number of the proposal whose deposit information is requested.

Return value

  • uint256
    • The amount deposited by the specified user for the specified proposal.

proposalToken

javascript
function proposalToken(uint256 proposal) external view returns(address);

Overview

Retrieves the address of the token used for a specified proposal.

Details

The function retrieves the token address associated with the specified proposal. It helps identify which token was used for a particular proposal.

Parameters

  • proposal
    • The number of the proposal to query.

Return value

  • address
    • The address of the token used for the specified proposal.

proposalWithdrew

javascript
function proposalWithdrew(uint256 proposal) external view returns(uint256);

Overview

Retrieves the amount withdrawn for a specified proposal.

Details

The function retrieves the withdrawal amount associated with the specified proposal. It returns the amount already withdrawn for that proposal.

Parameters

  • proposal (uint256): The number of the proposal to query.

Return value

  • uint256
    • The amount withdrawn for the specified proposal.

proposalDeposited

javascript
function proposalDeposited(uint256 proposal) external view returns(uint256);

Overview

Retrieves the amount received for a specified closed proposal.

Details

The function retrieves the amount received in connection with the specified closed proposal. It returns the amount received for that proposal.

Parameters

  • proposal
    • The number of the proposal to query.

Return value

  • uint256
    • The amount received for the specified proposal.

proposalDeposit

javascript
function proposalDeposit(uint256 assets, address receiver, uint256 proposal) external virtual returns(uint256);

Overview

Makes a deposit for a proposal and creates new shares using the ERC4626 deposit function.

Details

The function makes a deposit using the ERC4626 deposit mechanism to create new shares associated with the proposal. The proposal must already be open and must not have been closed. Note that calling the ordinary ERC4626 deposit function directly, rather than proposalDeposit, does not account for the deposited assets against a proposal.

Parameters

  • assets
    • The amount of assets to deposit.
  • receiver
    • The address designated to receive the shares.
  • proposal
    • The number of the associated proposal.

Return value

  • uint256
    • The number of newly created shares.

proposalWithdraw

javascript
function proposalWithdraw(uint256 assets, address receiver, address owner, uint256 proposal) external virtual returns(uint256);

Overview

Burns shares to receive their value at a one-to-one rate, as described in the proposed interface.

Details

The function burns shares and returns their corresponding value under the proposal's stated one-to-one model. The specified proposal must be closed, and the user's recorded deposits must be at least as large as the applicable withdrawals. This one-to-one model is specific to the proposal; ERC4626 does not generally guarantee that one share is worth one asset.

Parameters

  • assets
    • The amount of assets to withdraw.
  • receiver
    • The address of the recipient.
  • owner
    • The address of the share owner.
  • proposal
    • The number of the associated proposal.

Return value

  • uint256
    • The share amount associated with the withdrawal. The original article describes this as new shares, but the operation described by the interface burns shares rather than minting them.

proposalOpen

javascript
function proposalOpen(address token, uint256 amount, address receiver) external virtual returns (uint256);

Overview

Creates a new proposal.

Details

The function creates a new proposal. It must generate a new proposal number and account for the amount withdrawn. It must also emit the proposals event.

Parameters

  • token
    • The address of the ERC20 token.
  • amount
    • The quantity of tokens to withdraw.
  • receiver
    • The address of the token recipient.

Return value

  • uint256
    • The new proposal number.

proposalClose

javascript
function proposalClose(address token, uint256 proposal, uint256 amount, bool close) external virtual returns (bool);

Overview

Makes a deposit and allows the caller to choose whether to close an open proposal.

Details

The function makes a deposit and determines whether the open proposal should be closed. When the proposal is closed, the article describes the tokens as being accounted for in the reserve rather than remaining available for further withdrawal under that proposal. If the proposal remains open, the article describes the tokens as not yet being credited to the reserve. In either case, the interface explicitly requires accounting for the amount received and emitting the proposals event. The closing and accounting rules require a concrete implementation.

Parameters

  • token
    • The address of the ERC20 token.
    • Specifies the token type deposited for the proposal.
  • proposal
    • The proposal number.
    • Identifies the proposal.
  • amount
    • The amount of tokens deposited into the reserve.
    • Specifies the token quantity being returned from the proposal to the reserve.
  • close
    • A Boolean determining whether the proposal is closed.
    • If true, the proposal is closed and the corresponding reserve accounting is finalized as described above.
    • If false, the proposal remains open. The closing-related accounting is not finalized, although the amount received must still be recorded.

Return value

  • Returns true on success.
  • Indicates that the requested operation, including closing and accounting when applicable, succeeded.

Accounting

In general, accounting means accurately recording an item or amount in a ledger or record. In a blockchain context, it may refer to accurately recording transaction details in an on-chain ledger. Accounting is associated with transaction processing and updates to recorded data, including recording changes to data and transactions.

In short, it is the process of accurately recording specific actions or changes on the blockchain.


depositReserve

javascript
function depositReserve(address token, address sender, uint256 amount) external virtual;

Overview

Accounts for tokens optionally deposited by the reserve owner.

Details

The function accounts for optional deposits made by the reserve owner. No stakes or shares are issued for these deposits, and the deposited funds cannot be redeemed. These tokens can be withdrawn only through proposalOpen. The function must be executed by the reserve owner.

Parameters

  • token
    • The address of the ERC20 token.
    • Specifies the type of token being deposited.
  • sender
    • The address from which the tokens are sent.
    • Specifies the source of the tokens.
  • amount
    • The quantity of tokens being deposited.
    • Specifies the number of tokens deposited into the reserve.

Additional Considerations

The proposal provides a basic model for a reserve fund. Conditions that are not explicitly specified must be addressed on a case-by-case basis. The main points are as follows.

  • Each reserve uses the ERC20 standard to represent stakes or shares.
    • ERC4626 is used to create those shares.
  • Reserve tokens can represent a claim on the underlying ERC4626 assets, and shares can be created by depositing the underlying token into the vault.
  • ERC4626 is implemented in the reserve to account for user participation.
    • This makes it possible to represent users participating in proposals.
  • When using a vault, implementers can decide how participation is determined based on users' deposits into the vault.
    • For example, they can prevent users from using the same tokens for multiple proposals, helping ensure that shares are created fairly.
  • When underlying tokens are deposited into the vault for an open proposal, they remain inaccessible until the proposal closes.
  • However, the proposal does not explicitly enforce that the reserve owner cannot withdraw tokens deposited to create shares.
    • Implementations can introduce appropriate controls for those tokens as needed.

The proposal describes the fundamental concept of a reserve fund and how it can operate.

Backward Compatibility

Tokenized reserves are intended to be compatible with ERC20 and ERC4626.

Security Considerations

The proposal states that further discussion is required.

In particular, the interaction between proposal-specific accounting and the inherited ERC4626 deposit, withdrawal, mint, and redemption paths must be reviewed in a concrete implementation. The interface alone does not establish that funds are locked as intended or that share and asset accounting is correct.

Citation

Jimmy Debe (@jimstir), "ERC-7425: Tokenized Reserve [DRAFT]," Ethereum Improvement Proposals, no. 7425, June 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7425.

Citation

Martin Lundfall (@Mrchico), "ERC-2612: Permit Extension for EIP-20 Signed Approvals," Ethereum Improvement Proposals, no. 2612, April 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2612.

Conclusion

This article covered ERC7425, a proposed standard for transparent on-chain reserve funds that support stakeholder participation.

If you have questions, feel free to contact me by direct message on Twitter.

Twitter @cardene777

I also publish material on the following platforms.

https://chaldene.net/