eip | title | description | author | discussions-to | status | type | category | created | requires |
---|---|---|---|---|---|---|---|---|---|
7425 |
Tokenized Reserve |
Reserve with user auditing |
Jimmy Debe (@jimstir) |
Draft |
Standards Track |
ERC |
2023-06-30 |
20, 4626 |
This is a reference implementation of EIP 7425. There are getter functions, and intializled constructor parameters included. Continued development will include added testand other documentation.
A proposal for a tokenized reserve mechanism. The reserve allows an audit of on-chain actions of the owner. Using ERC-4626, stakeholders can create shares to show support for actions in the reserve.
Tokenized reserves are an extension of tokenized vaults. The goal is to create a reserve similar to a real world reserve an entity has as a backup incase regular funds run low. In the real world, an entity will have certain criteria to access reserve funds. In a decentralized environment, an entity can incorporate stakeholders into their criteria. Hopefully this will help entities who participate in decentralized environments to be transparent with stakeholders.
- owner: The creator of the reserve.
- user: Stakeholders of specific proposals
- reserve: The tokenized reserve contract
- proposal: Occurs when the owner wants a withdrawal from contract
- name: ERC-20 token name
- ticker: ERC-20 ticker
- asset: ERC-4626 underlying ERC-20 address
- rAuth: Primary authorized user
- rOwner: Owner of the Reserve
- Get the reserve owner
- name: whosOwner
type: function
stateMutability: view
inputs: [ ]
outputs:
- name: _rOwner
type : address
- Get the reserve primary authorized user
- name: whosAuth
type: function
stateMutability: view
inputs: [ ]
outputs:
- name: _rAuth
type : address
- Check current total of opened proposals
- name: proposalCheck
type: function
stateMutability: view
inputs: [ ]
outputs:
- name: _proposalNum
type : uint256
- Authorized users of the reserve
- name: getAuth
type: function
stateMutability: view
inputs: [ ]
outputs:
- name: _authUsers
type : bool
- Get number of deposits made to reserve by the owner
- MUST BE deposits made by calling depositReserve function
- name: accountCheck
type: function
stateMutability: view
inputs: [ ]
outputs:
- name: _ownerDeposits
type : uint256
- Get time of a deposit made to reserve by the owner
- name: depositTime
type: function
stateMutability: view
inputs:
- name: count
type: uint256
outputs:
- name: ownerBook.time
type : uint256
- Get time of a deposit made to reserve by the owner
- name: ownerDeposit
type: function
stateMutability: view
inputs:
- name: count
type: uint256
outputs:
- name: ownerBook.deposit
type : uint256
- Token type deposited to contract by the owner
- name: tokenDeposit
type: function
stateMutability: view
inputs:
- name: count
type: uint256
outputs:
- name: ownerBook.token
type : address
- Token type deposited to contract by the owner
- MUST be an ERC20 address
- name: userDeposit
type: function
stateMutability: view
inputs:
- name: user
type: address
- name: proposal
type: uint256
outputs:
- name: userBook.deposit
type : uint256
- Amount withdrawn from given proposal by the user
- MUST be an ERC20 address
- name: userWithdrew
type: function
stateMutability: view
inputs:
- name: user
type: address
- name: proposal
type: uint256
outputs:
- name: userBook.withdrew
type : uint256
- The total number of proposals joined by the user
- name: userNumOfProposal
type: function
stateMutability: view
inputs:
- name: user
type: address
outputs:
- name: userBook.numOfProposals
type : uint256
- The proposal number from the specific proposal joined by the user
- MUST NOT be zero
- name: userProposal
type: function
stateMutability: view
inputs:
- name: user
type: address
- name: proposal
type: uint256
outputs:
- name: userBook.proposal
type : uint256
- Token used for given proposal
- MUST be ERC20 address
- name: proposalToken
type: function
stateMutability: view
inputs:
- name: proposal
type: uint256
outputs:
- name: proposalBook.token
type : uint256
- Amount withdrawn for given proposal
- name: proposalWithdrew
type: function
stateMutability: view
inputs:
- name: proposal
type: uint256
outputs:
- name: proposalBook.withdrew
type : uint256
- Amount received for given proposal
- name: proposalDeposit
type: function
stateMutability: view
inputs:
- name: proposal
type: uint256
outputs:
- name: proposalBook.received
type : uint256
- Total shares issued for a given proposal
- name: totalShares
type: function
stateMutability: view
inputs:
- name: proposal
type: uint256
outputs:
- name: _totalShares
type : uint256
- Check if proposal is closed
- name: closedProposal
type: function
stateMutability: view
inputs:
- name: proposal
type: uint256
outputs:
- name: _closedProposal
type : uint256
- Add a new authorized user
- name: addAuth
type: function
stateMutability: nonpayable
inputs:
- name: author
type: address
outputs:
- []
- Make a deposit to proposal creating new shares
- MUST be open proposal
- MUST NOT be opened proposal that was closed
- name: proposalDeposit
type: function
stateMutability: nonpayable
inputs:
- name: assets
type: uint256
-name: receiver
type: address
-name: proposal
type: uint256
outputs:
- name: shares
type: uint256
- Make a deposit to proposal creating new shares
- MUST be open proposal
- MUST NOT be opened proposal that was closed
- name: proposalMint
type: function
stateMutability: nonpayable
inputs:
- name: shares
type: uint256
-name: receiver
type: address
-name: proposal
type: uint256
outputs:
- name: assets
type: uint256
- Burn shares, receive 1 to 1 value of assets
- MUST have closed proposalNumber
- MUST have userDeposit greater than or equal to userWithdrawal
- name: proposalWithdrawal
type: function
stateMutability: nonpayable
inputs:
- name: assets
type: uint256
-name: receiver
type: address
-name: owner
type: address
-name: proposal
type: uint256
outputs:
- name: shares
type: uint256
- Burn shares, receive 1 to 1 value of assets
- MUST have closed proposal number
- MUST have userDeposit greater than or equal to userWithdrawal
- name: proposalRedeem
type: function
stateMutability: nonpayable
inputs:
- name: shares
type: uint256
-name: receiver
type: address
-name: owner
type: address
-name: proposal
type: uint256
outputs:
- name: assets
type: uint256
- Issue new proposal
- MUST create new proposal number
- MUST account for amount withdrawn
- name: proposalOpen
type: function
stateMutability: nonpayable
inputs:
- name: token
type: address
-name: amount
type: uint256
-name: receiver
type: address
-name: num
type: uint256
outputs:
- name: proposalNum
type: uint256
- Close an opened proposal
- MUST account for amount received
- MUST be a proposal that is less than or equal to current proposal
- name: proposalClose
type: function
stateMutability: nonpayable
inputs:
- name: token
type: address
-name: proposal
type: uint256
-name: amount
type: uint256
-name: num
type: uint256
outputs:
- name: close
type: bool
- Optional accounting for tokens deposited by owner
- MUST be reserve rOwner
- name: depositReserve
type: function
stateMutability: nonpayable
inputs:
- name: token
type: address
-name: sender
type: address
-name: amount
type: uint256
outputs:
- name: deposit
type: bool
- name: token
indexed: true
type: address
- name: proposalNum
indexed: true
type: uint256
- name: amount
indexed: true
type: uint256
- name: recipient
indexed: false
type: address
- name: token
indexed: true
type: address
- name: amount
indexed: true
type: uint256
-name: time
indexed: true
type: uint256
- name: count
indexed: false
type: uint256
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
The reserve is designed to be a basic implementation of the reserve interface. Other non specified conditions should be addressed on case by case instances. Reserves use ERC-20 for shares and ERC-4626 for creations of shares within proposals. All accounting measures are designed to enforce audit practices based on use case.
Tokenized reserves are made compatible with ERC-20 and ERC-4626.
Needs discussion.
Copyright and related rights waived via CC0.