Skip to content

Commit

Permalink
Add register token how-to
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Electron committed Feb 16, 2024
1 parent e035aac commit b2cbb80
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
description: How to register a native token as ERC20
image: /img/logo/WASP_logo_dark.png
tags:
- ERC20
- EVM
- how-to
---

## Register Tokens

To properly use your native tokens you should register them as ERC20 using the `registerERC20NativeToken`.

## Example Code

1. Create the allowance
2. Register the native tokens specifying the foundry serial number, a name, a symbol, it's decimals and the allowance.

```solidity
function registerERC20NativeToken(uint32 _foundrySN, string calldata _name, string calldata _symbol, uint8 _decimals) public {
ISCAssets memory allowance = ISCAssets({
baseTokens: 500_000,
nativeTokens: new NativeToken[](0),
nfts: new NFTID[](0)
});
ISC.sandbox.registerERC20NativeToken(_foundrySN, _name, _symbol, _decimals, allowance);
}
```
5 changes: 5 additions & 0 deletions docs/build/isc/v1.0.0-rc.6/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ module.exports = {
label: 'Create Foundry',
id: 'how-tos/native-token/create-foundry',
},
{
type: 'doc',
label: 'Register Token as ERC20',
id: 'how-tos/native-token/register-erc20',
}
{
type: 'doc',
label: 'Mint Token',
Expand Down

0 comments on commit b2cbb80

Please sign in to comment.