-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathMintToken.sol
39 lines (33 loc) · 1016 Bytes
/
MintToken.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@iscmagic/ISC.sol";
contract MyToken {
event MintedToken(uint32 foundrySN);
constructor(
string memory _tokenName,
string memory _tokenSymbol,
uint8 _tokenDecimals,
uint256 _maximumSupply,
uint64 _storageDeposit
) payable {
require(
msg.value == _storageDeposit * (10 ** 12),
"Please send exact funds to pay for storage deposit"
);
ISCAssets memory allowance;
allowance.baseTokens = _storageDeposit;
NativeTokenScheme memory nativeTokenScheme = NativeTokenScheme({
mintedTokens: 0,
meltedTokens: 0,
maximumSupply: _maximumSupply
});
uint32 foundrySN = ISC.accounts.createNativeTokenFoundry(
_tokenName,
_tokenSymbol,
_tokenDecimals,
nativeTokenScheme,
allowance
);
emit MintedToken(foundrySN);
}
}