Closed thegostep closed 5 years ago
Hi @thegostep, thank you for submitting the proposal. Could you please add a short explanation about what is out-of-scope for this proposal under Non-Goal section?
Updated status to "Review".
And accepting final feedback now till Dec 7th.
This AIP is rejected.
Reason: This Aion interface registry is for Aion Solidity contracts only. Since Aion is deprecating Solidity from the network, this registry will be no longer needed.
Title: Aion Interface Registry Author(s): Sam Pajot-Phipps, Yao Sun, Stephane Gosselin Type: ASC (Aion Standards and Conventions) Status: Rejected Creation Date: April 15th, 2018 Contact Information: sam@aion.network
Summary
A standard for a universal registry smart contract where any address can register which interface it supports and delegate responsibility for its implementation. This standard follows the ERC-820 standard from Ethereum.
Value Proposition
Provide a way to determine if a contract implements an interface of interest before executing a transaction.
Motivation
Contract pseudo-introspection provides a standard way for the manager of a contract to describe the interface it has implemented such that it can be queried by other contracts before executing a transaction.
Delegated implementation allows a manager to define a delegated address which implements an interface on behalf of the main address.
The registry contract also provides a simple way of monitoring the deployment of contracts with an interface of interest.
Non-Goals
Success Metrics
There are two key indicators of success for this standard: 1) Number of interface registered 2) Number of queries for interface registrations
Description
A standard for a universal registry smart contract where any address can register which interface it supports and delegate responsibility for its implementation. This standard follows the ERC-820 standard from Ethereum.
Contract pseudo-introspection provides a standard way for the manager of a contract to describe the interface it has implemented such that it can be queried by other contracts before executing a transaction.
Delegated implementation allows a manager to define a delegated address which implements an interface on behalf of the main address.
The registry contract also provides a simple way of monitoring the deployment of contracts with an interface of interest.
Specification
Definitions
Interface Naming Conventions
Each interface name must be unique. Following the guidelines used in ERC-820, interfaces for approved AIPs must use the following conventions.
MUST be named AIP###XXXXX where ### is the number of the AIP and XXXXX should be the name of the interface in CamelCase. The meaning of this interface SHOULD be defined in the specified AIP.
Examples:
sha3("AIP004Token")
sha3("AIP004TokensSender")
sha3("AIP004TokensRecipient")
Methods for AIRDelegateInterface
isDelegateFor
functionCalled to get whether or not this delegate contract implements the interface
interfaceHash
for the addresstarget
.NOTE: Although the function returns true or false, it is necessary to return
sha3("AIR_ACCEPT_MAGIC")
to avoid issues with calling fallback functions which return booleans.NOTE: This interface is only required if the
delegate
is a different address than themanager
.Methods for AionInterfaceRegistry
InterfaceDelegateSet
eventIndicate that the address
target
supports the interfaceinterfaceHash
through the delegate addressdelegate
.If the
target
implements the interface itself,target
anddelegate
will be equivalent.This event can be monitored to determine the number of contracts on the network which support a given interface.
ManagerChanged
eventIndicate that the address
newManager
now controls the interface registration of the addresstarget
.getInterfaceDelegate
functionCalled to get the address of the delegate implementing the
interfaceHash
on behalf of thetarget
.NOTE: MUST return address
0x0
if thetarget
does not support the interface.getManager
functionCalled to get the address of the manager which controls the registration of the
target
.NOTE: MUST return address
target
if no manager have been set.interfaceHash
functionCalled to get the sha3 hash of an interface given its name as a string
interfaceName
.setInterfaceDelegate
functionCalled to set the address of the
delegate
which implements the interfaceinterfaceHash
on behalf of thetarget
.NOTE: MUST remove an interface by calling with
delegate
set to address 0.NOTE: MUST call with
delegate
set as addresstarget
if the target contract implements the interface itself (without a delegate).setManager
functionCalled to set the address of the
manager
which controls the registration of thetarget
.Solidity Contract
Logic
This standard is based on ERC-820 from Ethereum. The following modifications have been made in migrating the standard.
Risks & Assumptions
This standard does not guarantee that a given contract will behave as described by the associated interface. Since interface registration is perform on an opt-in basis by the author of the smart contract, users querying the interface registry must assume the author could register a false interface.
Test Cases
N/A
Implementations
N/A
Dependencies
N/A
Copyright
All AIP’s are public domain. Copyright waiver: https://creativecommons.org/publicdomain/zero/1.0/