View Source: contracts/fakes/FakeToken.sol
↗ Extends: ERC20
FakeToken
Constants & Variables
//public members
address public deployer;
mapping(address => bool) public minters;
//private members
uint8 private _decimals;
modifier onlyDeployer() internal
Arguments
Name | Type | Description |
---|
- addMinter(address account, bool flag)
- constructor(string name, string symbol, uint256 supply, uint8 decimalPlaces)
- decimals()
- mint(uint256 amount)
- burn(uint256 amount)
function addMinter(address account, bool flag) public nonpayable onlyDeployer
Arguments
Name | Type | Description |
---|---|---|
account | address | |
flag | bool |
Source Code
function addMinter(address account, bool flag) public onlyDeployer {
minters[account] = flag;
}
function (string name, string symbol, uint256 supply, uint8 decimalPlaces) public nonpayable ERC20
Arguments
Name | Type | Description |
---|---|---|
name | string | |
symbol | string | |
supply | uint256 | |
decimalPlaces | uint8 |
Source Code
constructor(
string memory name,
string memory symbol,
uint256 supply,
uint8 decimalPlaces
) ERC20(name, symbol) {
require(decimalPlaces > 0, "Invalid decimal places value");
super._mint(msg.sender, supply);
deployer = msg.sender;
minters[msg.sender] = true;
_decimals = decimalPlaces;
}
function decimals() public view
returns(uint8)
Arguments
Name | Type | Description |
---|
Source Code
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
function mint(uint256 amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
amount | uint256 |
Source Code
function mint(uint256 amount) external {
if (amount > 2000 * (10**_decimals)) {
require(minters[msg.sender], "Please specify a smaller value");
}
super._mint(msg.sender, amount);
}
function burn(uint256 amount) external nonpayable
Arguments
Name | Type | Description |
---|---|---|
amount | uint256 |
Source Code
function burn(uint256 amount) external {
super._burn(msg.sender, amount);
}
- AaveStrategy
- AccessControl
- AccessControlLibV1
- Address
- BaseLibV1
- BokkyPooBahsDateTimeLibrary
- BondPool
- BondPoolBase
- BondPoolLibV1
- CompoundStrategy
- Context
- Cover
- CoverBase
- CoverLibV1
- CoverReassurance
- CoverStake
- CoverUtilV1
- cxToken
- cxTokenFactory
- cxTokenFactoryLibV1
- Delayable
- Destroyable
- ERC165
- ERC20
- FakeAaveLendingPool
- FakeCompoundDaiDelegator
- FakePriceOracle
- FakeRecoverable
- FakeStore
- FakeToken
- FakeUniswapPair
- FakeUniswapV2FactoryLike
- FakeUniswapV2PairLike
- FakeUniswapV2RouterLike
- FaultyAaveLendingPool
- FaultyCompoundDaiDelegator
- Finalization
- ForceEther
- Governance
- GovernanceUtilV1
- IAaveV2LendingPoolLike
- IAccessControl
- IBondPool
- IClaimsProcessor
- ICompoundERC20DelegatorLike
- ICover
- ICoverReassurance
- ICoverStake
- ICxToken
- ICxTokenFactory
- IERC165
- IERC20
- IERC20Detailed
- IERC20Metadata
- IERC3156FlashBorrower
- IERC3156FlashLender
- IFinalization
- IGovernance
- ILendingStrategy
- ILiquidityEngine
- IMember
- INeptuneRouterV1
- InvalidStrategy
- IPausable
- IPolicy
- IPolicyAdmin
- IPriceOracle
- IProtocol
- IRecoverable
- IReporter
- IResolution
- IResolvable
- IStakingPools
- IStore
- IStoreLike
- IUniswapV2FactoryLike
- IUniswapV2PairLike
- IUniswapV2RouterLike
- IUnstakable
- IVault
- IVaultDelegate
- IVaultFactory
- IWitness
- LiquidityEngine
- MaliciousToken
- MockAccessControlUser
- MockCoverUtilUser
- MockCxToken
- MockCxTokenPolicy
- MockCxTokenStore
- MockFlashBorrower
- MockLiquidityEngineUser
- MockProcessorStore
- MockProcessorStoreLib
- MockProtocol
- MockRegistryClient
- MockStore
- MockStoreKeyUtilUser
- MockValidationLibUser
- MockVault
- MockVaultLibUser
- NeptuneRouterV1
- NPM
- NpmDistributor
- NTransferUtilV2
- NTransferUtilV2Intermediate
- Ownable
- Pausable
- Policy
- PolicyAdmin
- PolicyHelperV1
- PoorMansERC20
- POT
- PriceLibV1
- Processor
- ProtoBase
- Protocol
- ProtoUtilV1
- Recoverable
- ReentrancyGuard
- RegistryLibV1
- Reporter
- Resolution
- Resolvable
- RoutineInvokerLibV1
- SafeERC20
- StakingPoolBase
- StakingPoolCoreLibV1
- StakingPoolInfo
- StakingPoolLibV1
- StakingPoolReward
- StakingPools
- Store
- StoreBase
- StoreKeyUtil
- StrategyLibV1
- Strings
- TimelockController
- Unstakable
- ValidationLibV1
- Vault
- VaultBase
- VaultDelegate
- VaultDelegateBase
- VaultDelegateWithFlashLoan
- VaultFactory
- VaultFactoryLibV1
- VaultLibV1
- VaultLiquidity
- VaultStrategy
- WithFlashLoan
- WithPausability
- WithRecovery
- Witness