cic-contracts/doc/texinfo/overview.texi
2021-02-14 12:22:42 +00:00

77 lines
3.1 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@node Smart contract interfaces
@chapter Smart contract interfaces
@section Smart Contracts in the CIC Network
@subsection Technology
The long-term aim of the CIC network is to be agnostic of consensus engines. However, since we have to start @emph{somewhere}, the current state of development only deals with Smart Contracts on the (Ethereum Virtual Machine (EVM).
@subsection The registry contract
The CICRegistry contract defines the entry-point to the entire CIC network. All other CIC network resources can be discovered through this contract.
Its implementation is contained in the @file{cic-registry} repository. Details about it are documented further in that section.
@subsection Auxiliary contracts
All other Smart Contracts in the network other than CICRegistry are essentially optional, and each applies @emph{at least one} the interfaces defined in the @code{cic-contracts} repository.
@subsection Contract interfaces
All contracts interfaces also implement the @strong{EIP165} Standard Interface Detection.
@subsubsection Registry
A key-value store, which resolves arbitrary 32-byte pointers to Ethereum addresses. Typically, this is used to resolve an address from a well-known identifier, either as a UTF-8 value or a 256-bit hash.
It also provides numerical index access to all registered values in order of insertion.
@subsubsection Registry Client
A subset of the @code{Registry} interface, which defines only the non-transactional methods of the contract. The @code{Registry Client} interface is implemented by the @code{CICRegistry} contract.
@subsubsection Faucet
Enables disbursement of a set amount of tokens to a requesting address.
Allows privileged accounts to adjust the amount of tokens to disburse.
Can be implemented as a periodic or a one-time service per account.
@subsubsection Transfer approval
Enables a third-party approval to spend an ERC20 token allowance.
This is useful in the case of a custodial key store, where a transaction has been initiated by another entity than the owner of the key.
The contract allows the third-party address to either allow or reject the transfer.
@subsubsection Declarator
Stores one or more 32-byte entries as a description of an Ethereum address, @emph{signed} by another Ethereum address.
This can be used to @emph{describe} network resources, be it tokens, contracts or user accounts. Examples of uses are KYC documentation proofs for users, token metadata used for display, or fraud alerts.
Entries are stored by the transacting address that adds address/description pairs. In other words, any address may have different "opinions" registered about it, depending on which signing address it is queried in the context of. This, in turn, allows the quering entity to compile its own "opinion" of an address by combining data from signatures it trusts.
Entries typically are text strings or content hashes.
@subsubsection Address Index
A simple append-only list of addresses. Used to check whether an address is part of a particular group.
@subsubsection DEX Index
Methods required to convert between tokens.