From 66cd8cc427dfc9b3fdbf775e59dc68f04a819bec Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 4 Feb 2025 11:36:36 +0100 Subject: [PATCH] Update erc6909.adoc --- docs/modules/ROOT/pages/erc6909.adoc | 11 ++++++----- .../ERC6909/extensions/ERC6909TokenSupply.test.js | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/modules/ROOT/pages/erc6909.adoc b/docs/modules/ROOT/pages/erc6909.adoc index 37985ddfd45..164ded8ed0c 100644 --- a/docs/modules/ROOT/pages/erc6909.adoc +++ b/docs/modules/ROOT/pages/erc6909.adoc @@ -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. @@ -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]. @@ -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 ---- @@ -43,4 +44,4 @@ We can transfer items to player accounts: 1 > gameItems.balanceOf(deployerAddress, 2) 0 ----- \ No newline at end of file +---- diff --git a/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js b/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js index 1dcbaa5d43e..0b8b053d0a3 100644 --- a/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js +++ b/test/token/ERC6909/extensions/ERC6909TokenSupply.test.js @@ -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); });