cic-contracts/doc/texinfo/index/Smart-contract-interfaces.html
2022-06-13 14:15:50 +03:00

164 lines
6.6 KiB
HTML
Raw Permalink 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.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.8, https://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Smart contract interfaces (Untitled Document)</title>
<meta name="description" content="Smart contract interfaces (Untitled Document)">
<meta name="keywords" content="Smart contract interfaces (Untitled Document)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta name="viewport" content="width=device-width,initial-scale=1">
<link href="#Smart-contract-interfaces" rel="start" title="Smart contract interfaces">
<style type="text/css">
<!--
a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
span:hover a.copiable-anchor {visibility: visible}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<div class="chapter" id="Smart-contract-interfaces">
<span id="Smart-contract-interfaces-1"></span><h2 class="chapter">1 Smart contract interfaces</h2>
<ul class="section-toc">
<li><a href="#Smart-Contracts-in-the-CIC-Network" accesskey="1">Smart Contracts in the CIC Network</a></li>
</ul>
<div class="section" id="Smart-Contracts-in-the-CIC-Network">
<h3 class="section">1.1 Smart Contracts in the CIC Network</h3>
<ul class="section-toc">
<li><a href="#Technology" accesskey="1">Technology</a></li>
<li><a href="#The-registry-contract" accesskey="2">The registry contract</a></li>
<li><a href="#Auxiliary-contracts" accesskey="3">Auxiliary contracts</a></li>
<li><a href="#Contract-interfaces" accesskey="4">Contract interfaces</a></li>
</ul>
<div class="subsection" id="Technology">
<h4 class="subsection">1.1.1 Technology</h4>
<p>The long-term aim of the CIC network is to be agnostic of consensus engines. However, since we have to start <em>somewhere</em>, the current state of development only deals with Smart Contracts on the (Ethereum Virtual Machine (EVM).
</p>
</div>
<div class="subsection" id="The-registry-contract">
<h4 class="subsection">1.1.2 The registry contract</h4>
<p>The CICRegistry contract defines the entry-point to the entire CIC network. All other CIC network resources can be discovered through this contract.
</p>
<p>Its implementation is contained in the <samp>cic-registry</samp> repository. Details about it are documented further in that section.
</p>
</div>
<div class="subsection" id="Auxiliary-contracts">
<h4 class="subsection">1.1.3 Auxiliary contracts</h4>
<p>All other Smart Contracts in the network other than CICRegistry are essentially optional, and each applies <em>at least one</em> the interfaces defined in the <code>cic-contracts</code> repository.
</p>
</div>
<div class="subsection" id="Contract-interfaces">
<h4 class="subsection">1.1.4 Contract interfaces</h4>
<p>All contracts interfaces also implement the <strong>EIP165</strong> Standard Interface Detection.
</p>
<ul class="section-toc">
<li><a href="#Registry" accesskey="1">Registry</a></li>
<li><a href="#Registry-Client" accesskey="2">Registry Client</a></li>
<li><a href="#Faucet" accesskey="3">Faucet</a></li>
<li><a href="#Transfer-approval" accesskey="4">Transfer approval</a></li>
<li><a href="#Declarator" accesskey="5">Declarator</a></li>
<li><a href="#Address-Index" accesskey="6">Address Index</a></li>
<li><a href="#DEX-Index" accesskey="7">DEX Index</a></li>
</ul>
<div class="subsubsection" id="Registry">
<h4 class="subsubsection">1.1.4.1 Registry</h4>
<p>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.
</p>
<p>It also provides numerical index access to all registered values in order of insertion.
</p>
</div>
<div class="subsubsection" id="Registry-Client">
<h4 class="subsubsection">1.1.4.2 Registry Client</h4>
<p>A subset of the <code>Registry</code> interface, which defines only the non-transactional methods of the contract. The <code>Registry Client</code> interface is implemented by the <code>CICRegistry</code> contract.
</p>
</div>
<div class="subsubsection" id="Faucet">
<h4 class="subsubsection">1.1.4.3 Faucet</h4>
<p>Enables disbursement of a set amount of tokens to a requesting address.
</p>
<p>Allows privileged accounts to adjust the amount of tokens to disburse.
</p>
<p>Can be implemented as a periodic or a one-time service per account.
</p>
</div>
<div class="subsubsection" id="Transfer-approval">
<h4 class="subsubsection">1.1.4.4 Transfer approval</h4>
<p>Enables a third-party approval to spend an ERC20 token allowance.
</p>
<p>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.
</p>
<p>The contract allows the third-party address to either allow or reject the transfer.
</p>
</div>
<div class="subsubsection" id="Declarator">
<h4 class="subsubsection">1.1.4.5 Declarator</h4>
<p>Stores one or more 32-byte entries as a description of an Ethereum address, <em>signed</em> by another Ethereum address.
</p>
<p>This can be used to <em>describe</em> 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.
</p>
<p>Entries are stored by the transacting address that adds address/description pairs. In other words, any address may have different &quot;opinions&quot; 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 &quot;opinion&quot; of an address by combining data from signatures it trusts.
</p>
<p>Entries typically are text strings or content hashes.
</p>
</div>
<div class="subsubsection" id="Address-Index">
<h4 class="subsubsection">1.1.4.6 Address Index</h4>
<p>A simple append-only list of addresses. Used to check whether an address is part of a particular group.
</p>
</div>
<div class="subsubsection" id="DEX-Index">
<h4 class="subsubsection">1.1.4.7 DEX Index</h4>
<p>Methods required to convert between tokens.
</p><hr></div>
</div>
</div>
</div>
</body>
</html>