Skip to content

Commit

Permalink
Initial Interchain token
Browse files Browse the repository at this point in the history
  • Loading branch information
cujowolf committed Apr 17, 2024
1 parent 524fbf6 commit b5f0b73
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/protocol/tokens/regular/KlimaInterchain.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {IERC20, ERC20, ERC20Wrapper} from "oz/token/ERC20/extensions/ERC20Wrapper.sol";
import {ERC20Permit} from "oz/token/ERC20/extensions/ERC20Permit.sol";

import {Minter} from "@axelar-network/interchain-token-service/contracts/utils/Minter.sol";
// import {IInterchainTokenStandard} from
// "@axelar-network/interchain-token-service/contracts/interfaces/IInterchainTokenStandard.sol";

contract KlimaInterchain is ERC20Wrapper, ERC20Permit, Minter {
uint8 internal immutable decimals_ = 9;

uint256 internal constant UINT256_MAX = 2 ** 256 - 1;

constructor(string memory name_, string memory symbol_, IERC20 _underlying)
ERC20(name_, symbol_)
ERC20Permit(name_)
ERC20Wrapper(_underlying)
{
_addMinter(msg.sender);
}

function decimals() public pure override(ERC20, ERC20Wrapper) returns (uint8) {
return decimals_;
}

/**
* @notice Function to mint new tokens.
* @dev Can only be called by the minter address.
* @param account The address that will receive the minted tokens.
* @param amount The amount of tokens to mint.
*/
function mint(address account, uint256 amount) external onlyRole(uint8(Roles.MINTER)) {
_mint(account, amount);
}

/**
* @notice Function to burn tokens.
* @dev Can only be called by the minter address.
* @param account The address that will have its tokens burnt.
* @param amount The amount of tokens to burn.
*/
function burn(address account, uint256 amount) external onlyRole(uint8(Roles.MINTER)) {
_burn(account, amount);
}
}

0 comments on commit b5f0b73

Please sign in to comment.