ERC-5247: Smart Contract Executable Proposal Interface
An interface to create and execute proposals.
Abstract
This EIP presents an interface for "smart contract executable proposals": proposals that are submitted to, recorded on, and possibly executed on-chain. Such proposals include a series of information about function calls including the target contract address, ether value to be transmitted, gas limits and calldatas.
Motivation
It is oftentimes necessary to separate the code that is to be executed from the actual execution of the code.
A typical use case for this EIP is in a Decentralized Autonomous Organization (DAO). A proposer will create a smart proposal and advocate for it. Members will then choose whether or not to endorse the proposal and vote accordingly (see ERC-1202
). Finallym when consensus has been formed, the proposal is executed.
A second typical use-case is that one could have someone who they trust, such as a delegator, trustee, or an attorney-in-fact, or any bilateral collaboration format, where a smart proposal will be first composed, discussed, approved in some way, and then put into execution.
A third use-case is that a person could make an "offer" to a second person, potentially with conditions. The smart proposal can be presented as an offer and the second person can execute it if they choose to accept this proposal.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
Rationale
- Originally, this interface was part of part of
ERC-1202
. However, the proposal itself can potentially have many use cases outside of voting. It is possible that voting may not need to be upon a proposal in any particular format. Hence, we decide to decouple the voting interface and proposal interface. - Arrays were used for
target
s,value
s,calldata
s instead of single variables, allowing a proposal to carry arbitrarily long multiple functional calls. registeredProposalId
is returned increateProposal
so the standard can support implementation to decide their own format of proposal id.
Test Cases
A simple test case can be found as
See testProposalRegistry.ts for the whole testset.
Reference Implementation
A simple reference implementation can be found.
See ProposalRegistry.sol for more information.
Security Considerations
Needs discussion.
Copyright
Copyright and related rights waived via CC0.