Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update core contract refs #1538

Merged
merged 5 commits into from
May 31, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,27 @@ 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
Dr-Electron marked this conversation as resolved.
Show resolved Hide resolved
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.

Expand All @@ -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.
Expand All @@ -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`.
Expand Down Expand Up @@ -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

Expand Down
Loading