Skip to content

Commit

Permalink
deploy: 710626f
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminbollen committed Sep 2, 2024
1 parent 8ade8f6 commit 4f87cd3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
38 changes: 29 additions & 9 deletions architecture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<ul>
<li class="toctree-l3"><a class="reference internal" href="#circles-erc1155">Circles (ERC1155)</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#wrappers">Wrappers</a>
<li class="toctree-l3"><a class="reference internal" href="#erc20-wrappers">ERC20 Wrappers</a>
</li>
<li class="toctree-l3"><a class="reference internal" href="#erc20lift">ERC20Lift</a>
</li>
Expand Down Expand Up @@ -304,15 +304,35 @@ <h4 id="remarks">Remarks</h4>
</ul>
<h2 id="token-representations">Token Representations</h2>
<h3 id="circles-erc1155">Circles (ERC1155)</h3>
<p>The core representation of Circles currencies uses the ERC1155 standard, allowing for efficient management of multiple token types (personal and group currencies) within a single contract.</p>
<h3 id="wrappers">Wrappers</h3>
<p>To enhance compatibility with existing DeFi ecosystems, Circles provides ERC20 wrappers:</p>
<ol>
<li><strong>Demurrage ERC20</strong>: Represents Circles with the demurrage (decay) factor applied.</li>
<li><strong>Inflationary ERC20</strong>: Represents Circles in their inflationary form, without demurrage applied.</li>
</ol>
<p>The core representation of Circles currencies uses the ERC1155 standard, allowing for efficient management of multiple token types (personal and group currencies) within a single contract:</p>
<ul>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/Circles.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/Circles.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/ERC1155.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/ERC1155.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/DiscountedBalances.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/DiscountedBalances.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/Demurrage.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/Demurrage.sol</a></li>
</ul>
<h3 id="erc20-wrappers">ERC20 Wrappers</h3>
<p>To enhance compatibility with existing smart contract ecosystems, Circles provides two types of ERC20 wrappers:</p>
<ul>
<li><strong>Demurrage ERC20</strong>: This wrapper represents Circles with demurrage applied. It results in rebalancing amounts, reflecting the daily decrease in the balances over time over all Circles.</li>
<li><strong>Inflationary ERC20</strong>: This wrapper represents Circles in their inflationary form. Balances remain static (when not transacted), but the issuance rate for personal Circles mints increases daily. This mechanism offsets the static supply of Circles in circulation.</li>
</ul>
<p>For every Circles identifier (human or group Circles) either/both ERC20 contract can be deployed upon demand by calling <code>hub:wrap()</code>, and it will ensure the ERC20 contract is deployed if it doesn't already exist. ERC20 contracts can also be created explicitly before wrapping.</p>
<p>If the ERC20 contract already exists, one can also wrap the ERC1155 Circles into ERC20 by directly sending (the correct Circles) to the relevant ERC20 contract.</p>
<p>Both demurrage and inflationary ERC20 Circles can be converted back into demurraged ERC1155 Circles by calling <code>ECR20:unwrap()</code> as the owner of a balance on the desired ERC20 contract.</p>
<p>Both approaches allow Circles to interact more seamlessly with standard ERC20-compatible platforms and protocols while preserving the core economic principles of the Circles system.</p>
<p>ERC20 contracts also implement <a href="https://eips.ethereum.org/EIPS/eip-2612">ERC-2612</a>, aka <code>ERC20Permit</code>.</p>
<ul>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/lift/DemurrageCircles.sol" target="_blank" rel="noopener noreferrer">Code: /src/lift/DemurrageCircles.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/lift/ERC20DiscountedBalances.sol" target="_blank" rel="noopener noreferrer">Code: /src/lift/ERC20DiscountedBalances.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/lift/InflationaryCircles.sol" target="_blank" rel="noopener noreferrer">Code: /src/lift/InflationaryCircles.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/lift/ERC20InflationaryBalances.sol" target="_blank" rel="noopener noreferrer">Code: /src/lift/ERC20InflationaryBalances.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/BatchedDemurrage.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/BatchedDemurrage.sol</a></li>
<li><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/circles/Demurrage.sol" target="_blank" rel="noopener noreferrer">Code: /src/circles/Demurrage.sol</a></li>
</ul>
<h3 id="erc20lift">ERC20Lift</h3>
<p>The ERC20Lift contract serves as a bridge between the ERC1155 and ERC20 representations, allowing users to wrap and unwrap their Circles tokens as needed.</p>
<p>The ERC20Lift contract serves as a factory-bridge between the ERC1155 and ERC20 representations, ensuring ERC20 contracts are deployed (ahead of time).</p>
<p><a href="https://github.com/aboutcircles/circles-contracts-v2/blob/v0.3.6-docs/src/lift/ERC20Lift.sol" target="_blank" rel="noopener noreferrer">Code: /src/lift/ERC20Lift.sol</a></p>
<h2 id="circles-v1-components-legacy">Circles v1 Components (Legacy)</h2>
<h3 id="hub-v1">Hub v1</h3>
<p>The original Hub contract from Circles v1, which is being phased out but remains relevant for migration purposes.</p>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,5 +219,5 @@ <h2 id="table-of-contents">Table of Contents</h2>

<!--
MkDocs version : 1.6.1
Build Date UTC : 2024-09-02 19:43:32.539337+00:00
Build Date UTC : 2024-09-02 20:14:49.058806+00:00
-->
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

0 comments on commit 4f87cd3

Please sign in to comment.