From b2cbb808b0aba562ff71c424742c7d08218623d3 Mon Sep 17 00:00:00 2001 From: Dr-Electron Date: Fri, 16 Feb 2024 14:01:00 +0100 Subject: [PATCH] Add register token how-to --- .../how-tos/native-token/register-token.md | 28 +++++++++++++++++++ docs/build/isc/v1.0.0-rc.6/sidebars.js | 5 ++++ 2 files changed, 33 insertions(+) create mode 100644 docs/build/isc/v1.0.0-rc.6/docs/how-tos/native-token/register-token.md diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/native-token/register-token.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/native-token/register-token.md new file mode 100644 index 00000000000..c902a8fadfc --- /dev/null +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/native-token/register-token.md @@ -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); + } +``` diff --git a/docs/build/isc/v1.0.0-rc.6/sidebars.js b/docs/build/isc/v1.0.0-rc.6/sidebars.js index 8b9ca99d8f9..949de40e757 100644 --- a/docs/build/isc/v1.0.0-rc.6/sidebars.js +++ b/docs/build/isc/v1.0.0-rc.6/sidebars.js @@ -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',