Skip to content

Commit

Permalink
Update erc6909.adoc
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Feb 4, 2025
1 parent f0c0571 commit 66cd8cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions docs/modules/ROOT/pages/erc6909.adoc
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
= ERC-6909

ERC-6909 is a draft EIP that draws on ERC-1155 and learnings since it was published in 2018. The main goals of ERC-6909 is to decrease gas costs and complexity--this is mainly accomplished by removing batching and callbacks.
ERC-6909 is a draft EIP that draws on ERC-1155 learnings since it was published in 2018. The main goals of ERC-6909 is to decrease gas costs and complexity--this is mainly accomplished by removing batching and callbacks.

TIP: To understand the inspiration for a multi token standard, see the xref:erc1155.adoc#multi-token-standard[multi token standard] section within the EIP-1155 docs.

== Changes from ERC-1155

There are three main changes from ERC-1155 which are as follows:

. The removal of batch operations.
Expand All @@ -13,9 +14,9 @@ There are three main changes from ERC-1155 which are as follows:

== Constructing an ERC-6909 Token Contract

We'll use ERC-6909 to track multiple items in a game, each having their own unique attributes. All item types with by minted to the deployer of the contract, which we can later transfer to players. We'll also use the xref:api:token/ERC6909.adoc#ERC6909Metadata[`ERC6909Metadata`] extension to add decimals to our fungible items (the vanilla ERC-6909 implementation does not have decimals).
We'll use ERC-6909 to track multiple items in a game, each having their own unique attributes. All item types will by minted to the deployer of the contract, which we can later transfer to players. We'll also use the xref:api:token/ERC6909.adoc#ERC6909Metadata[`ERC6909Metadata`] extension to add decimals to our fungible items (the vanilla ERC-6909 implementation does not have decimals).

For simplicity, we will mint all items in the constructor--however, minting functionality could be added to the contract to min on demand to players.
For simplicity, we will mint all items in the constructor--however, minting functionality could be added to the contract to mint on demand to players.

TIP: For an overview of minting mechanisms, check out xref:erc20-supply.adoc[Creating ERC-20 Supply].

Expand All @@ -31,7 +32,7 @@ Note that there is no content URI functionality in the base implementation, but
Once the contract is deployed, we will be able to query the deployer’s balance:
[source,javascript]
----
> gameItems.balanceOf(deployerAddress,3)
> gameItems.balanceOf(deployerAddress, 3)
1000000000
----

Expand All @@ -43,4 +44,4 @@ We can transfer items to player accounts:
1
> gameItems.balanceOf(deployerAddress, 2)
0
----
----
2 changes: 1 addition & 1 deletion test/token/ERC6909/extensions/ERC6909TokenSupply.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('ERC6909TokenSupply', function () {
});

it('supply unaffected by transfers', async function () {
await this.token.$_transfer(this.holder, this.receiver, 1n, 42n);
await this.token.$_transfer(this.holder, this.recipient, 1n, 42n);
await expect(this.token.totalSupply(1n)).to.eventually.be.equal(supply);
});

Expand Down

0 comments on commit 66cd8cc

Please sign in to comment.