-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e035aac
commit b2cbb80
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
docs/build/isc/v1.0.0-rc.6/docs/how-tos/native-token/register-token.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters