From c9a7b2f36a0bf01eae22be3f1e55964f4c251a1a Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Fri, 26 Apr 2024 16:36:56 +0200 Subject: [PATCH 1/4] Update core contract refs --- .../docs/reference/core-contracts/accounts.md | 45 ++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md index e445e0db13a..071f442c2a4 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md @@ -93,24 +93,24 @@ the target chain to the sender SC's L2 account on the origin chain. ::: -### `foundryCreateNew(t TokenScheme) s SerialNumber` +### `nativeTokenCreate(t TokenScheme, tn TokenName, ts TokenSymbol, td TokenDecimal) s SerialNumber` -Creates a new foundry with the specified token scheme, and assigns the foundry to the sender. +Creates a new foundry and registers it as a ERC20 and IRC30 token. -You can call this end point from the CLI using `wasp-cli chain create-foundry -h` +You can call this end point from the CLI using `wasp-cli chain create-native-token -h` #### Parameters -- `t` ([`iotago::TokenScheme`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme +- `t` ([`bytes`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme for the new foundry. +- `tn` (`string`): The token name +- `ts` (`string`): The token symbol +- `td` (`uint8`): The token decimals The storage deposit for the new foundry must be provided via allowance (only the minimum required will be used). -#### Returns - -- `s` (`uint32`): The serial number of the newly created foundry -### `foundryModifySupply(s SerialNumber, d SupplyDeltaAbs, y DestroyTokens)` +### `nativeTokenModifySupply(s SerialNumber, d SupplyDeltaAbs, y DestroyTokens)` Mints or destroys tokens for the given foundry, which must be controlled by the caller. @@ -124,7 +124,7 @@ When minting new tokens, the storage deposit for the new output must be provided When destroying tokens, the tokens to be destroyed must be provided via an allowance. -### `foundryDestroy(s SerialNumber)` +### `nativeTokenDestroy(s SerialNumber)` Destroys a given foundry output on L1, reimbursing the storage deposit to the caller. The foundry must be owned by the caller. @@ -139,6 +139,31 @@ This operation cannot be reverted. - `s` (`uint32`): The serial number of the foundry. + +### `foundryCreateNew(t TokenScheme) s SerialNumber` + +:::warning Deprecated + +This function is deprecated, please use [`nativeTokenCreate`](#nativetokencreatet-tokenscheme-s-serialnumber) instead + +::: + +Creates a new foundry with the specified token scheme, and assigns the foundry to the sender. + +You can call this end point from the CLI using `wasp-cli chain create-foundry -h` + +#### Parameters + +- `t` ([`iotago::TokenScheme`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme + for the new foundry. + +The storage deposit for the new foundry must be provided via allowance (only the minimum required will be used). + +#### Returns + +- `s` (`uint32`): The serial number of the newly created foundry + + ### `mintNFT(I ImmutableData, a AgentID, C CollectionID, w WithdrawOnMint)` Mints an NFT with ImmutableData `I` that will be owned by the AgentID `a`. @@ -221,7 +246,7 @@ Returns a list of all native tokenIDs that are owned by the chain. A map of [`TokenID`](#tokenid) => `0x01` -### `foundryOutput(s FoundrySerialNumber)` +### `nativeToken(s FoundrySerialNumber)` #### Parameters From 6543765159137494b6187692e062d5f45f2db940 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Mon, 6 May 2024 09:59:17 +0200 Subject: [PATCH 2/4] Add return value --- .../isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md index 071f442c2a4..f323114f2ea 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md @@ -109,6 +109,9 @@ You can call this end point from the CLI using `wasp-cli chain create-native-tok The storage deposit for the new foundry must be provided via allowance (only the minimum required will be used). +#### Returns + +- `s` (`uint32`): The serial number of the newly created foundry ### `nativeTokenModifySupply(s SerialNumber, d SupplyDeltaAbs, y DestroyTokens)` From 58d3b9642658fcbe1ae935fadd56a3dc257f6bd3 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 1 Jun 2024 00:29:52 +0200 Subject: [PATCH 3/4] Update docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md --- .../isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md index f323114f2ea..18a3f77e787 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/reference/core-contracts/accounts.md @@ -101,7 +101,7 @@ You can call this end point from the CLI using `wasp-cli chain create-native-tok #### Parameters -- `t` ([`bytes`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme +- `t` ([`iotago::TokenScheme`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme for the new foundry. - `tn` (`string`): The token name - `ts` (`string`): The token symbol From 725c6d04e0bb872b8ed0f27fcab9bdb5ba6ab4a3 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Sat, 1 Jun 2024 00:33:40 +0200 Subject: [PATCH 4/4] Update 1.3 --- .../docs/reference/core-contracts/accounts.md | 40 ++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/docs/build/isc/v1.3-alpha/docs/reference/core-contracts/accounts.md b/docs/build/isc/v1.3-alpha/docs/reference/core-contracts/accounts.md index e445e0db13a..18a3f77e787 100644 --- a/docs/build/isc/v1.3-alpha/docs/reference/core-contracts/accounts.md +++ b/docs/build/isc/v1.3-alpha/docs/reference/core-contracts/accounts.md @@ -93,16 +93,19 @@ the target chain to the sender SC's L2 account on the origin chain. ::: -### `foundryCreateNew(t TokenScheme) s SerialNumber` +### `nativeTokenCreate(t TokenScheme, tn TokenName, ts TokenSymbol, td TokenDecimal) s SerialNumber` -Creates a new foundry with the specified token scheme, and assigns the foundry to the sender. +Creates a new foundry and registers it as a ERC20 and IRC30 token. -You can call this end point from the CLI using `wasp-cli chain create-foundry -h` +You can call this end point from the CLI using `wasp-cli chain create-native-token -h` #### Parameters - `t` ([`iotago::TokenScheme`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme for the new foundry. +- `tn` (`string`): The token name +- `ts` (`string`): The token symbol +- `td` (`uint8`): The token decimals The storage deposit for the new foundry must be provided via allowance (only the minimum required will be used). @@ -110,7 +113,7 @@ The storage deposit for the new foundry must be provided via allowance (only the - `s` (`uint32`): The serial number of the newly created foundry -### `foundryModifySupply(s SerialNumber, d SupplyDeltaAbs, y DestroyTokens)` +### `nativeTokenModifySupply(s SerialNumber, d SupplyDeltaAbs, y DestroyTokens)` Mints or destroys tokens for the given foundry, which must be controlled by the caller. @@ -124,7 +127,7 @@ When minting new tokens, the storage deposit for the new output must be provided When destroying tokens, the tokens to be destroyed must be provided via an allowance. -### `foundryDestroy(s SerialNumber)` +### `nativeTokenDestroy(s SerialNumber)` Destroys a given foundry output on L1, reimbursing the storage deposit to the caller. The foundry must be owned by the caller. @@ -139,6 +142,31 @@ This operation cannot be reverted. - `s` (`uint32`): The serial number of the foundry. + +### `foundryCreateNew(t TokenScheme) s SerialNumber` + +:::warning Deprecated + +This function is deprecated, please use [`nativeTokenCreate`](#nativetokencreatet-tokenscheme-s-serialnumber) instead + +::: + +Creates a new foundry with the specified token scheme, and assigns the foundry to the sender. + +You can call this end point from the CLI using `wasp-cli chain create-foundry -h` + +#### Parameters + +- `t` ([`iotago::TokenScheme`](https://github.com/iotaledger/iota.go/blob/develop/token_scheme.go)): The token scheme + for the new foundry. + +The storage deposit for the new foundry must be provided via allowance (only the minimum required will be used). + +#### Returns + +- `s` (`uint32`): The serial number of the newly created foundry + + ### `mintNFT(I ImmutableData, a AgentID, C CollectionID, w WithdrawOnMint)` Mints an NFT with ImmutableData `I` that will be owned by the AgentID `a`. @@ -221,7 +249,7 @@ Returns a list of all native tokenIDs that are owned by the chain. A map of [`TokenID`](#tokenid) => `0x01` -### `foundryOutput(s FoundrySerialNumber)` +### `nativeToken(s FoundrySerialNumber)` #### Parameters