The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/solidity/contracts/test/ERC20Test.sol

80 lines
1.9 KiB

// SPDX-License-Identifier: Apache-2.0
pragma solidity >=0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "../token/interfaces/IXERC20.sol";
import "../token/interfaces/IFiatToken.sol";
contract ERC20Test is ERC20 {
uint8 public immutable _decimals;
constructor(
string memory name,
string memory symbol,
uint256 totalSupply,
uint8 __decimals
) ERC20(name, symbol) {
_decimals = __decimals;
_mint(msg.sender, totalSupply);
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function mint(uint256 amount) public {
_mint(msg.sender, amount);
}
function mintTo(address account, uint256 amount) public {
_mint(account, amount);
}
}
contract FiatTokenTest is ERC20Test, IFiatToken {
constructor(
string memory name,
string memory symbol,
uint256 totalSupply,
uint8 __decimals
) ERC20Test(name, symbol, totalSupply, __decimals) {}
function burn(uint256 amount) public override {
_burn(msg.sender, amount);
}
function mint(address account, uint256 amount) public returns (bool) {
_mint(account, amount);
return true;
}
}
contract XERC20Test is ERC20Test, IXERC20 {
constructor(
string memory name,
string memory symbol,
uint256 totalSupply,
uint8 __decimals
) ERC20Test(name, symbol, totalSupply, __decimals) {}
function mint(address account, uint256 amount) public override {
_mint(account, amount);
}
function burn(address account, uint256 amount) public override {
_burn(account, amount);
}
function setLimits(
address _bridge,
uint256 _mintingLimit,
uint256 _burningLimit
) external {
require(false);
}
function owner() external returns (address) {
return address(0x0);
}
}